Skip to content

JAVA-1133: Add OSGi headers to cassandra-driver-extras.#635

Merged
olim7t merged 1 commit into
3.0.xfrom
java1133
Apr 26, 2016
Merged

JAVA-1133: Add OSGi headers to cassandra-driver-extras.#635
olim7t merged 1 commit into
3.0.xfrom
java1133

Conversation

@adutra
Copy link
Copy Markdown
Contributor

@adutra adutra commented Mar 24, 2016

The problem was simply due to the fact that this module had a packaging type of jar instead of bundle.

This commit also improves OSGi tests in driver-examples/osgi:

  1. Included driver-mapping and driver-extras as a dependency.
    Tests now also validate that these modules are fully operational when accessed from within an OSGi container.

  2. Split tests in different classes for a better reporting (different test names for each configuration)

  3. Updated pax-exam to 4.8.0.

  4. Added Guava 19 as a supported Guava version for all bundles (driver-core, driver-mapping, driver-extras and driver-osgi).
    Tests in driver-examples/osgi now also test a configuration including Guava 19.0 explicitly.

  5. Removed log4j dependency from parent pom.
    This can lead to multiple bindings on the classpath if some submodules (e.g. osgi) use a different logging backend.

  6. Updated logback configuration file in osgi module.

  7. Added project.reporting.outputEncoding Maven property in osgi pom file (Failsafe plugin requires it).

  8. Deleted GuavaSanityCheckNegativeIT.

Caused by: java.lang.ClassNotFoundException: Unable to load class 'xxx' because the bundle wiring for xxx is no longer valid.
Although ugly, they are harmless and can be safely ignored.
*/
Thread.sleep(10000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the sleep need to be 10 seconds? Is it because that's how often the ThreadDeathWatcher does its check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose 10 secs thinking that in our current Jenkins CI this could be necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, makes sense. The exception doesn't really cause any particular issues right other than being logged? I've encountered it in the past, but seems everything continues to work with it (just curious on its impact).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think of it, the exception isn't harmful, so we could lower the the sleep to 1 or 2 seconds, which is more than enough when running tests on a macbook.

@tolbertam
Copy link
Copy Markdown
Contributor

This looks excellent, 👍

@tolbertam
Copy link
Copy Markdown
Contributor

We should wait to merge this until after #636 as it looks like jdk7 is failing to compile extras, which causes OSGi tests to fail.

@tolbertam
Copy link
Copy Markdown
Contributor

I tried rebasing this on #636 and everything worked great. There were a few conflicts in pom.xml but they were pretty easy to overcome. I think after merging that branch this one should be good to rebase and merge as well.

Comment thread driver-examples/osgi/pom.xml Outdated
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<felix.version>4.6.0</felix.version>
<pax-exam.version>3.6.0</pax-exam.version>
<pax-exam.version>4.8.0</pax-exam.version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it looks like 4.8.0 requires JDK 7, didn't catch this because our CI bypasses build failures (I should probably look into fixing that). Switching back to 3.6.0 seems to work fine, do you think we should switch back?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah darn :( sorry for not verifying this. I will revert back and see if the tests compile/pass.

The problem was simply due to the fact that this module had a packaging type of jar instead of bundle.

This commit also improves OSGi tests in driver-examples/osgi:

1) Included driver-mapping and driver-extras as a dependency.
Tests now also validate that these modules are fully operational when accessed from within an OSGi container.

2) Split tests in different classes for a better reporting (different test names for each configuration)

3) Added Guava 19 as a supported Guava version for all bundles (driver-core, driver-mapping, driver-extras and driver-osgi).
Tests in driver-examples/osgi now also test a configuration including Guava 19.0 explicitly.

4) Removed log4j dependency from parent pom.
This can lead to multiple bindings on the classpath if some submodules (e.g. osgi) use a different logging backend.

5) Updated logback configuration file in osgi module.

6) Added project.reporting.outputEncoding Maven property in osgi pom file (Failsafe plugin requires it).

7) Deleted GuavaSanityCheckNegativeIT.
@olim7t olim7t merged commit 3ae8d2f into 3.0.x Apr 26, 2016
@olim7t olim7t deleted the java1133 branch April 26, 2016 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants