Search in sources :

Example 91 with BiConsumer

use of java.util.function.BiConsumer in project DataX by alibaba.

the class DefaultGdbMapper method forElement.

private static BiConsumer<Record, GdbElement> forElement(final MappingRule rule) {
    final boolean numPattern = rule.isNumPattern();
    final List<BiConsumer<Record, GdbElement>> properties = new ArrayList<>();
    for (final MappingRule.PropertyMappingRule propRule : rule.getProperties()) {
        final Function<Record, String> keyFunc = forStrColumn(numPattern, propRule.getKey());
        if (propRule.getValueType() == ValueType.STRING) {
            final Function<Record, String> valueFunc = forStrColumn(numPattern, propRule.getValue());
            properties.add((r, e) -> {
                e.addProperty(keyFunc.apply(r), valueFunc.apply(r), propRule.getPType());
            });
        } else {
            final Function<Record, Object> valueFunc = forObjColumn(numPattern, propRule.getValue(), propRule.getValueType());
            properties.add((r, e) -> {
                e.addProperty(keyFunc.apply(r), valueFunc.apply(r), propRule.getPType());
            });
        }
    }
    if (rule.getPropertiesJsonStr() != null) {
        final Function<Record, String> jsonFunc = forStrColumn(numPattern, rule.getPropertiesJsonStr());
        properties.add((r, e) -> {
            final String propertiesStr = jsonFunc.apply(r);
            final JSONObject root = (JSONObject) JSONObject.parse(propertiesStr);
            final JSONArray propertiesList = root.getJSONArray("properties");
            for (final Object object : propertiesList) {
                final JSONObject jsonObject = (JSONObject) object;
                final String key = jsonObject.getString("k");
                final String name = jsonObject.getString("v");
                final String type = jsonObject.getString("t");
                final String card = jsonObject.getString("c");
                if (key == null || name == null) {
                    continue;
                }
                addToProperties(e, key, name, type, card);
            }
        });
    }
    final BiConsumer<Record, GdbElement> ret = (r, e) -> {
        final String label = forStrColumn(numPattern, rule.getLabel()).apply(r);
        String id = forStrColumn(numPattern, rule.getId()).apply(r);
        if (rule.getImportType() == Key.ImportType.EDGE) {
            final String to = forStrColumn(numPattern, rule.getTo()).apply(r);
            final String from = forStrColumn(numPattern, rule.getFrom()).apply(r);
            if (to == null || from == null) {
                log.error("invalid record to: {} , from: {}", to, from);
                throw new IllegalArgumentException("to or from missed in edge");
            }
            ((GdbEdge) e).setTo(to);
            ((GdbEdge) e).setFrom(from);
            // generate UUID for edge
            if (id == null) {
                id = UUID.randomUUID().toString();
            }
        }
        if (id == null || label == null) {
            log.error("invalid record id: {} , label: {}", id, label);
            throw new IllegalArgumentException("id or label missed");
        }
        e.setId(id);
        e.setLabel(label);
        properties.forEach(p -> p.accept(r, e));
    };
    return ret;
}
Also used : VERTEX(com.alibaba.datax.plugin.writer.gdbwriter.Key.ImportType.VERTEX) UUID(java.util.UUID) Function(java.util.function.Function) ArrayList(java.util.ArrayList) Configuration(com.alibaba.datax.common.util.Configuration) Key(com.alibaba.datax.plugin.writer.gdbwriter.Key) JSONArray(com.alibaba.fastjson.JSONArray) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) Matcher(java.util.regex.Matcher) Record(com.alibaba.datax.common.element.Record) GdbElement(com.alibaba.datax.plugin.writer.gdbwriter.model.GdbElement) GdbEdge(com.alibaba.datax.plugin.writer.gdbwriter.model.GdbEdge) BiConsumer(java.util.function.BiConsumer) GdbVertex(com.alibaba.datax.plugin.writer.gdbwriter.model.GdbVertex) JSONObject(com.alibaba.fastjson.JSONObject) Pattern(java.util.regex.Pattern) ArrayList(java.util.ArrayList) JSONArray(com.alibaba.fastjson.JSONArray) JSONObject(com.alibaba.fastjson.JSONObject) Record(com.alibaba.datax.common.element.Record) JSONObject(com.alibaba.fastjson.JSONObject) BiConsumer(java.util.function.BiConsumer) GdbElement(com.alibaba.datax.plugin.writer.gdbwriter.model.GdbElement)

