String docurl = getBeanString(suite, "getDocURL", "");
out.print(" <docurl>");
out.print("<![CDATA[" + docurl + "]]>");
out.println("</docurl>");
ServiceTracker testListenerTracker = null;
try {
System.out.println("run test on " + suite);
final TestResult tr = new TestResult();
testListenerTracker = new ServiceTracker(Activator.bc,
TestListener.class.getName(),
null) {
public Object addingService(ServiceReference reference)
{
TestListener tl = (TestListener) Activator.bc.getService(reference);
tr.addListener(tl);
return tl;
}
public void removedService(ServiceReference reference, Object service)
{
TestListener tl = (TestListener) service;
tr.removeListener(tl);
}
};
testListenerTracker.open();
long start = System.currentTimeMillis();
suite.run(tr);
long stop = System.currentTimeMillis();
toXMLSuite(suite, tr, stop - start, out, 2);
toXMLResult(tr, out);
testListenerTracker.close();
} finally {
out.println(" </testcase>");
if (null!=testListenerTracker){
testListenerTracker.close();
}
}
}