| 1 | # OSGi Tests |
| 2 | |
| 3 | A collection of simple tests for the Java Driver in an OSGi environment. |
| 4 | |
| 5 | This project is mainly intended as a tool for validating |
| 6 | that each new release of the driver is fully OSGi-compatible. |
| 7 | It is _not_ meant as an example application. |
| 8 | |
| 9 | If you are looking for examples demonstrating usage of the driver in an OSGi |
| 10 | environment, please refer to our [OSGi examples repository]. |
| 11 | |
| 12 | [OSGi examples repository]:https://github.com/datastax/java-driver-examples-osgi |
| 13 | |
| 14 | ## Usage |
| 15 | |
| 16 | `MailboxService` is an OSGi service that uses Cassandra to |
| 17 | store messages that can be retrieved by email address. |
| 18 | |
| 19 | Before running the tests, there are some prerequisites that must be met: |
| 20 | |
| 21 | The tests in this module will try to locate and load the following artifacts: |
| 22 | |
| 23 | 1. The jars of 3 dependent modules: |
| 24 | `driver-core`, `driver-mapping` and `driver-extras`. |
| 25 | These are expected to be found in their respective `target` directory; |
| 26 | 2. The test-jar for `driver-core`. Tests will attempt to load it from your local Maven repository. |
| 27 | |
| 28 | Therefore, before you can launch the tests, it is required to run `mvn install` |
| 29 | first _on the entire project_ to make sure all the above artifacts will be present. |
| 30 | |
| 31 | If the above prerequisites are met, then it is possible to build |
| 32 | this project and run its tests by executing the following Maven goal: |
| 33 | |
| 34 | mvn verify -P short |
| 35 | |
| 36 | The "short" profile needs to be activated since the tests run under |
| 37 | this group. |
| 38 | |
| 39 | Once `mvn verify` completes, the bundle jar will be present in the `target/` directory. |
| 40 | |
| 41 | The project includes integration tests that verify that the service can |
| 42 | be activated and used in an OSGi container. It also verifies that |
| 43 | the Java driver can be used in an OSGi container in the following |
| 44 | configurations: |
| 45 | |
| 46 | 1. Default (default classifier with all dependencies) |
| 47 | 2. Netty-Shaded (shaded classifier with all dependencies w/o Netty) |
| 48 | 5. Guava 17 |
| 49 | 6. Guava 18 |
| 50 | 7. Guava 19 |