Package io.reactivex.netty

Examples of io.reactivex.netty.NoOpChannelHandlerContext


        String cookie1Domain = ".google.com";
        String cookie1Path = "/";
        String cookie1Header = cookie1Name + '=' + cookie1Value
                               + "; expires=Thu, 18-Feb-2016 07:47:08 GMT; path=" + cookie1Path + "; domain=" + cookie1Domain;
        nettyRequest.headers().add(HttpHeaders.Names.COOKIE, cookie1Header);
        Channel noOpChannel = new NoOpChannelHandlerContext().channel();
        HttpServerRequest<ByteBuf> request =
                new HttpServerRequest<ByteBuf>(noOpChannel, nettyRequest,
                                               UnicastContentSubject.<ByteBuf>createWithoutNoSubscriptionTimeout());
        Map<String,Set<Cookie>> cookies = request.getCookies();
        Assert.assertEquals("Unexpected number of cookies.", 1, cookies.size());
View Full Code Here


    @Test
    public void testSetCookie() throws Exception {
        DefaultHttpResponse nettyResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND);
        HttpServerResponse<ByteBuf> response =
                new HttpServerResponse<ByteBuf>(new NoOpChannelHandlerContext().channel(), nettyResponse,
                                                new MetricEventsSubject<HttpServerMetricsEvent<?>>());
        String cookieName = "name";
        String cookieValue = "value";
        response.addCookie(new DefaultCookie(cookieName, cookieValue));
        String cookieHeader = nettyResponse.headers().get(HttpHeaders.Names.SET_COOKIE);
View Full Code Here

        Assert.assertEquals("Unexpected uri string", uri, request.getUri());
        Assert.assertEquals("Unexpected query string", "", request.getQueryString());
    }

    protected HttpServerRequest<ByteBuf> newServerRequest(DefaultHttpRequest nettyRequest) {
        Channel noOpChannel = new NoOpChannelHandlerContext().channel();
        return new HttpServerRequest<ByteBuf>(noOpChannel, nettyRequest,
                                              UnicastContentSubject.<ByteBuf>createWithoutNoSubscriptionTimeout());
    }
View Full Code Here

*/
public class MultipleFutureListenerTest {

    @Test
    public void testCompletionWhenNoFuture() throws Exception {
        NoOpChannelHandlerContext context = new NoOpChannelHandlerContext();
        MultipleFutureListener listener = new MultipleFutureListener(context.newPromise());
        final CountDownLatch completionLatch = new CountDownLatch(1);
        listener.asObservable().doOnTerminate(new Action0() {
            @Override
            public void call() {
                completionLatch.countDown();
View Full Code Here

TOP

Related Classes of io.reactivex.netty.NoOpChannelHandlerContext

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.