Example 92 with BiConsumer

use of java.util.function.BiConsumer in project spring-boot by spring-projects.

the class PropertyDescriptorResolverTests method process.

private void process(Class<?> target, Collection<Class<?>> additionalClasses, BiConsumer<TypeElement, MetadataGenerationEnvironment> consumer) throws IOException {
    BiConsumer<RoundEnvironmentTester, MetadataGenerationEnvironment> internalConsumer = (roundEnv, metadataEnv) -> {
        TypeElement element = roundEnv.getRootElement(target);
        consumer.accept(element, metadataEnv);
    };
    TestableAnnotationProcessor<MetadataGenerationEnvironment> processor = new TestableAnnotationProcessor<>(internalConsumer, new MetadataGenerationEnvironmentFactory());
    TestCompiler compiler = new TestCompiler(this.tempDir);
    ArrayList<Class<?>> allClasses = new ArrayList<>();
    allClasses.add(target);
    allClasses.addAll(additionalClasses);
    compiler.getTask(allClasses.toArray(new Class<?>[0])).call(processor);
}
Also used : HierarchicalProperties(org.springframework.boot.configurationsample.simple.HierarchicalProperties) Arrays(java.util.Arrays) RoundEnvironmentTester(org.springframework.boot.configurationprocessor.test.RoundEnvironmentTester) HierarchicalPropertiesParent(org.springframework.boot.configurationsample.simple.HierarchicalPropertiesParent) ImmutableClassConstructorBindingProperties(org.springframework.boot.configurationsample.immutable.ImmutableClassConstructorBindingProperties) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TestableAnnotationProcessor(org.springframework.boot.configurationprocessor.test.TestableAnnotationProcessor) SimpleProperties(org.springframework.boot.configurationsample.simple.SimpleProperties) TypeElement(javax.lang.model.element.TypeElement) ImmutableMultiConstructorProperties(org.springframework.boot.configurationsample.immutable.ImmutableMultiConstructorProperties) ArrayList(java.util.ArrayList) ItemMetadata(org.springframework.boot.configurationprocessor.metadata.ItemMetadata) AutowiredProperties(org.springframework.boot.configurationsample.simple.AutowiredProperties) BiConsumer(java.util.function.BiConsumer) TwoConstructorsExample(org.springframework.boot.configurationsample.specific.TwoConstructorsExample) TestCompiler(org.springframework.boot.testsupport.compiler.TestCompiler) ImmutableNameAnnotationProperties(org.springframework.boot.configurationsample.immutable.ImmutableNameAnnotationProperties) ImmutableDeducedConstructorBindingProperties(org.springframework.boot.configurationsample.immutable.ImmutableDeducedConstructorBindingProperties) LombokExplicitProperties(org.springframework.boot.configurationsample.lombok.LombokExplicitProperties) Collection(java.util.Collection) ImmutableSimpleProperties(org.springframework.boot.configurationsample.immutable.ImmutableSimpleProperties) IOException(java.io.IOException) LombokSimpleValueProperties(org.springframework.boot.configurationsample.lombok.LombokSimpleValueProperties) HierarchicalPropertiesGrandparent(org.springframework.boot.configurationsample.simple.HierarchicalPropertiesGrandparent) File(java.io.File) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) Stream(java.util.stream.Stream) TempDir(org.junit.jupiter.api.io.TempDir) LombokSimpleProperties(org.springframework.boot.configurationsample.lombok.LombokSimpleProperties) Collections(java.util.Collections) LombokSimpleDataProperties(org.springframework.boot.configurationsample.lombok.LombokSimpleDataProperties) TestableAnnotationProcessor(org.springframework.boot.configurationprocessor.test.TestableAnnotationProcessor) TestCompiler(org.springframework.boot.testsupport.compiler.TestCompiler) TypeElement(javax.lang.model.element.TypeElement) RoundEnvironmentTester(org.springframework.boot.configurationprocessor.test.RoundEnvironmentTester) ArrayList(java.util.ArrayList)

