cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [4/4] git commit: Add a test for the http-jetty support. Update to karaf 3.0.1 since that is required for http-jetty
Date Thu, 04 Sep 2014 16:44:34 GMT
Add a test for the http-jetty support.  Update to karaf 3.0.1 since that is required for http-jetty


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

Branch: refs/heads/master
Commit: 1d29dfaa8e686570c1b2ec2da4c31ba380e0b9b0
Parents: 491f98b
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Sep 4 12:43:17 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Sep 4 12:44:05 2014 -0400

----------------------------------------------------------------------
 osgi/itests/pom.xml                              |  5 +++++
 .../cxf/osgi/itests/soap/HttpServiceTest.java    | 19 ++++++++++++++-----
 .../cxf/osgi/itests/soap/HttpTestActivator.java  | 13 ++++++++++++-
 parent/pom.xml                                   |  2 +-
 4 files changed, 32 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1d29dfaa/osgi/itests/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/itests/pom.xml b/osgi/itests/pom.xml
index 018f604..613befb 100644
--- a/osgi/itests/pom.xml
+++ b/osgi/itests/pom.xml
@@ -45,6 +45,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-jms</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/cxf/blob/1d29dfaa/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpServiceTest.java
----------------------------------------------------------------------
diff --git a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpServiceTest.java
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpServiceTest.java
index 8420a6a..731a40d 100644
--- a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpServiceTest.java
+++ b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpServiceTest.java
@@ -22,9 +22,11 @@ import java.io.InputStream;
 
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.osgi.itests.CXFOSGiTestSupport;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -33,6 +35,7 @@ import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 import org.ops4j.pax.tinybundles.core.TinyBundles;
 import org.osgi.framework.Constants;
+
 import static org.ops4j.pax.exam.CoreOptions.provision;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
@@ -43,24 +46,30 @@ public class HttpServiceTest extends CXFOSGiTestSupport {
 
     @Test
     public void testHttpEndpoint() throws Exception {
-        Greeter greeter = greeterHttp();
+        Greeter greeter = greeterHttp("8181");
+        String res = greeter.greetMe("Chris");
+        Assert.assertEquals("Hi Chris", res);
+    }
+    @Test
+    public void testHttpEndpointJetty() throws Exception {
+        Greeter greeter = greeterHttp(HttpTestActivator.PORT);
         String res = greeter.greetMe("Chris");
         Assert.assertEquals("Hi Chris", res);
     }
     
-    private Greeter greeterHttp() {
+    private Greeter greeterHttp(String port) {
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
         factory.setServiceClass(Greeter.class);
-        factory.setAddress("http://localhost:8181/cxf/greeter");
+        factory.setAddress("http://localhost:" + port + "/cxf/greeter");
         return factory.create(Greeter.class);
     }
     
     @Configuration
     public Option[] config() {
         return new Option[] {
-            cxfBaseConfig(),
+            cxfBaseConfigWithTestUtils(),
             logLevel(LogLevel.INFO),
-            features(cxfUrl, "cxf-http"),
+            features(cxfUrl, "cxf-http", "cxf-http-jetty"),
             provision(serviceBundle())
         };
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/1d29dfaa/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpTestActivator.java
----------------------------------------------------------------------
diff --git a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpTestActivator.java
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpTestActivator.java
index 5082508..6fa7226 100644
--- a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpTestActivator.java
+++ b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/HttpTestActivator.java
@@ -20,12 +20,14 @@ package org.apache.cxf.osgi.itests.soap;
 
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
 public class HttpTestActivator implements BundleActivator {
-
+    public static final String PORT = TestUtil.getPortNumber(HttpTestActivator.class);
     private Server server;
+    private Server serverJetty;
 
     @Override
     public void start(BundleContext arg0) throws Exception {
@@ -34,11 +36,20 @@ public class HttpTestActivator implements BundleActivator {
         factory.setAddress("/greeter");
         factory.setServiceBean(new GreeterImpl());
         server = factory.create();
+        
+        factory = new JaxWsServerFactoryBean();
+        factory.setServiceClass(Greeter.class);
+        factory.setAddress("http://localhost:" + PORT + "/cxf/greeter");
+        factory.setServiceBean(new GreeterImpl());
+        serverJetty = factory.create();
     }
 
     @Override
     public void stop(BundleContext arg0) throws Exception {
+        server.stop();
         server.destroy();
+        serverJetty.stop();
+        serverJetty.destroy();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/1d29dfaa/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 8682888..6c659bf 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -162,7 +162,7 @@
         <cxf.aries.version>1.0.0</cxf.aries.version>
         <cxf.aries.version.range>[1.0,2)</cxf.aries.version.range>
         <cxf.osgi.version>4.2.0</cxf.osgi.version>
-        <cxf.karaf.version>2.3.6</cxf.karaf.version>
+        <cxf.karaf.version>3.0.1</cxf.karaf.version>
         <cxf.pax.logging.version>1.6.0</cxf.pax.logging.version>
         <cxf.pax.exam.version>3.4.0</cxf.pax.exam.version>
         <cxf.felix.framework.version>2.0.5</cxf.felix.framework.version>


Mime
View raw message