From 88af5ee2fb4cff44a3de2207049246029b37fe64 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Mon, 27 Nov 2023 15:39:14 +0800 Subject: [PATCH] [WFLY-18478]:helloworld-ws Quickstart Common Enhancements CY2023Q3 --- .../workflows/quickstart_helloworld-ws_ci.yml | 14 ++ helloworld-ws/README.adoc | 26 +-- helloworld-ws/pom.xml | 168 +++++------------- .../WEB-INF/{beans.xml => jboss-web.xml} | 15 +- helloworld-ws/src/main/webapp/index.html | 2 +- .../quickstarts/wshelloworld/ClientArqIT.java | 111 ------------ .../as/quickstarts/wshelloworld/ClientIT.java | 2 +- .../wshelloworld/RemoteClientIT.java | 35 ---- .../src/test/resources/arquillian.xml | 36 ---- 9 files changed, 70 insertions(+), 339 deletions(-) create mode 100644 .github/workflows/quickstart_helloworld-ws_ci.yml rename helloworld-ws/src/main/webapp/WEB-INF/{beans.xml => jboss-web.xml} (72%) delete mode 100644 helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java delete mode 100644 helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java delete mode 100644 helloworld-ws/src/test/resources/arquillian.xml diff --git a/.github/workflows/quickstart_helloworld-ws_ci.yml b/.github/workflows/quickstart_helloworld-ws_ci.yml new file mode 100644 index 0000000000..87e1bc9ee0 --- /dev/null +++ b/.github/workflows/quickstart_helloworld-ws_ci.yml @@ -0,0 +1,14 @@ +name: WildFly helloworld-ws Quickstart CI + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths: + - 'helloworld-ws/**' + - '.github/workflows/quickstart_ci.yml' +jobs: + call-quickstart_ci: + uses: ./.github/workflows/quickstart_ci.yml + with: + QUICKSTART_PATH: helloworld-ws + TEST_PROVISIONED_SERVER: true diff --git a/helloworld-ws/README.adoc b/helloworld-ws/README.adoc index 61e6a241d1..7a37ca659d 100644 --- a/helloworld-ws/README.adoc +++ b/helloworld-ws/README.adoc @@ -34,7 +34,7 @@ Review the server log to see useful information about the deployed web service e [source,options="nowrap"] ---- JBWS024061: Adding service endpoint metadata: id=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl - address=http://localhost:8080/{artifactId}/HelloWorldService + address=http://localhost:8080/HelloWorldService implementor=org.jboss.as.quickstarts.wshelloworld.HelloWorldServiceImpl serviceName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorldService portName={http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld}HelloWorld @@ -45,29 +45,7 @@ JBWS024061: Adding service endpoint metadata: id=org.jboss.as.quickstarts.wshell === Access the Application -You can verify that the Web Service is running and deployed correctly by accessing the following URL: http://localhost:8080/{artifactId}/HelloWorldService?wsdl. This URL will display the deployed WSDL endpoint for the Web Service. - -// Testing with Arquillian -include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] - -=== Investigate the Console Output - -When you run the Arquillian tests, Maven prints summary of the performed tests to the console. You should see the following results. - -[source,options="nowrap"] ----- -------------------------------------------------------- -T E S T S -------------------------------------------------------- -Running org.jboss.as.quickstarts.wshelloworld.ClientArqTest -[Client] Requesting the WebService to say Hello. -[WebService] Hello World! -[Client] Requesting the WebService to say Hello to John. -[WebService] Hello John! -[Client] Requesting the WebService to say Hello to John, Mary and Mark. -[WebService] Hello John, Mary & Mark! -Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.988 sec ----- +You can verify that the Web Service is running and deployed correctly by accessing the following URL: http://localhost:8080/HelloWorldService?wsdl. This URL will display the deployed WSDL endpoint for the Web Service. // Undeploy the Quickstart include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] diff --git a/helloworld-ws/pom.xml b/helloworld-ws/pom.xml index 2c13ae6d4c..14b2bcc4d4 100644 --- a/helloworld-ws/pom.xml +++ b/helloworld-ws/pom.xml @@ -43,11 +43,13 @@ - - 30.0.0.Final + 30.0.0.Final - 4.2.0.Final - 5.0.0.Final + + ${version.server} + 5.0.0.Final + 4.2.0.Final + @@ -111,7 +113,7 @@ org.wildfly.bom wildfly-ee-with-tools - ${version.server.bom} + ${version.bom.ee} pom import @@ -134,27 +136,6 @@ test jar - - org.jboss.arquillian.container - arquillian-container-test-spi - test - jar - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet-jakarta - test - - - org.wildfly.arquillian - wildfly-arquillian-common - test - org.wildfly wildfly-jaxws-client-bom @@ -184,24 +165,26 @@ - + + + + + org.wildfly.plugins + wildfly-maven-plugin + ${version.plugin.wildfly} + + + + provisioned-server - - - org.wildfly.arquillian - wildfly-arquillian-container-managed - test - - org.wildfly.plugins wildfly-maven-plugin - ${version.wildfly.maven.plugin} @@ -212,6 +195,7 @@ cloud-server webservices + ROOT.war @@ -221,83 +205,36 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} - - - ${project.build.directory}/server - - - **/RemoteClientIT - - - **/ClientArqIT - **/ClientIT - - - - - - integration-test - - - - - - arq-remote - - - org.wildfly.arquillian - wildfly-arquillian-container-remote - test - - + openshift - org.apache.maven.plugins - maven-surefire-plugin - - - **/RemoteClientIT - - - **/ClientArqIT - **/ClientIT - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} + org.wildfly.plugins + wildfly-maven-plugin + ${version.plugin.wildfly} - - **/ClientIT - - - **/ClientArqIT - **/RemoteClientIT - + + + org.wildfly:wildfly-galleon-pack:${version.server} + + + org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.pack.cloud} + + + + cloud-server + webservices + + ROOT.war - verify + package @@ -306,39 +243,22 @@ - openshift + integration-testing org.apache.maven.plugins - maven-war-plugin - - ${project.artifactId} - - - - org.wildfly.plugins - wildfly-maven-plugin - ${version.wildfly.maven.plugin} + maven-failsafe-plugin - - - org.wildfly:wildfly-galleon-pack:${version.server} - - - org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.cloud.fp} - - - - cloud-server - webservices - - ${project.artifactId}.war + + **/ClientIT + - package + integration-test + verify diff --git a/helloworld-ws/src/main/webapp/WEB-INF/beans.xml b/helloworld-ws/src/main/webapp/WEB-INF/jboss-web.xml similarity index 72% rename from helloworld-ws/src/main/webapp/WEB-INF/beans.xml rename to helloworld-ws/src/main/webapp/WEB-INF/jboss-web.xml index d3ddf148e7..20a5dd9e56 100644 --- a/helloworld-ws/src/main/webapp/WEB-INF/beans.xml +++ b/helloworld-ws/src/main/webapp/WEB-INF/jboss-web.xml @@ -15,10 +15,11 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - + + + / + + diff --git a/helloworld-ws/src/main/webapp/index.html b/helloworld-ws/src/main/webapp/index.html index 144a666967..b00db0d928 100644 --- a/helloworld-ws/src/main/webapp/index.html +++ b/helloworld-ws/src/main/webapp/index.html @@ -21,7 +21,7 @@

