Question

I have a successfully running suite of integration tests using PaxExam. I run the tests using Maven. The purpose of the tests is to test REST web services implemented through Apache CXF running in Karaf.

The tests run on my machine but fail during Jenkins build due to port conflict. The CXF uses port 8181 which seems to be the default Jetty port. Is there a way to change this port declaratively or programmatically in the tests suite?

I tried using a variety of PaxExam options listed here:

http://team.ops4j.org/wiki/display/PAXEXAM3/Configuration+Options, but to no avail.

Thank you.

Was it helpful?

Solution

Do you use Pax-Exam-Karaf or do you use plain Pax-Exam, if it's Pax-Exam-Karaf use the following for your configuration:

KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.pax.web.cfg",
 "org.osgi.service.http.port", "alternative-port"),

if it's plain Pax-Exam:

systemProperty("org.osgi.service.http.port").value("8181")

You might also take a look on how Karaf does it's regression testing at Karaf Regression Test or take a look at the pax-web itests at Pax-Web Integration Tests

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top