OLD | NEW |
(Empty) | |
| 1 # Protobuf Java Compatibility Tests |
| 2 |
| 3 This directory contains tests to ensure protobuf library is compatible with |
| 4 previously released versions. |
| 5 |
| 6 ## Directory Layout |
| 7 |
| 8 For each released protobuf version we are testing compatibility with, there |
| 9 is a sub-directory with the following layout (take v2.5.0 as an example): |
| 10 |
| 11 * v2.5.0 |
| 12 * test.sh |
| 13 * pom.xml |
| 14 * protos/ - unittest protos. |
| 15 * more_protos/ - unittest protos that import the ones in "protos". |
| 16 * tests/ - actual Java test classes. |
| 17 |
| 18 The testing code is extracted from regular protobuf unittests by removing: |
| 19 |
| 20 * tests that access package private methods/classes. |
| 21 * tests that are known to be broken by an intended behavior change (e.g., we |
| 22 changed the parsing recursion limit from 64 to 100). |
| 23 * all lite runtime tests. |
| 24 |
| 25 It's also divided into 3 submodule with tests depending on more_protos and |
| 26 more_protos depending on protos. This way we can test scenarios where only part |
| 27 of the dependency is upgraded to the new version. |
| 28 |
| 29 ## How to Run The Tests |
| 30 |
| 31 We use a shell script to drive the test of different scenarios so the test |
| 32 will only run on unix-like environments. The script expects a few command |
| 33 line tools to be available on PATH: git, mvn, wget, grep, sed, java. |
| 34 |
| 35 Before running the tests, make sure you have already built the protoc binary |
| 36 following [the C++ installation instructions](../../src/README.md). The test |
| 37 scripts will use the built binary located at ${protobuf}/src/protoc. |
| 38 |
| 39 To start a test, simply run the test.sh script in each version directory. For |
| 40 example: |
| 41 |
| 42 $ v2.5.0/test.sh |
| 43 |
| 44 For each version, the test script will test: |
| 45 |
| 46 * only upgrading protos to the new version |
| 47 * only upgrading more_protos to the new version |
| 48 |
| 49 and see whether everything builds/runs fine. Both source compatibility and |
| 50 binary compatibility will be tested. |
OLD | NEW |