@Test @FixFor( "MODE-1857" ) public void shouldAllowOverridingOfPropertyDefinitionsWithResidualDefinitions() throws Exception { InputStream cnd = getClass().getClassLoader().getResourceAsStream("cnd/overridingPropertyDefinitionWithResidual.cnd"); assertThat(cnd, is(notNullValue())); session.getWorkspace().getNodeTypeManager().registerNodeTypes(cnd, true); Node car = session.getRootNode().addNode("car", "car"); car.setProperty("engine", "4CYL"); Node cycle = session.getRootNode().addNode("cycle", "motorcycle"); cycle.setProperty("engine", "2CYL"); session.save(); try { car.setProperty("engine", "2CYL"); fail("Should not have allowed setting the 'engine' property on a node of type 'car' to \"2CYL\""); } catch (ConstraintViolationException e) { } try { cycle.setProperty("engine", "4CYL"); fail("Should not have allowed setting the 'engine' property on a node of type 'car' to \"2CYL\""); } catch (ConstraintViolationException e) { } }
List<JcrNodeType> registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypeDefns ) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, RepositoryException { return registerNodeTypes(nodeTypeDefns, true, false, true); }
RepositoryNodeTypeManager implements ChangeSetListener, NodeTypes.Supplier { List<JcrNodeType> registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypeDefns ) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, RepositoryException { return registerNodeTypes(nodeTypeDefns, true, false, true); } }
RepositoryNodeTypeManager implements ChangeSetListener, NodeTypes.Supplier { List<JcrNodeType> registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypeDefns ) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, RepositoryException { return registerNodeTypes(nodeTypeDefns, true, false, true); } RepositoryNodeTypeManager( JcrRepository.RunningState repository,
                               boolean includeColumnsForInheritedProperties,
                               boolean includePseudoColumnsInSelectStar ); }
RepositoryNodeTypeManager implements ChangeSetListener, NodeTypes.Supplier { List<JcrNodeType> registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypeDefns ) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, RepositoryException { return registerNodeTypes(nodeTypeDefns, true, false, true); } RepositoryNodeTypeManager( JcrRepository.RunningState repository,
                               boolean includeColumnsForInheritedProperties,
                               boolean includePseudoColumnsInSelectStar ); @Override NodeTypes getNodeTypes(); @Override void notify( ChangeSet changeSet ); @Override String toString(); }
RepositoryNodeTypeManager implements ChangeSetListener, NodeTypes.Supplier { List<JcrNodeType> registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypeDefns ) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, RepositoryException { return registerNodeTypes(nodeTypeDefns, true, false, true); } RepositoryNodeTypeManager( JcrRepository.RunningState repository,
                               boolean includeColumnsForInheritedProperties,
                               boolean includePseudoColumnsInSelectStar ); @Override NodeTypes getNodeTypes(); @Override void notify( ChangeSet changeSet ); @Override String toString();  }