Examples of BaseURLSource


Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void force_link_to_secure()
    {
        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

    {
        Request request = mockRequest();
        Response response = mockResponse();
        LinkSource linkSource = mockLinkSource();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();

        train_isSecure(request, true);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    {
        Request request = mockRequest();
        Response response = mockResponse();
        LinkSource linkSource = mockLinkSource();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();

        train_isSecure(request, false);

        train_isSecure(locator, PAGE_NAME, false);
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    {
        Request request = mockRequest();
        Response response = mockResponse();
        LinkSource linkSource = mockLinkSource();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        Link link = mockLink();

        train_isSecure(request, false);

        train_isSecure(locator, PAGE_NAME, true);
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    {
        Request request = mockRequest();
        Response response = mockResponse();
        LinkSource linkSource = mockLinkSource();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();

        train_isSecure(request, secureRequest);

        train_isSecure(locator, PAGE_NAME, securePage);
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test(dataProvider = "to_client_url_data")
    public void to_client_url(String resourcePath, String expectedClientURL)
    {
        Request request = mockRequest();

        BaseURLSource baseURLSource = newMock(BaseURLSource.class);

        train_getContextPath(request, "/ctx");

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

    public void asset_client_URL()
    {
        Context context = mockContext();
        Request request = mockRequest();

        BaseURLSource baseURLSource = newMock(BaseURLSource.class);

        Resource r = new ContextResource(context, "foo/Bar.txt");

        train_getContextPath(request, "/context");
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    public void getBaseURLFromRequest() {
        expect(request.getServerName()).andReturn("localhost").once();
        expect(request.getServerPort()).andReturn(80).once();
        expect(request.isSecure()).andReturn(false).once();
        replay();
        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "localhost", 0, 0);
        assertEquals(baseURLSource.getBaseURL(false), "http://localhost");
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BaseURLSource

    @Test
    public void getBaseURLWithContributedHostname() {
        expect(request.getServerPort()).andReturn(80).once();
        expect(request.isSecure()).andReturn(false).once();
        replay();
        BaseURLSource baseURLSource = new BaseURLSourceImpl(request, "my.server.com", 0, 0);
        assertEquals(baseURLSource.getBaseURL(false), "http://my.server.com");
    }
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.