TestListenerAdapter tla = new TestListenerAdapter();
TestNG testng = new TestNG();
testng.setTestClasses(new Class[] { RunTest.class });
testng.addListener(tla);
try {
testng.run();
assertEquals(1, tla.getPassedTests().size());
assertEquals(0, tla.getFailedTests().size());
assertTrue(RunTest.ran);
assertNotNull(RunTest.mgr);
assertNotNull(RunTest.du);
assertNull(Dispatcher.getInstance());
} finally {
RunTest.mgr = null;
}