I am attempting to test simple UI with the following test case,
The main idea is to set in the test some of the UI text (to mimic user input) and then actively click an event.
public class StackTestCase
extends ActivityInstrumentationTestCase2<Stack>
{
private StackDemo mActivity;
private EditText eaten;
public StuckTestCase() {
...
Hey there
Need to setup JMock code to test call back with google protobuf
Full project is located at http://github.com/andrewmilkowski/template-transport
In short, following are methods signatures (below)
what I need to do is to test method getLongValue, using Jmock JUnit4Mockery
what is the best and cleanest way to go about this
...
I am writing an Android Library Project basing on Android Bitmap class (call it AndroindLib) which contains only utility class (no activity). I tried to test it using Android JUnit, but it keeps complaining that can't find the AnroidLib.apk
What's the right way to Unit test Android Library Project?
Thanks.
Lily
...
Hi, I have a server client project and for testing purposes I want to start the server in a whole new process. The problem is, I have just a main() method in project, no jar. So my guess would be something like
Runtime.getRuntime().exec("javac MyServer.java");
Runtime.getRuntime().exec("java class MyServer");
But I am really not sure ...
I have JsTestDriver set up to run tests automatically on remote server, which then produces XML format to my "test-reports" folder. I'm looking for some way to visualize the results automatically in Aptana/Eclipse, so that the other coders wouldn't be forced to check the console output to see if the tests failed or not.
Ideally, I would...
I was wondering how I could test two servlets that need to communicate with one another in JUnit. I'm using com.meterware.servletunit.ServletRunner to run each servlet, but for some reason they cannot communicate with one another.
For example, servlet A needs to open up a URLConnection to servlet B, but when run in JUnit with both se...
Howdy,
I have 2 test classes, both extend TestCase. Each class contains a bunch of individual tests which run against my program.
How can i execute both classes (and all tests they have) as part of the same suite?
I am using jUnit 4.8
Thank you
...
We have a smoke test that we run every morning to check a number of applications which involves logging in, executing a simple operation and logging out.
The test at the moment is a collection of Selenium IDE scripts which were imported into Selenium RC as Java and run inside JUnit running inside Netbeans.
What we would like to do is r...
Hey,
I was wondering if anyone knew of a way to check if a List is empty using assertThat() and Matchers?
Best way I could see just use JUnit:
assertFalse(list.isEmpty());
But I was hoping that there was some way to do this in Hamcrest.
Thanks!
...
Hi all,
Time elapsed (time taken?) to run(and pass) my Junit test case is shown as 0.00. I have tried failing the test case (by doing assertEquals for a wrong value) and its still showing time elapsed as 0.00.
The rest of test cases have non-zero time elapsed values.
EDIT: Assumption - I assumed that it would surely take non-zero time...
Suppose that you have the following logic in place:
processMissing(masterKey, masterValue, p.getPropertiesData().get(i).getDuplicates());
public StringBuffer processMissing(String keyA, String valueA, Set<String> dupes) {
// do some magic
}
I would like to write a jUnit test for processMissing, testing its behavior in event dupes is ...
I am wanting to set up a Run/Debug Configuration in IntelliJ for JUnit. I know how to set it up to run a specific package, a specific class, or a specific method. I was wondering if there was a way to set up the configurations so it will run the currently opened Class file or the currently selected test method. I would imagine I would pu...
Hi All,
I believe that we are all know that setUp (@Before) will execute before any test method and tearDown(@After) will execute after test method.
Also we know that Junit will create one instance of Test per test method.
my question is that can we just move setUp method content to class Constructor and remove setUp method? is the...
Hi,
I have the following JUnit test:
@Test
public final void testDivisors() {
testDivisorsAux(1, new int[] { 1 });
testDivisorsAux(6, new int[] { 1, 2, 3, 6 });
testDivisorsAux(0, new int[] { });
...
}
private final void testDivisorsAux(final int number, final int[] expected) {
List<Integer> divisors = Util.diviso...
I am reading one book about JUnit now and writer advises nulling resources in tearDown method. Why? Isn't this GC's job? Can it seriously make any harm?
Lets think of example like this:
public class SomeTest extends TestCase {
Vector vector;
List<Object> list;
protected void setUp() {
vector = new Vector();
list = new ...
I was intrigued by the answer to a similar question. I believe it is incorrect. So I created some test code. My question is, does this code prove/disprove/inconclusive the hypothesis that it is useful to nullify member variables in teardown methods? I tested it with JUnit4.8.1.
JUnit creates a new instance of the test class for each...
We use JUnit it for normal unit testing, integration testing, feature testing etc.
It will be useful to record memory consumed by individual test and compare with different run. Is there any JUnit extension that does this sort of thing already? (apparently IntelliJ 's JUnit runner does this)
...
We have around 80 jars in our applications. All are created using javac task and jar task in ant.
I would like to introduce findbug checks. One option was to create single findbug check ant project. This has all jars , all source paths defined in it. This works -- require lot of space. Analysis of result too not very straight forward. ...
My code:
@Component
public class A {
@Autowired
private B b;
public void method() {}
}
public interface X {...}
@Component
public class B implements X {
...
}
I want to test in isolation class A. Do I have to mock class B? If yes, how? Because it is autowired and there is no setter where i could send the mocked obje...
I have a Junit process that runs a bunch of data integrity tests every night, and I would like to have it email the results in a nicely formatted HTML email. The issue is the HTML formatter built into JUnit uses frames and an external stylesheet so it is not appropriate for email. The plain formatter has the results buried in the midst...