poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1829641 - /poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
Date Fri, 20 Apr 2018 09:46:47 GMT
Author: centic
Date: Fri Apr 20 09:46:47 2018
New Revision: 1829641

URL: http://svn.apache.org/viewvc?rev=1829641&view=rev
Log:
OOXMLLite: improve progress output: count test-classes, not single test-methods

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java?rev=1829641&r1=1829640&r2=1829641&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java Fri Apr 20 09:46:47 2018
@@ -29,8 +29,10 @@ import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.Vector;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
@@ -165,18 +167,23 @@ public final class OOXMLLite {
         //run tests
         JUnitCore jUnitCore = new JUnitCore();
         jUnitCore.addListener(new TextListener(System.out) {
+            private final Set<String> classes = new HashSet<>();
             private int count;
+
             @Override
             public void testStarted(Description description) {
+                // count how many test-classes we already saw
+                classes.add(description.getClassName());
                 count++;
                 if(count % 100 == 0) {
                     System.out.println();
-                    System.out.println(count + "/" + lst.size() + ": " + description.getDisplayName());
+                    System.out.println(classes.size() + "/" + lst.size() + ": " + description.getDisplayName());
                 }
+
                 super.testStarted(description);
             }
         });
-        Result result = jUnitCore.run(lst.toArray(new Class<?>[lst.size()]));
+        Result result = jUnitCore.run(lst.toArray(new Class<?>[0]));
         if (!result.wasSuccessful()) {
             throw new RuntimeException("Tests did not succeed, cannot build ooxml-lite jar");
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message