cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [4/7] cxf git commit: Cleanup some tests
Date Tue, 25 Apr 2017 15:06:08 GMT
Cleanup some tests


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

Branch: refs/heads/master
Commit: 20b73a780e54f3815ab6b8c5f41d052f75745ee1
Parents: bc4cd1e
Author: Christian Schneider <chris@die-schneider.net>
Authored: Tue Apr 25 12:22:30 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Tue Apr 25 16:10:47 2017 +0200

----------------------------------------------------------------------
 .../cxf/transport/jms/JMSDestinationTest.java   |  4 +---
 .../cxf/systest/jms/JMSClientServerTest.java    |  5 ++---
 .../cxf/systest/jms/TwoWayJMSImplBase.java      | 14 +-------------
 .../systest/jms/security/TwoWayJMSImplBase.java | 20 +++++++-------------
 4 files changed, 11 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/20b73a78/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
index 67369d4..1b0b305 100644
--- a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
+++ b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
@@ -259,11 +259,9 @@ public class JMSDestinationTest extends AbstractJMSTester {
         final Message outMessage = new MessageImpl();
         setupMessageHeader(outMessage, null);
 
-        JMSPropertyType excludeProp = new JMSPropertyType(customPropertyName, customPropertyName);
-
         JMSMessageHeadersType headers = (JMSMessageHeadersType)outMessage
             .get(JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
-        headers.getProperty().add(excludeProp);
+        headers.getProperty().add(new JMSPropertyType(customPropertyName, customPropertyName));
 
         final JMSDestination destination = setupJMSDestination(ei);
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/20b73a78/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
index 0f7dae6..44b56d8 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
@@ -558,9 +558,8 @@ public class JMSClientServerTest extends AbstractBusClientServerTestBase
{
         JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
         requestHeader.setJMSCorrelationID("JMS_SAMPLE_CORRELATION_ID");
         requestHeader.setJMSExpiration(3600000L);
-        JMSPropertyType propType = new JMSPropertyType(testReturnPropertyName, "mustReturn");
-        requestHeader.getProperty().add(propType);
-        propType = new JMSPropertyType(testIgnoredPropertyName, "mustNotReturn");
+        requestHeader.getProperty().add(new JMSPropertyType(testReturnPropertyName, "mustReturn"));
+        requestHeader.getProperty().add(new JMSPropertyType(testIgnoredPropertyName, "mustNotReturn"));
         requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
 
         String greeting = greeter.greetMe("Milestone-");

http://git-wip-us.apache.org/repos/asf/cxf/blob/20b73a78/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
index 3787eee..79499e1 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
@@ -52,21 +52,9 @@ public class TwoWayJMSImplBase implements HelloWorldPortType {
         }
 
         MessageContext mc = wsContext.getMessageContext();
-        //JMSMessageHeadersType headers =
-        //    (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
-        //System.out.println("get the message headers JMSCorrelationID: " + headers.getJMSCorrelationID());
-        //System.out.println("Reached here :" + me);
-
-        // set reply header custom property
-        JMSPropertyType testProperty = new JMSPropertyType("Test_Prop", "some return value
"  + me);
-
-        //System.out.println("found property in request headers at index: "
-        //                   + headers.getProperty().indexOf(testProperty));
-
         JMSMessageHeadersType responseHeaders =
             (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
-        responseHeaders.getProperty().add(testProperty);
-
+        responseHeaders.getProperty().add(new JMSPropertyType("Test_Prop", "some return value
"  + me));
         return "Hello " + me;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/20b73a78/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
index d6ca0da..511ea8b 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
@@ -41,6 +41,7 @@ public class TwoWayJMSImplBase implements HelloWorldPortType {
 
     @Resource
     protected WebServiceContext wsContext;
+
     public String greetMe(String me) {
         if (me.startsWith("PauseForTwoSecs")) {
             try {
@@ -51,23 +52,16 @@ public class TwoWayJMSImplBase implements HelloWorldPortType {
             me = me.substring("PauseForTwoSecs".length()).trim();
         }
 
-        MessageContext mc = wsContext.getMessageContext();
-        //JMSMessageHeadersType headers =
-        //    (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
-        //System.out.println("get the message headers JMSCorrelationID: " + headers.getJMSCorrelationID());
-        //System.out.println("Reached here :" + me);
-
-        // set reply header custom property
-        JMSPropertyType testProperty = new JMSPropertyType("Test_Prop", "some return value
"  + me);
+        addToReply(new JMSPropertyType("Test_Prop", "some return value "  + me));
 
-        //System.out.println("found property in request headers at index: "
-        //                   + headers.getProperty().indexOf(testProperty));
+        return "Hello " + me;
+    }
 
+    private void addToReply(JMSPropertyType prop) {
+        MessageContext mc = wsContext.getMessageContext();
         JMSMessageHeadersType responseHeaders =
             (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
-        responseHeaders.getProperty().add(testProperty);
-
-        return "Hello " + me;
+        responseHeaders.getProperty().add(prop);
     }
 
     public String sayHi() {


Mime
View raw message