Package org.jboss.netty.handler.codec.http

Examples of org.jboss.netty.handler.codec.http.HttpResponse


    SimpleTestHttpClient httpClient = SimpleTestHttpClient.createLocal(TimeoutPolicy.ALL_TIMEOUTS);
    SimpleHttpResponseHandler respHandler = httpClient.sendRequest(_serverAddress, httpRequest);

    assertTrue("failed to get a response", respHandler.awaitResponseUninterruptedly(1, TimeUnit.SECONDS));

    HttpResponse respObj = respHandler.getResponse();
    assertNull("/stream returned unexpected error", respObj.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CLASS_HEADER));

    if (LOG.isDebugEnabled())
    {
      LOG.debug("/stream response:" + new String(respHandler.getReceivedBytes()));
    }
View Full Code Here


    SimpleTestHttpClient httpClient = SimpleTestHttpClient.createLocal(TimeoutPolicy.ALL_TIMEOUTS);
    SimpleHttpResponseHandler respHandler = httpClient.sendRequest(_serverAddress, httpRequest);

    assertTrue("failed to get a response", respHandler.awaitResponseUninterruptedly(1, TimeUnit.SECONDS));

    HttpResponse respObj = respHandler.getResponse();
    if (expectFail)
    {
      assertNotNull("/stream failed to return expected error",
                    respObj.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CLASS_HEADER));
    }
    else
    {
      assertNull("/stream returned unexpected error",
                 respObj.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CLASS_HEADER));
    }

    if (LOG.isDebugEnabled())
    {
      LOG.debug("/stream response:" + new String(respHandler.getReceivedBytes()));
View Full Code Here

  @Test
  public void testStreamHappyPathChunked() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = HeapChannelBufferFactory.getInstance().getBuffer(100);
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

  @Test
  public void testStreamHappyPathNonChunked() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);

    processor.startResponse(httpResponse);
    processor.finishResponse();
View Full Code Here

  @Test
  public void testStreamExceptionAtStart() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = HeapChannelBufferFactory.getInstance().getBuffer(100);
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

  @Test
  public void testStreamExceptionAfterStartCase1() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = HeapChannelBufferFactory.getInstance().getBuffer(100);
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

  @Test
  public void testStreamExceptionAfterStartCase2() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = HeapChannelBufferFactory.getInstance().getBuffer(100);
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

  @Test
  public void testStreamExceptionAfterStartCase3() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = HeapChannelBufferFactory.getInstance().getBuffer(100);
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

  @Test
  public void testStreamExceptionAfterFinish() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    StreamHttpResponseProcessor  processor =
        new StreamHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = HeapChannelBufferFactory.getInstance().getBuffer(100);
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

  @Test
  public void testRegisterExceptionAtStart() throws Exception
  {
    TestAbstractQueue queue = new TestAbstractQueue();
    TestConnectionStateMessage stateMsg = new TestConnectionStateMessage();
    HttpResponse httpResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
    RegisterHttpResponseProcessor  processor =
        new RegisterHttpResponseProcessor(null, queue, stateMsg, null);
    ChannelBuffer buf = getRegisterResponse();
    HttpChunk httpChunk = new DefaultHttpChunk(buf);
    HttpChunkTrailer httpChunkTrailer = new DefaultHttpChunkTrailer();
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.HttpResponse

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.