Example 93 with BiConsumer

use of java.util.function.BiConsumer in project vert.x by eclipse.

the class WebSocketTest method testTLS.

private void testTLS(Cert<?> clientCert, Trust<?> clientTrust, Cert<?> serverCert, Trust<?> serverTrust, boolean requireClientAuth, boolean serverUsesCrl, boolean clientTrustAll, boolean clientUsesCrl, boolean shouldPass, boolean clientSsl, boolean serverSsl, boolean sni, String[] enabledCipherSuites, BiConsumer<HttpClient, Handler<AsyncResult<WebSocket>>> wsProvider) throws Exception {
    HttpClientOptions options = new HttpClientOptions();
    options.setSsl(clientSsl);
    options.setTrustAll(clientTrustAll);
    if (clientUsesCrl) {
        options.addCrlPath("tls/root-ca/crl.pem");
    }
    options.setTrustOptions(clientTrust.get());
    options.setKeyCertOptions(clientCert.get());
    for (String suite : enabledCipherSuites) {
        options.addEnabledCipherSuite(suite);
    }
    client = vertx.createHttpClient(options);
    HttpServerOptions serverOptions = new HttpServerOptions();
    serverOptions.setSsl(serverSsl);
    serverOptions.setSni(sni);
    serverOptions.setTrustOptions(serverTrust.get());
    serverOptions.setKeyCertOptions(serverCert.get());
    if (requireClientAuth) {
        serverOptions.setClientAuth(ClientAuth.REQUIRED);
    }
    if (serverUsesCrl) {
        serverOptions.addCrlPath("tls/root-ca/crl.pem");
    }
    for (String suite : enabledCipherSuites) {
        serverOptions.addEnabledCipherSuite(suite);
    }
    server = vertx.createHttpServer(serverOptions.setPort(4043));
    server.webSocketHandler(ws -> {
        ws.handler(ws::write);
    });
    try {
        server.listen(ar -> {
            assertTrue(ar.succeeded());
            Handler<AsyncResult<WebSocket>> handler = ar2 -> {
                if (ar2.succeeded()) {
                    WebSocket ws = ar2.result();
                    if (clientSsl && sni) {
                        try {
                            Certificate clientPeerCert = ws.peerCertificates().get(0);
                            assertEquals("host2.com", TestUtils.cnOf(clientPeerCert));
                        } catch (Exception err) {
                            fail(err);
                        }
                    }
                    int size = 100;
                    Buffer received = Buffer.buffer();
                    ws.handler(data -> {
                        received.appendBuffer(data);
                        if (received.length() == size) {
                            ws.close();
                            testComplete();
                        }
                    });
                    Buffer buff = Buffer.buffer(TestUtils.randomByteArray(size));
                    ws.writeFrame(WebSocketFrame.binaryFrame(buff, true));
                } else {
                    if (shouldPass) {
                        ar2.cause().printStackTrace();
                        fail("Should not throw exception");
                    } else {
                        testComplete();
                    }
                }
            };
            wsProvider.accept(client, handler);
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
    await();
}
Also used : WebSocketInternal(io.vertx.core.http.impl.WebSocketInternal) MultiMap(io.vertx.core.MultiMap) Context(io.vertx.core.Context) Matcher(java.util.regex.Matcher) PlatformDependent(io.netty.util.internal.PlatformDependent) TestUtils(io.vertx.test.core.TestUtils) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DEFAULT_HTTP_HOST(io.vertx.core.http.HttpTestBase.DEFAULT_HTTP_HOST) ReadStream(io.vertx.core.streams.ReadStream) HAProxy(io.vertx.test.proxy.HAProxy) WebSocketFrameImpl(io.vertx.core.http.impl.ws.WebSocketFrameImpl) CheckingSender(io.vertx.test.core.CheckingSender) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) VertxOptions(io.vertx.core.VertxOptions) Trust(io.vertx.test.tls.Trust) BlockingQueue(java.util.concurrent.BlockingQueue) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) CountDownLatch(java.util.concurrent.CountDownLatch) Certificate(java.security.cert.Certificate) Buffer(io.vertx.core.buffer.Buffer) ReferenceCountUtil(io.netty.util.ReferenceCountUtil) AbstractVerticle(io.vertx.core.AbstractVerticle) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Cert(io.vertx.test.tls.Cert) Pattern(java.util.regex.Pattern) UnsupportedEncodingException(java.io.UnsupportedEncodingException) NetSocketInternal(io.vertx.core.net.impl.NetSocketInternal) NetSocket(io.vertx.core.net.NetSocket) java.util(java.util) MessageDigest(java.security.MessageDigest) DEFAULT_HTTP_PORT(io.vertx.core.http.HttpTestBase.DEFAULT_HTTP_PORT) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CompletableFuture(java.util.concurrent.CompletableFuture) TestUtils.assertNullPointerException(io.vertx.test.core.TestUtils.assertNullPointerException) VertxTestBase(io.vertx.test.core.VertxTestBase) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) DEFAULT_HTTPS_HOST(io.vertx.core.http.HttpTestBase.DEFAULT_HTTPS_HOST) BiConsumer(java.util.function.BiConsumer) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) WebSocket13FrameDecoder(io.netty.handler.codec.http.websocketx.WebSocket13FrameDecoder) AsyncResult(io.vertx.core.AsyncResult) SocketAddress(io.vertx.core.net.SocketAddress) DEFAULT_TEST_URI(io.vertx.core.http.HttpTestBase.DEFAULT_TEST_URI) ConcurrentHashSet(io.vertx.core.impl.ConcurrentHashSet) Promise(io.vertx.core.Promise) TestUtils.randomAlphaString(io.vertx.test.core.TestUtils.randomAlphaString) Vertx(io.vertx.core.Vertx) Test(org.junit.Test) IOException(java.io.IOException) Http1xServerConnection(io.vertx.core.http.impl.Http1xServerConnection) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) WebSocket13FrameEncoder(io.netty.handler.codec.http.websocketx.WebSocket13FrameEncoder) DeploymentOptions(io.vertx.core.DeploymentOptions) NetServer(io.vertx.core.net.NetServer) DEFAULT_HTTPS_PORT(io.vertx.core.http.HttpTestBase.DEFAULT_HTTPS_PORT) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Handler(io.vertx.core.Handler) TestUtils.assertIllegalStateException(io.vertx.test.core.TestUtils.assertIllegalStateException) Http1xClientConnection(io.vertx.core.http.impl.Http1xClientConnection) Buffer(io.vertx.core.buffer.Buffer) TestUtils.randomAlphaString(io.vertx.test.core.TestUtils.randomAlphaString) AsyncResult(io.vertx.core.AsyncResult) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) TestUtils.assertNullPointerException(io.vertx.test.core.TestUtils.assertNullPointerException) IOException(java.io.IOException) TestUtils.assertIllegalStateException(io.vertx.test.core.TestUtils.assertIllegalStateException) Certificate(java.security.cert.Certificate)

