Package org.apache.tapestry5.annotations

Examples of org.apache.tapestry5.annotations.Mixin.order()


        boolean orderEmpty = annotation.order().length == 0;

        if (!orderEmpty && annotation.order().length != annotation.value().length)
            throw new TapestryException(String.format("%d mixins defined via @MixinClasses on field '%s', but %d ordering constraints \\\n" +
                    " specified (expected 0 or %1$d).", annotation.value().length, field.getName(), annotation.order().length), model,
                    null);

        for (int i = 0; i < annotation.value().length; i++)
        {
            String[] constraints = orderEmpty ? InternalConstants.EMPTY_STRING_ARRAY : TapestryInternalUtils
View Full Code Here


                    null);

        for (int i = 0; i < annotation.value().length; i++)
        {
            String[] constraints = orderEmpty ? InternalConstants.EMPTY_STRING_ARRAY : TapestryInternalUtils
                    .splitMixinConstraints(annotation.order()[i]);

            model.addMixin(annotation.value()[i].getName(), constraints);
        }
    }
View Full Code Here

   
    @Test
    public void run()
    {
        WhitelistAuthorizer auth = new WhitelistAuthorizer(Arrays.asList("foo"));
        assertEquals(auth.order().get(0), AssetPathAuthorizer.Order.ALLOW);
        assertEquals(auth.order().get(1), AssetPathAuthorizer.Order.DENY);
        assertEquals(auth.order().size(),2);
        assertTrue(auth.accessAllowed("foo"));
        assertFalse(auth.accessDenied("foo"));
       
View Full Code Here

    @Test
    public void run()
    {
        WhitelistAuthorizer auth = new WhitelistAuthorizer(Arrays.asList("foo"));
        assertEquals(auth.order().get(0), AssetPathAuthorizer.Order.ALLOW);
        assertEquals(auth.order().get(1), AssetPathAuthorizer.Order.DENY);
        assertEquals(auth.order().size(),2);
        assertTrue(auth.accessAllowed("foo"));
        assertFalse(auth.accessDenied("foo"));
       
        assertFalse(auth.accessAllowed("bar"));
View Full Code Here

    public void run()
    {
        WhitelistAuthorizer auth = new WhitelistAuthorizer(Arrays.asList("foo"));
        assertEquals(auth.order().get(0), AssetPathAuthorizer.Order.ALLOW);
        assertEquals(auth.order().get(1), AssetPathAuthorizer.Order.DENY);
        assertEquals(auth.order().size(),2);
        assertTrue(auth.accessAllowed("foo"));
        assertFalse(auth.accessDenied("foo"));
       
        assertFalse(auth.accessAllowed("bar"));
        assertTrue(auth.accessDenied("bar"));
View Full Code Here

    {
        Logger logger = createMock(Logger.class);
        List<AssetPathAuthorizer> auths = new ArrayList<AssetPathAuthorizer>();
        AssetPathAuthorizer auth = createMock(AssetPathAuthorizer.class);

        expect(auth.order()).andReturn(Arrays.asList(AssetPathAuthorizer.Order.ALLOW, AssetPathAuthorizer.Order.DENY)).times(2);

        expect(auth.accessAllowed("/cayenne.xml")).andReturn(false);
        expect(auth.accessDenied("/cayenne.xml")).andReturn(true);
        expect(auth.accessAllowed("/org/apache/tapestry/default.css")).andReturn(true);
        auths.add(auth);
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.