From 1c1495299ff272aa8eb1e55803dcf3f6eb45dda1 Mon Sep 17 00:00:00 2001 From: Thai Nguyen Date: Tue, 12 Jul 2016 08:13:43 +0700 Subject: [PATCH 1/2] Refactors code for Introduction to Apache CXF --- apache-cxf/cxf-introduction/pom.xml | 37 ++++++------------- .../com/baeldung/cxf/introduction/Server.java | 8 +--- .../cxf/introduction/StudentTest.java | 2 +- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index e28039c1af..b25ef4db03 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -10,9 +10,19 @@ 0.0.1-SNAPSHOT - true 3.1.6 + + + + org.codehaus.mojo + exec-maven-plugin + + com.baeldung.cxf.introduction.Server + + + + org.apache.cxf @@ -25,29 +35,4 @@ ${cxf.version} - - - server - - test - - - org.codehaus.mojo - exec-maven-plugin - - - test - - java - - - com.baeldung.cxf.introduction.Server - - - - - - - - \ No newline at end of file diff --git a/apache-cxf/cxf-introduction/src/main/java/com/baeldung/cxf/introduction/Server.java b/apache-cxf/cxf-introduction/src/main/java/com/baeldung/cxf/introduction/Server.java index 58caa9087e..0e5af60b9d 100644 --- a/apache-cxf/cxf-introduction/src/main/java/com/baeldung/cxf/introduction/Server.java +++ b/apache-cxf/cxf-introduction/src/main/java/com/baeldung/cxf/introduction/Server.java @@ -3,15 +3,11 @@ package com.baeldung.cxf.introduction; import javax.xml.ws.Endpoint; public class Server { - private Server() { + public static void main(String args[]) throws InterruptedException { BaeldungImpl implementor = new BaeldungImpl(); String address = "http://localhost:8080/baeldung"; Endpoint.publish(address, implementor); - } - - public static void main(String args[]) throws InterruptedException { - new Server(); - System.out.println("Server ready"); + System.out.println("Server ready..."); Thread.sleep(60 * 1000); System.out.println("Server exiting"); System.exit(0); diff --git a/apache-cxf/cxf-introduction/src/test/java/com/baeldung/cxf/introduction/StudentTest.java b/apache-cxf/cxf-introduction/src/test/java/com/baeldung/cxf/introduction/StudentTest.java index 68bc4aa5e8..e1e5b60ec3 100644 --- a/apache-cxf/cxf-introduction/src/test/java/com/baeldung/cxf/introduction/StudentTest.java +++ b/apache-cxf/cxf-introduction/src/test/java/com/baeldung/cxf/introduction/StudentTest.java @@ -21,7 +21,7 @@ public class StudentTest { private Service service; private Baeldung baeldungProxy; - private Baeldung baeldungImpl; + private BaeldungImpl baeldungImpl; { service = Service.create(SERVICE_NAME); From 351b4a53972545cbb4390ede1e64c2139cafd24c Mon Sep 17 00:00:00 2001 From: Thai Nguyen Date: Wed, 13 Jul 2016 07:39:31 +0700 Subject: [PATCH 2/2] Updates POM to skip a test. --- apache-cxf/cxf-introduction/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index b25ef4db03..27a2978956 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -21,6 +21,15 @@ com.baeldung.cxf.introduction.Server + + maven-surefire-plugin + 2.19.1 + + + **/StudentTest.java + + +