incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1388992 - in /sling/trunk/performance: base/src/main/java/org/apache/sling/performance/tests/ jcr-resource-2.0.10/ jcr-resource-2.0.10/src/test/java/org/apache/sling/performance/ jcr-resource-2.1.0/ jcr-resource-2.1.0/src/test/java/org/apa...
Date Sun, 23 Sep 2012 09:49:09 GMT
Author: asanso
Date: Sun Sep 23 09:49:08 2012
New Revision: 1388992

URL: http://svn.apache.org/viewvc?rev=1388992&view=rev
Log:
SLING-2593 - Improvement for the Sling performance tools. Adding first part of the patch provided
from Christian Vazzolla:  Created a new maven project that contains only the sling performance
tests and left the framework(tool) related part in the base project as we would like to use
the framework for performance testing in other projects also. Thanks Christian! 

Added:
    sling/trunk/performance/tests/
    sling/trunk/performance/tests/pom.xml
    sling/trunk/performance/tests/src/
    sling/trunk/performance/tests/src/main/
    sling/trunk/performance/tests/src/main/java/
    sling/trunk/performance/tests/src/main/java/org/
    sling/trunk/performance/tests/src/main/java/org/apache/
    sling/trunk/performance/tests/src/main/java/org/apache/sling/
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/
    sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/
    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
    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
Removed:
    sling/trunk/performance/base/src/main/java/org/apache/sling/performance/tests/
Modified:
    sling/trunk/performance/jcr-resource-2.0.10/pom.xml
    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/pom.xml
    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/pom.xml
    sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java

Modified: sling/trunk/performance/jcr-resource-2.0.10/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.0.10/pom.xml?rev=1388992&r1=1388991&r2=1388992&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.0.10/pom.xml (original)
+++ sling/trunk/performance/jcr-resource-2.0.10/pom.xml Sun Sep 23 09:49:08 2012
@@ -48,5 +48,10 @@
             <version>2.0</version>
             <scope>compile</scope>
         </dependency>
+         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.performance.tests</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 </project>

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=1388992&r1=1388991&r2=1388992&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
Sun Sep 23 09:49:08 2012
@@ -35,8 +35,6 @@ import org.apache.sling.performance.test
 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.ResolveNonExistingWith30000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith30000VanityPathTest;
 import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
 import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;
 

Modified: sling/trunk/performance/jcr-resource-2.1.0/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.1.0/pom.xml?rev=1388992&r1=1388991&r2=1388992&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.1.0/pom.xml (original)
+++ sling/trunk/performance/jcr-resource-2.1.0/pom.xml Sun Sep 23 09:49:08 2012
@@ -50,5 +50,10 @@
             <version>2.0</version>
             <scope>compile</scope>
         </dependency>
+         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.performance.tests</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 </project>

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=1388992&r1=1388991&r2=1388992&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
Sun Sep 23 09:49:08 2012
@@ -33,7 +33,12 @@ import org.apache.sling.jcr.resource.Jcr
 import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl;
 import org.apache.sling.jcr.resource.internal.helper.MapEntries;
 import org.apache.sling.jcr.resource.internal.helper.Mapping;
-import org.apache.sling.performance.tests.*;
+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.osgi.framework.BundleContext;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;

Modified: sling/trunk/performance/jcr-resource-2.2.0/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.2.0/pom.xml?rev=1388992&r1=1388991&r2=1388992&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.2.0/pom.xml (original)
+++ sling/trunk/performance/jcr-resource-2.2.0/pom.xml Sun Sep 23 09:49:08 2012
@@ -67,5 +67,10 @@
             <version>2.1.0</version>
             <scope>compile</scope>
         </dependency>
+         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.performance.tests</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 </project>

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=1388992&r1=1388991&r2=1388992&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
Sun Sep 23 09:49:08 2012
@@ -41,8 +41,6 @@ import org.apache.sling.performance.test
 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.ResolveNonExistingWith30000AliasTest;
-import org.apache.sling.performance.tests.ResolveNonExistingWith30000VanityPathTest;
 import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
 import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;
 import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
@@ -51,7 +49,6 @@ import org.apache.sling.resourceresolver
 import org.apache.sling.resourceresolver.impl.mapping.Mapping;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
