cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amic...@apache.org
Subject [2/3] cxf-dosgi git commit: [DOSGI-258] Made itests HTTP port configurable via constant, and changed default to port 8989
Date Fri, 10 Feb 2017 09:06:22 GMT
[DOSGI-258] Made itests HTTP port configurable via constant, and changed default to port 8989


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

Branch: refs/heads/master
Commit: 776238eb3ac65300797a926586879cd5b6b9c3f1
Parents: d785e34
Author: Amichai Rothman <amichai@apache.org>
Authored: Thu Feb 9 22:17:22 2017 +0200
Committer: Amichai Rothman <amichai@apache.org>
Committed: Fri Feb 10 11:02:55 2017 +0200

----------------------------------------------------------------------
 .../apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java | 11 +++++++++++
 .../apache/cxf/dosgi/itests/multi/TestCustomIntent.java  |  3 ++-
 .../apache/cxf/dosgi/itests/multi/TestExportService.java |  4 ++--
 3 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/776238eb/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java
----------------------------------------------------------------------
diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java
b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java
index 0887cb6..01975bf 100644
--- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java
+++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java
@@ -55,6 +55,9 @@ import org.osgi.framework.ServiceReference;
 
 public class AbstractDosgiTest {
     static final int ZK_PORT = 35101;
+    static final int HTTP_PORT = 8989;
+    static final String HTTP_HOST = "localhost"; // can specify specific bound IP
+    static final String HTTP_BASE_URI = "http://" + HTTP_HOST + ":" + HTTP_PORT;
     private static final int TIMEOUT = 20;
     
     @Inject
@@ -236,6 +239,13 @@ public class AbstractDosgiTest {
         Assert.assertNotNull("ZooKeeper node " + zNode + " was not found", stat);
     }
 
+    protected static Option configHttpService(String host, int port) {
+        return newConfiguration("org.ops4j.pax.web")
+            .put("org.osgi.service.http.port", "" + port)
+            .put("org.ops4j.pax.web.listening.addresses", host)
+            .asOption();
+    }
+
     protected static Option configZKConsumer() {
         return newConfiguration("org.apache.aries.rsa.discovery.zookeeper") //
             .put("zookeeper.host", "127.0.0.1") //
@@ -290,6 +300,7 @@ public class AbstractDosgiTest {
                          systemProperty("pax.exam.osgi.unresolved.fail").value("true"), //
                          systemProperty("org.apache.cxf.stax.allowInsecureParser").value("true"),
//
                          systemProperty("rsa.export.policy.filter").value("(name=cxf)"),
//
+                         configHttpService(HTTP_HOST, HTTP_PORT),
                          configLogging(),
                          frameworkStartLevel(100)
         );

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/776238eb/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java
----------------------------------------------------------------------
diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java
b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java
index b722255..618aedb 100644
--- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java
+++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java
@@ -53,7 +53,8 @@ public class TestCustomIntent extends AbstractDosgiTest {
 
     @Test
     public void testCustomIntent() throws Exception {
-        final TaskService greeterService = TaskServiceProxyFactory.create("http://localhost:8080/cxf/taskservice");
+        String serviceUri = HTTP_BASE_URI + "/cxf/taskservice";
+        final TaskService greeterService = TaskServiceProxyFactory.create(serviceUri);
         Task task = tryTo("Call TaskService", new Callable<Task>() {
             public Task call() throws Exception {
                 return greeterService.get(1);

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/776238eb/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java
----------------------------------------------------------------------
diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java
b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java
index c8c619a..a4bc5a1 100644
--- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java
+++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java
@@ -48,8 +48,8 @@ import org.w3c.dom.Element;
 @ExamReactorStrategy(PerClass.class)
 public class TestExportService extends AbstractDosgiTest {
 
-    private static final String SERVICE_URI = "http://localhost:8080/cxf/taskservice";
-    private static final String REST_SERVICE_URI = "http://localhost:8080/cxf/tasks";
+    private static final String SERVICE_URI = HTTP_BASE_URI + "/cxf/taskservice";
+    private static final String REST_SERVICE_URI = HTTP_BASE_URI + "/cxf/tasks";
     
     private static final String GREETER_ZOOKEEPER_NODE = //
         "/osgi/service_registry/org/apache/cxf/dosgi/samples/soap/TaskService/localhost#8181##cxf#taskservice";


Mime
View raw message