Search in sources :

Example 21 with QPropertyDefinition

use of org.apache.jackrabbit.spi.QPropertyDefinition in project jackrabbit by apache.

the class TestAll method testItemNodeType.

/** Test for node type item definitions. */
public void testItemNodeType() {
    QNodeTypeDefinition def = getNodeType("itemNodeType");
    assertEquals("itemNodeType primaryItemName", FACTORY.create(TEST_NAMESPACE, "emptyItem"), def.getPrimaryItemName());
    assertEquals("itemNodeType propertyDefs", 10, def.getPropertyDefs().length);
    QPropertyDefinition pdef = getPropDef("itemNodeType", null);
    assertTrue("itemNodeType wildcard property", pdef.definesResidual());
}
Also used : QNodeTypeDefinition(org.apache.jackrabbit.spi.QNodeTypeDefinition) QPropertyDefinition(org.apache.jackrabbit.spi.QPropertyDefinition)

Example 22 with QPropertyDefinition

use of org.apache.jackrabbit.spi.QPropertyDefinition in project jackrabbit by apache.

the class TestAll method testComputeItem.

/** Test for the <code>compute</code> parent version action. */
public void testComputeItem() {
    QPropertyDefinition def = getPropDef("itemNodeType", "computeItem");
    assertEquals("computeItem onParentVersion", OnParentVersionAction.COMPUTE, def.getOnParentVersion());
}
Also used : QPropertyDefinition(org.apache.jackrabbit.spi.QPropertyDefinition)

Example 23 with QPropertyDefinition

use of org.apache.jackrabbit.spi.QPropertyDefinition in project jackrabbit by apache.

the class TestAll method testAutoCreateItem.

/** Test for the <code>autoCreated</code> item definition attribute. */
public void testAutoCreateItem() {
    QPropertyDefinition def = getPropDef("itemNodeType", "autoCreatedItem");
    assertEquals("autoCreatedItem autoCreated", true, def.isAutoCreated());
}
Also used : QPropertyDefinition(org.apache.jackrabbit.spi.QPropertyDefinition)

Example 24 with QPropertyDefinition

use of org.apache.jackrabbit.spi.QPropertyDefinition in project jackrabbit by apache.

the class TestAll method testPathProperty2.

/** Test for the <code>path</code> property definition type. */
public void testPathProperty2() {
    QPropertyDefinition def = getPropDef("propertyNodeType", "pathProperty2");
    assertEquals("pathProperty requiredType", PropertyType.PATH, def.getRequiredType());
    assertEquals("pathProperty valueConstraints", 1, def.getValueConstraints().length);
    assertEquals("pathProperty valueConstraints[0]", "{http://www.apache.org/jackrabbit/test}testPath\t{}*", (def.getValueConstraints())[0].getString());
    assertNull("pathProperty defaultValues", def.getDefaultValues());
}
Also used : QPropertyDefinition(org.apache.jackrabbit.spi.QPropertyDefinition)

Example 25 with QPropertyDefinition

use of org.apache.jackrabbit.spi.QPropertyDefinition in project jackrabbit by apache.

the class TestAll method testNameProperty.

/** Test for the <code>name</code> property definition type. */
public void testNameProperty() {
    QPropertyDefinition def = getPropDef("propertyNodeType", "nameProperty");
    assertEquals("nameProperty requiredType", PropertyType.NAME, def.getRequiredType());
    assertEquals("nameProperty valueConstraints", 1, def.getValueConstraints().length);
    assertEquals("nameProperty valueConstraints[0]", "{http://www.apache.org/jackrabbit/test}testName", (def.getValueConstraints())[0].getString());
    assertEquals("nameProperty defaultValues", 1, def.getDefaultValues().length);
    assertEquals("nameProperty defaultValues[0]", "test:testName", getDefaultValue(def, 0));
}
Also used : QPropertyDefinition(org.apache.jackrabbit.spi.QPropertyDefinition)

Aggregations

QPropertyDefinition (org.apache.jackrabbit.spi.QPropertyDefinition)81 Name (org.apache.jackrabbit.spi.Name)32 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)22 QNodeDefinition (org.apache.jackrabbit.spi.QNodeDefinition)19 RepositoryException (javax.jcr.RepositoryException)14 QValue (org.apache.jackrabbit.spi.QValue)12 QItemDefinition (org.apache.jackrabbit.spi.QItemDefinition)9 QValueConstraint (org.apache.jackrabbit.spi.QValueConstraint)9 ArrayList (java.util.ArrayList)8 Value (javax.jcr.Value)7 InternalValue (org.apache.jackrabbit.core.value.InternalValue)7 ItemExistsException (javax.jcr.ItemExistsException)6 NodeId (org.apache.jackrabbit.core.id.NodeId)6 PropertyDefinition (javax.jcr.nodetype.PropertyDefinition)5 EffectiveNodeType (org.apache.jackrabbit.core.nodetype.EffectiveNodeType)5 PropertyState (org.apache.jackrabbit.core.state.PropertyState)5 QNodeTypeDefinition (org.apache.jackrabbit.spi.QNodeTypeDefinition)5 ValueConstraint (org.apache.jackrabbit.spi.commons.nodetype.constraint.ValueConstraint)5 NodeState (org.apache.jackrabbit.core.state.NodeState)4 NameException (org.apache.jackrabbit.spi.commons.conversion.NameException)4