aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-09 21:21:01 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-08-09 21:21:01 -0700
commitacd5b05e9f1ec2153574807463af0612267b6067 (patch)
tree7f0d6bee5ea04e9f3e8e8ce9be5b168d5ff5c05d /java
parent8e4fd1b4e8a1b29faefaff1ce794b7a2f607d994 (diff)
downloadprotobuf-acd5b05e9f1ec2153574807463af0612267b6067.tar.gz
protobuf-acd5b05e9f1ec2153574807463af0612267b6067.tar.bz2
protobuf-acd5b05e9f1ec2153574807463af0612267b6067.zip
Fix failing tests.
1. Fix C++ tests. * Add missing files to Makefile.am and fix distcheck in tests.sh * Remove BUILT_SOURCES from conformance/Makefile.am. * Add some missing override keyword. * Add a type cast to int64 because our StrCat() in stubs can't handle size_t. 2. Fix Java tests. * Add missing test dependency on guava in pom.xml. * Include newly referenced test data in test resources. * Manually fix map_lite_test.proto which is overwritten because it's mapped from map_test.proto in google3. * Add back "optimize_for = LITE_RUNTIME" which is still needed to keep the opensource test passing as it's still running lite tests. * Add a type cast in newBuilder() because without it the code doesn't compile with openjdk javac 1.8 (the compiler can't figure if it's the right type due to complex generic typing). 3. Fix Python tests. * Remove/replace references to <hash_map>. * Suppress more warnings in setup.py. * Replace incorrect header inclusion for google/protobuf/proto_api.h. * Add strings::EndsWith to google/protobuf/stubs/strutil.h because it's referenced in the updated python C extension code. * Replace proto2 with google::protobuf. The proto2 name is leaked to opensource because we removed the subsitition rule for proto2 namespace but only fixed C++ source code and forgot to update python C extension code.
Diffstat (limited to 'java')
-rw-r--r--java/core/pom.xml14
-rw-r--r--java/core/src/test/proto/com/google/protobuf/map_lite_test.proto5
-rw-r--r--java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto1
-rw-r--r--java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto1
4 files changed, 19 insertions, 2 deletions
diff --git a/java/core/pom.xml b/java/core/pom.xml
index 0c0fd8ff..9dbaff15 100644
--- a/java/core/pom.xml
+++ b/java/core/pom.xml
@@ -34,6 +34,11 @@
<artifactId>easymockclassextension</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -57,6 +62,15 @@
</includes>
</resource>
</resources>
+ <testResources>
+ <testResource>
+ <directory>${protobuf.source.dir}</directory>
+ <includes>
+ <include>google/protobuf/testdata/golden_message_oneof_implemented</include>
+ <include>google/protobuf/testdata/golden_packed_fields_message</include>
+ </includes>
+ </testResource>
+ </testResources>
<plugins>
<!-- Use Antrun plugin to generate sources with protoc -->
diff --git a/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto b/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto
index bc2105e5..c04f5d57 100644
--- a/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto
+++ b/java/core/src/test/proto/com/google/protobuf/map_lite_test.proto
@@ -30,9 +30,10 @@
syntax = "proto3";
-package map_test;
+package map_lite_test;
-option java_package = "map_test";
+option optimize_for = LITE_RUNTIME;
+option java_package = "map_lite_test";
option java_outer_classname = "MapTestProto";
message TestMap {
diff --git a/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto b/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto
index 6793d6b7..a95c38b2 100644
--- a/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto
+++ b/java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto
@@ -38,6 +38,7 @@ syntax = "proto2";
package protobuf_unittest;
+option optimize_for = LITE_RUNTIME;
import "com/google/protobuf/non_nested_extension_lite.proto";
diff --git a/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto b/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto
index e42faaa8..37c369ed 100644
--- a/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto
+++ b/java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto
@@ -36,6 +36,7 @@ syntax = "proto2";
package protobuf_unittest;
+option optimize_for = LITE_RUNTIME;
message MessageLiteToBeExtended {
extensions 1 to max;