jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1128313 - /jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java
Date Fri, 27 May 2011 14:02:03 GMT
Author: mduerig
Date: Fri May 27 14:02:03 2011
New Revision: 1128313

URL: http://svn.apache.org/viewvc?rev=1128313&view=rev
Log:
spi2microkernel prototype (WIP)

Added:
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java

Added: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java?rev=1128313&view=auto
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java
(added)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java
Fri May 27 14:02:03 2011
@@ -0,0 +1,64 @@
+/*
+ * 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.spi2microkernel;
+
+import org.apache.jackrabbit.mk.MicroKernelImpl;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.io.File;
+
+import static org.junit.Assert.assertEquals;
+
+public class MicrokernelTests {
+    private static final File REPO_HOME_DIR = new File("target/repository");
+
+    @Before
+    public void setup() {
+        MicroKernelImpl mk = new MicroKernelImpl(REPO_HOME_DIR.getAbsolutePath());
+        String head = mk.getHeadRevision();
+
+        if (!mk.nodeExists("/test", head)) {
+            mk.commit("/", "+test : {}", head);
+        }
+    }
+
+    @Ignore
+    // todo fix in microkernel
+    @Test
+    public void missingName() {
+        MicroKernelImpl mk = new MicroKernelImpl(REPO_HOME_DIR.getAbsolutePath());
+        String head = mk.getHeadRevision();
+
+        String s1 = mk.getNodes("/test", 0, head);
+        String s2 = mk.getNodes("/test/", 0, head);
+        assertEquals(s1, s2);
+    }
+
+    @Ignore  // todo fix in microkernel
+    @Test
+    public void npe() {
+        MicroKernelImpl mk = new MicroKernelImpl(REPO_HOME_DIR.getAbsolutePath());
+        String head = mk.getHeadRevision();
+
+        mk.commit("/", "+foo/bar : {}", head);
+    }
+}



Mime
View raw message