| 1 | ## Testing Prerequisites |
| 2 | |
| 3 | ### Install CCM |
| 4 | |
| 5 | pip install ccm |
| 6 | |
| 7 | ### Setup CCM Loopbacks (required for OSX) |
| 8 | |
| 9 | # For basic ccm |
| 10 | sudo ifconfig lo0 alias 127.0.0.2 up |
| 11 | sudo ifconfig lo0 alias 127.0.0.3 up |
| 12 | |
| 13 | # Additional loopbacks for java-driver testing |
| 14 | sudo ifconfig lo0 alias 127.0.1.1 up |
| 15 | sudo ifconfig lo0 alias 127.0.1.2 up |
| 16 | sudo ifconfig lo0 alias 127.0.1.3 up |
| 17 | sudo ifconfig lo0 alias 127.0.1.4 up |
| 18 | sudo ifconfig lo0 alias 127.0.1.5 up |
| 19 | sudo ifconfig lo0 alias 127.0.1.6 up |
| 20 | |
| 21 | |
| 22 | |
| 23 | ## Building the Driver |
| 24 | |
| 25 | mvn clean package |
| 26 | |
| 27 | |
| 28 | |
| 29 | ## Testing the Driver |
| 30 | |
| 31 | ### Unit Tests |
| 32 | |
| 33 | Use the following command to run only the unit tests: |
| 34 | |
| 35 | mvn test |
| 36 | |
| 37 | _**Estimated Run Time**: x minutes_ |
| 38 | |
| 39 | ### Integration Tests |
| 40 | |
| 41 | The following command runs the full set of unit and integration tests: |
| 42 | |
| 43 | mvn verify |
| 44 | |
| 45 | _**Estimated Run Time**: 4 minutes_ |
| 46 | |
| 47 | ### Coverage Report |
| 48 | |
| 49 | The following command runs the full set of integration tests and produces a |
| 50 | coverage report: |
| 51 | |
| 52 | mvn cobertura:cobertura |
| 53 | |
| 54 | Coverage report can be found at: |
| 55 | |
| 56 | driver-core/target/site/cobertura/index.html |
| 57 | |
| 58 | _**Estimated Run Time**: 4 minutes_ |
| 59 | |
| 60 | |
| 61 | |
| 62 | ## Test Utility |
| 63 | |
| 64 | `testing/bin/coverage` exists to make testing a bit more straight-forward. |
| 65 | |
| 66 | The main commands are as follows: |
| 67 | |
| 68 | Displays the available parameters: |
| 69 | |
| 70 | testing/bin/coverage --help |
| 71 | |
| 72 | Runs all the integration tests, creates the Cobertura report, and uploads Cobertura |
| 73 | site to a remote machine, if applicable: |
| 74 | |
| 75 | testing/bin/coverage |
| 76 | |
| 77 | Runs a single integration test along with the Cobertura report for that test: |
| 78 | |
| 79 | testing/bin/coverage --test TestClass[#optionalTestMethod] |