junit

Does WindowTester work for AWT UIs?

I've just come across WindowTester, a JUnit GUI testing framework for "Swing, SWT and GWT". From reading the documentation, I can't work out if it also supports AWT. Anyone got any experience with this product? ...

m2eclipse filtering test resources

I am using m2eclipse and I want to right click and run tests from inside eclipse while the test resources get filtered from Maven. How can I do this? From eclipse when I right click on a test I do not get any m2eclipse options Julia. Similar to: http://stackoverflow.com/questions/2855706/debugging-maven-junit-tests-with-filtered-resou...

How to test protected method with Spring dependency

I have the following interface and implementation classes:- public interface MyService { void method1(); } public interface MyServiceImpl implements MyService { public void method1() { // ... } /*protected*/ void method2() { // ... } } MyServiceImpl has some Spring wirings, in another word, both m...

Attempt to stub android Activity class using PowerMockito throws RuntimeException "Stub!"

I found this example where they used PowerMock and EasyMock to stub/mock the Menu and MenuItem classes for android. I have been trying to do something similar with PowerMock and Mockito with the Activity class. I understand that a lot of the methods are final and that in the Android.jar they all just throw RuntimeException("Stub!"). I...

using a PLUG-IN to exisitng testing framework or using FULL FRAMEWORK - which do you recommend?

Say you have a huge automation project and are using a certain testing framework, say -JUnit for most of the automation. However you typically get stuck with automating the flash part of the the application . Now you can usually select several tools for that issue only. on the one hand tehre are tools that are standalone and include all ...

why testing an individual junit test works, while testing them together won't?

The test that fails when tested together with mvn test (or through the ide) is called EmpiricalTest. If I test the file alone it goes through, but not otherwise. Why could that be? You can checkout the Maven source code (to test) from here. This is how I make sure the database is 'blank' before each test: abstract public class Persis...

Where can I investigate junit tests in a real world project?

What is a good open source project which uses junit tests in its source code? I want to see how its doen and learn about it. ...

I am new to automated testing in Java. Which tool should I prefer? JUnit or TestNG?

I have read some comparisons of JUnit and TestNG and it looks like TestNG has more configuration options. On the other hand JUnit is more supported by IDEs, building tools, has more plugins. I have no experience in writing unit tests. Which tool should I prefer? P.S. I think my question is more like: Should I give TestNG a try, or just...

is it possible to make test method parameterized, not an entire class?

As I understand, with JUnit 4.x and its annotation org.junit.runners.Parameterized I can make my unit test "parameterized", meaning that for every set of params provided the entire unit test will be executed again, from scratch. This approach limits me, since I can't create a "parameterized method", for example: .. @Test public void t...

Pass parameters to Junit Class from Ant

Hi, I'm using Junit under ant to perform Selenium Test.My test cases need to read files which contain test data(in order to accomplish data driven test). I don't mind embedding the file names in the test cases, but I'd like to have the name of the directory where the data files are stored parameterized in the build.xml file. What's the...

Looking for free and easy that (auto) generates JUnit tests

Hey all. Can I get recommendations of free and easy tool(s) that can generate JUnit tests based on existing code? Either as a stand-alone application or pref. an Eclipse-plugin. ...

How to check that activity displays dialog during android unit testing

I want to write testcases for my android application using JUnit. And I faced some problems. Is it possible to check that activity displays some dialog at current moment? Here is a small piece of my test application: ... Instrumentation instr = getInstrumentation(); monitor = instr.addMonitor(MainActivity.class.getName(), n...

Failed to get the test results for JSFUnit

I am trying to configure JSFUnit to run in my application. We are an ICEFaces app deployed on WAS 6.1. When I create my TestCase and access it from the following URL: localhost:9085/smagui/ServletTestRunner?suite=com.sma.gui.product.JSFUnitTest&xsl=cactus-report.xsl I get a report that says: testInitialPage Error Failed to get the...

Bulk data set up for Unit Test cases

I have developed an application with Spring MVC that deals with bulk data insert/update. For ex: There are some use cases that insert a record with 100-125 attributes. For bulk data insert, I'm hard coding the values to be inserted in my Unit test class. I have Transfer Object to carry the data, so i'm populating these TOs in my Unit ...

Android: Application crashes while testing through Android Instrumentation

I have separated java code from Android code and have two projects. Android dependent on Java project. Now i want to get the memory trace of the Java project on Android. For that I have created Androd Junit Project implementing Android Instrumentation, and a dummy android project dependent on my actual java project.(as I only want to get...

junit and ant problem. Can not start test

when i am runing junit test from ant i always get: D:\metrike>ant test Buildfile: build.xml init: compile: test: [junit] Running jmt.test.TestCodeBase [junit] Testsuite: jmt.test.TestCodeBase [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0,046 sec [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapse...

Our project contains 2600 class files - where and how should we start writing junit tests?

Our project contains 2600 class files and we have decided to start using automated tests. We know we have should have started this 2599 class files ago, but how and where should large projects start to write tests? Pick a random class and just go? What's important to know? Are there any good tools to use? ...

JUnit Testing for Automated Testing Scripts?

I recently joined this organisation that I am currently working at that has asked me to re factor, extend and maintain an existing Automated Testing Framework written in java, which uses a keyword driven framework and RFT. I have been a developer all my life. By habit I write unit tests to test for behavior before writing source code. Th...

Writing data to System.in

In our application, we expect user input within a Thread as follows : BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); I want to pass that part in my unit test so that I can resume the thread to execute the rest of the code. How can I write something into System.in from junit? ...

Why is a junit test that is skipped because of an assumption failure is not reported as skipped?

I use junit assumptions to decide whether to run a test or not. Tests where the assumption fails are ignored/skipped by the junit framework. I wonder why skipped tests are not reported as 'skipped'? Please have a look at the example: import static org.junit.Assert.fail; import org.junit.Assume; import org.junit.Test; public class Ass...