jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1040459 - in /jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance: AbstractPerformanceTest.java SQL2SearchTest.java SimpleSearchTest.java
Date Tue, 30 Nov 2010 10:41:13 GMT
Author: jukka
Date: Tue Nov 30 10:41:13 2010
New Revision: 1040459

URL: http://svn.apache.org/viewvc?rev=1040459&view=rev
Log:
JCR-2715: Improved join query performance

Add a performance test case also for non-join SQL2 queries

Added:
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SQL2SearchTest.java
  (with props)
Modified:
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SimpleSearchTest.java

Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java?rev=1040459&r1=1040458&r2=1040459&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
(original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java
Tue Nov 30 10:41:13 2010
@@ -100,6 +100,7 @@ public abstract class AbstractPerformanc
         runTest(new ConcurrentReadTest(), name, conf);
         runTest(new ConcurrentReadWriteTest(), name, conf);
         runTest(new SimpleSearchTest(), name, conf);
+        runTest(new SQL2SearchTest(), name, conf);
         runTest(new TwoWayJoinTest(), name, conf);
         runTest(new ThreeWayJoinTest(), name, conf);
         runTest(new CreateManyChildNodesTest(), name, conf);

Added: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SQL2SearchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SQL2SearchTest.java?rev=1040459&view=auto
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SQL2SearchTest.java
(added)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SQL2SearchTest.java
Tue Nov 30 10:41:13 2010
@@ -0,0 +1,32 @@
+/*
+ * 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.jackrabbit.performance;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryManager;
+
+public class SQL2SearchTest extends SimpleSearchTest {
+
+    protected Query createQuery(QueryManager manager, int i)
+            throws RepositoryException {
+        return manager.createQuery(
+                "SELECT * FROM [nt:base] WHERE testcount=" + i,
+                "JCR-SQL2");
+    }
+
+}

Propchange: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SQL2SearchTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SimpleSearchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SimpleSearchTest.java?rev=1040459&r1=1040458&r2=1040459&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SimpleSearchTest.java
(original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/SimpleSearchTest.java
Tue Nov 30 10:41:13 2010
@@ -31,6 +31,11 @@ public class SimpleSearchTest extends Ab
 
     private Node root;
 
+    protected Query createQuery(QueryManager manager, int i)
+            throws RepositoryException {
+        return manager.createQuery("//*[@testcount=" + i + "]", Query.XPATH);
+    }
+
     public void beforeSuite() throws RepositoryException {
         session = getRepository().login(getCredentials());
 
@@ -48,8 +53,7 @@ public class SimpleSearchTest extends Ab
     public void runTest() throws Exception {
         QueryManager manager = session.getWorkspace().getQueryManager();
         for (int i = 0; i < NODE_COUNT; i++) {
-            Query query =
-                manager.createQuery("//*[@testcount=" + i + "]", Query.XPATH);
+            Query query = createQuery(manager, i);
             NodeIterator iterator = query.execute().getNodes();
             while (iterator.hasNext()) {
                 Node node = iterator.nextNode();



Mime
View raw message