Package org.jclouds.openstack.glance.functions

Examples of org.jclouds.openstack.glance.functions.VersionsJsonResponse$Version$Link


        train_encodeURL(response, "/ctx/foo", ENCODED);

        replay();

        Link link = new LinkImpl("/ctx/foo", true, false, response, optimizer);

        assertEquals(link.toAbsoluteURI(), ENCODED);

        verify();
    }
View Full Code Here


        String expectedURI = "/ctx/foo?foo=bar&baz=barney";
        train_encodeURL(response, expectedURI, expectedURI);

        replay();

        Link link = new LinkImpl("/ctx/foo?foo=bar", false, false, response, optimizer);
        link.addParameter("baz", "barney");

        assertEquals(link.toURI(), expectedURI);

        verify();
    }
View Full Code Here

        String expectedURI = "/ctx/baz?baz=barney";
        train_encodeURL(response, expectedURI, expectedURI);

        replay();

        Link link = new LinkImpl("/ctx/foo", false, false, response, optimizer);
        link.addParameter("baz", "barney");
        link.setAnchor("jacob");

        Link copy = link.copyWithBasePath("/ctx/baz");

        assertEquals(copy.toURI(), expectedURI + "#jacob");

        verify();
    }
View Full Code Here

    }

    @Test
    public void remove_parameter()
    {
        Link link = new LinkImpl("/baseURI", false, false, null, null);

        link.addParameter("fred", "flintstone");
        link.addParameter("barney", "rubble");

        link.removeParameter("fred");

        assertNull(link.getParameterValue("fred"));
        assertListsEquals(link.getParameterNames(), "barney");
    }
View Full Code Here

    {
        Request request = mockRequest();
        Response response = mockResponse();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        Link link = mockLink();
        ComponentEventLinkEncoder encoder = newMock(ComponentEventLinkEncoder.class);

        train_isSecure(request, false);

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

        return asset;
    }

    protected final Link mockLink(String absoluteURI)
    {
        Link link = mockLink();

        expect(link.toAbsoluteURI()).andReturn(absoluteURI).atLeastOnce();

        return link;
    }
View Full Code Here

        ComponentEventLinkEncoder encoder = new ComponentEventLinkEncoderImpl(null, contextPathEncoder, null, request,
                response, manager, optimizer, null, false);

        PageRenderRequestParameters parameters = new PageRenderRequestParameters("MyPage", new EmptyEventContext());

        Link link = encoder.createPageRenderLink(parameters);

        assertEquals(link.toAbsoluteURI(), "MAGIC");

        verify();
    }
View Full Code Here

                response, manager, optimizer, null, false);

        PageRenderRequestParameters parameters = new PageRenderRequestParameters("admin/Index", new ArrayEventContext(
                typeCoercer, "abc"));

        Link link = encoder.createPageRenderLink(parameters);

        assertEquals(link.toAbsoluteURI(), "MAGIC");

        verify();
    }
View Full Code Here

        ComponentEventLinkEncoder encoder = new ComponentEventLinkEncoderImpl(null, contextPathEncoder, null, request,
                response, manager, optimizer, null, false);

        PageRenderRequestParameters parameters = new PageRenderRequestParameters("Index", new EmptyEventContext());

        Link link = encoder.createPageRenderLink(parameters);

        assertEquals(link.toAbsoluteURI(), "MAGIC");

        verify();
    }
View Full Code Here

        builder.append(encodedPageName);

        appendContext(encodedPageName.length() > 0, parameters.getActivationContext(), builder);

        Link link = new LinkImpl(builder.toString(), baseURL == null, false, response, optimizer);

        if (parameters.isLoopback())
            link.addParameter(TapestryConstants.PAGE_LOOPBACK_PARAMETER_NAME, "t");

        return link;
    }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.glance.functions.VersionsJsonResponse$Version$Link

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.