addTest(setupHarness());
}
private TestHarness setupHarness() throws Exception {
Unmarshaller unm;
Harness harness;
TestHarness testApp;
Mapping mapping;
unm = new Unmarshaller(Harness.class);
mapping = new Mapping();
mapping.loadMapping(Main.class.getResource("harness/mapping.xml"));
unm.setMapping(mapping);
if (_testRes != null) {
harness = (Harness) unm.unmarshal(new InputStreamReader(
Main.class.getResourceAsStream(_testRes)));
} else if (_testFile != null) {
harness = (Harness) unm.unmarshal(new InputStreamReader(
new FileInputStream(_testFile)));
} else if (_testUrl != null) {
harness = (Harness) unm.unmarshal(new InputStreamReader(
(new URL(_testUrl)).openStream()));
} else {
harness = (Harness) unm.unmarshal(new InputStreamReader(
Main.class.getResourceAsStream(DEFAULT_FILE)));
}
testApp = harness.createTestHarness(_testBranchs);
return testApp;
}