jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1354504 - /jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java
Date Wed, 27 Jun 2012 13:57:55 GMT
Author: ard
Date: Wed Jun 27 13:57:55 2012
New Revision: 1354504

URL: http://svn.apache.org/viewvc?rev=1354504&view=rev
Log:
OCM-58 make OCM jackrabbit independent. Note that I did remove some methods from the NodeTypeManager
interface, but the NodeTypeManagerImpl didn't implement many of them any way. Jackrabbit dependency
is now only used as scope test

Added:
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java
  (contents, props changed)
      - copied, changed from r1351959, jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/jackrabbit/NodeTypeManagerImplTest.java

Copied: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java
(from r1351959, jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/jackrabbit/NodeTypeManagerImplTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java?p2=jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java&p1=jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/jackrabbit/NodeTypeManagerImplTest.java&r1=1351959&r2=1354504&rev=1354504&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/jackrabbit/NodeTypeManagerImplTest.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java
Wed Jun 27 13:57:55 2012
@@ -14,9 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.ocm.nodemanagement.impl.jackrabbit;
+package org.apache.jackrabbit.ocm.nodemanagement.impl;
 
-import java.io.FileInputStream;
 import java.io.IOException;
 
 import javax.jcr.PropertyType;
@@ -104,22 +103,6 @@ public class NodeTypeManagerImplTest ext
         assertTrue(failed);
     }
 
-
-    public void testCreateNodeTypesFromConfiguration() throws Exception
-    {
-        nodeTypeManagerImpl.createNodeTypesFromConfiguration(getSession(),
-                new FileInputStream("./src/test/test-config/nodetypes/nodetypes_test1.xml"));
-
-        NodeType test1 = getSession().getWorkspace().getNodeTypeManager().getNodeType("ocm:test1");
-        assertNotNull(test1);
-        assertFalse(test1.isMixin());
-        assertFalse(test1.hasOrderableChildNodes());
-        assertEquals(test1.getPrimaryItemName(), "test1");
-        assertEquals(test1.getSupertypes().length, 1);
-        assertEquals(test1.getSupertypes()[0].getName(), "nt:base");
-        assertTrue(containsPropertyDefintion(test1.getPropertyDefinitions(), "ocm:ocmtestproperty"));
-    }
-
     public void testCreateSingleNodeType() throws Exception
     {
         ClassDescriptor classDescriptor = new ClassDescriptor();
@@ -163,11 +146,11 @@ public class NodeTypeManagerImplTest ext
         assertTrue(containsProperty("jcr:mixinTypes", testNodeType.getPropertyDefinitions()));
 
         PropertyDefinition propDef1 = getPropertyDefinition(testNodeType.getPropertyDefinitions(),
"ocm:a");
-        log.info(nodeTypeManagerImpl.showPropertyDefinition(propDef1));
+        log.info(showPropertyDefinition(propDef1));
         // TODO test all properties
 
         PropertyDefinition propDef2 = getPropertyDefinition(testNodeType.getPropertyDefinitions(),
"ocm:b");
-        log.info(nodeTypeManagerImpl.showPropertyDefinition(propDef2));
+        log.info(showPropertyDefinition(propDef2));
         // TODO test all properties
     }
 
@@ -474,27 +457,6 @@ public class NodeTypeManagerImplTest ext
         assertNotNull(test7);
     }
 
-    public void testRemoveSingleNodeType() throws Exception
-    {
-        ClassDescriptor classDescriptor = new ClassDescriptor();
-        classDescriptor.setClassName("test.Test8Class");
-        classDescriptor.setJcrType("ocm:test8");
-        classDescriptor.setJcrSuperTypes("nt:base");
-
-        FieldDescriptor field1 = new FieldDescriptor();
-        field1.setFieldName("a");
-        field1.setJcrName("a");
-        field1.setJcrType("String");
-        classDescriptor.addFieldDescriptor(field1);
-
-        nodeTypeManagerImpl.createSingleNodeType(getSession(), classDescriptor);
-
-        NodeType test8 = getSession().getWorkspace().getNodeTypeManager().getNodeType("ocm:test8");
-        assertNotNull(test8);
-        // not implemented yet in jackrabbit
-        // getJackrabbitNodeTypeManagerImpl().removeSingleNodeType(session, "ocm:test8");
-    }
-
     /** Returns true if a given property is found in an array of property
      * definitions.
      *
@@ -636,4 +598,21 @@ public class NodeTypeManagerImplTest ext
 
         return found;
     }
+
+
+    /**
+     *
+     * @param propDef
+     * @return
+     */
+    protected String showPropertyDefinition(PropertyDefinition propDef)
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("----");
+        sb.append("\nName: " + propDef.getName());
+        sb.append("\nAutocreated: " + propDef.isAutoCreated());
+        sb.append("\nMandatory: " + propDef.isMandatory());
+        sb.append("\n----");
+        return sb.toString();
+    }
 }

Propchange: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/nodemanagement/impl/NodeTypeManagerImplTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message