jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1325385 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
Date Thu, 12 Apr 2012 17:01:31 GMT
Author: jukka
Date: Thu Apr 12 17:01:31 2012
New Revision: 1325385

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

IndexWrapperTest targets the IndexWrapper functionality so it doesn't need to be executed
against more than one MicroKernel implementation.
Additionally the test currently only works with the SimpleKernelImpl because of some test-specific
assumptions.

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java?rev=1325385&r1=1325384&r2=1325385&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
Thu Apr 12 17:01:31 2012
@@ -17,36 +17,24 @@
 package org.apache.jackrabbit.mk.wrapper;
 
 import static org.junit.Assert.assertEquals;
-import org.apache.jackrabbit.mk.MultiMkTestBase;
+import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.index.IndexWrapper;
-import org.junit.Before;
+import org.apache.jackrabbit.mk.simple.SimpleKernelImpl;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 
 /**
  * Test the index wrapper.
  */
-@RunWith(Parameterized.class)
-public class IndexWrapperTest extends MultiMkTestBase {
+public class IndexWrapperTest {
 
-    private String head;
-
-    public IndexWrapperTest(String url) {
-        super(url);
-    }
+    // TODO: Remove SimpleKernelImpl-specific assumptions from the test
+    private final MicroKernel mk =
+            new IndexWrapper(new SimpleKernelImpl("mem:IndexWrapperTest"));
 
-    @Before
-    public void setUp() throws Exception {
-        super.setUp();
-        mk = new IndexWrapper(mk);
-    }
+    private String head;
 
     @Test
     public void prefix() {
-        if (!isSimpleKernel(mk)) {
-            return;
-        }
         head = mk.commit("/index", "+ \"prefix:x\": {}", head, "");
         head = mk.commit("/", "+ \"n1\": { \"value\":\"a:no\" }", head, "");
         head = mk.commit("/", "+ \"n2\": { \"value\":\"x:yes\" }", head, "");
@@ -62,9 +50,6 @@ public class IndexWrapperTest extends Mu
 
     @Test
     public void propertyUnique() {
-        if (!isSimpleKernel(mk)) {
-            return;
-        }
         head = mk.commit("/index", "+ \"property:id,unique\": {}", head, "");
         head = mk.commit("/", "+ \"n1\": { \"value\":\"empty\" }", head, "");
         head = mk.commit("/", "+ \"n2\": { \"id\":\"1\" }", head, "");
@@ -76,9 +61,6 @@ public class IndexWrapperTest extends Mu
 
     @Test
     public void propertyNonUnique() {
-        if (!isSimpleKernel(mk)) {
-            return;
-        }
         head = mk.commit("/index", "+ \"property:ref\": {}", head, "");
         head = mk.commit("/", "+ \"n1\": { \"ref\":\"a\" }", head, "");
         head = mk.commit("/", "+ \"n2\": { \"ref\":\"b\" }", head, "");



Mime
View raw message