FileDocCategorySizeDatePackage
FailureExpectedCollector.javaAPI DocHibernate 3.2.51471Thu Mar 29 10:55:42 BST 2007org.hibernate.junit

FailureExpectedCollector

public class FailureExpectedCollector extends Object
A simple class to collect the names of "failure expected" tests...
author
Steve Ebersole

Fields Summary
Constructors Summary
Methods Summary
public static java.util.SetcollectAllFailureExpectedTestNames()

		Set names = new HashSet();
		collectFailureExpectedTestNames( names, ( TestSuite ) AllTests.unfilteredSuite() );
		return names;
	
public static voidcollectFailureExpectedTestNames(java.util.Set names, junit.framework.TestSuite suite)

		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 );
	
public static voidmain(java.lang.String[] args)

		Set testNames = collectAllFailureExpectedTestNames();
		Iterator itr = testNames.iterator();
		int i = 0;
		while ( itr.hasNext() ) {
			i++;
			System.out.println( i + ") " + itr.next() );
		}