jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1133777 - /jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Date Thu, 09 Jun 2011 10:24:40 GMT
Author: thomasm
Date: Thu Jun  9 10:24:40 2011
New Revision: 1133777

URL: http://svn.apache.org/viewvc?rev=1133777&view=rev
Log:
Enabled tests.

Modified:
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java

Modified: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java?rev=1133777&r1=1133776&r2=1133777&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Thu Jun  9 10:24:40 2011
@@ -18,7 +18,8 @@
  */
 package org.apache.jackrabbit.spi2microkernel;
 
-import org.apache.jackrabbit.mk.MicroKernelImpl;
+import org.apache.jackrabbit.mk.MicroKernelFactory;
+import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -35,7 +36,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.RepositoryFactory;
 import javax.jcr.Session;
 import javax.jcr.Value;
-import java.io.File;
 import java.math.BigDecimal;
 import java.util.Collections;
 import java.util.HashSet;
@@ -46,7 +46,8 @@ import static java.util.Arrays.asList;
 import static org.junit.Assert.*;
 
 public class RepositoryTest {
-    private static final File REPO_HOME_DIR = new File("target/repository-test/repository");
+
+    private static final String URL = "fs:target/repository-test/repository;clean";
 
     private final String testNode = "node_" + System.currentTimeMillis();
     private final String testPath = '/' + testNode;
@@ -55,7 +56,7 @@ public class RepositoryTest {
 
     @Before
     public void setup() {
-        MicroKernelImpl mk = new MicroKernelImpl(REPO_HOME_DIR.getAbsolutePath());
+        MicroKernel mk = MicroKernelFactory.getInstance(URL);
         String head = mk.getHeadRevision();
 
         if (!mk.nodeExists("/default", head)) {
@@ -84,7 +85,7 @@ public class RepositoryTest {
     @Test
     public void createRepository() throws RepositoryException {
         Repository repository = getRepository();
-        assertNotNull(repository);        
+        assertNotNull(repository);
     }
 
     @Test
@@ -233,21 +234,18 @@ public class RepositoryTest {
         addProperty(parentNode, "string", getSession().getValueFactory().createValue("string
value"));
     }
 
-    @Ignore  // todo fix in microkernel
     @Test
     public void addLongProperty() throws RepositoryException {
         Node parentNode = getNode(testPath);
         addProperty(parentNode, "long", getSession().getValueFactory().createValue(42L));
     }
 
-    @Ignore  // todo fix in microkernel
     @Test
     public void addDoubleProperty() throws RepositoryException {
         Node parentNode = getNode(testPath);
         addProperty(parentNode, "double", getSession().getValueFactory().createValue(42.2D));
     }
 
-    @Ignore  // todo fix in microkernel
     @Test
     public void addBooleanProperty() throws RepositoryException {
         Node parentNode = getNode(testPath);
@@ -375,7 +373,7 @@ public class RepositoryTest {
             while (repository == null && factories.hasNext()) {
                 RepositoryFactory factory = factories.next();
                 repository = factory.getRepository(Collections.singletonMap(
-                        RepositoryServiceFactoryImpl.PARAM_HOME_DIR, "file:///" + REPO_HOME_DIR.getAbsolutePath()));
+                        RepositoryServiceFactoryImpl.PARAM_URL, URL));
             }
         }
 



Mime
View raw message