Skip to content

Commit

Permalink
Code cleanup. Move tests from directory demos to deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsearls committed Sep 6, 2023
1 parent 0e8516b commit 7cc2104
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 14 deletions.
1 change: 0 additions & 1 deletion demos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

<modules>
<module>legacy-wildfly-shrinkwrap-example</module>
<module>ws-bootable-jar-example</module>
</modules>

</project>
1 change: 1 addition & 0 deletions deployments/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<module>intersmash-deployments-shared</module>
<module>intersmash-deployments-provider</module>
<module>openshift-jakarta-sample-standalone</module>
<module>ws-bootable-jar-example</module>
</modules>

<properties>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

@WebService(targetNamespace = "http://org.jboss.ws/cxf/container")
public interface Endpoint {
/**

@WebMethod
public String greetings(String time);
**/

@WebMethod
String ping();
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

@WebService(serviceName = "EndpointServiceSERVICE", name = "EndpointService", portName = "EndpointService", endpointInterface = "org.jboss.jaxws.Endpoint", targetNamespace = "http://org.jboss.ws/cxf/container")
public class EndpointImpl implements Endpoint {
/**
@WebMethod
public String greetings(String input) {
return input + ", hello from WildFly bootable jar!";
return input + ", hello from WildFly bootable jar!";
}
**/

@WebMethod
//@Override
public String ping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SoapWildflyBootableOpenShiftJarTest {
private String appOpenShiftUrl;

@Test
public void testNameChange() throws Exception {
public void testPing() throws Exception {
URL baseURL = new URL(appOpenShiftUrl + "/EndpointServiceSERVICE");
QName serviceName = new QName("http://org.jboss.ws/cxf/container", "EndpointServiceSERVICE");
URL wsdlURL = new URL(baseURL + "?wsdl");
Expand All @@ -58,4 +58,20 @@ public void testNameChange() throws Exception {
String greeting = proxy.ping();
Assertions.assertThat(greeting).contains("pong");
}

@Test
public void testGreet() throws Exception {
URL baseURL = new URL(appOpenShiftUrl + "/EndpointServiceSERVICE");
QName serviceName = new QName("http://org.jboss.ws/cxf/container", "EndpointServiceSERVICE");
URL wsdlURL = new URL(baseURL + "?wsdl");
jakarta.xml.ws.Service service = jakarta.xml.ws.Service.create(wsdlURL, serviceName);

Endpoint proxy = service.getPort(Endpoint.class);

BindingProvider bp = (BindingProvider) proxy;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, baseURL.toExternalForm());

String greeting = proxy.greetings("Bob");
Assertions.assertThat(greeting).contains("Bob, hello from WildFly");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<packaging>pom</packaging>

<modules>
<!-- <module>jaxrs</module> -->
<module>jaxws</module> <!-- -->
<module>jaxrs</module>
<module>jaxws</module>
</modules>

<properties>
Expand All @@ -31,8 +31,8 @@
<wildfly-maven-plugin.version>4.0.0.Final</wildfly-maven-plugin.version>
<version.maven-war-plugin>3.3.2</version.maven-war-plugin>
<!--
Default version for the Bootable JAR Plugin is set here and can be overridden, e.g. also for pulling
the productized version
Default version for the Bootable JAR Plugin is set here and can be overridden,
e.g. also for pulling the productized version
-->
<version.wildfly-jar-maven-plugin>8.0.0.Final</version.wildfly-jar-maven-plugin>

Expand Down Expand Up @@ -181,7 +181,7 @@
<version>${version.maven-war-plugin}</version>
<configuration>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
<warName>ROOT.war</warName>
<warName>ROOT</warName>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -213,7 +213,6 @@
<jboss-fork-embedded>true</jboss-fork-embedded>
</plugin-options>
</configuration>

</plugin>
</plugins>
</pluginManagement>
Expand All @@ -233,7 +232,7 @@
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<!-- Two package goals - OpenShift and bare metal but we still need to
<!-- Two package goals - OpenShift and bare metal, but we still need to
ensure that artifacts are installed correctly into maven repo -->
<executions>
<execution>
Expand Down

0 comments on commit 7cc2104

Please sign in to comment.