incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r881767 - in /sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing: jcr/RepositoryUtil.java sling/AdapterManagerTestHelper.java sling/MockAdapterFactory.java sling/SlingTestHelper.java
Date Wed, 18 Nov 2009 13:24:10 GMT
Author: cziegeler
Date: Wed Nov 18 13:24:09 2009
New Revision: 881767

URL: http://svn.apache.org/viewvc?rev=881767&view=rev
Log:
SLING-1166 : Remove adapter manager support, move nodetype registration to repository util

Removed:
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/AdapterManagerTestHelper.java
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockAdapterFactory.java
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/SlingTestHelper.java
Modified:
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryUtil.java

Modified: sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryUtil.java?rev=881767&r1=881766&r2=881767&view=diff
==============================================================================
--- sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryUtil.java
(original)
+++ sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/RepositoryUtil.java
Wed Nov 18 13:24:09 2009
@@ -68,7 +68,7 @@
 
     /**
      * Start a new repository
-     * 
+     *
      * @throws RepositoryException when it is not possible to start the
      *             repository.
      * @throws NamingException
@@ -85,7 +85,7 @@
 
         File configFile = new File(HOME_DIR, CONFIG_FILE);
         configFile.getParentFile().mkdirs();
-        
+
         FileOutputStream out = null;
         try {
             out = new FileOutputStream(configFile);
@@ -123,7 +123,7 @@
 
     /**
      * Stop a repository.
-     * 
+     *
      * @throws NamingException when it is not possible to stop the repository
      * @throws NamingException
      */
@@ -134,7 +134,7 @@
 
     /**
      * Get a repository
-     * 
+     *
      * @return a JCR repository reference
      * @throws NamingException when it is not possible to get the repository.
      *             Before calling this method, the repository has to be
@@ -158,7 +158,7 @@
      * <p>
      * This method is not synchronized. It is up to the calling method to
      * prevent paralell execution.
-     * 
+     *
      * @param session The <code>Session</code> providing the node type manager
      *            through which the node type is to be registered.
      * @param source The <code>InputStream</code> from which the CND file is
@@ -199,6 +199,16 @@
         return false;
     }
 
+    public static void registerSlingNodeTypes(Session adminSession) throws IOException, RepositoryException
{
+        final Class<RepositoryUtil> clazz = RepositoryUtil.class;
+        registerNodeType(adminSession,
+                clazz.getResourceAsStream("/SLING-INF/nodetypes/folder.cnd"));
+        RepositoryUtil.registerNodeType(adminSession,
+                clazz.getResourceAsStream("/SLING-INF/nodetypes/resource.cnd"));
+        RepositoryUtil.registerNodeType(adminSession,
+                clazz.getResourceAsStream("/SLING-INF/nodetypes/vanitypath.cnd"));
+    }
+
     public static final class RepositoryWrapper implements SlingRepository {
 
         protected final Repository wrapped;



Mime
View raw message