cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [1/2] cxf-dosgi git commit: Fix TestCustomIntent
Date Mon, 10 Apr 2017 13:44:44 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master 2e016b755 -> 43ec61137


Fix TestCustomIntent


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

Branch: refs/heads/master
Commit: fd5accc11094ab0339c5ae37909086d1634f9000
Parents: 2e016b7
Author: Christian Schneider <chris@die-schneider.net>
Authored: Mon Apr 10 15:43:37 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Mon Apr 10 15:43:37 2017 +0200

----------------------------------------------------------------------
 .../apache/cxf/dosgi/itests/multi/TestCustomIntent.java   |  4 ++--
 .../itests/multi/customintent/ChangeTitleInterceptor.java | 10 +++++++---
 .../dosgi/itests/multi/customintent/CustomFeature.java    |  4 ++++
 3 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/fd5accc1/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 618aedb..2699b33 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
@@ -54,10 +54,10 @@ public class TestCustomIntent extends AbstractDosgiTest {
     @Test
     public void testCustomIntent() throws Exception {
         String serviceUri = HTTP_BASE_URI + "/cxf/taskservice";
-        final TaskService greeterService = TaskServiceProxyFactory.create(serviceUri);
+        final TaskService taskService = TaskServiceProxyFactory.create(serviceUri);
         Task task = tryTo("Call TaskService", new Callable<Task>() {
             public Task call() throws Exception {
-                return greeterService.get(1);
+                return taskService.get(1);
             }
         });
         

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/fd5accc1/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/ChangeTitleInterceptor.java
----------------------------------------------------------------------
diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/ChangeTitleInterceptor.java
b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/ChangeTitleInterceptor.java
index fcec431..ee89341 100644
--- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/ChangeTitleInterceptor.java
+++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/ChangeTitleInterceptor.java
@@ -26,21 +26,25 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public final class ChangeTitleInterceptor extends AbstractPhaseInterceptor<Message>
{
+    Logger log = LoggerFactory.getLogger(ChangeTitleInterceptor.class);
 
     ChangeTitleInterceptor() {
         super(Phase.USER_LOGICAL);
     }
 
     public void handleMessage(Message message) throws Fault {
-        MessageContentsList contents = MessageContentsList.getContentsList(message);
-        Object response = contents.get(0);
-        Method method = response.getClass().getMethods()[0];
         try {
+            MessageContentsList contents = MessageContentsList.getContentsList(message);
+            Object response = contents.get(0);
+            Method method = response.getClass().getMethod("getReturn", new Class[]{});
             Task task = (Task)method.invoke(response);
             task.setTitle("changed");
         } catch (Exception e) {
+            log.warn("Error in interceptor", e);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/fd5accc1/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeature.java
----------------------------------------------------------------------
diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeature.java
b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeature.java
index 7d46c87..90778b9 100644
--- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeature.java
+++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeature.java
@@ -21,11 +21,15 @@ package org.apache.cxf.dosgi.itests.multi.customintent;
 import org.apache.cxf.Bus;
 import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.InterceptorProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public final class CustomFeature extends AbstractFeature {
+    Logger log = LoggerFactory.getLogger(CustomFeature.class);
 
     @Override
     protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+        log.info("Adding interceptor " + ChangeTitleInterceptor.class.getName());
         provider.getOutInterceptors().add(0, new ChangeTitleInterceptor());
         super.initializeProvider(provider, bus);
     }


Mime
View raw message