mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-28 14:59:12 +00:00
git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@11766 1b8cb986-b30d-0410-93ca-fae66ebed9b2
51 lines
1.4 KiB
Java
51 lines
1.4 KiB
Java
package org.hibernate.junit;
|
|
|
|
import java.util.Set;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
|
|
import junit.framework.TestSuite;
|
|
import junit.framework.Test;
|
|
import junit.framework.TestCase;
|
|
|
|
import org.hibernate.test.AllTests;
|
|
|
|
/**
|
|
* A simple class to collect the names of "failure expected" tests...
|
|
*
|
|
* @author Steve Ebersole
|
|
*/
|
|
public class FailureExpectedCollector {
|
|
|
|
public static void main(String[] args) {
|
|
Set testNames = collectAllFailureExpectedTestNames();
|
|
Iterator itr = testNames.iterator();
|
|
int i = 0;
|
|
while ( itr.hasNext() ) {
|
|
i++;
|
|
System.out.println( i + ") " + itr.next() );
|
|
}
|
|
}
|
|
|
|
public static Set collectAllFailureExpectedTestNames() {
|
|
Set names = new HashSet();
|
|
collectFailureExpectedTestNames( names, ( TestSuite ) AllTests.unfilteredSuite() );
|
|
return names;
|
|
}
|
|
|
|
public static void collectFailureExpectedTestNames(final Set names, 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 );
|
|
}
|
|
}
|