Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a quick, simple IT using PAX to validate OSGi config #159

Open
wants to merge 4 commits into
base: v-1.4.x
Choose a base branch
from

Conversation

wwannemacher
Copy link
Contributor

After the discussion on #156 I thought maybe it would be helpful to add a quick test that loads xstream in an OSGi container. There may be other ways to pull this off, but this is the way that I'm familiar with. It's pretty straightforward - it pretty closely aligns with the tutorial here:
https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/pages/54263846/Getting+Started+with+OSGi+Tests

I am not sure about formatting styles, headers, etc. So just let me know if there are some updates to get in-line.

@coveralls
Copy link

coveralls commented Jul 11, 2019

Coverage Status

Coverage remained the same at 78.394% when pulling deef9d6 on wwannemacher:osgi-it into 31e5f94 on x-stream:v-1.4.x.

@joehni
Copy link
Member

joehni commented Aug 22, 2019

Thanks!

@joehni joehni reopened this Apr 12, 2020
@joehni
Copy link
Member

joehni commented Apr 12, 2020

The it-test fails, if the main artifact of XStream is not yet in the repository. For me it failed now the release, but it fails also if you clean the local repository first of the XStream SNAPSHOTs and run

mvn clean integration-test

@wwannemacher
Copy link
Contributor Author

@joehni - I will have a look at this tonight.

@joehni
Copy link
Member

joehni commented Apr 13, 2020

Thanks, because I have no idea how this really works. I've included the module again in master. Remember, you have to clean your repo of the XStream SNAPSHOTs and for me the build does not break with "mvn clean integration-test", but the test fails.

@joehni
Copy link
Member

joehni commented Mar 20, 2021

Well, "tonight" is long gone, but now it fails for Java 16:

[INFO] Running com.thoughtworks.xstream.OSGiIT
20 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.13.4) created.
72 [main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class com.thoughtworks.xstream.OSGiIT
130 [main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - running test class com.thoughtworks.xstream.OSGiIT
362 [main] INFO org.ops4j.pax.exam.spi.reactors.ReactorManager - suite finished
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.377 s <<< FAILURE! - in com.thoughtworks.xstream.OSGiIT
[ERROR] smokeTest(com.thoughtworks.xstream.OSGiIT)  Time elapsed: 0.229 s  <<< ERROR!
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Unable to make protected boolean java.net.URLStreamHandler.equals(java.net.URL,java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @3e6d8c1c
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected boolean java.net.URLStreamHandler.equals(java.net.URL,java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @3e6d8c1c

Since I have no experience with OSGi nor do I know, how Pax Exam works, all I can do is to disable this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants