Examples of RegExFacetAnnotationForType


Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

        regExFacetAnnotationForType = null;
    }

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

        regExFacetAnnotationForType = new RegExFacetAnnotationForType(".*", "", true, facetHolder);
    }

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

                                                                                     // match
    }

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

                                                                                     // match
    }

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

                                                                                     // match
    }

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

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

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

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

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

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

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

        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof RegExFacetAnnotationForType);
        final RegExFacetAnnotationForType regExFacet = (RegExFacetAnnotationForType) facet;
        assertEquals("^A.*", regExFacet.validation());
        assertEquals(false, regExFacet.caseSensitive());
    }
View Full Code Here

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

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

        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof RegExFacetAnnotationForType);
        final RegExFacetAnnotationForType regExFacet = (RegExFacetAnnotationForType) facet;
        assertEquals("^A.*", regExFacet.validation());
        assertEquals(false, regExFacet.caseSensitive());
    }
View Full Code Here

Examples of org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType

        regExFacetAnnotationForType = null;
    }

    @Test
    public void shouldBeAbleToInstantiate() {
        regExFacetAnnotationForType = new RegExFacetAnnotationForType(".*", "", true, facetHolder);
    }
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.