Skip to content

Commit

Permalink
Jakarta flavor of CXF #5
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Mar 28, 2024
1 parent cbdc238 commit 6dd848a
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 14 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 3.0-M3

* #5 Jakarta flavor of CXF
* #6 Upgrade CXF 3.x to 3.6.3

## 2.0.B1
Expand Down
4 changes: 2 additions & 2 deletions bootique-cxf-jakarta-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@

<!-- Unit test dependencies -->
<dependency>
<groupId>io.bootique</groupId>
<artifactId>bootique-junit5</artifactId>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-jakarta-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import org.apache.http.HttpResponse;
Expand All @@ -36,14 +37,17 @@
@BQTest
public class CxfJaxrsModuleDefaultIT {

static final JettyTester jetty = JettyTester.create();

@BQApp
final BQRuntime app = Bootique.app("-s")
.autoLoadModules()
.module(jetty.moduleReplacingConnectors())
.createRuntime();

@Test
public void response() throws IOException {
HttpResponse response = Request.Get("http://localhost:8080/").execute().returnResponse();
HttpResponse response = Request.Get(jetty.getUrl()).execute().returnResponse();

assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
assertEquals("CXF REST API Module", EntityUtils.toString(response.getEntity()));
Expand Down
4 changes: 2 additions & 2 deletions bootique-cxf-jakarta-jaxws-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

<!-- Unit test dependencies -->
<dependency>
<groupId>io.bootique</groupId>
<artifactId>bootique-junit5</artifactId>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-jakarta-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.cxf.CxfModule;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import jakarta.xml.ws.Endpoint;
Expand All @@ -15,9 +16,12 @@
@BQTest
public class SimpleJavaFirstIT {

static final JettyTester jetty = JettyTester.create();

@BQApp
static final BQRuntime app = Bootique.app("-s")
.autoLoadModules()
.module(jetty.moduleReplacingConnectors())
.module(b -> {

CxfModule.extend(b).addFeature(LoggingFeature.class);
Expand All @@ -32,7 +36,7 @@ public class SimpleJavaFirstIT {
public void simpleService() {

JaxWsProxyFactoryBean proxyFactoryBean = new JaxWsProxyFactoryBean();
proxyFactoryBean.setAddress("http://localhost:8080/test");
proxyFactoryBean.setAddress(jetty.getUrl() + "/test");
HelloWorld helloWorldClient = proxyFactoryBean.create(HelloWorld.class);

String responseFromClient = helloWorldClient.sayHi("Simple Client");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.cxf.CxfModule;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import org.apache.cxf.ext.logging.LoggingFeature;
Expand All @@ -25,9 +26,12 @@
@BQTest
public class WsdlFirstIT {

static final JettyTester jetty = JettyTester.create();

@BQApp
static final BQRuntime app = Bootique.app("-s")
.autoLoadModules()
.module(jetty.moduleReplacingConnectors())
.module(binder -> {
// adding logging for both client and a server
CxfModule.extend(binder).addFeature(LoggingFeature.class);
Expand All @@ -45,7 +49,7 @@ public class WsdlFirstIT {

@BeforeAll
public static void setUp() throws Exception {
String wsdlLoc = "http://localhost:8080/test?wsdl";
String wsdlLoc = jetty.getUrl() + "/test?wsdl";
CustomerServiceService service = new CustomerServiceService(new URL(wsdlLoc));
CLIENT = service.getCustomerServicePort();
}
Expand Down
4 changes: 2 additions & 2 deletions bootique-cxf-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@

<!-- Unit test dependencies -->
<dependency>
<groupId>io.bootique</groupId>
<artifactId>bootique-junit5</artifactId>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import org.apache.http.HttpResponse;
Expand All @@ -36,14 +37,17 @@
@BQTest
public class CxfJaxrsModuleDefaultIT {

static final JettyTester jetty = JettyTester.create();

@BQApp
final BQRuntime app = Bootique.app("-s")
.autoLoadModules()
.module(jetty.moduleReplacingConnectors())
.createRuntime();

@Test
public void response() throws IOException {
HttpResponse response = Request.Get("http://localhost:8080/").execute().returnResponse();
HttpResponse response = Request.Get(jetty.getUrl()).execute().returnResponse();

assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
assertEquals("CXF REST API Module", EntityUtils.toString(response.getEntity()));
Expand Down
4 changes: 2 additions & 2 deletions bootique-cxf-jaxws-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

<!-- Unit test dependencies -->
<dependency>
<groupId>io.bootique</groupId>
<artifactId>bootique-junit5</artifactId>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.cxf.CxfModule;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import org.apache.cxf.ext.logging.LoggingFeature;
Expand All @@ -16,9 +17,12 @@
@BQTest
public class SimpleJavaFirstIT {

static final JettyTester jetty = JettyTester.create();

@BQApp
static final BQRuntime app = Bootique.app("-s")
.autoLoadModules()
.module(jetty.moduleReplacingConnectors())
.module(b -> {

CxfModule.extend(b).addFeature(LoggingFeature.class);
Expand All @@ -33,7 +37,7 @@ public class SimpleJavaFirstIT {
public void simpleService() {

JaxWsProxyFactoryBean proxyFactoryBean = new JaxWsProxyFactoryBean();
proxyFactoryBean.setAddress("http://localhost:8080/test");
proxyFactoryBean.setAddress(jetty.getUrl() + "/test");
HelloWorld helloWorldClient = proxyFactoryBean.create(HelloWorld.class);

String responseFromClient = helloWorldClient.sayHi("Simple Client");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.cxf.CxfModule;
import io.bootique.jetty.junit5.JettyTester;
import io.bootique.junit5.BQApp;
import io.bootique.junit5.BQTest;
import org.apache.cxf.ext.logging.LoggingFeature;
Expand All @@ -25,9 +26,12 @@
@BQTest
public class WsdlFirstIT {

static final JettyTester jetty = JettyTester.create();

@BQApp
static final BQRuntime app = Bootique.app("-s")
.autoLoadModules()
.module(jetty.moduleReplacingConnectors())
.module(binder -> {
// adding logging for both client and a server
CxfModule.extend(binder).addFeature(LoggingFeature.class);
Expand All @@ -45,7 +49,7 @@ public class WsdlFirstIT {

@BeforeAll
public static void setUp() throws Exception {
String wsdlLoc = "http://localhost:8080/test?wsdl";
String wsdlLoc = jetty.getUrl() + "/test?wsdl";
CustomerServiceService service = new CustomerServiceService(new URL(wsdlLoc));
CLIENT = service.getCustomerServicePort();
}
Expand Down
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
<artifactId>bootique-junit5</artifactId>
<version>${bootique.version}</version>
</dependency>
<dependency>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-junit5</artifactId>
<version>${bootique.version}</version>
</dependency>
<dependency>
<groupId>io.bootique.jetty</groupId>
<artifactId>bootique-jetty-jakarta-junit5</artifactId>
<version>${bootique.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down

0 comments on commit 6dd848a

Please sign in to comment.