Package org.glassfish.jersey.client

Examples of org.glassfish.jersey.client.JerseyClient.target()


    public void testDisabledCookies() {
        ClientConfig cc = new ClientConfig();
        cc.property(JettyClientProperties.DISABLE_COOKIES, true);
        cc.connectorProvider(new JettyConnectorProvider());
        JerseyClient client = JerseyClientBuilder.createClient(cc);
        WebTarget r = client.target(getBaseUri());

        assertEquals("NO-COOKIE", r.request().get(String.class));
        assertEquals("NO-COOKIE", r.request().get(String.class));

        final JettyConnector connector = (JettyConnector) client.getConfiguration().getConnector();
View Full Code Here


    @Test
    public void testCookies() {
        ClientConfig cc = new ClientConfig();
        cc.connectorProvider(new JettyConnectorProvider());
        JerseyClient client = JerseyClientBuilder.createClient(cc);
        WebTarget r = client.target(getBaseUri());

        assertEquals("NO-COOKIE", r.request().get(String.class));
        assertEquals("value", r.request().get(String.class));

        final JettyConnector connector = (JettyConnector) client.getConfiguration().getConnector();
View Full Code Here

    public void testDisabledCookies() {
        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.DISABLE_COOKIES, true);
        cc.connectorProvider(new ApacheConnectorProvider());
        JerseyClient client = JerseyClientBuilder.createClient(cc);
        WebTarget r = client.target(getBaseUri());

        assertEquals("NO-COOKIE", r.request().get(String.class));
        assertEquals("NO-COOKIE", r.request().get(String.class));

        final ApacheConnector connector = (ApacheConnector) client.getConfiguration().getConnector();
View Full Code Here

    @Test
    public void testCookies() {
        ClientConfig cc = new ClientConfig();
        cc.connectorProvider(new ApacheConnectorProvider());
        JerseyClient client = JerseyClientBuilder.createClient(cc);
        WebTarget r = client.target(getBaseUri());

        assertEquals("NO-COOKIE", r.request().get(String.class));
        assertEquals("value", r.request().get(String.class));

        final ApacheConnector connector = (ApacheConnector) client.getConfiguration().getConnector();
View Full Code Here

        final BarListener filter = new BarListener();
        final BarListener filter2 = new BarListener2();

        // ClientRuntime initializes lazily, so it is forced by invoking a (dummy) request
        client.register(filter2);                                                   // instance registered into client
        client.target(getBaseUri()).register(filter).request().get(String.class);   // instance registration into target

        assertTrue("Filter was expected to be already initialized.", filter.isInitialized());
        assertTrue("Filter2 was expected to be already initialized.", filter2.isInitialized());

        client.target(getBaseUri()).register(FooListener.class).request().get(String.class); // class registration into target
View Full Code Here

        client.target(getBaseUri()).register(filter).request().get(String.class);   // instance registration into target

        assertTrue("Filter was expected to be already initialized.", filter.isInitialized());
        assertTrue("Filter2 was expected to be already initialized.", filter2.isInitialized());

        client.target(getBaseUri()).register(FooListener.class).request().get(String.class); // class registration into target

        assertTrue("Class-registered filter was expected to be already initialized", FooListener.isInitialized());

        assertFalse("Class-registered filter was expected to be still open.", FooListener.isClosed());
        assertFalse("Filter was expected to be still open.", filter.isClosed());
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.