jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1325744 - in /jackrabbit/oak/trunk: oak-core/ oak-core/src/test/java/org/apache/jackrabbit/mk/ oak-core/src/test/java/org/apache/jackrabbit/mk/blobs/ oak-core/src/test/java/org/apache/jackrabbit/mk/server/ oak-core/src/test/java/org/apache...
Date Fri, 13 Apr 2012 12:54:47 GMT
Author: jukka
Date: Fri Apr 13 12:54:46 2012
New Revision: 1325744

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

Move DataStoreTest to the integration test suite.

Run the tests in oak-it-mk also against SimpleKernelImpl and the HTTP bridge

Added:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/EverythingIT.java
      - copied, changed from r1325699, jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
  (with props)
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/SimpleKernelImplFixture.java
      - copied, changed from r1325699, jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
    jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/
    jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/
    jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/DataStoreIT.java
  (contents, props changed)
      - copied, changed from r1325699, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/blobs/DataStoreTest.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/blobs/DataStoreTest.java
Modified:
    jackrabbit/oak/trunk/oak-core/pom.xml
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java

Modified: jackrabbit/oak/trunk/oak-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/pom.xml?rev=1325744&r1=1325743&r2=1325744&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-core/pom.xml Fri Apr 13 12:54:46 2012
@@ -78,6 +78,12 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-it-mk</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>com.googlecode.json-simple</groupId>
       <artifactId>json-simple</artifactId>
       <version>1.1</version>

Copied: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/EverythingIT.java
(from r1325699, jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/EverythingIT.java?p2=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/EverythingIT.java&p1=jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java&r1=1325699&r2=1325744&rev=1325744&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/EverythingIT.java
Fri Apr 13 12:54:46 2012
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.test;
+package org.apache.jackrabbit.mk;
 
+import org.apache.jackrabbit.mk.test.MicroKernelTestSuite;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
-@Suite.SuiteClasses({
-    MicroKernelIT.class
-})
-public class MicroKernelTestSuite {
+@Suite.SuiteClasses({ MicroKernelTestSuite.class })
+public class EverythingIT {
 }

Added: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java?rev=1325744&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
Fri Apr 13 12:54:46 2012
@@ -0,0 +1,63 @@
+/*
+ * 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.mk.server;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.client.Client;
+import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.mk.test.MicroKernelFixture;
+
+public class ClientServerFixture implements MicroKernelFixture {
+
+    @Override
+    public void setUpCluster(MicroKernel[] cluster) {
+        MicroKernel mk = new MicroKernelImpl();
+        final Server server = new Server(mk);
+        try {
+            server.start();
+        } catch (IOException e) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+
+        InetSocketAddress address = server.getAddress();
+        cluster[0] = new Client(address) {
+            @Override
+            public synchronized void dispose() {
+                super.dispose();
+                server.stop();
+            }
+        };
+        for (int i = 1; i < cluster.length; i++) {
+            cluster[i] = new Client(address);
+        }
+    }
+
+    @Override
+    public void syncMicroKernelCluster(MicroKernel... nodes) {
+    }
+
+    @Override
+    public void tearDownCluster(MicroKernel[] cluster) {
+        for (int i = 0; i < cluster.length; i++) {
+            ((Client) cluster[i]).dispose();
+        }
+    }
+
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/server/ClientServerFixture.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/SimpleKernelImplFixture.java
(from r1325699, jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/SimpleKernelImplFixture.java?p2=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/SimpleKernelImplFixture.java&p1=jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java&r1=1325699&r2=1325744&rev=1325744&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/simple/SimpleKernelImplFixture.java
Fri Apr 13 12:54:46 2012
@@ -14,14 +14,28 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.test;
+package org.apache.jackrabbit.mk.simple;
 
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.test.MicroKernelFixture;
+
+public class SimpleKernelImplFixture implements MicroKernelFixture {
+
+    @Override
+    public void setUpCluster(MicroKernel[] cluster) {
+        MicroKernel mk =
+                new SimpleKernelImpl("mem:SimpleKernelImplFixture");
+        for (int i = 0; i < cluster.length; i++) {
+            cluster[i] = mk;
+        }
+    }
+
+    @Override
+    public void syncMicroKernelCluster(MicroKernel... nodes) {
+    }
+
+    @Override
+    public void tearDownCluster(MicroKernel[] cluster) {
+    }
 
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
-    MicroKernelIT.class
-})
-public class MicroKernelTestSuite {
 }

Added: jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture?rev=1325744&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
(added)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/META-INF/services/org.apache.jackrabbit.mk.test.MicroKernelFixture
Fri Apr 13 12:54:46 2012
@@ -0,0 +1,17 @@
+#  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.
+
+org.apache.jackrabbit.mk.server.ClientServerFixture
+org.apache.jackrabbit.mk.simple.SimpleKernelImplFixture

Copied: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/DataStoreIT.java
(from r1325699, jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/blobs/DataStoreTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/DataStoreIT.java?p2=jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/DataStoreIT.java&p1=jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/blobs/DataStoreTest.java&r1=1325699&r2=1325744&rev=1325744&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/blobs/DataStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/DataStoreIT.java
Fri Apr 13 12:54:46 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.blobs;
+package org.apache.jackrabbit.mk.test;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Random;
 import junit.framework.Assert;
-import org.apache.jackrabbit.mk.MultiMkTestBase;
 import org.apache.jackrabbit.mk.util.MicroKernelInputStream;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -32,10 +31,10 @@ import org.junit.runners.Parameterized;
  * Test the data store using the MicroKernel API.
  */
 @RunWith(Parameterized.class)
-public class DataStoreTest extends MultiMkTestBase {
+public class DataStoreIT extends AbstractMicroKernelIT {
 
-    public DataStoreTest(String url) {
-        super(url);
+    public DataStoreIT(MicroKernelFixture fixture) {
+        super(fixture, 1);
     }
 
     @Test

Propchange: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/DataStoreIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java?rev=1325744&r1=1325743&r2=1325744&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelTestSuite.java
Fri Apr 13 12:54:46 2012
@@ -21,7 +21,8 @@ import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
 @Suite.SuiteClasses({
-    MicroKernelIT.class
+    MicroKernelIT.class,
+    DataStoreIT.class
 })
 public class MicroKernelTestSuite {
 }



Mime
View raw message