}
@Test
public void testUnRegisterNodeType() throws Exception {
NodeTypeManager ntm = superuser.getWorkspace().getNodeTypeManager();
NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
ntd.setName("testNodeType");
ntd.setMixin(true);
ntm.registerNodeType(ntd, true);
Workspace testWsp = testSession.getWorkspace();
try {
try {
NodeTypeManager testNtm = testWsp.getNodeTypeManager();
testNtm.unregisterNodeType(ntd.getName());
fail("Node type unregistration should be denied.");
} catch (AccessDeniedException e) {
// success
}
try {
NodeTypeManager testNtm = testWsp.getNodeTypeManager();
testNtm.unregisterNodeTypes(new String[] {ntd.getName()});
fail("Node type unregistration should be denied.");
} catch (AccessDeniedException e) {
// success
}
} finally {
// NOTE: diff to jr-core where unregisterNt was not supported
ntm.unregisterNodeType(ntd.getName());
}
}