nodeTypes = new CndNodeTypeSource(CND_LOCATION + "validType.cnd");
repoTypeManager.registerNodeTypes(nodeTypes);
Name testNodeName = context.getValueFactories().getNameFactory().create(TestLexicon.Namespace.URI, "testType");
NodeType nodeType = repoTypeManager.getNodeType(testNodeName);
assertThat(nodeType, is(notNullValue()));
assertThat(nodeType.isMixin(), is(true));
assertThat(nodeType.hasOrderableChildNodes(), is(true));
assertThat(nodeType.getDeclaredSupertypes().length, is(2));
assertThat(nodeType.getDeclaredChildNodeDefinitions().length, is(1));
JcrNodeDefinition childNode = (JcrNodeDefinition)nodeType.getDeclaredChildNodeDefinitions()[0];
assertThat(childNode.getName(), is("dnatest:namespace"));
assertThat(childNode.getDefaultPrimaryType().getName(), is("dna:namespace"));
assertThat(childNode.getRequiredPrimaryTypes().length, is(1));
assertThat(childNode.getRequiredPrimaryTypes()[0].getName(), is("dna:namespace"));
assertThat(childNode.allowsSameNameSiblings(), is(false));
assertThat(childNode.isMandatory(), is(false));
assertThat(nodeType.getDeclaredPropertyDefinitions().length, is(1));
JcrPropertyDefinition property = (JcrPropertyDefinition)nodeType.getDeclaredPropertyDefinitions()[0];
assertThat(property.getName(), is("*"));
assertThat(property.getRequiredType(), is(PropertyType.STRING));
assertThat(property.getValueConstraints().length, is(3));
assertThat(property.getValueConstraints()[0], is("foo"));
assertThat(property.getValueConstraints()[1], is("bar"));