jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r633498 - in /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core: ./ query/
Date Tue, 04 Mar 2008 14:54:21 GMT
Author: mreutegg
Date: Tue Mar  4 06:54:18 2008
New Revision: 633498

URL: http://svn.apache.org/viewvc?rev=633498&view=rev
Log:
JCR-1452: Make use of jackrabbit.test.scale in test cases
- reverted previous commit

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentCheckinMixedTransactionTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReadWriteTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningWithTransactionsTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AxisQueryTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ConcurrentQueryTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/UpperLowerCaseQueryTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java
Tue Mar  4 06:54:18 2008
@@ -29,11 +29,6 @@
 public abstract class AbstractConcurrencyTest extends AbstractJCRTest {
 
     /**
-     * Execute random queries for this amount of time.
-     */
-    protected static final int RUN_NUM_SECONDS = getTestScale();
-
-    /**
      * Runs a task with the given concurrency and creates an individual test
      * node for each thread.
      *

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java
Tue Mar  4 06:54:18 2008
@@ -28,8 +28,8 @@
 public class ConcurrencyTest extends AbstractJCRTest {
 
     private static final int NUM_ITERATIONS = 2;
-    private static final int NUM_SESSIONS = getTestScale();
-    private static final int NUM_NODES = getTestScale();
+    private static final int NUM_SESSIONS = 100;
+    private static final int NUM_NODES = 100;
 
     final ArrayList exceptions = new ArrayList();
 
@@ -154,4 +154,4 @@
             log.println("ended.");
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentCheckinMixedTransactionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentCheckinMixedTransactionTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentCheckinMixedTransactionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentCheckinMixedTransactionTest.java
Tue Mar  4 06:54:18 2008
@@ -40,6 +40,8 @@
 
     private static final int NUM_THREADS = 10;
 
+    private static final int RUN_NUM_SECONDS = 20;
+
     public void testCheckInOut() throws RepositoryException {
         final List exceptions = Collections.synchronizedList(new ArrayList());
         final long end = System.currentTimeMillis() + RUN_NUM_SECONDS * 1000;

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReadWriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReadWriteTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReadWriteTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReadWriteTest.java
Tue Mar  4 06:54:18 2008
@@ -37,6 +37,8 @@
 
     private static final int NUM_THREADS = 5;
 
+    private static final int RUN_NUM_SECONDS = 20;
+
     public void testReadWrite() throws RepositoryException {
         final List uuids = new ArrayList();
         for (int i = 0; i < NUM_NODES; i++) {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java
Tue Mar  4 06:54:18 2008
@@ -36,7 +36,7 @@
     /** logger instance */
     private static final Logger log = LoggerFactory.getLogger(ConcurrentSaveTest.class);
 
-    private final int NUM_NODES = 10 * getTestScale();
+    private final int NUM_NODES = 1000;
     private Session addNodeSession;
     private Session removePropertySession;
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningTest.java
Tue Mar  4 06:54:18 2008
@@ -39,7 +39,7 @@
      * The total number of operations to execute. E.g. number of checkins
      * performed by the threads.
      */
-    private static final int NUM_OPERATIONS = 10 * getTestScale();
+    private static final int NUM_OPERATIONS = 200;
 
     public void testConcurrentAddVersionable() throws RepositoryException {
         runTask(new Task() {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningWithTransactionsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningWithTransactionsTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningWithTransactionsTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentVersioningWithTransactionsTest.java
Tue Mar  4 06:54:18 2008
@@ -37,13 +37,13 @@
     /**
      * The number of threads.
      */
-    private static final int CONCURRENCY = 10;
+    private static final int CONCURRENCY = 100;
 
     /**
      * The total number of operations to execute. E.g. number of checkins
      * performed by the threads.
      */
-    private static final int NUM_OPERATIONS = 10 * getTestScale();
+    private static final int NUM_OPERATIONS = 100;
 
     public void testConcurrentAddVersionableInTransaction()
             throws RepositoryException {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java
Tue Mar  4 06:54:18 2008
@@ -33,11 +33,11 @@
  */
 public class LockTest extends AbstractJCRTest {
 
-    private static final int NUM_THREADS = 10;
+    private static final int NUM_THREADS = 100;
 
-    private static final int NUM_CHANGES = 10 * getTestScale();
+    private static final int NUM_CHANGES = 10;
 
-    private static final int NUM_VALUE_GETS = 10 * getTestScale();
+    private static final int NUM_VALUE_GETS = 10;
 
     /**
      * Tests the utility {@link org.apache.jackrabbit.util.Locked} by

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java
Tue Mar  4 06:54:18 2008
@@ -31,6 +31,8 @@
  */
 public class ReadVersionsWhileModified extends AbstractConcurrencyTest {
 
+    private static final int RUN_NUM_SECONDS = 20;
+
     public void testVersionHistory() throws RepositoryException {
         final Node n = testRootNode.addNode(nodeName1);
         n.addMixin(mixVersionable);
@@ -38,7 +40,7 @@
         final Session s = helper.getSuperuserSession();
         Thread t = new Thread(new Runnable() {
             public void run() {
-                long end = System.currentTimeMillis() + 1000 * getTestScale();
+                long end = System.currentTimeMillis() + RUN_NUM_SECONDS * 1000;
                 try {
                     Node vn = (Node) s.getItem(n.getPath());
                     while (end > System.currentTimeMillis()) {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
Tue Mar  4 06:54:18 2008
@@ -37,11 +37,6 @@
  */
 public class AbstractQueryTest extends AbstractJCRTest {
 
-    /**
-     * Execute random queries for this amount of time.
-     */
-    protected static final int RUN_NUM_SECONDS = getTestScale();
-
     protected QueryManager qm;
 
     protected void setUp() throws Exception {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AxisQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AxisQueryTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AxisQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AxisQueryTest.java
Tue Mar  4 06:54:18 2008
@@ -43,6 +43,11 @@
     private static final int NODES_PER_LEVEL = 3;
 
     /**
+     * Execute random queries for this amount of time.
+     */
+    private static final int RUN_NUM_SECONDS = 10;
+
+    /**
      * Controls if query results are checked for their correctness. When the
      * number of test nodes increases this becomes expensive and should be
      * disabled.

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ConcurrentQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ConcurrentQueryTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ConcurrentQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ConcurrentQueryTest.java
Tue Mar  4 06:54:18 2008
@@ -67,14 +67,13 @@
     }
 
     /**
-     * Writes 100 * {@link #getTestScale()} nodes in transactions of 5 nodes to
-     * the workspace while other threads query the workspace. Query results must
-     * always return a consistent view of the workspace, that is:<br/>
+     * Writes 1000 nodes in transactions of 5 nodes to the workspace while
+     * other threads query the workspace. Query results must always return
+     * a consistent view of the workspace, that is:<br/>
      * <code>result.numNodes % 5 == 0</code>
      */
     public void testConcurrentQueryWithWrite() throws Exception {
 
-        final int testScale = getTestScale();
         final List exceptions = Collections.synchronizedList(new ArrayList());
         List readers = new ArrayList();
         String query = "/jcr:root" + testRoot + "//*[@testprop = 'foo']";
@@ -88,7 +87,7 @@
                 try {
                     for (int i = 0; i < 20; i++) {
                         Node n = testRootNode.addNode("node" + i);
-                        for (int j = 0; j < testScale; j++) {
+                        for (int j = 0; j < 10; j++) {
                             Node n1 = n.addNode("node" + j);
                             for (int k = 0; k < 5; k++) {
                                 n1.addNode("node" + k).setProperty("testprop", "foo");
@@ -125,17 +124,17 @@
     }
 
     /**
-     * Deletes 100 * {@link #getTestScale()} nodes in transactions of 5 nodes
-     * while other threads query the workspace. Query results must always return
+     * Deletes 1000 nodes in transactions of 5 nodes while
+     * other threads query the workspace. Query results must always return
      * a consistent view of the workspace, that is:<br/>
      * <code>result.numNodes % 5 == 0</code>
      */
     public void testConcurrentQueryWithDeletes() throws Exception {
-        final int testScale = getTestScale();
-        // create 100 * getTestScale() nodes
+
+        // create 1000 nodes
         for (int i = 0; i < 20; i++) {
             Node n = testRootNode.addNode("node" + i);
-            for (int j = 0; j < testScale; j++) {
+            for (int j = 0; j < 10; j++) {
                 Node n1 = n.addNode("node" + j);
                 for (int k = 0; k < 5; k++) {
                     n1.addNode("node" + k).setProperty("testprop", "foo");
@@ -157,7 +156,7 @@
                 try {
                     for (int i = 0; i < 20; i++) {
                         Node n = testRootNode.getNode("node" + i);
-                        for (int j = 0; j < testScale; j++) {
+                        for (int j = 0; j < 10; j++) {
                             Node n1 = n.getNode("node" + j);
                             for (int k = 0; k < 5; k++) {
                                 n1.getNode("node" + k).remove();

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/UpperLowerCaseQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/UpperLowerCaseQueryTest.java?rev=633498&r1=633497&r2=633498&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/UpperLowerCaseQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/UpperLowerCaseQueryTest.java
Tue Mar  4 06:54:18 2008
@@ -146,8 +146,7 @@
     public void testLikeComparisonRandom() throws RepositoryException {
         String abcd = "abcd";
         Random random = new Random();
-        long end = System.currentTimeMillis() + 1000 * RUN_NUM_SECONDS;
-        while (end > System.currentTimeMillis()) {
+        for (int i = 0; i < 50; i++) {
             String pattern = "";
             pattern += getRandomChar(abcd, random);
             pattern += getRandomChar(abcd, random);



Mime
View raw message