Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.Request


    private static final String PAGE_NAME = "Whatever";

    @Test
    public void check_request_is_secure() throws Exception
    {
        Request request = mockRequest();
        Response response = mockResponse();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        ComponentEventLinkEncoder encoder = newMock(ComponentEventLinkEncoder.class);
View Full Code Here


    }

    @Test
    public void check_page_not_secure() throws Exception
    {
        Request request = mockRequest();
        Response response = mockResponse();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        ComponentEventLinkEncoder encoder = newMock(ComponentEventLinkEncoder.class);
View Full Code Here

    }

    @Test
    public void check_redirect_needed() throws Exception
    {
        Request request = mockRequest();
        Response response = mockResponse();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        Link link = mockLink();
        ComponentEventLinkEncoder encoder = newMock(ComponentEventLinkEncoder.class);
View Full Code Here

    }

    @Test(dataProvider = "base_URL_data")
    public void get_base_URL(boolean secureRequest, boolean securePage, String expectedURL)
    {
        Request request = mockRequest();
        Response response = mockResponse();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        ComponentEventLinkEncoder encoder = newMock(ComponentEventLinkEncoder.class);
View Full Code Here

    @Test
    public void known_locale()
    {
        PersistentLocale pl = mockPersistentLocale();
        ThreadLocale tl = mockThreadLocale();
        Request request = mockRequest();

        tl.setLocale(Locale.FRENCH);
        pl.set(Locale.FRENCH);

        replay();
View Full Code Here

    @Test
    public void unknown_locale_uses_locale_from_request()
    {
        PersistentLocale pl = mockPersistentLocale();
        ThreadLocale tl = mockThreadLocale();
        Request request = mockRequest();

        tl.setLocale(Locale.FRENCH);

        train_getLocale(request, Locale.CANADA_FRENCH);
View Full Code Here

    @Test
    public void unsupported_locale_in_request_uses_default_locale()
    {
        PersistentLocale pl = mockPersistentLocale();
        ThreadLocale tl = mockThreadLocale();
        Request request = mockRequest();

        tl.setLocale(Locale.ITALIAN);

        train_getLocale(request, Locale.CHINESE);
View Full Code Here

    @Test
    public void set_nonpersistent_locale()
    {
        PersistentLocale pl = mockPersistentLocale();
        ThreadLocale tl = mockThreadLocale();
        Request request = mockRequest();

        tl.setLocale(Locale.FRENCH);

        replay();
View Full Code Here

    @Test
    public void locale_not_encoded()
    {
        RequestSecurityManager manager = mockRequestSecurityManager();
        Request request = mockRequest();
        Response response = mockResponse();
        RequestPathOptimizer optimizer = mockRequestPathOptimizer();
        ContextPathEncoder contextPathEncoder = getService(ContextPathEncoder.class);

        expect(manager.getBaseURL("MyPage")).andReturn(null);
View Full Code Here

    @Test
    public void index_stripped_off()
    {
        RequestSecurityManager manager = mockRequestSecurityManager();
        Request request = mockRequest();
        Response response = mockResponse();
        RequestPathOptimizer optimizer = mockRequestPathOptimizer();
        ContextPathEncoder contextPathEncoder = getService(ContextPathEncoder.class);

        expect(manager.getBaseURL("admin/Index")).andReturn(null);
View Full Code Here

TOP

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

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.