jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1515321 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak: ./ api/ core/ plugins/name/ util/
Date Mon, 19 Aug 2013 09:05:18 GMT
Author: mduerig
Date: Mon Aug 19 09:05:17 2013
New Revision: 1515321

URL: http://svn.apache.org/r1515321
Log:
OAK-961 Parametrise tests to run against all Microkernel backends
Parametrise ContentSessionTest, ImmutableRootTest, ImmutableTreeTest, LargeMoveTest, MutableTreeTest,
RootTest, ReadWriteNamespaceRegistryTest, TreeLocationTest and ignore failing tests

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableRootTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableTreeTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/TreeLocationTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/OakBaseTest.java
Mon Aug 19 09:05:17 2013
@@ -16,20 +16,56 @@
  */
 package org.apache.jackrabbit.oak;
 
+import java.util.Arrays;
+import java.util.Collection;
+
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
 /**
  * OakBaseTest... TODO
  */
+@RunWith(Parameterized.class)
 public abstract class OakBaseTest {
 
+    @Parameterized.Parameters
+    public static Collection<Object[]> fixtures() {
+        Object[][] fixtures = new Object[][] {
+                {NodeStoreFixture.MK_IMPL},
+                {NodeStoreFixture.MONGO_MK},
+                {NodeStoreFixture.SEGMENT_MK},
+        };
+        return Arrays.asList(fixtures);
+    }
+
+    protected NodeStoreFixture fixture;
+    protected NodeStore store;
+
+    @Before
+    public void setup() {
+        store = fixture.createNodeStore();
+    }
+
+    @After
+    public void teardown() {
+        fixture.dispose(store);
+    }
+
+    protected OakBaseTest(NodeStoreFixture fixture) {
+        this.fixture = fixture;
+    }
+
     protected ContentRepository createContentRepository() {
-        return new Oak().with(new OpenSecurityProvider()).createContentRepository();
+        return new Oak(store).with(new OpenSecurityProvider()).createContentRepository();
     }
 
     protected ContentSession createContentSession() {
-        return new Oak().with(new OpenSecurityProvider()).createContentSession();
+        return new Oak(store).with(new OpenSecurityProvider()).createContentSession();
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/ContentSessionTest.java
Mon Aug 19 09:05:17 2013
@@ -23,6 +23,7 @@ import java.io.IOException;
 import javax.jcr.NoSuchWorkspaceException;
 import javax.security.auth.login.LoginException;
 
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.junit.After;
 import org.junit.Before;
@@ -32,6 +33,10 @@ public class ContentSessionTest extends 
 
     private ContentRepository repository;
 
+    public ContentSessionTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Before
     public void setUp() {
         repository = createContentRepository();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableRootTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableRootTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableRootTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableRootTest.java
Mon Aug 19 09:05:17 2013
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.core;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -31,6 +32,10 @@ public class ImmutableRootTest extends O
 
     private ImmutableRoot root;
 
+    public ImmutableRootTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Before
     public void setUp() throws CommitFailedException {
         ContentSession session = createContentSession();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableTreeTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/ImmutableTreeTest.java
Mon Aug 19 09:05:17 2013
@@ -23,6 +23,8 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -37,6 +39,10 @@ public class ImmutableTreeTest extends O
 
     private Root root;
 
+    public ImmutableTreeTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Before
     public void setUp() throws CommitFailedException {
         ContentSession session = createContentSession();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/LargeMoveTestIT.java
Mon Aug 19 09:05:17 2013
@@ -19,6 +19,9 @@
 
 package org.apache.jackrabbit.oak.core;
 
+import static org.junit.Assume.assumeTrue;
+
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -37,8 +40,14 @@ public class LargeMoveTestIT extends Oak
     private String treeAPath;
     private String treeBPath;
 
+    public LargeMoveTestIT(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
+    // FIXME slow on MongoMK
     @Before
     public void setUp() throws CommitFailedException {
+        assumeTrue(fixture != NodeStoreFixture.MONGO_MK);
         session = createContentSession();
 
         // Add test content

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/MutableTreeTest.java
Mon Aug 19 09:05:17 2013
@@ -29,6 +29,7 @@ import java.util.HashSet;
 import java.util.Set;
 
 import com.google.common.collect.Sets;
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -48,6 +49,10 @@ public class MutableTreeTest extends Oak
 
     private Root root;
 
+    public MutableTreeTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Before
     public void setUp() throws CommitFailedException {
         ContentSession session = createContentSession();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootTest.java
Mon Aug 19 09:05:17 2013
@@ -23,10 +23,12 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
@@ -43,6 +45,10 @@ public class RootTest extends OakBaseTes
 
     private ContentSession session;
 
+    public RootTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Before
     public void setUp() throws CommitFailedException {
         session = createContentSession();
@@ -169,8 +175,10 @@ public class RootTest extends OakBaseTes
         assertEquals("/moved/new", n.getPath());
     }
 
+    // FIXME fails on SegmentMK
     @Test
     public void moveToSelf() throws CommitFailedException {
+        assumeTrue(fixture != NodeStoreFixture.SEGMENT_MK);
         Root root = session.getLatestRoot();
         root.getTree("/").addChild("s");
         root.commit();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistryTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistryTest.java
Mon Aug 19 09:05:17 2013
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEqu
 
 import javax.jcr.NamespaceRegistry;
 
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
@@ -28,6 +29,10 @@ import org.junit.Test;
 
 public class ReadWriteNamespaceRegistryTest extends OakBaseTest {
 
+    public ReadWriteNamespaceRegistryTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Test
     public void testMappings() throws Exception {
         final ContentSession session = createContentSession();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/TreeLocationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/TreeLocationTest.java?rev=1515321&r1=1515320&r2=1515321&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/TreeLocationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/util/TreeLocationTest.java
Mon Aug 19 09:05:17 2013
@@ -22,12 +22,12 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
+import org.apache.jackrabbit.oak.NodeStoreFixture;
 import org.apache.jackrabbit.oak.OakBaseTest;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.util.TreeLocation;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -38,6 +38,10 @@ public class TreeLocationTest extends Oa
     private Root root;
     private TreeLocation nullLocation;
 
+    public TreeLocationTest(NodeStoreFixture fixture) {
+        super(fixture);
+    }
+
     @Before
     public void setUp() throws CommitFailedException {
         ContentSession session = createContentSession();



Mime
View raw message