Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: third_party/protobuf/conformance/ConformanceJavaLite.java

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/protobuf/conformance/ConformanceJava.java ('k') | third_party/protobuf/conformance/Makefile.am » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/conformance/ConformanceJavaLite.java
diff --git a/third_party/protobuf/conformance/ConformanceJava.java b/third_party/protobuf/conformance/ConformanceJavaLite.java
similarity index 71%
copy from third_party/protobuf/conformance/ConformanceJava.java
copy to third_party/protobuf/conformance/ConformanceJavaLite.java
index a983ba3c8a6b1f37978daa84730b85e04eda8dc9..121dc7d1b6a1757b22537d00a2abcb485a081f91 100644
--- a/third_party/protobuf/conformance/ConformanceJava.java
+++ b/third_party/protobuf/conformance/ConformanceJavaLite.java
@@ -1,12 +1,9 @@
import com.google.protobuf.conformance.Conformance;
-import com.google.protobuf.util.JsonFormat;
-import com.google.protobuf.util.JsonFormat.TypeRegistry;
import com.google.protobuf.InvalidProtocolBufferException;
-class ConformanceJava {
+class ConformanceJavaLite {
private int testCount = 0;
- private TypeRegistry typeRegistry;
private boolean readFromStdin(byte[] buf, int len) throws Exception {
int ofs = 0;
@@ -60,15 +57,8 @@ class ConformanceJava {
break;
}
case JSON_PAYLOAD: {
- try {
- Conformance.TestAllTypes.Builder builder = Conformance.TestAllTypes.newBuilder();
- JsonFormat.parser().usingTypeRegistry(typeRegistry)
- .merge(request.getJsonPayload(), builder);
- testMessage = builder.build();
- } catch (InvalidProtocolBufferException e) {
- return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
- }
- break;
+ return Conformance.ConformanceResponse.newBuilder().setSkipped(
+ "Lite runtime does not suport Json Formant.").build();
}
case PAYLOAD_NOT_SET: {
throw new RuntimeException("Request didn't have payload.");
@@ -87,13 +77,8 @@ class ConformanceJava {
return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(testMessage.toByteString()).build();
case JSON:
- try {
- return Conformance.ConformanceResponse.newBuilder().setJsonPayload(
- JsonFormat.printer().usingTypeRegistry(typeRegistry).print(testMessage)).build();
- } catch (InvalidProtocolBufferException | IllegalArgumentException e) {
- return Conformance.ConformanceResponse.newBuilder().setSerializeError(
- e.getMessage()).build();
- }
+ return Conformance.ConformanceResponse.newBuilder().setSkipped(
+ "Lite runtime does not suport Json Formant.").build();
default: {
throw new RuntimeException("Unexpected request output.");
@@ -126,17 +111,15 @@ class ConformanceJava {
}
public void run() throws Exception {
- typeRegistry = TypeRegistry.newBuilder().add(
- Conformance.TestAllTypes.getDescriptor()).build();
while (doTestIo()) {
- // Empty.
+ this.testCount++;
}
- System.err.println("ConformanceJava: received EOF from test runner after " +
+ System.err.println("ConformanceJavaLite: received EOF from test runner after " +
this.testCount + " tests");
}
public static void main(String[] args) throws Exception {
- new ConformanceJava().run();
+ new ConformanceJavaLite().run();
}
}
« no previous file with comments | « third_party/protobuf/conformance/ConformanceJava.java ('k') | third_party/protobuf/conformance/Makefile.am » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698