Examples of DefaultHttpChunk


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

    Assert.assertTrue(msgReq.getUri().startsWith("/stream"));

    ////// send back some partial response
    ChannelBuffer tmpBuf = NettyTestUtils.streamToChannelBuffer(buf, cp, 10000, null);
    _dummyServer.sendServerResponse(clientAddr, sourcesResp, 1000);
    _dummyServer.sendServerResponse(clientAddr, new DefaultHttpChunk(tmpBuf), 1000);

    serverChannel.close();

    waitForCallback(callback,
                    TestResponseProcessors.TestConnectionStateMessage.State.STREAM_RESPONSE_SUCCESS,
View Full Code Here

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

    String expectedVersion = "&" + DatabusHttpHeaders.MAX_EVENT_VERSION + "=" + MAX_EVENT_VERSION;
    Assert.assertTrue(msgReq.getUri().contains(expectedVersion));

    //send back some response
    ChannelBuffer tmpBuf = NettyTestUtils.streamToChannelBuffer(buf, cp, 10000, null);
    NettyTestUtils.sendServerResponses(_dummyServer, clientAddr, sourcesResp, new DefaultHttpChunk(tmpBuf));

    waitForCallback(callback,
                    TestResponseProcessors.TestConnectionStateMessage.State.STREAM_RESPONSE_SUCCESS,
                    log);
    Assert.assertNull(remoteExceptionHandler.getLastException());
View Full Code Here

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

    Assert.assertTrue(msgReq.getUri().startsWith("/register"));

    //send back some response
    RegisterResponseEntry entry = new RegisterResponseEntry(1L, (short)1, SOURCE1_SCHEMA_STR);
    String responseStr = NettyTestUtils.generateRegisterResponse(entry);
    body = new DefaultHttpChunk(
        ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
    NettyTestUtils.sendServerResponses(_dummyServer, clientAddr, sourcesResp, body);

    waitForCallback(callback,
                    TestResponseProcessors.TestConnectionStateMessage.State.REGISTER_SUCCESS,
View Full Code Here

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

    HttpResponse sourcesResp = new DefaultHttpResponse(HttpVersion.HTTP_1_1,
                                                       HttpResponseStatus.OK);
    sourcesResp.setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
    sourcesResp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
    HttpChunk body =
        new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("[{\"id\":1,\"name\":\"test.source1\"}]".getBytes(Charset.defaultCharset())));
    NettyTestUtils.sendServerResponses(_dummyServer, clientAddr, sourcesResp, body);

    waitForCallback(callback,
                    TestResponseProcessors.TestConnectionStateMessage.State.SOURCES_SUCCESS,
                    log);
View Full Code Here

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

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 1000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        HttpChunk chunk2 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk2".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk2, 1000);

        sendServerResponse(clientAddr, new DefaultHttpChunkTrailer(), 1000);

        final List<String> callbacks = respProcessor.getCallbacks();
View Full Code Here

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

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 1000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        HttpChunk chunk2 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk2".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk2, 1000);

        sendServerResponse(clientAddr, new DefaultHttpChunkTrailer(), 1000);
        TestUtil.sleep(200);
        sendServerClose(clientAddr, -1);
View Full Code Here

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

          }
        }, "make sure we have all tracking populated for client connection", 1000, log);

        sendServerResponse(clientAddr, resp, 1000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        TestUtil.sleep(200);

        sendServerClose(clientAddr, -1);
View Full Code Here

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

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 1000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);
        final List<String> callbacks = respProcessor.getCallbacks();

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
View Full Code Here

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

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.SERVICE_UNAVAILABLE);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 2000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        sendServerResponse(clientAddr, new DefaultHttpChunkTrailer(), 1000);

        final List<String> callbacks = respProcessor.getCallbacks();
View Full Code Here

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

        HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
        resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        sendServerResponse(clientAddr, resp, 2000);

        HttpChunk chunk1 = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer("chunk1".getBytes(Charset.defaultCharset())));
        sendServerResponse(clientAddr, chunk1, 1000);

        sendServerResponse(clientAddr, new DefaultHttpChunkTrailer(), 1000);

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.