commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1187737 - in /commons/proper/ognl/performance-analysis: ./ src/test/java/org/apache/commons/ognl/performance/
Date Sat, 22 Oct 2011 17:44:18 GMT
Author: mcucchiara
Date: Sat Oct 22 17:44:17 2011
New Revision: 1187737

URL: http://svn.apache.org/viewvc?rev=1187737&view=rev
Log:
Introduced abstract base test

Added:
    commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/BasePerformanceTest.java
Modified:
    commons/proper/ognl/performance-analysis/pom.xml
    commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java
    commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java

Modified: commons/proper/ognl/performance-analysis/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/pom.xml?rev=1187737&r1=1187736&r2=1187737&view=diff
==============================================================================
--- commons/proper/ognl/performance-analysis/pom.xml (original)
+++ commons/proper/ognl/performance-analysis/pom.xml Sat Oct 22 17:44:17 2011
@@ -52,7 +52,7 @@
     <dependency>
       <groupId>ognl</groupId>
       <artifactId>ognl</artifactId>
-      <version>3.0.3</version>
+      <version>3.0.2</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>

Added: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/BasePerformanceTest.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/BasePerformanceTest.java?rev=1187737&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/BasePerformanceTest.java
(added)
+++ commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/BasePerformanceTest.java
Sat Oct 22 17:44:17 2011
@@ -0,0 +1,124 @@
+/*
+ * $Id: $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.commons.ognl.performance;
+
+import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
+import com.carrotsearch.junitbenchmarks.BenchmarkRule;
+import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
+import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
+import org.apache.commons.ognl.performance.invocation.FieldInvocation;
+import org.apache.commons.ognl.performance.invocation.FindParameterTypesInvocation;
+import org.apache.commons.ognl.performance.invocation.GetConstructorsInvocation;
+import org.apache.commons.ognl.performance.invocation.GetDeclaredMethodsInvocation;
+import org.apache.commons.ognl.performance.invocation.GetMethodsInvocation;
+import org.apache.commons.ognl.performance.invocation.MethodParameterTypesInvocation;
+import org.apache.commons.ognl.performance.invocation.PermissionInvocation;
+import org.apache.commons.ognl.performance.invocation.PrimitiveDefaultInvocation;
+import org.apache.commons.ognl.performance.runtime.CommonsRuntimeWrapper;
+import org.apache.commons.ognl.performance.runtime.OldOgnlRuntimeWrapper;
+import org.apache.commons.ognl.performance.runtime.RuntimeWrapper;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+
+/**
+ * User: Maurizio Cucchiara
+ * Date: 10/22/11
+ * Time: 10:25 AM
+ */
+@AxisRange( min = 0, max = 1 )
+@BenchmarkMethodChart( filePrefix = "benchmark-ognl" )
+public abstract class BasePerformanceTest
+{
+    @Rule
+    public MethodRule benchmarkRun = new BenchmarkRule( );
+
+    public static final RuntimeWrapper COMMONS_RUNTIME_WRAPPER = new CommonsRuntimeWrapper(
);
+
+    public static final RuntimeWrapper OLD_RUNTIME_WRAPPER = new OldOgnlRuntimeWrapper( );
+
+    protected static RuntimeWrapper runtimeWrapper;
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void constructorCache( )
+        throws Exception
+    {
+        new GetConstructorsInvocation( runtimeWrapper, 50000 );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void declaredMethodCache( )
+        throws Exception
+    {
+        new GetDeclaredMethodsInvocation( runtimeWrapper );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void fieldCache( )
+        throws Exception
+    {
+        new FieldInvocation( runtimeWrapper, 50000 );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void findParameterTypeCache( )
+        throws Exception
+    {
+        new FindParameterTypesInvocation( runtimeWrapper, 100 );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void methodCache( )
+        throws Exception
+    {
+        new GetMethodsInvocation( runtimeWrapper, 20000 );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void methodParameterTypeCache( )
+        throws Exception
+    {
+        new MethodParameterTypesInvocation( runtimeWrapper );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void permissionCache( )
+        throws Exception
+    {
+        new PermissionInvocation( runtimeWrapper );
+    }
+
+    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+    @Test
+    public void primitiveCache( )
+        throws Exception
+    {
+        new PrimitiveDefaultInvocation( runtimeWrapper, 100000 );
+    }
+}

Modified: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java?rev=1187737&r1=1187736&r2=1187737&view=diff
==============================================================================
--- commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java
(original)
+++ commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java
Sat Oct 22 17:44:17 2011
@@ -21,28 +21,12 @@
 
 package org.apache.commons.ognl.performance;
 
-import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
 import com.carrotsearch.junitbenchmarks.annotation.LabelType;
-import org.apache.commons.ognl.performance.invocation.FieldInvocation;
-import org.apache.commons.ognl.performance.invocation.FindParameterTypesInvocation;
-import org.apache.commons.ognl.performance.invocation.GetConstructorsInvocation;
-import org.apache.commons.ognl.performance.invocation.GetDeclaredMethodsInvocation;
-import org.apache.commons.ognl.performance.invocation.GetMethodsInvocation;
-import org.apache.commons.ognl.performance.invocation.MethodParameterTypesInvocation;
-import org.apache.commons.ognl.performance.invocation.PermissionInvocation;
-import org.apache.commons.ognl.performance.invocation.PrimitiveDefaultInvocation;
-import org.apache.commons.ognl.performance.runtime.CommonsRuntimeWrapper;
-import org.apache.commons.ognl.performance.runtime.OldOgnlRuntimeWrapper;
-import org.apache.commons.ognl.performance.runtime.RuntimeWrapper;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.MethodRule;
 
 /**
  * User: Maurizio Cucchiara
@@ -54,81 +38,8 @@ import org.junit.rules.MethodRule;
 @BenchmarkMethodChart( filePrefix = "benchmark-commons-ognl" )
 @BenchmarkHistoryChart( labelWith = LabelType.CUSTOM_KEY, maxRuns = 20 )
 public class PerformanceCommonsOgnlTest
+    extends BasePerformanceTest
 {
-    @Rule
-    public MethodRule benchmarkRun = new BenchmarkRule( );
-
-    public static final RuntimeWrapper COMMONS_RUNTIME_WRAPPER = new CommonsRuntimeWrapper(
);
-
-    public static final RuntimeWrapper OLD_RUNTIME_WRAPPER = new OldOgnlRuntimeWrapper( );
-
-    protected static RuntimeWrapper runtimeWrapper;
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void constructorCache( )
-        throws Exception
-    {
-        new GetConstructorsInvocation( runtimeWrapper, 50000 );
-    }
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void declaredMethodCache( )
-        throws Exception
-    {
-        new GetDeclaredMethodsInvocation( runtimeWrapper );
-    }
-
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void fieldCache( )
-        throws Exception
-    {
-        new FieldInvocation( runtimeWrapper, 50000 );
-    }
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void findParameterTypeCache( )
-        throws Exception
-    {
-        new FindParameterTypesInvocation( runtimeWrapper, 100 );
-    }
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void methodCache( )
-        throws Exception
-    {
-        new GetMethodsInvocation( runtimeWrapper, 20000 );
-    }
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void methodParameterTypeCache( )
-        throws Exception
-    {
-        new MethodParameterTypesInvocation( runtimeWrapper );
-    }
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void permissionCache( )
-        throws Exception
-    {
-        new PermissionInvocation( runtimeWrapper );
-    }
-
-    @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
-    @Test
-    public void primitiveCache( )
-        throws Exception
-    {
-        new PrimitiveDefaultInvocation( runtimeWrapper, 100000 );
-    }
-
     @BeforeClass
     public static void before( )
     {

Modified: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java?rev=1187737&r1=1187736&r2=1187737&view=diff
==============================================================================
--- commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java
(original)
+++ commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java
Sat Oct 22 17:44:17 2011
@@ -35,15 +35,17 @@ import org.junit.BeforeClass;
  */
 
 @AxisRange( min = 0, max = 1 )
-@BenchmarkMethodChart(filePrefix = "benchmark-old-ognl")
+@BenchmarkMethodChart( filePrefix = "benchmark-old-ognl" )
 @BenchmarkHistoryChart( labelWith = LabelType.CUSTOM_KEY, maxRuns = 20 )
-public class PerformanceOldOgnlTest extends PerformanceCommonsOgnlTest
+public class PerformanceOldOgnlTest
+    extends PerformanceCommonsOgnlTest
 {
     @BeforeClass
     public static void before( )
     {
         runtimeWrapper = OLD_RUNTIME_WRAPPER;
     }
+
     @AfterClass
     public static void after( )
     {



Mime
View raw message