Package org.apache.tapestry

Examples of org.apache.tapestry.Link


        RequestPathOptimizer optimizer = mockRequestPathOptimizer();
        Response response = mockResponse();

        replay();

        Link link = new LinkImpl(response, optimizer, "/foo", "bar");

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

        assertEquals(link.getParameterNames(), Arrays.asList("barney", "fred"));

        verify();
    }
View Full Code Here


        _message = message;
    }

    public String getActionURL()
    {
        Link link = _resources.createActionLink("UpdateMessage", false, "from getActionURL()");

        return link.toURI();
    }
View Full Code Here

        Response response = mockResponse();
        LinkFactory linkFactory = mockLinkFactory();
        MetaDataLocator locator = mockMetaDataLocator();
        BaseURLSource source = mockBaseURLSource();
        Page page = mockPage();
        Link link = mockLink();
        RequestPageCache cache = mockRequestPageCache();

        train_isSecure(request, false);

        train_get(cache, PAGE_NAME, page);
View Full Code Here

{
    @Test
    public void no_client_data_in_request()
    {
        Request request = mockRequest(null);
        Link link = mockLink();

        replay();

        ClientPersistentFieldStorage storage = new ClientPersistentFieldStorageImpl(request);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void store_and_restore_a_change()
    {
        Request request = mockRequest(null);
        Link link = mockLink();
        final Holder<String> holder = Holder.create();

        String pageName = "Foo";
        String componentId = "bar.baz";
        String fieldName = "biff";
        Object value = 99;

        // Use an IAnswer to capture the value.

        link.addParameter(eq(ClientPersistentFieldStorageImpl.PARAMETER_NAME), isA(String.class));
        getMocksControl().andAnswer(new IAnswer<Void>()
        {
            public Void answer() throws Throwable
            {
                String base64 = (String) EasyMock.getCurrentArguments()[1];
View Full Code Here

    @Test
    public void multiple_changes()
    {
        Request request = mockRequest(null);
        Link link = mockLink();

        String pageName = "Foo";
        String componentId = "bar.baz";

        link.addParameter(eq(ClientPersistentFieldStorageImpl.PARAMETER_NAME), isA(String.class));

        replay();

        ClientPersistentFieldStorage storage = new ClientPersistentFieldStorageImpl(request);
View Full Code Here

    @Test
    public void null_value_is_a_remove()
    {
        Request request = mockRequest(null);
        Link link = mockLink();

        String pageName = "Foo";
        String componentId = "bar.baz";
        String fieldName = "woops";
View Full Code Here

     */
    @Test
    public void discard_changes()
    {
        Request request = mockRequest(null);
        Link link = mockLink();

        String pageName = "Foo";
        String componentId = "bar.baz";
        String fieldName = "woops";

View Full Code Here

        LinkFactory factory = new LinkFactoryImpl(request, response, map, null, optimizer, null, _contextValueEncoder,
                                                  securityManager);

        factory.addListener(listener);

        Link link = factory.createPageLink(page, false);

        assertEquals(link.toRedirectURI(), ENCODED);

        // Make sure the link was passed to the LinkFactoryListener

        assertSame(link, holder.get());
View Full Code Here

                                                  _contextValueEncoder,
                                                  securityManager);

        factory.addListener(listener);

        Link link = factory.createPageLink(page, false);

        assertEquals(link.toRedirectURI(), ENCODED);

        // Make sure the link was passed to the LinkFactoryListener

        assertSame(link, holder.get());
View Full Code Here

TOP

Related Classes of org.apache.tapestry.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.