Search in sources :

Example 11 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class TcpServerTests method retryStrategiesWhenServerFails.

@Test
public void retryStrategiesWhenServerFails() throws Exception {
    ObjectMapper mapper = new ObjectMapper();
    Function<List<Pojo>, ByteBuf> jsonEncoder = pojo -> {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            mapper.writeValue(out, pojo);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return Unpooled.copiedBuffer(out.toByteArray());
    };
    Function<String, Pojo[]> jsonDecoder = s -> {
        try {
            return mapper.readValue(s, Pojo[].class);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    };
    int elem = 10;
    CountDownLatch latch = new CountDownLatch(elem);
    final AtomicInteger j = new AtomicInteger();
    NettyContext server = TcpServer.create("localhost").newHandler((in, out) -> out.sendGroups(in.receive().asString().map(jsonDecoder).map(d -> Flux.fromArray(d).doOnNext(pojo -> {
        if (j.getAndIncrement() < 2) {
            throw new RuntimeException("test");
        }
    }).retry(2).collectList().map(jsonEncoder)).doOnComplete(() -> System.out.println("wow")).log("flatmap-retry"))).block(Duration.ofSeconds(30));
    NettyContext client = TcpClient.create(ops -> ops.connectAddress(() -> server.address())).newHandler((in, out) -> {
        in.receive().asString().map(jsonDecoder).concatMap(d -> Flux.fromArray(d)).log("receive").subscribe(c -> latch.countDown());
        return out.send(Flux.range(1, elem).map(i -> new Pojo("test" + i)).log("send").collectList().map(jsonEncoder)).neverComplete();
    }).block(Duration.ofSeconds(30));
    Assertions.assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue();
    Assertions.assertThat(latch.getCount()).isEqualTo(0);
    server.dispose();
    client.dispose();
}
Also used : URISyntaxException(java.net.URISyntaxException) BiFunction(java.util.function.BiFunction) Processor(org.reactivestreams.Processor) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) Loggers(reactor.util.Loggers) SocketChannel(java.nio.channels.SocketChannel) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) After(org.junit.After) Logger(reactor.util.Logger) Assertions(org.assertj.core.api.Assertions) SocketUtils(reactor.ipc.netty.SocketUtils) Path(java.nio.file.Path) JsonObjectDecoder(io.netty.handler.codec.json.JsonObjectDecoder) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) Exceptions(reactor.core.Exceptions) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) WorkQueueProcessor(reactor.core.publisher.WorkQueueProcessor) Charset(java.nio.charset.Charset) ByteBuf(io.netty.buffer.ByteBuf) NettyInbound(reactor.ipc.netty.NettyInbound) NettyPipeline(reactor.ipc.netty.NettyPipeline) EmitterProcessor(reactor.core.publisher.EmitterProcessor) HttpClient(reactor.ipc.netty.http.client.HttpClient) Schedulers(reactor.core.scheduler.Schedulers) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) HttpServer(reactor.ipc.netty.http.server.HttpServer) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) Assert.assertNotNull(org.junit.Assert.assertNotNull) Publisher(org.reactivestreams.Publisher) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) MonoProcessor(reactor.core.publisher.MonoProcessor) NetUtil(io.netty.util.NetUtil) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Ignore(org.junit.Ignore) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) FileSystems(java.nio.file.FileSystems) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ByteBuf(io.netty.buffer.ByteBuf) CountDownLatch(java.util.concurrent.CountDownLatch) URISyntaxException(java.net.URISyntaxException) SSLException(javax.net.ssl.SSLException) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) NettyContext(reactor.ipc.netty.NettyContext) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) List(java.util.List) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 12 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class UdpServerTests method supportsReceivingDatagrams.

