jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1325387 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index: IndexTest.java PrefixIndexTest.java PropertyIndexTest.java
Date Thu, 12 Apr 2012 17:10:38 GMT
Author: jukka
Date: Thu Apr 12 17:10:37 2012
New Revision: 1325387

URL: http://svn.apache.org/viewvc?rev=1325387&view=rev
Log:
OAK-12: Implement a test suite for the MicroKernel

The indexing tests exercise the indexing code, not the underlying MicroKernel implementation,
so there's no need to run them as integration tests against multiple MK implementations

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java?rev=1325387&r1=1325386&r2=1325387&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
Thu Apr 12 17:10:37 2012
@@ -20,21 +20,16 @@ import java.util.Iterator;
 import java.util.Random;
 import java.util.TreeMap;
 import junit.framework.Assert;
-import org.apache.jackrabbit.mk.MultiMkTestBase;
 import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 
 /**
  * Tests the indexing mechanism.
  */
-@RunWith(Parameterized.class)
-public class IndexTest extends MultiMkTestBase {
+public class IndexTest {
 
-    public IndexTest(String url) {
-        super(url);
-    }
+    private final MicroKernel mk = new MicroKernelImpl();
 
     @Test
     public void createIndexAfterAddingData() {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java?rev=1325387&r1=1325386&r2=1325387&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
Thu Apr 12 17:10:37 2012
@@ -18,23 +18,18 @@ package org.apache.jackrabbit.mk.index;
 
 import java.util.Iterator;
 import junit.framework.Assert;
-import org.apache.jackrabbit.mk.MultiMkTestBase;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 
 /**
  * Test the prefix index.
  */
-@RunWith(Parameterized.class)
-public class PrefixIndexTest extends MultiMkTestBase {
-
-    public PrefixIndexTest(String url) {
-        super(url);
-    }
+public class PrefixIndexTest {
 
     @Test
     public void test() {
+        MicroKernel mk = new MicroKernelImpl();
         Indexer indexer = new Indexer(mk, "index");
         PrefixIndex index = indexer.createPrefixIndex("d:");
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java?rev=1325387&r1=1325386&r2=1325387&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java
Thu Apr 12 17:10:37 2012
@@ -17,23 +17,18 @@
 package org.apache.jackrabbit.mk.index;
 
 import junit.framework.Assert;
-import org.apache.jackrabbit.mk.MultiMkTestBase;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 
 /**
  * Test the property index.
  */
-@RunWith(Parameterized.class)
-public class PropertyIndexTest extends MultiMkTestBase {
-
-    public PropertyIndexTest(String url) {
-        super(url);
-    }
+public class PropertyIndexTest {
 
     @Test
     public void test() {
+        MicroKernel mk = new MicroKernelImpl();
         Indexer indexer = new Indexer(mk, "index");
         PropertyIndex index = indexer.createPropertyIndex("id", true);
 
@@ -64,8 +59,7 @@ public class PropertyIndexTest extends M
 
         Assert.assertEquals("/test/test", index.getPath("3", head));
 
-        reconnect();
-
+        // Recreate the indexer
         indexer = new Indexer(mk);
         index = indexer.createPropertyIndex("id", true);
         head = mk.getHeadRevision();



Mime
View raw message