Package org.apache.tapestry

Examples of org.apache.tapestry.Link


    {
        Response response = mockResponse();

        replay();

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

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

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

        verify();
    }
View Full Code Here


    {
        Response response = mockResponse();

        replay();

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

        link.addParameter("fred", "flintstone");
        try
        {
            link.addParameter("fred", "flintstone");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(
View Full Code Here

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

        replay();

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

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

        assertEquals(link.toURI(), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, url, ENCODED);

        replay();

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

        link.setAnchor(anchor);

        assertEquals(link.toURI(), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, "/foo/bar?barney=rubble&fred=flintstone#wilma", ENCODED);

        replay();

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

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

        assertEquals(link.toURI(), ENCODED);

        verify();
    }
View Full Code Here

    public void writer_notifies_map_about_links()
    {
        ComponentInvocationMap map = mockComponentInvocationMap();

        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), map);
        Link link = mockLink();

        Element e = writer.element("form");

        map.store(e, link);
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

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.