Skip to content

Commit

Permalink
fix(transcoding): test
Browse files Browse the repository at this point in the history
  • Loading branch information
zZHorizonZz committed Jan 22, 2025
1 parent 9f79eb4 commit 4441529
Show file tree
Hide file tree
Showing 39 changed files with 192 additions and 244 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@

<modules>
<module>vertx-grpc-common</module>
<module>vertx-grpc-transcoding</module>
<module>vertx-grpc-server</module>
<module>vertx-grpc-client</module>
<module>vertx-grpcio-common</module>
Expand Down Expand Up @@ -271,4 +272,4 @@
</plugins>
</build>

</project>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public String methodName() {
return methodName;
}
@Override
public ServiceTranscodingOptions transcodingOptions() {return null;}
@Override
public GrpcMessageDecoder<Resp> decoder() {
return decoder;
}
Expand All @@ -42,10 +40,6 @@ public GrpcMessageEncoder<Req> encoder() {
}

static <Req, Resp> ServiceMethod<Req, Resp> server(ServiceName serviceName, String methodName, GrpcMessageEncoder<Resp> encoder, GrpcMessageDecoder<Req> decoder) {
return server(serviceName, methodName, null, encoder, decoder);
}

static <Req, Resp> ServiceMethod<Req, Resp> server(ServiceName serviceName, String methodName, ServiceTranscodingOptions transcodingOptions, GrpcMessageEncoder<Resp> encoder, GrpcMessageDecoder<Req> decoder) {
return new ServiceMethod<>() {
@Override
public ServiceName serviceName() {
Expand All @@ -56,10 +50,6 @@ public String methodName() {
return methodName;
}
@Override
public ServiceTranscodingOptions transcodingOptions() {
return transcodingOptions;
}
@Override
public GrpcMessageDecoder<Req> decoder() {
return decoder;
}
Expand All @@ -84,11 +74,6 @@ default String fullMethodName() {
return serviceName().fullyQualifiedName() + "/" + methodName();
}

/**
* @return the transcoding options
*/
ServiceTranscodingOptions transcodingOptions();

/**
* @return the message decoder
*/
Expand Down
7 changes: 3 additions & 4 deletions vertx-grpc-common/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
requires com.google.protobuf.util;
requires transitive io.vertx.core;
requires static io.vertx.codegen.api;
requires com.google.common;
exports io.vertx.grpc.common;
requires com.google.common;
exports io.vertx.grpc.common;
exports io.vertx.grpc.common.impl to io.vertx.tests.common, io.vertx.grpc.server, io.vertx.grpc.client, io.vertx.tests.server, io.vertx.tests.client;
exports io.vertx.grpc.common.transcoding;
provides VertxServiceProvider with io.vertx.grpc.common.impl.GrpcRequestLocalRegistration;
provides VertxServiceProvider with io.vertx.grpc.common.impl.GrpcRequestLocalRegistration;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.vertx.grpc.common.GrpcWriteStream;
import io.vertx.grpc.common.GrpcMessageDecoder;
import io.vertx.grpc.common.GrpcMessageEncoder;
import io.vertx.grpc.common.ServiceTranscodingOptions;
import io.vertx.grpc.transcoding.ServiceTranscodingOptions;
import io.vertx.grpc.server.GrpcServerResponse;
import io.vertx.grpc.server.GrpcServer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.vertx.grpc.common.GrpcWriteStream;
import io.vertx.grpc.common.GrpcMessageDecoder;
import io.vertx.grpc.common.GrpcMessageEncoder;
import io.vertx.grpc.common.ServiceTranscodingOptions;
import io.vertx.grpc.transcoding.ServiceTranscodingOptions;
import io.vertx.grpc.server.GrpcServerResponse;
import io.vertx.grpc.server.GrpcServer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import io.vertx.grpc.common.GrpcReadStream;
import io.vertx.grpc.common.GrpcWriteStream;
import io.vertx.grpc.common.GrpcMessageDecoder;
import io.vertx.grpc.common.GrpcMessageEncoder;
import io.vertx.grpc.common.ServiceTranscodingOptions;
import io.vertx.grpc.transcoding.ServiceTranscodingOptions;
import io.vertx.grpc.server.GrpcServerResponse;
import io.vertx.grpc.server.GrpcServer;

Expand Down
12 changes: 12 additions & 0 deletions vertx-grpc-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<groupId>io.vertx</groupId>
<artifactId>vertx-grpc-common</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-grpc-transcoding</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>io.vertx</groupId>
Expand All @@ -42,6 +47,13 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-grpc-transcoding</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- Self signed certificate generation -->
<dependency>
<groupId>org.bouncycastle</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.grpc.common.ServiceMethod;
import io.vertx.grpc.common.ServiceTranscodingOptions;
import io.vertx.grpc.server.impl.GrpcServerImpl;
import io.vertx.grpc.transcoding.ServiceTranscodingOptions;

/**
* <p>A gRPC server based on Vert.x HTTP server.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
import io.vertx.core.spi.context.storage.AccessMode;
import io.vertx.grpc.common.*;
import io.vertx.grpc.common.impl.GrpcMethodCall;
import io.vertx.grpc.common.transcoding.PathMatcherBuilderImpl;
import io.vertx.grpc.common.transcoding.PathMatcherImpl;
import io.vertx.grpc.common.transcoding.PathMatcherUtility;
import io.vertx.grpc.transcoding.*;
import io.vertx.grpc.transcoding.impl.PathMatcherBuilderImpl;
import io.vertx.grpc.transcoding.impl.PathMatcherImpl;
import io.vertx.grpc.transcoding.impl.PathMatcherUtility;
import io.vertx.grpc.server.GrpcProtocol;
import io.vertx.grpc.server.GrpcServer;
import io.vertx.grpc.server.GrpcServerOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.vertx.grpc.server.GrpcProtocol;
import io.vertx.grpc.server.GrpcServerRequest;
import io.vertx.grpc.server.GrpcServerResponse;
import io.vertx.grpc.transcoding.HttpVariableBinding;

import java.nio.charset.StandardCharsets;
import java.util.HashMap;
Expand Down
11 changes: 5 additions & 6 deletions vertx-grpc-server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module io.vertx.grpc.server {
requires io.netty.buffer;
requires io.netty.codec;
requires io.vertx.core.logging;
requires transitive io.vertx.grpc.common;
requires static io.vertx.docgen;
requires static io.vertx.codegen.api;
requires static io.vertx.codegen.json;
requires com.google.protobuf;
requires com.google.protobuf.util;
exports io.vertx.grpc.server;
requires io.vertx.grpc.transcoding;
requires io.vertx.codegen.api;
requires io.netty.codec;
requires io.netty.buffer;
exports io.vertx.grpc.server;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.vertx.grpc.server.GrpcServer;
import io.vertx.grpc.server.GrpcServerOptions;
import io.vertx.grpc.server.GrpcServerResponse;
import io.vertx.grpc.transcoding.ServiceTranscodingOptions;
import io.vertx.grpcweb.GrpcWebTesting.*;
import io.vertx.tests.common.GrpcTestBase;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.vertx.grpc.server.GrpcServer;
import io.vertx.grpc.server.GrpcServerOptions;
import io.vertx.grpc.server.GrpcServerResponse;
import io.vertx.grpc.transcoding.ServiceTranscodingOptions;
import io.vertx.grpcweb.GrpcWebTesting.*;
import io.vertx.tests.common.GrpcTestBase;
import org.junit.Test;
Expand Down
11 changes: 5 additions & 6 deletions vertx-grpc-server/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
open module io.vertx.tests.server {
requires com.google.protobuf;
requires com.google.common;
requires io.grpc;
requires io.grpc;
requires io.grpc.stub;
requires io.grpc.util;
requires io.grpc.protobuf;
requires io.vertx.core;
requires io.vertx.grpc.common;
requires io.vertx.grpc.common;
requires io.vertx.grpc.server;
requires io.vertx.testing.unit;
requires io.vertx.tests.common;
requires junit;
requires testcontainers;
requires com.google.protobuf.util;
requires io.vertx.grpc.transcoding;
requires com.google.protobuf.util;
requires com.google.protobuf;
}
Loading

0 comments on commit 4441529

Please sign in to comment.