Author: steve.ebersole(a)jboss.com
Date: 2007-03-29 11:55:13 -0400 (Thu, 29 Mar 2007)
New Revision: 11368
Added:
trunk/Hibernate3/test/org/hibernate/junit/FailureExpectedCollector.java
Modified:
trunk/Hibernate3/test/org/hibernate/test/AllTests.java
Log:
addded class to collect (and display) "failure expected" tests
Added: trunk/Hibernate3/test/org/hibernate/junit/FailureExpectedCollector.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/junit/FailureExpectedCollector.java
(rev 0)
+++ trunk/Hibernate3/test/org/hibernate/junit/FailureExpectedCollector.java 2007-03-29
15:55:13 UTC (rev 11368)
@@ -0,0 +1,50 @@
+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 );
+ }
+}
Modified: trunk/Hibernate3/test/org/hibernate/test/AllTests.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/AllTests.java 2007-03-29 13:26:40 UTC (rev
11367)
+++ trunk/Hibernate3/test/org/hibernate/test/AllTests.java 2007-03-29 15:55:13 UTC (rev
11368)
@@ -148,10 +148,22 @@
}
/**
+ * Returns the entire test suite (both legacy and new) w/o filtering
+ *
+ * @return the entire test suite
+ */
+ public static Test unfilteredSuite() {
+ TestSuite suite = new TestSuite();
+ suite.addTest( NewTests.unfilteredSuite() );
+ suite.addTest( LegacyTests.unfilteredSuite() );
+ return suite;
+ }
+
+ /**
* Runs the entire test suite.
- * <p/>
+ *
+ * @param args n/a
* @see #suite
- * @param args n/a
*/
public static void main(String args[]) {
TestRunner.run( suite() );
@@ -163,11 +175,20 @@
public static class NewTests {
/**
- * Returns the new test suite
+ * Returns the new test suite (filtered)
*
* @return the new test suite
*/
public static Test suite() {
+ return filter( ( TestSuite ) unfilteredSuite() );
+ }
+
+ /**
+ * Returns the new test suite (unfiltered)
+ *
+ * @return the new test suite
+ */
+ public static Test unfilteredSuite() {
TestSuite suite = new TestSuite("New tests suite");
suite.addTest( OpsSuite.suite() );
suite.addTest( NaturalIdTest.suite() );
@@ -280,7 +301,7 @@
suite.addTest( DialectFunctionalTestsSuite.suite() );
suite.addTest( DialectUnitTestsSuite.suite() );
- return filter( suite );
+ return suite;
}
/**
@@ -304,6 +325,15 @@
* @return the legacy test suite
*/
public static Test suite() {
+ return filter( ( TestSuite ) unfilteredSuite() );
+ }
+
+ /**
+ * Returns the legacy test suite
+ *
+ * @return the legacy test suite
+ */
+ public static Test unfilteredSuite() {
TestSuite suite = new TestSuite("Legacy tests suite");
suite.addTest( FumTest.suite() );
suite.addTest( MasterDetailTest.suite() );
@@ -324,8 +354,7 @@
suite.addTest( OneToOneCacheTest.suite() );
suite.addTest( NonReflectiveBinderTest.suite() );
suite.addTest( ConfigurationPerformanceTest.suite() ); // Added to ensure we can
utilize the recommended performance tips ;)
- return filter( suite );
-// return suite;
+ return suite;
}
/**
Show replies by date