incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1551896 - in /sling/trunk/performance: base/src/main/java/org/apache/sling/performance/ jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/ jcr-resource-2.1.0/src/test/java/org/apache/sling/performance/ jcr-resource-2.2.0/src/t...
Date Wed, 18 Dec 2013 10:04:45 GMT
Author: asanso
Date: Wed Dec 18 10:04:45 2013
New Revision: 1551896

URL: http://svn.apache.org/r1551896
Log:
SLING-3294 - Simplify Performance Test Creation

Removed:
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000AliasTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000VanityPathTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000AliasTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000VanityPathTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000AliasTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000VanityPathTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000AliasTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000VanityPathTest.java
Modified:
    sling/trunk/performance/base/src/main/java/org/apache/sling/performance/AbstractRepositoryTest.java
    sling/trunk/performance/base/src/main/java/org/apache/sling/performance/FrameworkPerformanceMethod.java
    sling/trunk/performance/jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/PerformanceTest.java
    sling/trunk/performance/jcr-resource-2.1.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
    sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java

Modified: sling/trunk/performance/base/src/main/java/org/apache/sling/performance/AbstractRepositoryTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/base/src/main/java/org/apache/sling/performance/AbstractRepositoryTest.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/base/src/main/java/org/apache/sling/performance/AbstractRepositoryTest.java
(original)
+++ sling/trunk/performance/base/src/main/java/org/apache/sling/performance/AbstractRepositoryTest.java
Wed Dec 18 10:04:45 2013
@@ -27,7 +27,14 @@ import org.apache.sling.jcr.api.SlingRep
 
   
 public abstract class AbstractRepositoryTest {
-	
+
+    protected String testInstanceName;
+
+    public AbstractRepositoryTest(String testInstanceName) {
+        super();
+        this.testInstanceName = testInstanceName;
+    }
+
 	private static class ShutdownThread extends Thread {
         @Override
         public void run() {
@@ -80,5 +87,9 @@ public abstract class AbstractRepository
         }
         return testRoot;
     }
+    
+    public String toString(){
+    	return testInstanceName;
+    }
 
 }

Modified: sling/trunk/performance/base/src/main/java/org/apache/sling/performance/FrameworkPerformanceMethod.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/base/src/main/java/org/apache/sling/performance/FrameworkPerformanceMethod.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/base/src/main/java/org/apache/sling/performance/FrameworkPerformanceMethod.java
(original)
+++ sling/trunk/performance/base/src/main/java/org/apache/sling/performance/FrameworkPerformanceMethod.java
Wed Dec 18 10:04:45 2013
@@ -177,7 +177,7 @@ class FrameworkPerformanceMethod extends
 		}
 
 		if (statistics.getN() > 0) {
-            ReportLogger.writeReport(this.performanceSuiteState.testSuiteName, testCaseName,
this.target.getClass().getName(),
+		    ReportLogger.writeReport(this.performanceSuiteState.testSuiteName, testCaseName, ((String
)this.target.getClass().getMethod("toString", null).invoke(this.target, null)),
                     getMethod().getName(), statistics, ReportLogger.ReportType.TXT, reportLevel);
 		}
 

Modified: sling/trunk/performance/jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/PerformanceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/PerformanceTest.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/PerformanceTest.java
(original)
+++ sling/trunk/performance/jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/PerformanceTest.java
Wed Dec 18 10:04:45 2013
@@ -18,9 +18,7 @@ package org.apache.sling.performance;
 
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.Session;
-
 import junitx.util.PrivateAccessor;
-
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.jcr.api.SlingRepository;
@@ -29,12 +27,8 @@ import org.apache.sling.jcr.resource.int
 import org.apache.sling.jcr.resource.internal.helper.MapEntries;
 import org.apache.sling.jcr.resource.internal.helper.Mapping;
 import org.apache.sling.performance.annotation.PerformanceTestSuite;
-import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;
+import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;
+import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
 import org.junit.runner.RunWith;
 
 
@@ -92,14 +86,13 @@ public class PerformanceTest {
         
         ParameterizedTestList testCenter = new ParameterizedTestList();
         testCenter.setTestSuiteTitle("jcr.resource-2.0.10");
-        testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper));
-        //tests.add(new ResolveNonExistingWith30000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper));
-        //tests.add(new ResolveNonExistingWith30000AliasTest(helper));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper,
100, 10));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper,
100, 50));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper,
100, 100));
+        
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWithManyAliasTest",helper,
1000));
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper,
5000));
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper,
10000));
         
         return testCenter;
         

Modified: sling/trunk/performance/jcr-resource-2.1.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.1.0/src/test/java/org/apache/sling/performance/PerformanceTest.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.1.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
(original)
+++ sling/trunk/performance/jcr-resource-2.1.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
Wed Dec 18 10:04:45 2013
@@ -16,7 +16,9 @@
  */
 package org.apache.sling.performance;
 
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.mock;
+
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.Session;
 import junitx.util.PrivateAccessor;
@@ -28,12 +30,8 @@ import org.apache.sling.jcr.resource.int
 import org.apache.sling.jcr.resource.internal.helper.MapEntries;
 import org.apache.sling.jcr.resource.internal.helper.Mapping;
 import org.apache.sling.performance.annotation.PerformanceTestSuite;