@Test
@Ignore
public void supportsReceivingDatagrams() throws InterruptedException {
    final int port = SocketUtils.findAvailableUdpPort();
    final CountDownLatch latch = new CountDownLatch(4);
    final NettyContext server = UdpServer.create(port).newHandler((in, out) -> {
        in.receive().asByteArray().log().subscribe(bytes -> {
            if (bytes.length == 1024) {
                latch.countDown();
            }
        });
        return Flux.never();
    }).doOnSuccess(v -> {
        try {
            DatagramChannel udp = DatagramChannel.open();
            udp.configureBlocking(true);
            udp.connect(new InetSocketAddress(InetAddress.getLocalHost(), port));
            byte[] data = new byte[1024];
            new Random().nextBytes(data);
            for (int i = 0; i < 4; i++) {
                udp.write(ByteBuffer.wrap(data));
            }
            udp.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }).block(Duration.ofSeconds(30));
    assertThat("latch was counted down", latch.await(10, TimeUnit.SECONDS));
    server.dispose();
}
Also used : ChannelOption(io.netty.channel.ChannelOption) Enumeration(java.util.Enumeration) DatagramChannel(java.nio.channels.DatagramChannel) Random(java.util.Random) ByteBuffer(java.nio.ByteBuffer) ArrayList(java.util.ArrayList) InetAddress(java.net.InetAddress) SocketException(java.net.SocketException) Loggers(reactor.util.Loggers) Duration(java.time.Duration) After(org.junit.After) Logger(reactor.util.Logger) InternetProtocolFamily(io.netty.channel.socket.InternetProtocolFamily) Schedulers(reactor.core.scheduler.Schedulers) SocketUtils(reactor.ipc.netty.SocketUtils) LoopResources(reactor.ipc.netty.resources.LoopResources) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) Collection(java.util.Collection) NetworkInterface(java.net.NetworkInterface) NetUtil(io.netty.util.NetUtil) IOException(java.io.IOException) Test(org.junit.Test) Inet4Address(java.net.Inet4Address) InetSocketAddress(java.net.InetSocketAddress) Executors(java.util.concurrent.Executors) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) Flux(reactor.core.publisher.Flux) Ignore(org.junit.Ignore) MulticastSocket(java.net.MulticastSocket) NettyContext(reactor.ipc.netty.NettyContext) DatagramPacket(java.net.DatagramPacket) Random(java.util.Random) InetSocketAddress(java.net.InetSocketAddress) DatagramChannel(java.nio.channels.DatagramChannel) IOException(java.io.IOException) CountDownLatch(java.util.concurrent.CountDownLatch) NettyContext(reactor.ipc.netty.NettyContext) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 13 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method releaseInboundChannelOnNonKeepAliveRequest.

@Test
public void releaseInboundChannelOnNonKeepAliveRequest() throws Exception {
    NettyContext c = HttpServer.create(0).newHandler((req, resp) -> req.receive().then(resp.status(200).send())).block();
    Flux<ByteBuf> src = Flux.range(0, 3).map(n -> Unpooled.wrappedBuffer(Integer.toString(n).getBytes()));
    Flux.range(0, 100).concatMap(n -> HttpClient.create(c.address().getPort()).post("/return", r -> r.keepAlive(false).send(src)).map(resp -> {
        resp.dispose();
        return resp.status().code();
    }).log()).collectList().block();
    c.dispose();
}
Also used : HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) ByteBuf(io.netty.buffer.ByteBuf) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Example 14 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method nonContentStatusCodes.

@Test
public void nonContentStatusCodes() {
    NettyContext server = HttpServer.create(ops -> ops.host("localhost")).newRouter(r -> r.get("/204-1", (req, res) -> res.status(HttpResponseStatus.NO_CONTENT).sendHeaders()).get("/204-2", (req, res) -> res.status(HttpResponseStatus.NO_CONTENT)).get("/205-1", (req, res) -> res.status(HttpResponseStatus.RESET_CONTENT).sendHeaders()).get("/205-2", (req, res) -> res.status(HttpResponseStatus.RESET_CONTENT)).get("/304-1", (req, res) -> res.status(HttpResponseStatus.NOT_MODIFIED).sendHeaders()).get("/304-2", (req, res) -> res.status(HttpResponseStatus.NOT_MODIFIED))).block(Duration.ofSeconds(30));
    checkResponse("/204-1", server.address());
    checkResponse("/204-2", server.address());
    checkResponse("/205-1", server.address());
    checkResponse("/205-2", server.address());
    checkResponse("/304-1", server.address());
    checkResponse("/304-2", server.address());
    server.dispose();
}
Also used : HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Example 15 with NettyContext

use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.

the class HttpServerTests method keepAlive.

