diff options
author | Yilun Chong <yilunchong@google.com> | 2017-06-30 17:22:32 -0700 |
---|---|---|
committer | Yilun Chong <yilunchong@google.com> | 2017-06-30 17:22:32 -0700 |
commit | 3adb054bbfa83530ca5a5fd54a856755fd72af83 (patch) | |
tree | 4d09a00969cdc7833dca181d6910b79f5ac877ae /conformance/ConformanceJava.java | |
parent | a7d5be6a910caabc4b26d73bc5c369dbc638c4c3 (diff) |
add some test proto2 supported, add js proto2 supported, fixed some error
Diffstat (limited to 'conformance/ConformanceJava.java')
-rw-r--r-- | conformance/ConformanceJava.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/conformance/ConformanceJava.java b/conformance/ConformanceJava.java index 15aaed96..596d113a 100644 --- a/conformance/ConformanceJava.java +++ b/conformance/ConformanceJava.java @@ -5,7 +5,7 @@ import com.google.protobuf.CodedInputStream; import com.google.protobuf.conformance.Conformance; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf_test_messages.proto3.TestMessagesProto3; -import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypes; +import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypesProto3; import com.google.protobuf_test_messages.proto2.TestMessagesProto2; import com.google.protobuf_test_messages.proto2.TestMessagesProto2.TestAllTypesProto2; import com.google.protobuf.ExtensionRegistry; @@ -205,7 +205,7 @@ class ConformanceJava { private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { com.google.protobuf.AbstractMessage testMessage; - boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypes"); + boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3"); boolean isProto2 = request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); switch (request.getPayloadCase()) { @@ -214,7 +214,7 @@ class ConformanceJava { try { ExtensionRegistry extensions = ExtensionRegistry.newInstance(); TestMessagesProto3.registerAllExtensions(extensions); - testMessage = parseBinary(request.getProtobufPayload(), TestAllTypes.parser(), extensions); + testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto3.parser(), extensions); } catch (InvalidProtocolBufferException e) { return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); } @@ -233,7 +233,8 @@ class ConformanceJava { } case JSON_PAYLOAD: { try { - TestMessagesProto3.TestAllTypes.Builder builder = TestMessagesProto3.TestAllTypes.newBuilder(); + TestMessagesProto3.TestAllTypesProto3.Builder builder = + TestMessagesProto3.TestAllTypesProto3.newBuilder(); JsonFormat.parser().usingTypeRegistry(typeRegistry) .merge(request.getJsonPayload(), builder); testMessage = builder.build(); @@ -301,7 +302,7 @@ class ConformanceJava { public void run() throws Exception { typeRegistry = TypeRegistry.newBuilder().add( - TestMessagesProto3.TestAllTypes.getDescriptor()).build(); + TestMessagesProto3.TestAllTypesProto3.getDescriptor()).build(); while (doTestIo()) { this.testCount++; } |