Why don't you use "*DTest.java", "*FTest.java", "*CTest.java", "*STest.java", then? It's not that expressive but still quite easy to pick up. And, as suggested already, having subdirectories for each type of test is an option.But it's a bit wordy in the class name
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by karthik Guru:
Ok so when u meant 4 different categories, you actually dont have these tests in 4 different packages?.
Originally posted by karthik Guru:
If that were the case i guess it w'd have been pretty straight forward to run the tests under the different categories
without specifying any complicated matchign pattern.
<i>The lyf so short, the craft so long to lerne.</i> --Geoffrey Chaucer (c. 1343-1400)
Originally posted by Lasse Koskela:
Why don't you use "*DTest.java", "*FTest.java", "*CTest.java", "*STest.java", then? It's not that expressive but still quite easy to pick up.
Originally posted by Lasse Koskela:
And, as suggested already, having subdirectories for each type of test is an option.
src/com/foobar/widget/MyClass.java
src/com/foobar/widget/dtest/TestMyClassThis.java
src/com/foobar/widget/stest/TestMyClassSomething.java
etc...
or
src/main/com/foobar/widget/MyClass.java
src/ftest/com/foobar/...
src/stest/com/foobar/...
src/dtest/com/foobar/...
<i>The lyf so short, the craft so long to lerne.</i> --Geoffrey Chaucer (c. 1343-1400)
-Vincent<br /><a href="http://www.manning.com/massol" target="_blank" rel="nofollow">JUnit in Action</a> author
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Originally posted by Peter Chase:
Perhaps this is tangential, but...
You can group tests by making your own TestSuites. You do not always have to accept the TestSuites that get made by JUnit's own behaviour. TestSuites can be put into TestSuites, to make a hierarchy.
Live Free, Live Happy
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by Vincent Massol:
I'd strongly suggest you use separate directories (but possibly same packages) for your different kind of tests.
Originally posted by Peter Chase:
You can group tests by making your own TestSuites.
At least Eclipse shows a compilation error if the project's source directories contain multiple classes with the same fully qualified name. Also javac will complain about a duplicate class definition. There could be problems with an Ant script if you compile the two source trees in separate steps, though.Originally posted by Allan Halme:
What if a class Foo has both standalone and database tests? I don't like the idea (and don't know if it would work too well at all) about having a com.company.FooTest test under src/junit and another having the same name under src/database ...
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
-Vincent<br /><a href="http://www.manning.com/massol" target="_blank" rel="nofollow">JUnit in Action</a> author
Originally posted by Vincent Massol:
Then simply use different names. For example FooTest and FooDatabaseTest.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Allan Halme:
Ah yes, but the purpose of the directory structuring was to avoid having to give funky names to the test classes ...
-Vincent<br /><a href="http://www.manning.com/massol" target="_blank" rel="nofollow">JUnit in Action</a> author
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Very nice!Originally posted by Christian Hargraves:
Take a look at the
examples in the Ant manual
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|