use of org.apache.axis2.transport.testkit.tests.TestResourceSetTransition in project wso2-axis2-transports by wso2.
the class ManagedTestSuite method run.
@Override
public void run(TestResult result) {
LogManager logManager = LogManager.INSTANCE;
if (!reuseResources) {
super.run(result);
} else {
TestResourceSet resourceSet = null;
for (Enumeration<?> e = tests(); e.hasMoreElements(); ) {
Test test = (Test) e.nextElement();
if (test instanceof ManagedTestCase) {
ManagedTestCase ttest = (ManagedTestCase) test;
TestResourceSet newResourceSet = ttest.getResourceSet();
try {
if (resourceSet == null) {
logManager.setTestCase(ttest);
newResourceSet.setUp();
} else {
TestResourceSetTransition transition = new TestResourceSetTransition(resourceSet, newResourceSet);
transition.tearDown();
logManager.setTestCase(ttest);
transition.setUp();
}
} catch (Throwable t) {
result.addError(this, t);
return;
}
resourceSet = newResourceSet;
}
runTest(test, result);
}
if (resourceSet != null) {
try {
resourceSet.tearDown();
logManager.setTestCase(null);
} catch (Throwable t) {
result.addError(this, t);
return;
}
}
}
}
Aggregations