Linked Questions
15 questions linked to/from Grouping JUnit tests
104 votes
5 answers
82k views
JUnit 4 Test Suites
How do I create test suites with JUnit 4? All the documentation I've seen doesn't seem to be working for me. And if I use the Eclipse wizard it doesn't give me an option to select any of the test ...
17 votes
6 answers
9k views
maven - fail build when unit test takes too long
I have in my project a lot of unit tests, written in JUnit and TestNG. The building process is based on maven with surefire plugin. Is there any way/plugin for maven to fail the build when at least ...
6 votes
2 answers
10k views
How do I make JUnit ignore specific test case at run time when run with Parameterized runner? [duplicate]
Possible Duplicate: Conditionally ignoring tests in JUnit 4 I have a suite of system tests that are run with Parameterized runner and that I would like to run against different environments. Some ...
2 votes
2 answers
6k views
Hierarchy of JUnit tests
I need the following test @runwith(cache, memory) class CollectionA is -- this is a suite (aka folder) class Cache { -- this is a sub-suite (aka folder) @test testCache1() -- this is a ...
6 votes
3 answers
2k views
Is there a way using surefire to exclude tests at a test method level - not a class level?
The Apache Maven Surefire site has the following example syntax to exclude tests from running: <configuration> <excludes> <exclude>**/TestCircle.java</exclude> <...
3 votes
3 answers
2k views
How to override the behavior of a failed JUnit test case
I need to write a JUnit test case for a never ending main() method. This main() method after processing some files sleeps for a minute and then resumes its execution. This process goes on and on and ...
2 votes
0 answers
2k views
JUnit: (possibly indirectly) contains itself as a SuiteClass
I want to add a subtest, FailingIO, to FailingTest while inheriting the parent's useful methods @RunWith(Suite.class) @Suite.SuiteClasses({FailingTest.FailingIO.class}) class FailingTest { @Test ...
1 vote
2 answers
1k views
How do I run test groups with Scala + JUnit runner + Maven?
I'm trying to support running tags/groups of tests on the Maven commandline. I think I have the correct syntax setup in my .scala file (see below), but I'm unsure how to actually execute on the ...
2 votes
1 answer
398 views
controlling which JUnit tests are run by Ant
I have an ant task set up like so: <target name="unit-test" description="unit tests" depends="compile-tests"> <mkdir dir="${build}/test"/> <mkdir dir="${build}/test/raw"/> &...
1 vote
1 answer
410 views
How to investigate Java Heap Space errors in jenkins
I have a matrix pipeline job which performs multiple stages (something like ~200) most of which are functional tests whose results are recorded by the following code: stage('Report') { ...
0 votes
0 answers
254 views
How can I run parallel tests with multiple group?
I want to run 10 groups after each other, and every single group should contain 10 tests and each test running parallel. I tried with a factory class, but if I placed It multiple times in the suite ...
-1 votes
2 answers
179 views
How to Run particular @Test methods from a class using TestSuite.class file?
I have a class with methods like below... class one{ @Test method1{} @Test method2{} @Test method3{} } I m using below class to run above Tests using JUnit. class ...
0 votes
3 answers
215 views
Java Selenium Junit Maven: Way to parametrize tests?
I have a test suite that is being run on a bunch of sites we have created. The majority of the sites work the same way so instead of having lots of duplicate code I can run all the tests on all sites. ...
2 votes
2 answers
114 views
Run all the junit tests that are in a given package in Netbeans?
We have a bunch junit tests in our current project. Essentially we are looking for a way to run all the test in a given package. Currently in Netbeans I see you can run all the tests or a single test, ...
1 vote
1 answer
106 views
How do I find out what testcases are in my source code and can I categorize them?
I'm working with a large project with 50,000 source files about 5000 tests spread over 2000 classes. These are mostly JUnit 3 with a smattering of JUnit 4. These tests are run on a frequent (daily or ...