Examples of RegExFacetOnTypeAnnotation


Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

        regExFacetOnTypeAnnotation = null;
    }

    @Test
    public void shouldBeAbleToInstantiate() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation(".*", "", true, facetHolder);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation(".*", "", true, facetHolder);
    }

    @Test
    public void shouldAllowDotStar() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation(".*", "", true, facetHolder);
        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("abc"), equalTo(false)); // ie
                                                                                     // does
                                                                                     // match
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

                                                                                     // match
    }

    @Test
    public void shouldAllowWhenCaseSensitive() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation("^abc$", "", true, facetHolder);
        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("abc"), equalTo(false)); // ie
                                                                                     // does
                                                                                     // match
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

                                                                                     // match
    }

    @Test
    public void shouldAllowWhenCaseInsensitive() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation("^abc$", "", false, facetHolder);
        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("ABC"), equalTo(false)); // ie
                                                                                     // does
                                                                                     // match
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

                                                                                     // match
    }

    @Test
    public void shouldDisallowWhenCaseSensitive() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation("^abc$", "", true, facetHolder);
        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("abC"), equalTo(true));
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("abC"), equalTo(true));
    }

    @Test
    public void shouldDisallowWhenCaseInsensitive() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation("^abc$", "", false, facetHolder);
        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("aBd"), equalTo(true));
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("aBd"), equalTo(true));
    }

    @Test
    public void shouldReformat() {
        regExFacetOnTypeAnnotation = new RegExFacetOnTypeAnnotation("^([0-9]{2})([0-9]{2})([0-9]{2})$", "$1-$2-$3", false, facetHolder);
        assertThat(regExFacetOnTypeAnnotation.doesNotMatch("123456"), equalTo(false));
        assertThat(regExFacetOnTypeAnnotation.format("123456"), equalTo("12-34-56"));
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.regex.annotation.RegExFacetOnTypeAnnotation

        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof RegExFacetOnTypeAnnotation);
        final RegExFacetOnTypeAnnotation regExFacet = (RegExFacetOnTypeAnnotation) facet;
        assertEquals("^A.*", regExFacet.validation());
        assertEquals(false, regExFacet.caseSensitive());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.