protected void setUp() throws Exception {
super.setUp();
// we assume sameNameSibs is supported by repository
NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager();
// sameNameSibs ALLOWED
// make sure 'sameNameSibsTrue' nodetype is properly defined
try {
sameNameSibsTrueNodeType = ntMgr.getNodeType(getProperty(PROP_SAME_NAME_SIBS_TRUE_NODE_TYPE));
NodeDefinition[] childNodeDefs = sameNameSibsTrueNodeType.getDeclaredChildNodeDefinitions();
boolean isSameNameSibs = false;
for (int i = 0; i < childNodeDefs.length; i++) {
if (childNodeDefs[i].allowsSameNameSiblings()) {
isSameNameSibs = true;
break;
}
}
if (!isSameNameSibs) {
throw new NotExecutableException("Property 'sameNameSibsTrueNodeType' does not define a nodetype where sameNameSibs are allowed: '" + sameNameSibsTrueNodeType.getName() + "'");
}
} catch (NoSuchNodeTypeException e) {
fail("Property 'sameNameSibsTrueNodeType' does not define an existing nodetype: '" + sameNameSibsTrueNodeType + "'");
}
// sameNameSibs NOT ALLOWED
// make sure 'sameNameSibsFalse' nodetype is properly defined
try {
sameNameSibsFalseNodeType = ntMgr.getNodeType(getProperty(PROP_SAME_NAME_SIBS_FALSE_NODE_TYPE));
NodeDefinition[] childNodeDefs = sameNameSibsFalseNodeType.getDeclaredChildNodeDefinitions();
boolean isSameNameSibs = true;
for (int i = 0; i < childNodeDefs.length; i++) {
if (!childNodeDefs[i].allowsSameNameSiblings()) {
isSameNameSibs = false;