helloworld-ws Quickstart

- The helloworld-ws quickstart demonstrates the use of JAX-WS in + The helloworld-ws quickstart demonstrates the use of Jakarta XML Web Services in Red Hat JBoss Enterprise Application Platform as a simple Hello World application.

diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java deleted file mode 100644 index 5ad885a81c..0000000000 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientArqIT.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import static org.junit.Assert.assertEquals; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Simple set of tests for the HelloWorld Web Service to demonstrate accessing the web service using a client - * - * @author lnewson@redhat.com - */ -@RunWith(Arquillian.class) -@RunAsClient -public class ClientArqIT { - /** - * The name of the WAR Archive that will be used by Arquillian to deploy the application. - */ - private static final String APP_NAME = "helloworld-ws"; - /** - * The path of the WSDL endpoint in relation to the deployed web application. - */ - private static final String WSDL_PATH = "HelloWorldService?wsdl"; - - @ArquillianResource - private URL deploymentUrl; - - private HelloWorldService client; - - @Deployment(testable = false) - public static WebArchive createDeployment() { - return ShrinkWrap.create(WebArchive.class, APP_NAME + ".war").addPackage(HelloWorldService.class.getPackage()); - } - - @Before - public void setup() { - try { - client = new Client(new URL(deploymentUrl, WSDL_PATH)); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } - - @Test - public void testHello() { - System.out.println("[Client] Requesting the WebService to say Hello."); - - // Get a response from the WebService - final String response = client.sayHello(); - assertEquals(response, "Hello World!"); - - System.out.println("[WebService] " + response); - - } - - @Test - public void testHelloName() { - System.out.println("[Client] Requesting the WebService to say Hello to John."); - - // Get a response from the WebService - final String response = client.sayHelloToName("John"); - assertEquals(response, "Hello John!"); - - System.out.println("[WebService] " + response); - } - - @Test - public void testHelloNames() { - System.out.println("[Client] Requesting the WebService to say Hello to John, Mary and Mark."); - - // Create the array of names for the WebService to say hello to. - final List names = new ArrayList<>(); - names.add("John"); - names.add("Mary"); - names.add("Mark"); - - // Get a response from the WebService - final String response = client.sayHelloToNames(names); - assertEquals(response, "Hello John, Mary & Mark!"); - - System.out.println("[WebService] " + response); - } -} diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java index 8e7ef788ca..598a06d224 100644 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java +++ b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/ClientIT.java @@ -46,7 +46,7 @@ protected static URL getHTTPEndpoint() { host = "http://localhost:8080"; } try { - return new URI(host + "/helloworld-ws/" + WSDL_PATH).toURL(); + return new URI(host + "/" + WSDL_PATH).toURL(); } catch (URISyntaxException | MalformedURLException ex) { throw new RuntimeException(ex); } diff --git a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java b/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java deleted file mode 100644 index 2bdf897fb9..0000000000 --- a/helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2022 Red Hat, Inc. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jboss.as.quickstarts.wshelloworld; - -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.junit.Arquillian; -import org.junit.runner.RunWith; - -/** - * - * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. - */ -@RunWith(Arquillian.class) -@RunAsClient -public class RemoteClientIT extends ClientIT { - -} diff --git a/helloworld-ws/src/test/resources/arquillian.xml b/helloworld-ws/src/test/resources/arquillian.xml deleted file mode 100644 index fdeb809fee..0000000000 --- a/helloworld-ws/src/test/resources/arquillian.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file