unit testing - Grouping JUnit tests -
Is there any way of group trials in JUnit so that I can only run some groups?
Or is it possible to annotate some tests and then disable them globally?
I am using JUnit 4 , I can not use TestNG.
Edit: @RunWith and @SuiteClasses work great. But is it possible to explain only a few tests in this test class? Or do I have to explain the whole test class?
Do you want to test inside the test class or do you want to group test classes? I am going to take the latter.
It depends on how you are running your tests. If you run them by Maven, it is possible to clarify what you want to include. Look for it.
More generally, though, what I have to do is that I have a test suit tree, something like JUnit 4 looks like a test suit:
@RunWith (Suite.class) @SuiteClasses (SomeUnitTest1.class, SomeUnitTest2.class) Public Classes UnitTestsSuite {} So, I probably have a function test site and a unit test site, and then an AllSestsite Which includes the other two if you run them in Eclipse, you have a very good hierarchical view The Ilta.
The problem with this approach is that you want to test hard in a way, but it is still possible (for example, you can set a set of such a set on the module Based piece, then another piece on the type of test).
Comments
Post a Comment