-import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;
+import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;
+import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
 import org.junit.runner.RunWith;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.event.Event;
@@ -106,15 +104,13 @@ public class PerformanceTest {
         Helper helper = new Helper();
         
         ParameterizedTestList testCenter = new ParameterizedTestList();
-        testCenter.setTestSuiteTitle("jcr.resource-2.1.0");
-        testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper));
-        //tests.add(new ResolveNonExistingWith30000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper));
-        //tests.add(new ResolveNonExistingWith30000AliasTest(helper));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper,
100, 10));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper,
100, 50));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper,
100, 100));
+        
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWithManyAliasTest",helper,
1000));
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper,
5000));
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper,
10000));
                 
         return testCenter;
     }

Modified: sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
(original)
+++ sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
Wed Dec 18 10:04:45 2013
@@ -32,12 +32,8 @@ import org.apache.sling.jcr.api.SlingRep
 import org.apache.sling.jcr.resource.JcrResourceConstants;
 import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory;
 import org.apache.sling.performance.annotation.PerformanceTestSuite;
-import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;
+import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;
+import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
 import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
 import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryImpl;
 import org.apache.sling.resourceresolver.impl.mapping.MapEntries;
@@ -112,18 +108,18 @@ public class PerformanceTest {
     @PerformanceTestSuite
     public ParameterizedTestList testPerformance() throws Exception {
         Helper helper = new Helper();
-        
+
         ParameterizedTestList testCenter = new ParameterizedTestList();
         testCenter.setTestSuiteTitle("jcr.resource-2.2.0");
-        testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper));
-        //tests.add(new ResolveNonExistingWith30000VanityPathTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper));
-        testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper));
-        //tests.add(new ResolveNonExistingWith30000AliasTest(helper));
         
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper,
100, 10));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper,
100, 50));
+        testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper,
100, 100));
+        
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith1000AliasTest",helper,
1000));
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper,
5000));
+        testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper,
10000));
+
         return testCenter;
     }
 }

Modified: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java
(original)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java
Wed Dec 18 10:04:45 2013
@@ -30,10 +30,11 @@ import org.apache.sling.commons.testing.
 import org.apache.sling.performance.AbstractRepositoryTest;
 import org.apache.sling.performance.TestHelper;
 import org.apache.sling.performance.ResourceResolverTestRequest;
+import org.apache.sling.performance.annotation.PerformanceTest;
 import org.junit.After;
 import org.junit.Before;
 
-class ResolveNonExistingWithManyAliasTest extends AbstractRepositoryTest {
+public class ResolveNonExistingWithManyAliasTest extends AbstractRepositoryTest {
     
     private static final String PN_SLING_ALIAS = "sling:alias";
     
@@ -49,7 +50,8 @@ class ResolveNonExistingWithManyAliasTes
 
     private final int nodeCount;
     
-    public ResolveNonExistingWithManyAliasTest(TestHelper helper, int nodeCount) {
+    public ResolveNonExistingWithManyAliasTest(String testInstanceName, TestHelper helper,
int nodeCount) {
+        super(testInstanceName);
         this.helper = helper;
         this.nodeCount = nodeCount;
     }
@@ -113,7 +115,8 @@ class ResolveNonExistingWithManyAliasTes
 
     }
 
-    protected void runTest() throws Exception {
+    @PerformanceTest
+    public void runTest() throws Exception {
         String path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + "testNonExistingAlias"
                 + ".print.html");
         HttpServletRequest request = new ResourceResolverTestRequest(path);

Modified: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java?rev=1551896&r1=1551895&r2=1551896&view=diff
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java
(original)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java
Wed Dec 18 10:04:45 2013
@@ -29,10 +29,11 @@ import org.apache.sling.commons.testing.
 import org.apache.sling.performance.AbstractRepositoryTest;
 import org.apache.sling.performance.TestHelper;
 import org.apache.sling.performance.ResourceResolverTestRequest;
+import org.apache.sling.performance.annotation.PerformanceTest;
 import org.junit.After;
 import org.junit.Before;
 
-class ResolveNonExistingWithManyVanityPathTest extends AbstractRepositoryTest {
+public class ResolveNonExistingWithManyVanityPathTest extends AbstractRepositoryTest {
     
     private static final String NT_VANITY_PATH = "sling:VanityPath";
 
@@ -52,7 +53,9 @@ class ResolveNonExistingWithManyVanityPa
     
     private final int childNodeCount;
     
-    public ResolveNonExistingWithManyVanityPathTest(TestHelper helper, int nodeCount, int
childNodeCount) {
+    public ResolveNonExistingWithManyVanityPathTest(String testInstanceName,
+            TestHelper helper, int nodeCount, int childNodeCount) {
+        super(testInstanceName);
         this.helper = helper;
         this.nodeCount = nodeCount;
         this.childNodeCount = childNodeCount;
@@ -123,8 +126,8 @@ class ResolveNonExistingWithManyVanityPa
 
     }
 
-
-    protected void runTest() throws Exception {
+    @PerformanceTest
+    public void runTest() throws Exception {
         String path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + "testNonExistingVanity"
                 + ".print.html");
         HttpServletRequest request = new ResourceResolverTestRequest(path);



Mime
View raw message