Package org.apache.isis.core.progmodel.facets.properties.typicallen.annotation

Examples of org.apache.isis.core.progmodel.facets.properties.typicallen.annotation.TypicalLengthOnPropertyFacetFactory


import org.apache.isis.core.progmodel.facets.properties.typicallen.annotation.TypicalLengthFacetOnPropertyAnnotation;

public class TypicalLengthAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {

    public void testTypicalLengthAnnotationPickedUpOnProperty() {
        final TypicalLengthOnPropertyFacetFactory facetFactory = new TypicalLengthOnPropertyFacetFactory();

        class Customer {
            @SuppressWarnings("unused")
            @TypicalLength(30)
            public String getFirstName() {
                return null;
            }
        }
        final Method method = findMethod(Customer.class, "getFirstName");

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, method, methodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(TypicalLengthFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof TypicalLengthFacetOnPropertyAnnotation);
        final TypicalLengthFacetOnPropertyAnnotation typicalLengthFacetAnnotation = (TypicalLengthFacetOnPropertyAnnotation) facet;
View Full Code Here

TOP

Related Classes of org.apache.isis.core.progmodel.facets.properties.typicallen.annotation.TypicalLengthOnPropertyFacetFactory

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.