Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeType


        assertThat(prop.satisfiesConstraints(valueFor("newprefix:constrainedType", PropertyType.NAME)), is(true));
    }

    @Test
    public void shouldAllowValidNameValues() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_NAME);

        Value[] values = new Value[] {valueFor("jcr:system", PropertyType.NAME),
            valueFor("dnatest:constrainedType", PropertyType.NAME),};
        assertThat(satisfiesConstraints(prop, new Value[] {}), is(true));
View Full Code Here


        assertThat(satisfiesConstraints(prop, values), is(true));
    }

    @Test
    public void shouldNotAllowInvalidNameValue() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_NAME);

        assertThat(prop.satisfiesConstraints(valueFor("system", PropertyType.NAME)), is(false));
        assertThat(prop.satisfiesConstraints(valueFor("jcr:system2", PropertyType.NAME)), is(false));
View Full Code Here

        assertThat(prop.satisfiesConstraints(valueFor("dnatest:constrainedType", PropertyType.NAME)), is(true));
    }

    @Test
    public void shouldNotAllowInvalidNameValues() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_NAME);

        Value[] values = new Value[] {valueFor("jcr:system", PropertyType.NAME),
            valueFor("dnatest:constrainedType2", PropertyType.NAME),};
        assertThat(satisfiesConstraints(prop, new Value[] {valueFor("jcr:system2", PropertyType.NAME)}), is(false));
View Full Code Here

        assertThat(satisfiesConstraints(prop, values), is(false));
    }

    @Test
    public void shouldAllowValidStringValue() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_STRING);

        assertThat(prop.satisfiesConstraints(valueFor("foo", PropertyType.STRING)), is(true));
        assertThat(prop.satisfiesConstraints(valueFor("bar", PropertyType.STRING)), is(true));
        assertThat(prop.satisfiesConstraints(valueFor("barr", PropertyType.STRING)), is(true));
View Full Code Here

        assertThat(prop.satisfiesConstraints(valueFor("shabaz", PropertyType.STRING)), is(true));
    }

    @Test
    public void shouldAllowValidStringValues() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_STRING);

        Value[] values = new Value[] {valueFor("foo", PropertyType.STRING), valueFor("barr", PropertyType.STRING),};
        assertThat(satisfiesConstraints(prop, new Value[] {}), is(true));
        assertThat(satisfiesConstraints(prop, new Value[] {valueFor("baz", PropertyType.STRING)}), is(true));
View Full Code Here

        assertThat(satisfiesConstraints(prop, values), is(true));
    }

    @Test
    public void shouldNotAllowInvalidStringValue() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_STRING);

        assertThat(prop.satisfiesConstraints(valueFor("", PropertyType.STRING)), is(false));
        assertThat(prop.satisfiesConstraints(valueFor("foot", PropertyType.STRING)), is(false));
        assertThat(prop.satisfiesConstraints(valueFor("abar", PropertyType.STRING)), is(false));
View Full Code Here

        assertThat(prop.satisfiesConstraints(valueFor("bazzat", PropertyType.STRING)), is(false));
    }

    @Test
    public void shouldNotAllowInvalidStringValues() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_STRING);

        Value[] values = new Value[] {valueFor("foo", PropertyType.STRING), valueFor("bard", PropertyType.STRING),};
        assertThat(satisfiesConstraints(prop, new Value[] {valueFor("bazzat", PropertyType.STRING)}), is(false));
        assertThat(satisfiesConstraints(prop, values), is(false));
View Full Code Here

        assertThat(satisfiesConstraints(prop, values), is(false));
    }

    @Test
    public void shouldAllowValidPathValue() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_PATH);

        assertThat(prop.satisfiesConstraints(valueFor("b", PropertyType.PATH)), is(true));
        assertThat(prop.satisfiesConstraints(valueFor("/a/b/c", PropertyType.PATH)), is(true));
        assertThat(prop.satisfiesConstraints(valueFor("/jcr:system/dna:namespace", PropertyType.PATH)), is(true));
View Full Code Here

        assertThat(prop.satisfiesConstraints(valueFor("/jcr2:system/dna:foo", PropertyType.PATH)), is(true));
    }

    @Test
    public void shouldAllowValidPathValues() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_PATH);

        Value[] values = new Value[] {valueFor("b", PropertyType.PATH), valueFor("/a/b/c", PropertyType.PATH),};
        assertThat(satisfiesConstraints(prop, new Value[] {}), is(true));
        assertThat(satisfiesConstraints(prop, new Value[] {valueFor("/a/b/c", PropertyType.PATH)}), is(true));
View Full Code Here

        assertThat(satisfiesConstraints(prop, values), is(true));
    }

    @Test
    public void shouldNotAllowInvalidPathValue() throws Exception {
        NodeType constrainedType = validateTypeDefinition();
        JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_PATH);

        assertThat(prop.satisfiesConstraints(valueFor("a", PropertyType.PATH)), is(false));
        assertThat(prop.satisfiesConstraints(valueFor("/a/b", PropertyType.PATH)), is(false));
        assertThat(prop.satisfiesConstraints(valueFor("/jcr:system", PropertyType.PATH)), is(false));
View Full Code Here

TOP

Related Classes of javax.jcr.nodetype.NodeType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.