You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/25 12:51:46 UTC

svn commit: r1697648 - in /commons/proper/bcel/trunk: pom.xml src/test/java/org/apache/commons/bcel6/PerformanceTest.java

Author: sebb
Date: Tue Aug 25 10:51:46 2015
New Revision: 1697648

URL: http://svn.apache.org/r1697648
Log:
Quieten the PerformanceTest when used as part of mvn test

Modified:
    commons/proper/bcel/trunk/pom.xml
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/PerformanceTest.java

Modified: commons/proper/bcel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/pom.xml?rev=1697648&r1=1697647&r2=1697648&view=diff
==============================================================================
--- commons/proper/bcel/trunk/pom.xml (original)
+++ commons/proper/bcel/trunk/pom.xml Tue Aug 25 10:51:46 2015
@@ -209,6 +209,13 @@
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
+        <systemProperties>
+          <property>
+             <!-- Suppress the stats, but keep the test as it exercises the code -->
+             <name>PerformanceTest.report</name>
+             <value>false</value>
+          </property>
+        </systemProperties>
           <includes>
             <include>**/*TestCase.java</include>
             <include>**/PerformanceTest.java</include>

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/PerformanceTest.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/PerformanceTest.java?rev=1697648&r1=1697647&r2=1697648&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/PerformanceTest.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/PerformanceTest.java Tue Aug 25 10:51:46 2015
@@ -39,6 +39,8 @@ import junit.framework.TestCase;
 
 public final class PerformanceTest extends TestCase {
 
+    private static final boolean REPORT = Boolean.parseBoolean(System.getProperty("PerformanceTest.report", "true"));;
+
     private static byte[] read(final InputStream is) throws IOException {
         if (is == null) {
             throw new IOException("Class not found");
@@ -118,13 +120,15 @@ public final class PerformanceTest exten
 
         jar.close();
         total.stop();
-        System.out.println("ClassParser.parse: " + parseTime);
-        System.out.println("ClassGen.init: " + cgenTime);
-        System.out.println("MethodGen.init: " + mgenTime);
-        System.out.println("MethodGen.getMethod: " + mserTime);
-        System.out.println("ClassGen.getJavaClass.getBytes: " + serTime);
-        System.out.println("Total: " + total);
-        System.out.println();
+        if (REPORT) {
+            System.out.println("ClassParser.parse: " + parseTime);
+            System.out.println("ClassGen.init: " + cgenTime);
+            System.out.println("MethodGen.init: " + mgenTime);
+            System.out.println("MethodGen.getMethod: " + mserTime);
+            System.out.println("ClassGen.getJavaClass.getBytes: " + serTime);
+            System.out.println("Total: " + total);
+            System.out.println();
+        }
     }
 
     public void testPerformance() throws IOException {