cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Making sure jaxws_spring_boot test runs again
Date Wed, 22 Mar 2017 13:53:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 71ed0cb16 -> 0a8ce71c2


Making sure jaxws_spring_boot test runs again


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0a8ce71c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0a8ce71c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0a8ce71c

Branch: refs/heads/3.1.x-fixes
Commit: 0a8ce71c2adfe44ff9903a25ff0b3f758d5be7fc
Parents: 71ed0cb
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Mar 22 13:41:27 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Mar 22 13:52:43 2017 +0000

----------------------------------------------------------------------
 .../release/samples/jaxws_spring_boot/pom.xml   | 14 ++--
 .../ws/service/SampleWsApplicationTest.java     | 81 +++++++++++++++++++
 .../ws/service/SampleWsApplicationTests.java    | 82 --------------------
 3 files changed, 89 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0a8ce71c/distribution/src/main/release/samples/jaxws_spring_boot/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jaxws_spring_boot/pom.xml b/distribution/src/main/release/samples/jaxws_spring_boot/pom.xml
index 008f6e0..8dadee0 100644
--- a/distribution/src/main/release/samples/jaxws_spring_boot/pom.xml
+++ b/distribution/src/main/release/samples/jaxws_spring_boot/pom.xml
@@ -24,17 +24,19 @@
     </dependencyManagement>
     <dependencies>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-ws</artifactId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
-            <version>${project.version}</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web-services</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a8ce71c/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
b/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
new file mode 100644
index 0000000..13e68eb
--- /dev/null
+++ b/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTest.java
@@ -0,0 +1,81 @@
+/**
+ * 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 sample.ws.service;
+
+import static org.hamcrest.Matchers.containsString;
+
+import java.io.StringReader;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.rule.OutputCapture;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.ws.client.core.WebServiceTemplate;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertThat;
+
+import sample.ws.SampleWsApplication;
+
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = SampleWsApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
+public class SampleWsApplicationTest {
+
+    //CHECKSTYLE:OFF
+    @Rule
+    public OutputCapture output = new OutputCapture(); // SUPPRESS CHECKSTYLE
+    //CHECKSTYLE:ON
+
+    private WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
+
+    @LocalServerPort
+    private int port;
+
+    @Before
+    public void setUp() {
+        this.webServiceTemplate.setDefaultUri("http://localhost:" + this.port + "/Service/Hello");
+    }
+
+    @Test
+    public void testHelloRequest() {
+        // final String request =
+        // "<q0:sayHello xmlns:q0=\"http://service.ws.sample\">Elan</q0:sayHello>";
+        String request = "<q0:sayHello xmlns:q0=\"http://service.ws.sample/\"><myname>Elan</myname></q0:sayHello>";
+
+        StreamSource source = new StreamSource(new StringReader(request));
+        StreamResult result = new StreamResult(System.out);
+
+        this.webServiceTemplate.sendSourceAndReceiveToResult(source, result);
+        assertThat(this.output.toString(),
+                   containsString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                                  + "<ns2:sayHelloResponse xmlns:ns2=\"http://service.ws.sample/\">"
+                                  + "<return>Hello, Welcome to CXF Spring boot Elan!!!</return>"
+                                  + "</ns2:sayHelloResponse>"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a8ce71c/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTests.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTests.java
b/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTests.java
deleted file mode 100644
index 0b9de2c..0000000
--- a/distribution/src/main/release/samples/jaxws_spring_boot/src/test/java/sample/ws/service/SampleWsApplicationTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * 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 sample.ws.service;
-
-import java.io.StringReader;
-
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.test.IntegrationTest;
-import org.springframework.boot.test.OutputCapture;
-import org.springframework.boot.test.SpringApplicationConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.ws.client.core.WebServiceTemplate;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.junit.Assert.assertThat;
-
-import sample.ws.SampleWsApplication;
-
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringApplicationConfiguration(classes = SampleWsApplication.class)
-@WebAppConfiguration
-@IntegrationTest("server.port=0")
-public class SampleWsApplicationTests {
-
-    //CHECKSTYLE:OFF
-    @Rule
-    public OutputCapture output = new OutputCapture(); // SUPPRESS CHECKSTYLE
-    //CHECKSTYLE:ON
-
-    private WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
-
-    @Value("${local.server.port}")
-    private int serverPort;
-
-    @Before
-    public void setUp() {
-        this.webServiceTemplate.setDefaultUri("http://localhost:" + this.serverPort + "/Service/Hello");
-    }
-
-    @Test
-    public void testHelloRequest() {
-        // final String request =
-        // "<q0:sayHello xmlns:q0=\"http://service.ws.sample\">Elan</q0:sayHello>";
-        String request = "<q0:sayHello xmlns:q0=\"http://service.ws.sample/\"><myname>Elan</myname></q0:sayHello>";
-
-        StreamSource source = new StreamSource(new StringReader(request));
-        StreamResult result = new StreamResult(System.out);
-
-        this.webServiceTemplate.sendSourceAndReceiveToResult(source, result);
-        assertThat(this.output.toString(),
-                   containsString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-                                  + "<ns2:sayHelloResponse xmlns:ns2=\"http://service.ws.sample/\">"
-                                  + "<return>Hello, Welcome to CXF Spring boot Elan!!!</return>"
-                                  + "</ns2:sayHelloResponse>"));
-    }
-
-}


Mime
View raw message