Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.ComponentClassResolver


        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = new ComponentClassResolverImpl(logger, locator, "HomePage",
                APP_ROOT_PACKAGE_MAPPINGS);

        assertEquals(resolver.canonicalizePageName("sub/HomePage"), "sub/HomePage");
        assertEquals(resolver.canonicalizePageName("sub"), "sub/HomePage");
        assertTrue(resolver.isPageName("sub/HomePage"));

        verify();
    }
View Full Code Here


        replay();

        List<LibraryMapping> mappings = APP_ROOT_PACKAGE_MAPPINGS;

        ComponentClassResolver resolver = new ComponentClassResolverImpl(logger, locator, "HomePage", mappings);

        assertTrue(resolver.isPageName("sub/HomePage"));
        assertTrue(resolver.isPageName("sub/subIndex"));
        assertEquals(resolver.resolvePageNameToClassName("sub/HomePage"), APP_ROOT_PACKAGE + ".pages.sub.HomePage");
        assertEquals(resolver.resolvePageNameToClassName("sub/SubIndex"), APP_ROOT_PACKAGE + ".pages.sub.SubIndex");
        assertEquals(resolver.resolvePageNameToClassName("sub/Index"), APP_ROOT_PACKAGE + ".pages.sub.SubIndex");
        assertEquals(resolver.resolvePageNameToClassName("sub"), APP_ROOT_PACKAGE + ".pages.sub.SubIndex");

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator);

        assertEquals(resolver.resolvePageNameToClassName("subfolder/NestedPage"), className);

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator);

        assertEquals(resolver.resolvePageNameToClassName("admin/edit/User"), className);
        assertEquals(resolver.resolvePageNameToClassName("admin/edit/AdminUserEdit"), className);

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator);

        assertEquals(resolver.resolvePageNameToClassName("subfolder/NestedPage"), className);

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator);

        assertEquals(resolver.resolvePageNameToClassName("foo/Bar"), className);

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", APP_ROOT_PACKAGE + ".pages.Wilma",
                APP_ROOT_PACKAGE + ".pages.Betty");

        replay();

        ComponentClassResolver resolver = create(logger, locator, new LibraryMapping(CORE_PREFIX, CORE_ROOT_PACKAGE));

        try
        {
            resolver.resolvePageNameToClassName("Unknown");
            unreachable();
        }
        catch (UnknownValueException ex)
        {
            assertEquals(ex.getMessage(), "Unable to resolve \'Unknown\' to a page class name.");
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator);

        assertTrue(resolver.isPageName("SimplePage"));
        assertTrue(resolver.isPageName("simplepage"));
        assertFalse(resolver.isPageName("UnknownPage"));

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, APP_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator);

        assertTrue(resolver.isPageName("Index"));
        assertTrue(resolver.isPageName(""));

        verify();
    }
View Full Code Here

        train_locateComponentClassNames(locator, CORE_ROOT_PACKAGE + ".pages", className);

        replay();

        ComponentClassResolver resolver = create(logger, locator, new LibraryMapping(CORE_PREFIX, CORE_ROOT_PACKAGE));

        // Can look like an application page, but still resolves to the core library class name.

        assertTrue(resolver.isPageName("MyCorePage"));

        // Or we can give it its true name

        assertTrue(resolver.isPageName("core/mycorepage"));

        assertFalse(resolver.isPageName("UnknownPage"));

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.ComponentClassResolver

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.