TestSuiteVisitor.Handler handler = new TestSuiteVisitor.Handler() {
public void handleTestCase(Test test) {
TestCase testCase = ( TestCase ) test;
if ( testCase.getName().endsWith( "FailureExpected" ) ) {
names.add( testCase.getClass().getName() + "#" + testCase.getName() );
}
}
public void startingTestSuite(TestSuite suite) {}
public void completedTestSuite(TestSuite suite) {}
};
TestSuiteVisitor visitor = new TestSuiteVisitor( handler );
visitor.visit( suite );