Examples of BaseURLSource


Examples of org.apache.tapestry5.services.BaseURLSource

        expect(request.getServerName()).andReturn("localhost").once();
        expect(request.getServerPort()).andReturn(80).once();

        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();

        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();

        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

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void absolute_URI_for_default_insecure_link()
    {
        Response response = mockResponse();
        BaseURLSource baseURLSource = mockBaseURLSource();

        train_getBaseURL(baseURLSource, false, INSECURE_BASE_URL);

        train_encodeURL(response, INSECURE_BASE_URL + BASE_PATH, ENCODED);
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void absolute_URI_for_default_secure_link()
    {
        Response response = mockResponse();
        BaseURLSource baseURLSource = mockBaseURLSource();

        train_getBaseURL(baseURLSource, true, SECURE_BASE_URL);

        train_encodeURL(response, SECURE_BASE_URL + BASE_PATH, ENCODED);
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void force_secure_URI_from_insecure_link()
    {
        Response response = mockResponse();
        BaseURLSource baseURLSource = mockBaseURLSource();

        train_getBaseURL(baseURLSource, true, SECURE_BASE_URL);

        train_encodeURL(response, SECURE_BASE_URL + BASE_PATH, ENCODED);
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void force_insecure_URI_from_secure_link()
    {
        Response response = mockResponse();
        BaseURLSource baseURLSource = mockBaseURLSource();

        train_getBaseURL(baseURLSource, false, INSECURE_BASE_URL);

        train_encodeURL(response, INSECURE_BASE_URL + BASE_PATH, ENCODED);
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.