incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1519729 - in /sling/whiteboard/bdelacretaz: bdelacretaz-oak-server/src/main/java/org/apache/sling/oak/server/ it-repository/ it-repository/src/test/java/org/apache/sling/jcr/repository/it/
Date Tue, 03 Sep 2013 15:50:51 GMT
Author: bdelacretaz
Date: Tue Sep  3 15:50:51 2013
New Revision: 1519729

URL: http://svn.apache.org/r1519729
Log:
SLING-2788 - node types setup, doesn't work yet with Oak 0.8

Modified:
    sling/whiteboard/bdelacretaz/bdelacretaz-oak-server/src/main/java/org/apache/sling/oak/server/SlingRepositoryImpl.java
    sling/whiteboard/bdelacretaz/it-repository/pom.xml
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java

Modified: sling/whiteboard/bdelacretaz/bdelacretaz-oak-server/src/main/java/org/apache/sling/oak/server/SlingRepositoryImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/bdelacretaz-oak-server/src/main/java/org/apache/sling/oak/server/SlingRepositoryImpl.java?rev=1519729&r1=1519728&r2=1519729&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/bdelacretaz-oak-server/src/main/java/org/apache/sling/oak/server/SlingRepositoryImpl.java
(original)
+++ sling/whiteboard/bdelacretaz/bdelacretaz-oak-server/src/main/java/org/apache/sling/oak/server/SlingRepositoryImpl.java
Tue Sep  3 15:50:51 2013
@@ -27,6 +27,7 @@ import javax.jcr.SimpleCredentials;
 
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.oak.Oak;
@@ -97,6 +98,13 @@ public class SlingRepositoryImpl extends
 
         //.withAsyncIndexing() // TODO oak 0.9?
         .createRepository();
+        
+        setup(ctx.getBundleContext());
+    }
+    
+    @Deactivate
+    protected void deactivate(ComponentContext ctx) {
+        tearDown();
     }
     
     @Override

Modified: sling/whiteboard/bdelacretaz/it-repository/pom.xml
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/it-repository/pom.xml?rev=1519729&r1=1519728&r2=1519729&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/it-repository/pom.xml (original)
+++ sling/whiteboard/bdelacretaz/it-repository/pom.xml Tue Sep  3 15:50:51 2013
@@ -26,6 +26,7 @@
         <exam.version>3.2.0</exam.version>
         <url.version>1.5.2</url.version>
         <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
+        <org.ops4j.pax.url.mvn.settings></org.ops4j.pax.url.mvn.settings>
         <oak.version>0.8</oak.version>
     </properties>
 
@@ -58,6 +59,10 @@
                             <value>${org.ops4j.pax.logging.DefaultServiceLog.level}</value>
                         </property>
                         <property>
+                            <name>org.ops4j.pax.url.mvn.settings</name>
+                            <value>${org.ops4j.pax.url.mvn.settings}</value>
+                        </property>
+                        <property>
                             <name>org.osgi.service.http.port</name>
                             <value>${http.port}</value>
                         </property>

Modified: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java?rev=1519729&r1=1519728&r2=1519729&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
(original)
+++ sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
Tue Sep  3 15:50:51 2013
@@ -67,16 +67,16 @@ public abstract class SlingRepositoryITB
         final Credentials creds = new SimpleCredentials("badName", "badPAssword".toCharArray());
         repository.login(creds).logout();
     }
-
-    @Test
-    public void testCreateRetrieveNode() throws RepositoryException {
+    
+    private void assertCreateRetrieveNode(String nodeType) throws RepositoryException {
         Session s = repository.loginAdministrative(null);
         try {
             final Node root = s.getRootNode();
             final String name = "TEST_" + System.currentTimeMillis();
             final String propName = "PN_" + name;
             final String propValue = "PV_" + name;
-            root.addNode(name).setProperty(propName, propValue);
+            final Node child = nodeType == null ? root.addNode(name) : root.addNode(name,
nodeType);
+            child.setProperty(propName, propValue);
             s.save();
             s.logout();
             s = repository.loginAdministrative(null);
@@ -89,6 +89,17 @@ public abstract class SlingRepositoryITB
     }
 
     @Test
+    public void testCreateRetrieveNode() throws RepositoryException {
+        assertCreateRetrieveNode(null);
+    }
+
+    @Test
+    @Ignore("doesn't seem to work with Oak 0.8")
+    public void testCreateRetrieveSlingFolder() throws RepositoryException {
+        assertCreateRetrieveNode("sling:Folder");
+    }
+
+    @Test
     public void testQuery() throws RepositoryException {
         final Session s = repository.loginAdministrative(null);
         final String id = "ID_" + System.currentTimeMillis();



Mime
View raw message