Index: src/test/java/org/apache/jackrabbit/oak/jcr/type/NodeTypeTest.java
===================================================================
--- src/test/java/org/apache/jackrabbit/oak/jcr/type/NodeTypeTest.java	(revision 0)
+++ src/test/java/org/apache/jackrabbit/oak/jcr/type/NodeTypeTest.java	(revision 0)
@@ -0,0 +1,68 @@
+/*
+ * 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.oak.jcr.type;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import javax.jcr.Node;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeTypeManager;
+
+import junit.framework.Assert;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.commons.cnd.CndImporter;
+import org.apache.jackrabbit.oak.jcr.AbstractRepositoryTest;
+import org.junit.Test;
+
+public class NodeTypeTest extends AbstractRepositoryTest {
+
+    @Test
+    public void testAddCustomType() throws Exception {
+
+        Session superuser = getAdminSession();
+        superuser
+                .getWorkspace()
+                .getNamespaceRegistry()
+                .registerNamespace("test",
+                        "http://www.apache.org/jackrabbit/test");
+
+        NodeTypeManager manager = superuser.getWorkspace().getNodeTypeManager();
+        if (!manager.hasNodeType("test:RTypeTest")) {
+            StringBuilder defs = new StringBuilder();
+            defs.append("[test:RTypeTest]\n");
+            defs.append("  - prop1\n");
+            defs.append("  - prop2\n");
+            Reader cndReader = new InputStreamReader(new ByteArrayInputStream(
+                    defs.toString().getBytes()));
+            CndImporter.registerNodeTypes(cndReader, superuser);
+        }
+        Assert.assertTrue(manager.hasNodeType("test:RTypeTest"));
+
+        Node n1 = superuser
+                .getRootNode()
+                .addNode("ntype" + System.currentTimeMillis(),
+                        JcrConstants.NT_UNSTRUCTURED)
+                .addNode("node1", "test:RTypeTest");
+        n1.setProperty("prop1", "p1");
+        n1.setProperty("prop2", "p2");
+        superuser.save();
+
+    }
+}
