Has anyone got experience of extending JUnit4?
I want to get rid of the usage of JUnit3-style TestSuite and TestCase.
(Why? No reason other than an itch that using JUnit3 "junit.*" is old
stuff.)
These are used in the scripted tests because a TestSuite can have
variable number of tests and of variable type, a TestSuiet can contain a
TestSuite.
The working group tests from DAWG, SPARQL-WG and RDF 1.1 are scripted
with an RDF manifest file. A manifest can refer to other manifests.
JUnit4 parameterized tests are not sufficient. The best I got was to
turn a single manifest into a parameterized test set, with one test per
parameterization. That makes naming messy (I got the class to have the
right name but each class instance has one test called the same thing
(e.g. "test"). I could not see how to include @Parameterized inside a
@Parameterized.
What I have ended up so far is having to implement a JUnit4 Runner,
actually 3 of them, one to take class to pick out the annotations for
the manifests and two variants for runner that is either a single
scripted test and a test manifest runner including sub-manifests as a tree.
I know Junti4 is a testing "framework" but I feel I have had to write a
lot of machinery for what was in JUnit3 quite simple. I get the feeling
I've missed something somewhere.
Any ideas?
Andy