-
1. Re: Test runner delegation chain
abertschi Dec 10, 2014 12:54 PM (in response to dan.j.allen)I am looking for the same feature.
More than 4 years have already passed by since you wrote that suggestion.
Has anybody already implemented that?
-
2. Re: Test runner delegation chain
kpiwko Dec 11, 2014 8:30 AM (in response to abertschi)Hi Andrin,
is there anything specific you want to solve by chaining runners? A lot of the stuff can be implemented by a @Rule with current version of JUnit, such as parametrization.
Karel
-
3. Re: Test runner delegation chain
abertschi Dec 11, 2014 10:25 AM (in response to kpiwko)Hi Karel, Thanks for your answer.
I was thinking about writing a small JUnit extension that injects annotated method arguments with objects that were serialized as xml files, so that they don't need to be constructed in the unit test and thus will not blow up my tests.
Somewhat like:
@Target({METHOD, TYPE})
@Retention(RUNTIME)
public @interface XmlObject {
String value();
}
@Test
public void my_junit_test_method(@XmlObject("path/to/myClass-1.xml") MyClass input) {
input.fooBar(); // input is ready to use
}
I would then just write a junit runner that does the magic for the test.
Because I also would like to apply this feature for my arquillian tests, I wondered whether multiple runners can be applied for an arquillian test.
Since I need to package these xml-files into my deployable archive, I have to write a arquillian extension anyway for that purpose.
So my question is obsolete: The arquillian extension would probably make use of jboss.arquillian.test.spi.TestEnricher to enrich my test methods.
Andrin
-
4. Re: Test runner delegation chain
kpiwko Dec 11, 2014 1:21 PM (in response to abertschi)Exactly, that's currently recommend approach for such type of a task.
Karel