Package org.eclipse.jetty.client

Examples of org.eclipse.jetty.client.HttpClient.send()


        LOG.info("Received: [" + contentExchange.getResponseStatus() + "] " + contentExchange.getResponseContent());

        contentExchange = new ContentExchange();
        contentExchange.setMethod("POST");
        contentExchange.setURL("http://localhost:8080/message/test?clientId=test&action=unsubscribe");
        httpClient.send(contentExchange);
        contentExchange.waitForDone();

        httpClient.stop();

        ObjectName query = new ObjectName("org.apache.activemq:BrokerName=localhost,Type=Subscription,destinationType=Queue,destinationName=test,*");
 
View Full Code Here


        httpClient.start();
        ContentExchange contentExchange = new ContentExchange();
        httpClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
        contentExchange.setMethod("POST");
        contentExchange.setURL("http://localhost:8080/message/testPost?type=queue");
        httpClient.send(contentExchange);

        contentExchange.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange.getResponseStatus()));

        ContentExchange contentExchange2 = new ContentExchange();
View Full Code Here

        contentExchange.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange.getResponseStatus()));

        ContentExchange contentExchange2 = new ContentExchange();
        contentExchange2.setURL("http://localhost:8080/message/testPost?readTimeout=1000&type=Queue");
        httpClient.send(contentExchange2);
        contentExchange2.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange2.getResponseStatus()));
    }

    // test for https://issues.apache.org/activemq/browse/AMQ-3857
View Full Code Here

        httpClient.start();
        ContentExchange contentExchange = new ContentExchange();
        httpClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
        contentExchange.setMethod("POST");
        contentExchange.setURL("http://localhost:8080/message/testPost?type=queue&property=value");
        httpClient.send(contentExchange);

        contentExchange.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange.getResponseStatus()));

        ContentExchange contentExchange2 = new ContentExchange(true);
View Full Code Here

        contentExchange.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange.getResponseStatus()));

        ContentExchange contentExchange2 = new ContentExchange(true);
        contentExchange2.setURL("http://localhost:8080/message/testPost?readTimeout=1000&type=Queue");
        httpClient.send(contentExchange2);
        contentExchange2.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange2.getResponseStatus()));

        HttpFields fields = contentExchange2.getResponseFields();
        assertNotNull("Headers Exist", fields);
View Full Code Here

        ContentExchange contentExchange = new ContentExchange();
        httpClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
        contentExchange.setMethod("POST");
        contentExchange.setURL("http://localhost:8080/message/testPost?type=queue");
        contentExchange.setRequestHeader("Authorization", "Basic YWRtaW46YWRtaW4=");
        httpClient.send(contentExchange);

        contentExchange.waitForDone();
        assertTrue("success status", HttpStatus.isSuccess(contentExchange.getResponseStatus()));
    }
}
View Full Code Here

        AjaxTestContentExchange contentExchange = new AjaxTestContentExchange();
        contentExchange.setMethod( "POST" );
        contentExchange.setURL("http://localhost:8080/amq");
        contentExchange.setRequestContent( new ByteArrayBuffer("destination=queue://test&type=listen&message=handler") );
        contentExchange.setRequestContentType( "application/x-www-form-urlencoded; charset=UTF-8" );
        httpClient.send(contentExchange);
        contentExchange.waitForDone();
        String jsessionid = contentExchange.getJsessionId();

        // client 1 polls for messages
        LOG.debug( "SENDING POLL" );
View Full Code Here

        LOG.debug( "SENDING POLL" );
        AjaxTestContentExchange poll = new AjaxTestContentExchange();
        poll.setMethod( "GET" );
        poll.setURL("http://localhost:8080/amq?timeout=5000");
        poll.setRequestHeader( "Cookie", jsessionid );
        httpClient.send( poll );

        // while client 1 is polling, client 2 sends messages to the queue
        LOG.debug( "SENDING MESSAGES" );
        contentExchange = new AjaxTestContentExchange();
        contentExchange.setMethod( "POST" );
View Full Code Here

            "destination=queue://test&type=send&message=msg1&"+
            "d1=queue://test&t1=send&m1=msg2&"+
            "d2=queue://test&t2=send&m2=msg3"
        ) );
        contentExchange.setRequestContentType( "application/x-www-form-urlencoded; charset=UTF-8" );
        httpClient.send(contentExchange);
        contentExchange.waitForDone();
        LOG.debug( "DONE POSTING MESSAGES" );

        // wait for poll to finish
        poll.waitForDone();
View Full Code Here

        // messages might not all be delivered during the 1st poll.  We need to check again.
        poll = new AjaxTestContentExchange();
        poll.setMethod( "GET" );
        poll.setURL("http://localhost:8080/amq?timeout=5000");
        poll.setRequestHeader( "Cookie", jsessionid );
        httpClient.send( poll );
        poll.waitForDone();

        String fullResponse = response + poll.getResponseContent();
        LOG.debug( "full response : " + fullResponse );
        assertContains( "<response id='handler' destination='queue://test' >msg1</response>", fullResponse );
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.