-import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;
 
 public class PerformanceTest extends AbstractPerformanceTest {

Added: sling/trunk/performance/tests/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/pom.xml?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/pom.xml (added)
+++ sling/trunk/performance/tests/pom.xml Sun Sep 23 09:49:08 2012
@@ -0,0 +1,49 @@
+<!-- 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.sling</groupId>
+		<artifactId>sling-performance-tests</artifactId>
+		<version>0.0.1-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>org.apache.sling.performance.tests</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+
+	<name>Apache Sling Performance Tests</name>
+
+	<properties>
+		<junit.version>4.8.2</junit.version>
+	</properties>
+
+	<scm>
+		<connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/performance/tests</connection>
+		<developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/performance/tests</developerConnection>
+		<url>http://svn.apache.org/viewvc/sling/trunk/testing/performance/tests</url>
+	</scm>
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.sling</groupId>
+			<artifactId>org.apache.sling.performance.base</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
+		</dependency>
+	</dependencies>
+
+</project>
\ No newline at end of file

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000AliasTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000AliasTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000AliasTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000AliasTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith10000AliasTest extends ResolveNonExistingWithManyAliasTest
{
+    
+    public ResolveNonExistingWith10000AliasTest(TestHelper helper) {
+        super(helper, 10000);
+    }
+
+}
\ No newline at end of file

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000VanityPathTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000VanityPathTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000VanityPathTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith10000VanityPathTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith10000VanityPathTest extends ResolveNonExistingWithManyVanityPathTest
{
+
+    public ResolveNonExistingWith10000VanityPathTest(TestHelper helper) {
+        super(helper, 100, 100);
+    }
+
+}

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000AliasTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000AliasTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000AliasTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000AliasTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith1000AliasTest extends ResolveNonExistingWithManyAliasTest
{
+    
+    public ResolveNonExistingWith1000AliasTest(TestHelper helper) {
+        super(helper, 1000);
+    }
+
+}

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000VanityPathTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000VanityPathTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000VanityPathTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith1000VanityPathTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith1000VanityPathTest extends ResolveNonExistingWithManyVanityPathTest
{
+
+    public ResolveNonExistingWith1000VanityPathTest(TestHelper helper) {
+        super(helper, 100, 10);
+    }
+
+}

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000AliasTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000AliasTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000AliasTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000AliasTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith30000AliasTest extends ResolveNonExistingWithManyAliasTest
{
+    
+    public ResolveNonExistingWith30000AliasTest(TestHelper helper) {
+        super(helper, 30000);
+    }
+
+}
\ No newline at end of file

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000VanityPathTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000VanityPathTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000VanityPathTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith30000VanityPathTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith30000VanityPathTest extends ResolveNonExistingWithManyVanityPathTest
{
+
+    public ResolveNonExistingWith30000VanityPathTest(TestHelper helper) {
+        super(helper, 300, 100);
+    }
+
+}

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000AliasTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000AliasTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000AliasTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000AliasTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith5000AliasTest extends ResolveNonExistingWithManyAliasTest
{
+    
+    public ResolveNonExistingWith5000AliasTest(TestHelper helper) {
+        super(helper, 5000);
+    }
+
+}
\ No newline at end of file

Added: sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000VanityPathTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000VanityPathTest.java?rev=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000VanityPathTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWith5000VanityPathTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.sling.performance.tests;
+
+import org.apache.sling.performance.TestHelper;
+
+public class ResolveNonExistingWith5000VanityPathTest extends ResolveNonExistingWithManyVanityPathTest
{
+
+    public ResolveNonExistingWith5000VanityPathTest(TestHelper helper) {
+        super(helper, 100, 50);
+    }
+
+}

Added: 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=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyAliasTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,124 @@
+/*
+ * 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.sling.performance.tests;
+
+import java.math.BigInteger;
+import java.security.SecureRandom;
+
+import javax.jcr.Node;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.performance.AbstractRepositoryTest;
+import org.apache.sling.performance.TestHelper;
+import org.apache.sling.performance.ResourceResolverTestRequest;
+
+import static org.junit.Assert.assertNotNull;
+
+class ResolveNonExistingWithManyAliasTest extends AbstractRepositoryTest {
+    
+    private static final String PN_SLING_ALIAS = "sling:alias";
+    
+    private final TestHelper helper;
+
+    private Node mapRoot;
+
+    private ResourceResolver resResolver;
+    
+    private Node rootNode;
+    
+    private String rootPath;
+
+    private final int nodeCount;
+    
+    public ResolveNonExistingWithManyAliasTest(TestHelper helper, int nodeCount) {
+        this.helper = helper;
+        this.nodeCount = nodeCount;
+    }
+
+    @Override
+    protected void afterSuite() throws Exception {
+        if (helper != null) {
+            helper.dispose();
+        }
+
+        if (rootNode != null) {
+            rootNode.remove();
+        }
+        if (mapRoot != null) {
+            mapRoot.remove();
+        }
+        session.save();
+    }
+
+    @Override
+    protected void beforeSuite() throws Exception {
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/folder.cnd"));
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/resource.cnd"));
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/vanitypath.cnd"));
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/mapping.cnd"));
+
+        // test data
+        rootPath = "/test" + System.currentTimeMillis();
+        rootNode = getSession().getRootNode().addNode(rootPath.substring(1), JcrConstants.NT_UNSTRUCTURED);
+
+        // test mappings
+        mapRoot = getSession().getRootNode().addNode("etc", "nt:folder");
+        Node map = mapRoot.addNode("map", "sling:Mapping");
+        Node http = map.addNode("http", "sling:Mapping");
+        http.addNode("localhost.80", "sling:Mapping");
+        Node https = map.addNode("https", "sling:Mapping");
+        https.addNode("localhost.443", "sling:Mapping");
+
+        // define a vanity path for the rootPath
+        SecureRandom random = new SecureRandom();
+        // creating <nodeCount> nodes
+        for (int j = 0; j < nodeCount; j++) {
+            Node content = rootNode.addNode("a" + j, JcrConstants.NT_UNSTRUCTURED);
+            String alias = new BigInteger(130, random).toString(32);
+            content.setProperty(PN_SLING_ALIAS, alias);
+
+            if (j % 10 == 0) {
+                session.save();
+            }
+        }
+
+        session.save();
+        
+        helper.init(rootPath, session, getRepository());
+
+        resResolver = helper.getResourceResolver();
+
+    }
+
+    @Override
+    protected void runTest() throws Exception {
+        String path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + "testNonExistingAlias"
+                + ".print.html");
+        HttpServletRequest request = new ResourceResolverTestRequest(path);
+        Resource res = resResolver.resolve(request, path);
+        assertNotNull(res);
+    }
+}

Added: 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=1388992&view=auto
==============================================================================
--- sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java
(added)
+++ sling/trunk/performance/tests/src/main/java/org/apache/sling/performance/tests/ResolveNonExistingWithManyVanityPathTest.java
Sun Sep 23 09:49:08 2012
@@ -0,0 +1,136 @@
+/*
+ * 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.sling.performance.tests;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.math.BigInteger;
+import java.security.SecureRandom;
+
+import javax.jcr.Node;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.commons.testing.jcr.RepositoryUtil;
+import org.apache.sling.performance.AbstractRepositoryTest;
+import org.apache.sling.performance.TestHelper;
+import org.apache.sling.performance.ResourceResolverTestRequest;
+
+class ResolveNonExistingWithManyVanityPathTest extends AbstractRepositoryTest {
+    
+    private static final String NT_VANITY_PATH = "sling:VanityPath";
+
+    private static final String PN_VANITY_PATH = "sling:vanityPath";
+    
+    private final TestHelper helper;
+    
+    private Node mapRoot;
+    
+    private ResourceResolver resResolver;
+    
+    private Node rootNode;
+    
+    private String rootPath;
+
+    private final int nodeCount;
+    
+    private final int childNodeCount;
+    
+    public ResolveNonExistingWithManyVanityPathTest(TestHelper helper, int nodeCount, int
childNodeCount) {
+        this.helper = helper;
+        this.nodeCount = nodeCount;
+        this.childNodeCount = childNodeCount;
+    }
+
+    @Override
+    protected void afterSuite() throws Exception {
+        if (helper != null) {
+            helper.dispose();
+        }
+
+        if (rootNode != null) {
+            rootNode.remove();
+        }
+        if (mapRoot != null) {
+            mapRoot.remove();
+        }
+        session.save();
+    }
+
+    @Override
+    protected void beforeSuite() throws Exception {
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/folder.cnd"));
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/resource.cnd"));
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/vanitypath.cnd"));
+        RepositoryUtil.registerNodeType(getSession(),
+                this.getClass().getResourceAsStream("/SLING-INF/nodetypes/mapping.cnd"));
+
+        // test data
+        rootPath = "/test" + System.currentTimeMillis();
+        rootNode = getSession().getRootNode().addNode(rootPath.substring(1), "nt:unstructured");
+
+        // test mappings
+        mapRoot = getSession().getRootNode().addNode("etc", JcrConstants.NT_FOLDER);
+        Node map = mapRoot.addNode("map", "sling:Mapping");
+        Node http = map.addNode("http", "sling:Mapping");
+        http.addNode("localhost.80", "sling:Mapping");
+        Node https = map.addNode("https", "sling:Mapping");
+        https.addNode("localhost.443", "sling:Mapping");
+
+        SecureRandom random = new SecureRandom();
+
+        // creating <nodeCount> x <childNodeCount> nodes with vanity
+        for (int j = 0; j < nodeCount; j++) {
+            Node content = rootNode.addNode("a" + j, JcrConstants.NT_UNSTRUCTURED);
+            String s = new BigInteger(130, random).toString(32);
+            content.addMixin(NT_VANITY_PATH);
+            content.setProperty(PN_VANITY_PATH, s);
+            for (int k = 0; k < childNodeCount; k++) {
+                Node content2 = content.addNode("b" + k, JcrConstants.NT_UNSTRUCTURED);
+                String ss = new BigInteger(130, random).toString(32);
+                content2.addMixin(NT_VANITY_PATH);
+                content2.setProperty(PN_VANITY_PATH, ss);
+            }
+            if (j % 10 == 0) {
+                session.save();
+            }
+        }
+
+        session.save();
+        
+        helper.init(rootPath, session, getRepository());
+
+        resResolver = helper.getResourceResolver();
+
+    }
+
+    @Override
+    protected void runTest() throws Exception {
+        String path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath) + "/" + "testNonExistingVanity"
+                + ".print.html");
+        HttpServletRequest request = new ResourceResolverTestRequest(path);
+        Resource res = resResolver.resolve(request, path);
+        assertNotNull(res);
+    }
+
+}



Mime
View raw message