Skip to content

Commit

Permalink
Fabio's fixes. Code cleanup. Move tests from directory demos to deplo…
Browse files Browse the repository at this point in the history
…yments.
  • Loading branch information
rsearls committed Sep 6, 2023
1 parent 7b37797 commit 1a66edc
Show file tree
Hide file tree
Showing 26 changed files with 149 additions and 123 deletions.
4 changes: 4 additions & 0 deletions demos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
<artifactId>intersmash-demos</artifactId>
<packaging>pom</packaging>

<modules>
<module>legacy-wildfly-shrinkwrap-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
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@


<properties>
<formatting-style-base-directory>${project.parent.parent.parent.basedir}/ide-config</formatting-style-base-directory>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@


<properties>
<formatting-style-base-directory>${project.parent.parent.parent.basedir}/ide-config</formatting-style-base-directory>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
import jakarta.jws.WebService;

@WebService(targetNamespace = "http://org.jboss.ws/cxf/container")
public interface Endpoint
{
/**
@WebMethod
public String greetings(String time);
**/
@WebMethod
public String ping();
public interface Endpoint {

@WebMethod
public String greetings(String time);

@WebMethod
String ping();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@
*/
package org.jboss.jaxws;

import jakarta.jws.WebMethod;
import jakarta.jws.WebService;

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

@WebMethod
//@Override
public String ping() {
return "pong";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd
/jboss-web_4_0.dtd">
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
<jboss-web>
<context-root>ROOT-jaxws</context-root>
<context-root></context-root>
</jboss-web>
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,18 @@
*/
package org.jboss.jaxws;

import jakarta.xml.ws.BindingProvider;

import java.net.URL;
import javax.xml.namespace.QName;

import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.core.Response;
import javax.xml.namespace.QName;

import org.assertj.core.api.Assertions;
import org.jboss.intersmash.tools.annotations.Intersmash;
import org.jboss.intersmash.tools.annotations.Service;
import org.jboss.intersmash.tools.annotations.ServiceUrl;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.jboss.jaxws.Endpoint;

import cz.xtf.core.http.Https;
import lombok.extern.slf4j.Slf4j;

@Slf4j
Expand All @@ -47,17 +43,35 @@ public class SoapWildflyBootableOpenShiftJarTest {
@ServiceUrl(SoapWildflyBootableOpenShiftJarApplication.class)
private String appOpenShiftUrl;

private final String CONTEXT_ROOT = "/ROOT-jaxws";

@Test
public void testNameChange() throws Exception{
appOpenShiftUrl = "http://localhost:8080"; // rls test
URL baseURL = new URL(appOpenShiftUrl + CONTEXT_ROOT + "/EndpointServiceSERVICE");
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");
jakarta.xml.ws.Service service = jakarta.xml.ws.Service.create(wsdlURL, serviceName);

Endpoint proxy = service.getPort(Endpoint.class);
String greeting = proxy.ping();

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

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
@@ -0,0 +1,2 @@
cz.xtf.junit5.listeners.TestExecutionLogger
cz.xtf.junit5.listeners.ProjectCreator
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>

<configuration>
<!-- APPENDERS LIST -->
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${console-log-level:-INFO}</level>
</filter>
<encoder>
<pattern>[%d] %-5p- %m%n</pattern>
</encoder>
</appender>
<appender name="asyncConsoleAppender" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>300</queueSize>
<appender-ref ref="consoleAppender"/>
</appender>

<appender name="testAppender" class="ch.qos.logback.core.FileAppender">
<file>log/test.log</file>
<append>false</append>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
<encoder>
<pattern>[%d] %-5level [%thread]: %message%n</pattern>
</encoder>
</appender>
<appender name="asyncTestAppender" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>300</queueSize>
<appender-ref ref="testAppender"/>
</appender>

<appender name="defaulAppender" class="ch.qos.logback.core.FileAppender">
<file>log/everything.log</file>
<append>false</append>
<encoder>
<pattern>[%d] %-5p- %m%n</pattern>
</encoder>
</appender>
<appender name="asyncDefaulAppender" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>300</queueSize>
<appender-ref ref="defaulAppender"/>
</appender>

<!-- LOGGER LIST -->
<logger name="cz.xtf" level="DEBUG">
<appender-ref ref="asyncTestAppender"/>
<appender-ref ref="asyncConsoleAppender"/>
</logger>

<logger name="org.jboss.intersmash.tools" level="DEBUG">
<appender-ref ref="asyncTestAppender"/>
<appender-ref ref="asyncConsoleAppender"/>
</logger>

<root level="INFO">
<appender-ref ref="asyncDefaulAppender"/>
</root>
</configuration>
Loading

0 comments on commit 1a66edc

Please sign in to comment.