sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1550858 - in /sis/branches/JDK7/core: sis-referencing/src/test/java/org/apache/sis/referencing/datum/ sis-utility/src/test/java/org/apache/sis/test/
Date Sat, 14 Dec 2013 00:24:29 GMT
Author: desruisseaux
Date: Sat Dec 14 00:24:28 2013
New Revision: 1550858

URL: http://svn.apache.org/r1550858
Log:
Minor bug fix in the information that are reported in case of test failure.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java?rev=1550858&r1=1550857&r2=1550858&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
[UTF-8] Sat Dec 14 00:24:28 2013
@@ -76,7 +76,7 @@ public final strictfp class DefaultPrime
     @Test
     public void testMarshall() throws JAXBException {
         final DefaultPrimeMeridian pm = new DefaultPrimeMeridian(GREENWICH);
-        assertXmlEquals(getGreenwichXml(Namespaces.GML), marshal(pm), "xmlns:*", "xsi:schemaLocation");
+        assertXmlEquals(getGreenwichXml(Namespaces.GML), marshal(pm), "xmlns:*");
     }
 
     /**
@@ -147,6 +147,6 @@ public final strictfp class DefaultPrime
                 "  <gml:remarks>Equivalent to 2°20′14.025″.</gml:remarks>\n"
+
                 "  <gml:greenwichLongitude uom=\"urn:ogc:def:uom:EPSG::9105\">2.5969213</gml:greenwichLongitude>\n"
+
                 "</gml:PrimeMeridian>\n",
-                marshal(pm), "xmlns:*", "xsi:schemaLocation");
+                marshal(pm), "xmlns:*");
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1550858&r1=1550857&r2=1550858&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8]
Sat Dec 14 00:24:28 2013
@@ -181,7 +181,6 @@ public abstract strictfp class TestCase 
      * @param success {@code true} if this method is invoked on build success,
      */
     static void flushOutput() {
-        randomSeed = 0;
         System.out.flush();
         System.err.flush();
         synchronized (buffer) { // This is the lock used by the 'out' PrintWriter.

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1550858&r1=1550857&r2=1550858&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
Sat Dec 14 00:24:28 2013
@@ -68,6 +68,11 @@ public final class TestRunner extends Bl
 
     /**
      * The dependency methods that failed. This set will be created only when first needed.
+     * Values are method names.
+     *
+     * {@note There is no need to prefix the method names by classnames because a new instance
of
+     *        <code>TestRunner</code> will be created for each test class, even
if the the test
+     *        classes are aggregated in a <code>TestSuite</code>.}
      *
      * @see #addDependencyFailure(String)
      */
@@ -103,14 +108,16 @@ public final class TestRunner extends Bl
         }
 
         /**
-         * Prints output only in verbose mode.
-         * Otherwise silently discard the output.
+         * Prints output only in verbose mode. Otherwise silently discard the output.
+         * This method is invoked on failure as well as on success. In case of test
+         * failure, this method is invoked after {@link #testFailure(Failure)}.
          */
         @Override
         public void testFinished(final Description description) {
             if (TestCase.verbose) {
                 TestCase.flushOutput();
             }
+            TestCase.randomSeed = 0;
         }
 
         /**
@@ -118,17 +125,21 @@ public final class TestRunner extends Bl
          */
         @Override
         public void testFailure(final Failure failure) {
-            final String methodName = failure.getDescription().getMethodName();
+            final Description description = failure.getDescription();
+            final String methodName = description.getMethodName();
             addDependencyFailure(methodName);
             final long seed = TestCase.randomSeed;
             if (seed != 0) {
+                final String className = description.getClassName();
                 final PrintWriter out = TestCase.out;
-                out.print("Random number generator for “");
+                out.print("Random number generator for ");
+                out.print(className.substring(className.lastIndexOf('.') + 1));
+                out.print('.');
                 out.print(methodName);
-                out.print("” was created with seed ");
+                out.print("() was created with seed ");
                 out.print(seed);
                 out.println('.');
-                // Seed we be cleared by TestCase.flushOutput()
+                // Seed we be cleared by testFinished(…).
             }
             if (!TestCase.verbose) {
                 TestCase.flushOutput();



Mime
View raw message