@Test
public void keepAlive() throws URISyntaxException {
    Path resource = Paths.get(getClass().getResource("/public").toURI());
    NettyContext c = HttpServer.create(0).newRouter(routes -> routes.directory("/test", resource)).block(Duration.ofSeconds(30));
    HttpResources.set(PoolResources.fixed("http", 1));
    HttpClientResponse response0 = HttpClient.create(c.address().getPort()).get("/test/index.html").block(Duration.ofSeconds(30));
    HttpClientResponse response1 = HttpClient.create(c.address().getPort()).get("/test/test.css").block(Duration.ofSeconds(30));
    HttpClientResponse response2 = HttpClient.create(c.address().getPort()).get("/test/test1.css").block(Duration.ofSeconds(30));
    HttpClientResponse response3 = HttpClient.create(c.address().getPort()).get("/test/test2.css").block(Duration.ofSeconds(30));
    HttpClientResponse response4 = HttpClient.create(c.address().getPort()).get("/test/test3.css").block(Duration.ofSeconds(30));
    HttpClientResponse response5 = HttpClient.create(c.address().getPort()).get("/test/test4.css").block(Duration.ofSeconds(30));
    HttpClientResponse response6 = HttpClient.create(opts -> opts.port(c.address().getPort()).disablePool()).get("/test/test5.css").block(Duration.ofSeconds(30));
    Assert.assertEquals(response0.channel(), response1.channel());
    Assert.assertEquals(response0.channel(), response2.channel());
    Assert.assertEquals(response0.channel(), response3.channel());
    Assert.assertEquals(response0.channel(), response4.channel());
    Assert.assertEquals(response0.channel(), response5.channel());
    Assert.assertNotEquals(response0.channel(), response6.channel());
    HttpResources.reset();
    response0.dispose();
    response1.dispose();
    response2.dispose();
    response3.dispose();
    response4.dispose();
    response5.dispose();
    response6.dispose();
    c.dispose();
}
Also used : Path(java.nio.file.Path) HttpResources(reactor.ipc.netty.http.HttpResources) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) StepVerifier(reactor.test.StepVerifier) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) NettyOutbound(reactor.ipc.netty.NettyOutbound) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) Future(java.util.concurrent.Future) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Path(java.nio.file.Path) Context(reactor.util.context.Context) StandardOpenOption(java.nio.file.StandardOpenOption) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) FileSystem(java.nio.file.FileSystem) InetSocketAddress(java.net.InetSocketAddress) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) SSLException(javax.net.ssl.SSLException) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) ByteBufFlux(reactor.ipc.netty.ByteBufFlux) HttpVersion(io.netty.handler.codec.http.HttpVersion) FluxSink(reactor.core.publisher.FluxSink) Tuple3(reactor.util.function.Tuple3) Tuple2(reactor.util.function.Tuple2) AsynchronousFileChannel(java.nio.channels.AsynchronousFileChannel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) StandardCopyOption(java.nio.file.StandardCopyOption) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(reactor.ipc.netty.http.client.HttpClient) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) ExecutorService(java.util.concurrent.ExecutorService) TcpClient(reactor.ipc.netty.tcp.TcpClient) SslContext(io.netty.handler.ssl.SslContext) Files(java.nio.file.Files) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) FutureMono(reactor.ipc.netty.FutureMono) CompletionHandler(java.nio.channels.CompletionHandler) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) PoolResources(reactor.ipc.netty.resources.PoolResources) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) Paths(java.nio.file.Paths) NettyContext(reactor.ipc.netty.NettyContext) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) FileSystems(java.nio.file.FileSystems) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) BlockingNettyContext(reactor.ipc.netty.tcp.BlockingNettyContext) NettyContext(reactor.ipc.netty.NettyContext) Test(org.junit.Test)

Aggregations

NettyContext (reactor.ipc.netty.NettyContext)92 Test (org.junit.Test)87 Mono (reactor.core.publisher.Mono)86 Duration (java.time.Duration)83 Flux (reactor.core.publisher.Flux)78 InetSocketAddress (java.net.InetSocketAddress)65 HttpServer (reactor.ipc.netty.http.server.HttpServer)63 HttpClient (reactor.ipc.netty.http.client.HttpClient)61 CountDownLatch (java.util.concurrent.CountDownLatch)60 StepVerifier (reactor.test.StepVerifier)60 AtomicReference (java.util.concurrent.atomic.AtomicReference)56 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)53 Unpooled (io.netty.buffer.Unpooled)50 TimeUnit (java.util.concurrent.TimeUnit)44 StandardCharsets (java.nio.charset.StandardCharsets)43 Ignore (org.junit.Ignore)43 SslContext (io.netty.handler.ssl.SslContext)42 SslContextBuilder (io.netty.handler.ssl.SslContextBuilder)42 InsecureTrustManagerFactory (io.netty.handler.ssl.util.InsecureTrustManagerFactory)42 SelfSignedCertificate (io.netty.handler.ssl.util.SelfSignedCertificate)42