Examples of BaseURLSource


Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void getBaseURLWithEnvHostname() {
        expect(request.getServerPort()).andReturn(80).once();
        expect(request.isSecure()).andReturn(false).once();
        replay();
        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "$HOSTNAME", 0, 0);
        assertEquals(baseURLSource.getBaseURL(false), "http://" + System.getenv("HOSTNAME"));
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    }
   
    @Test
    public void getBaseURLWithContributedValuesDontUseRequest() {
        replay();
        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 443);
        assertEquals(baseURLSource.getBaseURL(false), "http://localhost");
    }   
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    }   
   
    @Test
    public void getBaseURLWithContributedNonStandardSecurePort() {
        replay();
        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 8443);
        assertEquals(baseURLSource.getBaseURL(true), "https://localhost:8443");
    }   
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    }

    @Contribute(ServiceOverride.class)
    public void setupCustomBaseURLSource(MappedConfiguration<Class, Object> configuration)
    {
        BaseURLSource source = new BaseURLSource()
        {
            public String getBaseURL(boolean secure)
            {
                String protocol = secure ? "https" : "http";
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

        expect(request.getServerPort()).andReturn(80).once();
        expect(request.isSecure()).andReturn(false);

        replay();

        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "", 0, 0);
        assertEquals(baseURLSource.getBaseURL(false), "http://localhost");

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

        expect(request.getServerPort()).andReturn(80).once();
        expect(request.isSecure()).andReturn(false);

        replay();

        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "my.server.com", 0, 0);

        assertEquals(baseURLSource.getBaseURL(false), "http://my.server.com");

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

        expect(request.getServerPort()).andReturn(80).once();
        expect(request.isSecure()).andReturn(false);

        replay();

        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "$HOSTNAME", 0, 0);

        assertEquals(baseURLSource.getBaseURL(false), "http://" + System.getenv("HOSTNAME"));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void insecure_url_using_default_port()
    {
        replay();

        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 443);

        assertEquals(baseURLSource.getBaseURL(false), "http://localhost");

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void secure_url_using_default_port()
    {
        replay();

        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 443);

        assertEquals(baseURLSource.getBaseURL(true), "https://localhost");

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void getBaseURLWithContributedNonStandardSecurePort()
    {
        replay();

        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 80, 8443);

        assertEquals(baseURLSource.getBaseURL(true), "https://localhost:8443");

        verify();
    }
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.