sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1584394 - /sis/branches/0.4/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
Date Thu, 03 Apr 2014 20:58:00 GMT
Author: desruisseaux
Date: Thu Apr  3 20:58:00 2014
New Revision: 1584394

URL: http://svn.apache.org/r1584394
Log:
Patch for allowing integration tests to run.

Modified:
    sis/branches/0.4/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java

Modified: sis/branches/0.4/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/0.4/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java?rev=1584394&r1=1584393&r2=1584394&view=diff
==============================================================================
--- sis/branches/0.4/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8]
(original)
+++ sis/branches/0.4/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8]
Thu Apr  3 20:58:00 2014
@@ -23,7 +23,6 @@ import java.util.List;
 import java.util.ArrayList;
 import java.io.File;
 import java.net.URL;
-import java.net.URISyntaxException;
 import javax.management.JMException;
 import org.apache.sis.internal.system.Shutdown;
 import org.apache.sis.internal.system.SystemListener;
@@ -55,6 +54,13 @@ public abstract strictfp class TestSuite
     };
 
     /**
+     * {@code true} for disabling the search for missing tests. This is necessary
+     * when the test suites are executed from an external project, for example during a
+     * <a href="https://svn.apache.org/repos/asf/sis/release-test/maven">release test</a>.
+     */
+    static boolean skipCheckForMissingTests;
+
+    /**
      * Creates a new test suite.
      */
     protected TestSuite() {
@@ -64,9 +70,12 @@ public abstract strictfp class TestSuite
      * Verifies that we did not forgot to declare some test classes in the given suite.
      * This method scans the directory for {@code *Test.class} files.
      *
+     * <p>This check is disabled if {@link #skipCheckForMissingTests} is {@code true}.</p>
+     *
      * @param suite The suite for which to check for missing tests.
      */
     protected static void assertNoMissingTest(final Class<? extends TestSuite> suite)
{
+        if (skipCheckForMissingTests) return;
         final ClassLoader loader = suite.getClassLoader();
         final URL url = loader.getResource(suite.getName().replace('.', '/') + ".class");
         assertNotNull("Test suite class not found.", url);



Mime
View raw message