kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | f2f4eb8f8405fff4b9c109d15def46f2f4f6469c6458255c9cfcb95020549a8e |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-05-21 17:02 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-05-28 10:27 +02:00 |
| Parents | f2fc528aa397 |
1 file changed
modified CONTRIBUTING.rst +31 −0
| @@ -70,3 +70,34 @@ | ||
| 70 | 70 | - Select ``src/main/config/ide/intellij-code-style.jar``. |
| 71 | 71 | |
| 72 | 72 | This should add a new Code Style scheme called "java-driver". |
| 73 | + | |
| 74 | +Running the tests | |
| 75 | +----------------- | |
| 76 | + | |
| 77 | +We use TestNG. There are 3 test categories: | |
| 78 | + | |
| 79 | +- "unit": pure Java unit tests. | |
| 80 | +- "short" and "long": integration tests that launch Cassandra instances. | |
| 81 | + | |
| 82 | +The Maven build uses profiles named after the categories to choose which tests to run:: | |
| 83 | + | |
| 84 | + mvn test -Pshort | |
| 85 | + | |
| 86 | +The default is "unit". Each profile runs the ones before it ("short" runs unit, etc.) | |
| 87 | + | |
| 88 | +Integration tests use `CCM https://github.com/pcmanus/ccm`_ to bootstrap Cassandra instances. | |
| 89 | +Two Maven properties control its execution: | |
| 90 | + | |
| 91 | +- ``cassandra.version``: the Cassandra version. This has a default value in the root POM, | |
| 92 | + you can override it on the command line (``-Dcassandra.version=...``). | |
| 93 | +- ``ipprefix``: the prefix of the IP addresses that the Cassandra instances will bind to (see | |
| 94 | + below). This defaults to ``127.0.1.``. | |
| 95 | + | |
| 96 | + | |
| 97 | +CCM launches multiple Cassandra instances on localhost by binding to different addresses. The | |
| 98 | +driver uses up to 6 different instances (127.0.1.1 to 127.0.1.6 with the default prefix). | |
| 99 | +You'll need to define loopback aliases for this to work, on Mac OS X your can do it with: | |
| 100 | + | |
| 101 | + sudo ifconfig lo0 alias 127.0.1.1 up | |
| 102 | + sudo ifconfig lo0 alias 127.0.1.2 up | |
| 103 | + ... |