}
public void testReregisterFromNameToResidualChangeRequiredNodeType() throws Exception
{
// create new NodeType value
NodeTypeValue testNValue = new NodeTypeValue();
List<String> superType = new ArrayList<String>();
superType.add("nt:base");
testNValue.setName("exo:testReregisterFromNameToResidualChechRequiredNodeType");
testNValue.setPrimaryItemName("");
testNValue.setDeclaredSupertypeNames(superType);
List<NodeDefinitionValue> nodes = new ArrayList<NodeDefinitionValue>();
nodes.add(new NodeDefinitionValue("child", false, false, 1, false, "nt:base", new ArrayList<String>(), true));
testNValue.setDeclaredChildNodeDefinitionValues(nodes);
nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);
testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());
Node testNode = root.addNode("testNode", testNValue.getName());
Node child = testNode.addNode("child", "nt:file");
Node cont = child.addNode("jcr:content", "nt:resource");
cont.setProperty("jcr:mimeType", "text");
cont.setProperty("jcr:lastModified", new GregorianCalendar(2011, 3, 4));
cont.setProperty("jcr:data", "test text");
session.save();
session.save();
nodes = new ArrayList<NodeDefinitionValue>();
List<String> requeredPrimaryType = new ArrayList<String>();
requeredPrimaryType.add("nt:unstructured");
nodes.add(new NodeDefinitionValue("*", false, false, 1, false, "nt:unstructured", requeredPrimaryType, true));
testNValue.setDeclaredChildNodeDefinitionValues(nodes);
try
{
nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
fail();