Example 94 with BiConsumer

use of java.util.function.BiConsumer in project vert.x by eclipse.

the class CompositeFutureTest method testConcurrentCompletion.

private void testConcurrentCompletion(BiConsumer<Integer, Promise<String>> completer, Function<List<Future>, CompositeFuture> fact, Consumer<CompositeFuture> check) throws Exception {
    disableThreadChecks();
    List<Promise<String>> promises = IntStream.range(0, NUM_THREADS).mapToObj(i -> Promise.<String>promise()).collect(Collectors.toList());
    List<Future> futures = promises.stream().map(Promise::future).collect(Collectors.toList());
    CompositeFuture compositeFuture = fact.apply(futures);
    ExecutorService executorService = Executors.newFixedThreadPool(NUM_THREADS);
    CyclicBarrier barrier = new CyclicBarrier(NUM_THREADS);
    for (int i = 0; i < NUM_THREADS; ++i) {
        final int x = i;
        executorService.submit(() -> {
            Promise<String> promise = promises.get(x);
            try {
                barrier.await();
                completer.accept(x, promise);
            } catch (Throwable t) {
                fail(t);
            }
        });
    }
    compositeFuture.onComplete(x -> {
        check.accept(compositeFuture);
        testComplete();
    });
    executorService.shutdown();
    executorService.awaitTermination(30, TimeUnit.SECONDS);
    await();
}
Also used : IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) CyclicBarrier(java.util.concurrent.CyclicBarrier) BiFunction(java.util.function.BiFunction) Test(org.junit.Test) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) ArrayList(java.util.ArrayList) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Repeat(io.vertx.test.core.Repeat) List(java.util.List) ThrowingCallable(org.assertj.core.api.ThrowableAssert.ThrowingCallable) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BiConsumer(java.util.function.BiConsumer) Collections(java.util.Collections) ExecutorService(java.util.concurrent.ExecutorService) ExecutorService(java.util.concurrent.ExecutorService) CyclicBarrier(java.util.concurrent.CyclicBarrier)

