Package org.apache.isis.core.metamodel.facetapi

Examples of org.apache.isis.core.metamodel.facetapi.Facet


        class Customer {
        }

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

        final Facet facet = facetedMethod.getFacet(PluralFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof PluralFacetAnnotation);
        final PluralFacetAnnotation pluralFacet = (PluralFacetAnnotation) facet;
        assertEquals("Some plural name", pluralFacet.value());
View Full Code Here


    @Test
    public void testTitleAnnotatedMethodPickedUpOnClassRemoved() throws Exception {
        facetFactory.process(new ProcessClassContext(Customer.class, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(TitleFacet.class);
        Assert.assertNotNull(facet);
        Assert.assertTrue(facet instanceof TitleFacetViaTitleAnnotation);
        final TitleFacetViaTitleAnnotation titleFacetViaTitleAnnotation = (TitleFacetViaTitleAnnotation) facet;

        final List<Method> titleMethods = Arrays.asList(Customer.class.getMethod("someTitle"));
View Full Code Here

    @Test
    public void testTitleAnnotatedMethodsPickedUpOnClass() throws Exception {

        facetFactory.process(new ProcessClassContext(Customer2.class, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(TitleFacet.class);
        Assert.assertNotNull(facet);
        Assert.assertTrue(facet instanceof TitleFacetViaTitleAnnotation);
        final TitleFacetViaTitleAnnotation titleFacetViaTitleAnnotation = (TitleFacetViaTitleAnnotation) facet;

        final List<Method> titleMethods = Arrays.asList(Customer2.class.getMethod("titleElement1"), Customer2.class.getMethod("titleElement3"), Customer2.class.getMethod("titleElement2"));
View Full Code Here

    @Test
    public void titleAnnotatedMethodsSomeOfWhichReturnNulls() throws Exception {

        facetFactory.process(new ProcessClassContext(Customer4.class, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(TitleFacet.class);
        final TitleFacetViaTitleAnnotation titleFacetViaTitleAnnotation = (TitleFacetViaTitleAnnotation) facet;

        final Customer4 customer = new Customer4();

        context.checking(new Expectations() {
View Full Code Here

       
        expectNoMethodsRemoved();
       
        facetFactory.process(new ProcessClassContext(Customer.class, null, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
        assertThat(facet, is(not(nullValue())));
        assertThat(facet instanceof NamedFacetAbstract, is(true));
        final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
        assertThat(namedFacetAbstract.value(), equalTo("some name"));
    }
View Full Code Here

        expectNoMethodsRemoved();

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, actionMethod, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
        assertThat(facet, is(not(nullValue())));
        assertThat(facet instanceof NamedFacetAbstract, is(true));
        final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
        assertThat(namedFacetAbstract.value(), equalTo("some name"));
    }
View Full Code Here

        expectNoMethodsRemoved();

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, actionMethod, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
        assertThat(facet, is(not(nullValue())));
        assertThat(facet instanceof NamedFacetAbstract, is(true));
        final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
        assertThat(namedFacetAbstract.value(), equalTo("some name"));
    }
View Full Code Here

        expectNoMethodsRemoved();

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, actionMethod, mockMethodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(NamedFacet.class);
        assertThat(facet, is(not(nullValue())));
        assertThat(facet instanceof NamedFacetAbstract, is(true));
        final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
        assertThat(namedFacetAbstract.value(), equalTo("some name"));
    }
View Full Code Here

        expectNoMethodsRemoved();

        facetFactory.processParams(new ProcessParameterContext(actionMethod, 0, facetedMethodParameter));

        final Facet facet = facetedMethodParameter.getFacet(NamedFacet.class);
        assertThat(facet, is(not(nullValue())));
        assertThat(facet instanceof NamedFacetAbstract, is(true));
        final NamedFacetAbstract namedFacetAbstract = (NamedFacetAbstract) facet;
        assertThat(namedFacetAbstract.value(), equalTo("some name"));
    }
View Full Code Here

    }

    @Test
    @Override
    public void testCollectionFacet() throws Exception {
        final Facet facet = specification.getFacet(CollectionFacet.class);
        Assert.assertNotNull(facet);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facetapi.Facet

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.