Package aQute.bnd.osgi

Examples of aQute.bnd.osgi.Macro$Link


        Page primaryPage = mockPage();
        PageRenderQueue queue = mockPageRenderQueue();
        PageActivationContextCollector collector = mockPageActivationContextCollector();
        LinkCreationListener2 listener = mockLinkCreationListener2();
        ComponentEventLinkEncoder linkEncoder = mockComponentEventLinkEncoder();
        Link link = mockLink();

        ArrayEventContext eventContext = new ArrayEventContext(typeCoercer, context);

        ArrayEventContext pageEventContext = new ArrayEventContext(typeCoercer, "a", "b");

        train_getRenderingPage(queue, null);

        train_getName(primaryPage, pageName);

        train_collectPageActivationContext(collector, pageName, "a", "b");

        ComponentEventRequestParameters parameters = new ComponentEventRequestParameters(pageName, pageName, nestedId,
                eventType, pageEventContext, eventContext);

        expect(linkEncoder.createComponentEventLink(parameters, forForm)).andReturn(link);

        listener.createdComponentEventLink(link, parameters);

        replay();

        LinkSource source = new LinkSourceImpl(queue, collector, typeCoercer, null, linkEncoder, null, null,
                emptyConfiguration);

        source.getLinkCreationHub().addListener(listener);

        Link returnedLink = source.createComponentEventLink(primaryPage, nestedId, eventType, forForm, context);

        // Make sure the same link is returned.

        assertSame(returnedLink, link);
View Full Code Here


        Page primaryPage = mockPage();
        PageRenderQueue queue = mockPageRenderQueue();
        PageActivationContextCollector collector = mockPageActivationContextCollector();
        LinkCreationListener2 listener = mockLinkCreationListener2();
        ComponentEventLinkEncoder linkEncoder = mockComponentEventLinkEncoder();
        Link link = mockLink();

        ArrayEventContext eventContext = new ArrayEventContext(typeCoercer, context);

        ArrayEventContext pageEventContext = new ArrayEventContext(typeCoercer, "a", "b");

        train_getRenderingPage(queue, null);

        train_getName(primaryPage, pageName);

        train_collectPageActivationContext(collector, pageName, "a", "b");

        ComponentEventRequestParameters parameters = new ComponentEventRequestParameters(pageName, pageName, nestedId,
                eventType, pageEventContext, eventContext);

        expect(linkEncoder.createComponentEventLink(parameters, forForm)).andReturn(link);

        listener.createdComponentEventLink(link, parameters);

        List<LinkCreationListener2> configuration = CollectionFactory.newList(listener);

        replay();

        LinkSource source = new LinkSourceImpl(queue, collector, typeCoercer, null, linkEncoder, null, null,
                configuration);

        Link returnedLink = source.createComponentEventLink(primaryPage, nestedId, eventType, forForm, context);

        // Make sure the same link is returned.

        assertSame(returnedLink, link);
View Full Code Here

        train_encodeRedirectURL(response, URI, ENCODED);

        replay();

        Link link = new LinkImpl(URI, false, LinkSecurity.INSECURE, response, null, null);

        assertEquals(link.toRedirectURI(), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, INSECURE_BASE_URL + BASE_PATH, ENCODED);

        replay();

        Link link = new LinkImpl(BASE_PATH, false, LinkSecurity.INSECURE, response, null, baseURLSource);

        assertEquals(link.toAbsoluteURI(), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, SECURE_BASE_URL + BASE_PATH, ENCODED);

        replay();

        Link link = new LinkImpl(BASE_PATH, false, LinkSecurity.SECURE, response, null, baseURLSource);

        assertEquals(link.toAbsoluteURI(), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, SECURE_BASE_URL + BASE_PATH, ENCODED);

        replay();

        Link link = new LinkImpl(BASE_PATH, false, LinkSecurity.INSECURE, response, null, baseURLSource);

        assertEquals(link.toAbsoluteURI(true), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, INSECURE_BASE_URL + BASE_PATH, ENCODED);

        replay();

        Link link = new LinkImpl(BASE_PATH, false, LinkSecurity.SECURE, response, null, baseURLSource);

        assertEquals(link.toAbsoluteURI(false), ENCODED);

        verify();
    }
View Full Code Here

        train_encodeURL(response, url, ENCODED);

        replay();

        Link link = new LinkImpl(url, false, LinkSecurity.INSECURE, response, null, null);

        assertEquals(link.toString(), ENCODED);

        assertEquals(link.getBasePath(), url);

        verify();
    }
View Full Code Here

    {
        Response response = mockResponse();

        replay();

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

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

        assertEquals(link.getParameterValue("fred"), "flintstone");

        verify();
    }
View Full Code Here

        train_encodeURL(response, url, ENCODED);

        replay();

        Link link = new LinkImpl(url, false, LinkSecurity.INSECURE, response, null, null);
        link.setAnchor("wilma");

        assertSame(link.getAnchor(), "wilma");

        assertEquals(link.toURI(), ENCODED + "#" + "wilma");

        verify();
    }
View Full Code Here

TOP

Related Classes of aQute.bnd.osgi.Macro$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.