Example 95 with BiConsumer

use of java.util.function.BiConsumer in project vert.x by eclipse.

the class Http2ServerTest method testPushPromise.

private void testPushPromise(Http2Headers requestHeaders, BiConsumer<HttpServerResponse, Handler<AsyncResult<HttpServerResponse>>> pusher, Consumer<Http2Headers> headerChecker) throws Exception {
    Context ctx = vertx.getOrCreateContext();
    server.requestHandler(req -> {
        Handler<AsyncResult<HttpServerResponse>> handler = ar -> {
            assertSameEventLoop(ctx, Vertx.currentContext());
            assertTrue(ar.succeeded());
            HttpServerResponse response = ar.result();
            response.end("the_content");
            assertIllegalStateException(() -> response.push(HttpMethod.GET, "/wibble2", resp -> {
            }));
        };
        pusher.accept(req.response(), handler);
    });
    startServer(ctx);
    TestClient client = new TestClient();
    ChannelFuture fut = client.connect(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, request -> {
        int id = request.nextStreamId();
        Http2ConnectionEncoder encoder = request.encoder;
        encoder.writeHeaders(request.context, id, requestHeaders, 0, true, request.context.newPromise());
        Map<Integer, Http2Headers> pushed = new HashMap<>();
        request.decoder.frameListener(new Http2FrameAdapter() {

            @Override
            public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) throws Http2Exception {
                pushed.put(promisedStreamId, headers);
            }

            @Override
            public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception {
                int delta = super.onDataRead(ctx, streamId, data, padding, endOfStream);
                String content = data.toString(StandardCharsets.UTF_8);
                vertx.runOnContext(v -> {
                    assertEquals(Collections.singleton(streamId), pushed.keySet());
                    assertEquals("the_content", content);
                    Http2Headers pushedHeaders = pushed.get(streamId);
                    headerChecker.accept(pushedHeaders);
                    testComplete();
                });
                return delta;
            }
        });
    });
    fut.sync();
    await();
}
Also used : Context(io.vertx.core.Context) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) MultiMap(io.vertx.core.MultiMap) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder) DefaultHttp2Connection(io.netty.handler.codec.http2.DefaultHttp2Connection) Http1xOrH2CHandler(io.vertx.core.http.impl.Http1xOrH2CHandler) Context(io.vertx.core.Context) Utils(io.vertx.core.impl.Utils) Unpooled(io.netty.buffer.Unpooled) Http2ConnectionDecoder(io.netty.handler.codec.http2.Http2ConnectionDecoder) ByteArrayInputStream(java.io.ByteArrayInputStream) TestUtils(io.vertx.test.core.TestUtils) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2Exception(io.netty.handler.codec.http2.Http2Exception) Map(java.util.Map) ApplicationProtocolNegotiationHandler(io.netty.handler.ssl.ApplicationProtocolNegotiationHandler) ReadStream(io.vertx.core.streams.ReadStream) AbstractHttp2ConnectionHandlerBuilder(io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder) Http2FrameAdapter(io.netty.handler.codec.http2.Http2FrameAdapter) ChannelDuplexHandler(io.netty.channel.ChannelDuplexHandler) HttpRequest(io.netty.handler.codec.http.HttpRequest) ChannelInitializer(io.netty.channel.ChannelInitializer) Http2Flags(io.netty.handler.codec.http2.Http2Flags) Trust(io.vertx.test.tls.Trust) Set(java.util.Set) ChannelPipeline(io.netty.channel.ChannelPipeline) Http2ConnectionHandler(io.netty.handler.codec.http2.Http2ConnectionHandler) Future(io.vertx.core.Future) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) StandardCharsets(java.nio.charset.StandardCharsets) Base64(java.util.Base64) List(java.util.List) Buffer(io.vertx.core.buffer.Buffer) SslHandler(io.netty.handler.ssl.SslHandler) Http2Headers(io.netty.handler.codec.http2.Http2Headers) Http2Error(io.netty.handler.codec.http2.Http2Error) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Http2EventAdapter(io.netty.handler.codec.http2.Http2EventAdapter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ByteBuf(io.netty.buffer.ByteBuf) WriteStream(io.vertx.core.streams.WriteStream) Http2Stream(io.netty.handler.codec.http2.Http2Stream) BiConsumer(java.util.function.BiConsumer) Assume(org.junit.Assume) AsyncResult(io.vertx.core.AsyncResult) DetectFileDescriptorLeaks(io.vertx.test.core.DetectFileDescriptorLeaks) VertxInternal(io.vertx.core.impl.VertxInternal) ClosedChannelException(java.nio.channels.ClosedChannelException) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) FileOutputStream(java.io.FileOutputStream) ApplicationProtocolNames(io.netty.handler.ssl.ApplicationProtocolNames) Test(org.junit.Test) IOException(java.io.IOException) SSLHelper(io.vertx.core.net.impl.SSLHelper) File(java.io.File) ChannelFuture(io.netty.channel.ChannelFuture) Channel(io.netty.channel.Channel) HttpServerCodec(io.netty.handler.codec.http.HttpServerCodec) Http2Settings(io.netty.handler.codec.http2.Http2Settings) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Bootstrap(io.netty.bootstrap.Bootstrap) AtomicLong(java.util.concurrent.atomic.AtomicLong) Http2Connection(io.netty.handler.codec.http2.Http2Connection) HttpUtils(io.vertx.core.http.impl.HttpUtils) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Handler(io.vertx.core.Handler) Collections(java.util.Collections) TestUtils.assertIllegalStateException(io.vertx.test.core.TestUtils.assertIllegalStateException) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) ChannelFuture(io.netty.channel.ChannelFuture) Http2Exception(io.netty.handler.codec.http2.Http2Exception) Http2FrameAdapter(io.netty.handler.codec.http2.Http2FrameAdapter) HashMap(java.util.HashMap) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ByteBuf(io.netty.buffer.ByteBuf) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2Headers(io.netty.handler.codec.http2.Http2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder) AsyncResult(io.vertx.core.AsyncResult)

Aggregations

BiConsumer (java.util.function.BiConsumer)255 Test (org.junit.Test)110 List (java.util.List)106 Map (java.util.Map)77 IOException (java.io.IOException)75 Consumer (java.util.function.Consumer)69 ArrayList (java.util.ArrayList)68 HashMap (java.util.HashMap)64 Collectors (java.util.stream.Collectors)53 CountDownLatch (java.util.concurrent.CountDownLatch)52 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)50 Collections (java.util.Collections)46 Set (java.util.Set)46 Collection (java.util.Collection)45 Arrays (java.util.Arrays)44 TimeUnit (java.util.concurrent.TimeUnit)43 Assert (org.junit.Assert)43 Function (java.util.function.Function)41 Optional (java.util.Optional)40 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)35