cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r803410 - in /cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/ rt/transpo...
Date Wed, 12 Aug 2009 08:22:48 GMT
Author: ningjiang
Date: Wed Aug 12 08:22:47 2009
New Revision: 803410

URL: http://svn.apache.org/viewvc?rev=803410&view=rev
Log:
CXF-2265 applied patch with thanks to LiuCong

Added:
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java   (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java   (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java   (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java   (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java   (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java   (with props)
Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSConstants.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSInInterceptor.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpointParser.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Server.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/AbstractSOAPJMSTestSuite.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteClientTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteServerTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
    cxf/trunk/testutils/src/main/resources/wsdl/jms_spec_testsuite.wsdl

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSConstants.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSConstants.java (original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSConstants.java Wed Aug 12 08:22:47 2009
@@ -27,6 +27,9 @@
 public final class SoapJMSConstants {
 
     public static final String SOAP_JMS_PREFIX = "SOAPJMS_";
+    public static final String JMS_MESSAGE_TYPE = "JMSMessageType";
+    public static final String TARGET_SERVICE_IN_REQUESTURI = "target.service.inrequesturi";
+    public static final String MALFORMED_REQUESTURI = "malformed.requesturi";
     
     // JMS Message properties' names.
     public static final String REQUESTURI_PARAMETER_NAME = "requestURI";

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSInInterceptor.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSInInterceptor.java (original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapJMSInInterceptor.java Wed Aug 12 08:22:47 2009
@@ -59,7 +59,17 @@
      * @param headers
      */
     private void checkJMSMessageFormat(SoapMessage message, Map<String, List<String>> headers) {
-        // ToDO
+        List<String> mt = headers.get(SoapJMSConstants.JMS_MESSAGE_TYPE);
+        if (mt != null && mt.size() > 0) {
+            String messageType = mt.get(0);
+            if (!"text".equals(messageType) && !"byte".equals(messageType)) {
+                JMSFault jmsFault = JMSFaultFactory.createUnsupportedJMSMessageFormatFault(messageType);
+                Fault f = createFault(message, jmsFault);
+                if (f != null) {
+                    throw f;
+                }
+            }
+        }
     }
 
     /**
@@ -82,9 +92,16 @@
         List<String> ru = headers.get(SoapJMSConstants.REQUESTURI_FIELD);
         JMSFault jmsFault = null;
         if (ru != null && ru.size() > 0) {
-            //String requestURI = ru.get(0);
-            // ToDO malformedRequestURI
-            // ToDO tagetServiceNotAllowedInRequestURI
+            String requestURI = ru.get(0);
+            List<String> mr = headers.get(SoapJMSConstants.MALFORMED_REQUESTURI);
+            if (mr != null && mr.size() > 0 && mr.get(0).equals("true")) {
+                jmsFault = JMSFaultFactory.createMalformedRequestURIFault(requestURI);
+            }
+
+            List<String> trn = headers.get(SoapJMSConstants.TARGET_SERVICE_IN_REQUESTURI);
+            if (trn != null && trn.size() > 0 && trn.get(0).equals("true")) {
+                jmsFault = JMSFaultFactory.createTargetServiceNotAllowedInRequestURIFault();
+            }
         } else {
             jmsFault = JMSFaultFactory.createMissingRequestURIFault();
         }
@@ -104,8 +121,12 @@
         List<String> ct = headers.get(SoapJMSConstants.CONTENTTYPE_FIELD);
         JMSFault jmsFault = null;
         if (ct != null && ct.size() > 0) {
-            //String contentType = ct.get(0);
-            // ToDO
+            String contentType = ct.get(0);
+            if (!contentType.startsWith("text/xml")
+                && !contentType.startsWith("application/soap+xml")
+                && !contentType.startsWith("multipart/related")) {
+                jmsFault = JMSFaultFactory.createContentTypeMismatchFault(contentType);
+            }
         } else {
             jmsFault = JMSFaultFactory.createMissingContentTypeFault();
         }

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java Wed Aug 12 08:22:47 2009
@@ -19,9 +19,7 @@
 
 package org.apache.cxf.transport.jms;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.UUID;
@@ -215,9 +213,7 @@
         try {
             JMSUtils.populateIncomingContext(jmsMessage, inMessage, JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
         
-            byte[] response = JMSUtils.retrievePayload(jmsMessage, (String)inMessage.get(Message.ENCODING));
-            LOG.log(Level.FINE, "The Response Message payload is : [" + response + "]");
-            inMessage.setContent(InputStream.class, new ByteArrayInputStream(response));
+            JMSUtils.retrieveAndSetPayload(inMessage, jmsMessage, (String)inMessage.get(Message.ENCODING));
 
             if (exchange.isSynchronous()) {
                 synchronized (exchange) {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java Wed Aug 12 08:22:47 2009
@@ -19,9 +19,7 @@
 
 package org.apache.cxf.transport.jms;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.Calendar;
@@ -175,9 +173,7 @@
             MessageImpl inMessage = new MessageImpl();            
             JMSUtils.populateIncomingContext(message, inMessage, JMSConstants.JMS_SERVER_REQUEST_HEADERS);
             
-            byte[] request = JMSUtils.retrievePayload(message, (String)inMessage.get(Message.ENCODING));
-            getLogger().log(Level.FINE, "The Request Message is [ " + request + "]");
-            inMessage.setContent(InputStream.class, new ByteArrayInputStream(request));
+            JMSUtils.retrieveAndSetPayload(inMessage, message, (String)inMessage.get(Message.ENCODING));
             inMessage.put(JMSConstants.JMS_SERVER_RESPONSE_HEADERS, new JMSMessageHeadersType());
             inMessage.put(JMSConstants.JMS_REQUEST_MESSAGE, message);
             inMessage.setDestination(this);

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java Wed Aug 12 08:22:47 2009
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.transport.jms;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.security.Principal;
 import java.util.ArrayList;
@@ -33,10 +35,12 @@
 import javax.jms.BytesMessage;
 import javax.jms.Destination;
 import javax.jms.JMSException;
+import javax.jms.MapMessage;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
 import javax.jms.Queue;
 import javax.jms.Session;
+import javax.jms.StreamMessage;
 import javax.jms.Topic;
 
 import org.apache.cxf.common.logging.LogUtils;
@@ -45,6 +49,8 @@
 import org.apache.cxf.helpers.HttpHeaderHelper;
 import org.apache.cxf.security.SecurityContext;
 import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
+import org.apache.cxf.transport.jms.uri.JMSEndpoint;
+import org.apache.cxf.transport.jms.uri.JMSEndpointParser;
 import org.springframework.jms.support.JmsUtils;
 import org.springframework.jms.support.converter.MessageConversionException;
 import org.springframework.jms.support.converter.SimpleMessageConverter102;
@@ -105,15 +111,19 @@
 
     /**
      * Extract the payload of an incoming message.
+     * @param inMessage 
      * 
      * @param message the incoming message
      * @param encoding the message encoding
      * @return the message payload as byte[]
      * @throws UnsupportedEncodingException
      */
-    public static byte[] retrievePayload(Message message, String encoding)
+    public static void retrieveAndSetPayload(org.apache.cxf.message.Message inMessage,
+                                             Message message, String encoding)
         throws UnsupportedEncodingException {
+        String messageType = null;
         Object converted;
+        byte[] result;
         try {
             converted = new SimpleMessageConverter102().fromMessage(message);
         } catch (MessageConversionException e) {
@@ -123,16 +133,33 @@
         }
         if (converted instanceof String) {
             if (encoding != null) {
-                return ((String)converted).getBytes(encoding);
+                result = ((String)converted).getBytes(encoding);
             } else {
                 // Using the UTF-8 encoding as default
-                return ((String)converted).getBytes("UTF-8");
+                result = ((String)converted).getBytes("UTF-8");
             }
+            inMessage.setContent(InputStream.class, new ByteArrayInputStream(result));
+            messageType = "text";
         } else if (converted instanceof byte[]) {
-            return (byte[])converted;
+            result = (byte[])converted;
+            inMessage.setContent(InputStream.class, new ByteArrayInputStream(result));
+            messageType = "byte";
+        } else if (message instanceof MapMessage) {
+            messageType = "map";
+        } else if (message instanceof ObjectMessage) {
+            messageType = "object";
+        } else if (message instanceof StreamMessage) {
+            messageType = "stream";
         } else {
-            return (byte[])converted; // TODO is this correct?
+            messageType = "unknow";
         }
+        Map<String, List<String>> headers = CastUtils.cast((Map)inMessage
+            .get(org.apache.cxf.message.Message.PROTOCOL_HEADERS));
+        if (headers == null) {
+            headers = new HashMap<String, List<String>>();
+            inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
+        }
+        headers.put(JMSSpecConstants.JMS_MESSAGE_TYPE, Collections.singletonList(messageType));
     }
 
     public static void populateIncomingContext(javax.jms.Message message,
@@ -227,6 +254,23 @@
             if (jmsMessage.propertyExists(JMSSpecConstants.REQUESTURI_FIELD)) {
                 messageProperties.setSOAPJMSRequestURI(jmsMessage
                     .getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
+                
+                Map<String, List<String>> headers = CastUtils.cast((Map)inMessage
+                    .get(org.apache.cxf.message.Message.PROTOCOL_HEADERS));
+                if (headers == null) {
+                    headers = new HashMap<String, List<String>>();
+                    inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
+                }
+                try {
+                    JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(jmsMessage
+                        .getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
+                    if (endpoint.getParameter(JMSSpecConstants.TARGETSERVICE_PARAMETER_NAME) != null) {
+                        headers.put(JMSSpecConstants.TARGET_SERVICE_IN_REQUESTURI, Collections
+                            .singletonList("true"));
+                    }
+                } catch (Exception e) {
+                    headers.put(JMSSpecConstants.MALFORMED_REQUESTURI, Collections.singletonList("true"));
+                }
             }
 
             if (messageProperties.isSetSOAPJMSContentType()) {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java Wed Aug 12 08:22:47 2009
@@ -66,6 +66,11 @@
     public static final String CONTENTTYPE_FIELD = SOAP_JMS_PREFIX + CONTENTTYPE_PARAMETER_NAME;
     public static final String ISFAULT_FIELD = SOAP_JMS_PREFIX + ISFAULT_PARAMETER_NAME;
     
+    //
+    public static final String JMS_MESSAGE_TYPE = "JMSMessageType";
+    public static final String TARGET_SERVICE_IN_REQUESTURI = "target.service.inrequesturi";
+    public static final String MALFORMED_REQUESTURI = "malformed.requesturi";
+    
     private JMSSpecConstants() {
     }
 }

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java Wed Aug 12 08:22:47 2009
@@ -46,6 +46,9 @@
         Iterator iter = parameters.keySet().iterator();
         while (iter.hasNext()) {
             String key = (String)iter.next();
+            if ("targetService".equals(key)) {
+                continue;
+            }
             String value = (String)parameters.get(key);
             if (first) {
                 requestUri += "?" + key + "=" + value;

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpointParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpointParser.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpointParser.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpointParser.java Wed Aug 12 08:22:47 2009
@@ -190,6 +190,8 @@
             remaining = removeStartingCharacters(remaining.substring(JMSURIConstants.JNDI_PREFIX
                 .length()), '/');
             isJndi = true;
+        } else {
+            throw new Exception("Unknow JMS Variant");
         }
 
         final String subject = convertPathToActualDestination(remaining);

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Server.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Server.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Server.java Wed Aug 12 08:22:47 2009
@@ -55,6 +55,24 @@
         
         Test1001Impl t1001 = new Test1001Impl();
         Endpoint.publish(JMSTestUtil.getTestCase("test1001").getAddress().trim(), t1001);
+        
+        Test1002Impl t1002 = new Test1002Impl();
+        Endpoint.publish(JMSTestUtil.getTestCase("test1002").getAddress().trim(), t1002);
+        
+        Test1003Impl t1003 = new Test1003Impl();
+        Endpoint.publish(JMSTestUtil.getTestCase("test1003").getAddress().trim(), t1003);
+        
+        Test1004Impl t1004 = new Test1004Impl();
+        Endpoint.publish(JMSTestUtil.getTestCase("test1004").getAddress().trim(), t1004);
+        
+        Test1006Impl t1006 = new Test1006Impl();
+        Endpoint.publish(JMSTestUtil.getTestCase("test1006").getAddress().trim(), t1006);
+        
+        Test1007Impl t1007 = new Test1007Impl();
+        Endpoint.publish(JMSTestUtil.getTestCase("test1007").getAddress().trim(), t1007);
+        
+        Test1008Impl t1008 = new Test1008Impl();
+        Endpoint.publish(JMSTestUtil.getTestCase("test1008").getAddress().trim(), t1008);
     }
 
     public static void main(String[] args) {

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java?rev=803410&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java Wed Aug 12 08:22:47 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jms.testsuite.services;
+
+import org.apache.cxf.jms_simple.JMSSimplePortType;
+
+@javax.jws.WebService(portName = "SimplePort", 
+                      serviceName = "JMSSimpleService1002",
+                      targetNamespace = "http://cxf.apache.org/jms_simple",
+                      endpointInterface = "org.apache.cxf.jms_simple.JMSSimplePortType",
+                      wsdlLocation = "testutils/jms_spec_testsuite.wsdl")
+public class Test1002Impl implements JMSSimplePortType {
+
+    /** {@inheritDoc}*/
+    public String echo(String in) {
+        return in;
+    }
+
+    /** {@inheritDoc}*/
+    public void ping(String in) {
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1002Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java?rev=803410&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java Wed Aug 12 08:22:47 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jms.testsuite.services;
+
+import org.apache.cxf.jms_simple.JMSSimplePortType;
+
+@javax.jws.WebService(portName = "SimplePort", 
+                      serviceName = "JMSSimpleService1003",
+                      targetNamespace = "http://cxf.apache.org/jms_simple",
+                      endpointInterface = "org.apache.cxf.jms_simple.JMSSimplePortType",
+                      wsdlLocation = "testutils/jms_spec_testsuite.wsdl")
+public class Test1003Impl implements JMSSimplePortType {
+
+    /** {@inheritDoc}*/
+    public String echo(String in) {
+        return in;
+    }
+
+    /** {@inheritDoc}*/
+    public void ping(String in) {
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1003Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java?rev=803410&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java Wed Aug 12 08:22:47 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jms.testsuite.services;
+
+import org.apache.cxf.jms_simple.JMSSimplePortType;
+
+@javax.jws.WebService(portName = "SimplePort", 
+                      serviceName = "JMSSimpleService1004",
+                      targetNamespace = "http://cxf.apache.org/jms_simple",
+                      endpointInterface = "org.apache.cxf.jms_simple.JMSSimplePortType",
+                      wsdlLocation = "testutils/jms_spec_testsuite.wsdl")
+public class Test1004Impl implements JMSSimplePortType {
+
+    /** {@inheritDoc}*/
+    public String echo(String in) {
+        return in;
+    }
+
+    /** {@inheritDoc}*/
+    public void ping(String in) {
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1004Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java?rev=803410&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java Wed Aug 12 08:22:47 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jms.testsuite.services;
+
+import org.apache.cxf.jms_simple.JMSSimplePortType;
+
+@javax.jws.WebService(portName = "SimplePort", 
+                      serviceName = "JMSSimpleService1006",
+                      targetNamespace = "http://cxf.apache.org/jms_simple",
+                      endpointInterface = "org.apache.cxf.jms_simple.JMSSimplePortType",
+                      wsdlLocation = "testutils/jms_spec_testsuite.wsdl")
+public class Test1006Impl implements JMSSimplePortType {
+
+    /** {@inheritDoc}*/
+    public String echo(String in) {
+        return in;
+    }
+
+    /** {@inheritDoc}*/
+    public void ping(String in) {
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1006Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java?rev=803410&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java Wed Aug 12 08:22:47 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jms.testsuite.services;
+
+import org.apache.cxf.jms_simple.JMSSimplePortType;
+
+@javax.jws.WebService(portName = "SimplePort", 
+                      serviceName = "JMSSimpleService1007",
+                      targetNamespace = "http://cxf.apache.org/jms_simple",
+                      endpointInterface = "org.apache.cxf.jms_simple.JMSSimplePortType",
+                      wsdlLocation = "testutils/jms_spec_testsuite.wsdl")
+public class Test1007Impl implements JMSSimplePortType {
+
+    /** {@inheritDoc}*/
+    public String echo(String in) {
+        return in;
+    }
+
+    /** {@inheritDoc}*/
+    public void ping(String in) {
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1007Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java?rev=803410&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java Wed Aug 12 08:22:47 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jms.testsuite.services;
+
+import org.apache.cxf.jms_simple.JMSSimplePortType;
+
+@javax.jws.WebService(portName = "SimplePort", 
+                      serviceName = "JMSSimpleService1008",
+                      targetNamespace = "http://cxf.apache.org/jms_simple",
+                      endpointInterface = "org.apache.cxf.jms_simple.JMSSimplePortType",
+                      wsdlLocation = "testutils/jms_spec_testsuite.wsdl")
+public class Test1008Impl implements JMSSimplePortType {
+
+    /** {@inheritDoc}*/
+    public String echo(String in) {
+        return in;
+    }
+
+    /** {@inheritDoc}*/
+    public void ping(String in) {
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/services/Test1008Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/AbstractSOAPJMSTestSuite.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/AbstractSOAPJMSTestSuite.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/AbstractSOAPJMSTestSuite.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/AbstractSOAPJMSTestSuite.java Wed Aug 12 08:22:47 2009
@@ -22,16 +22,23 @@
 import java.lang.reflect.Constructor;
 import java.net.URL;
 
+import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
+import javax.jms.Session;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
+import org.apache.cxf.jms.testsuite.util.JMSTestUtil;
 import org.apache.cxf.testsuite.testcase.MessagePropertiesType;
 import org.apache.cxf.testsuite.testcase.TestCaseType;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.transport.jms.JMSConfiguration;
+import org.apache.cxf.transport.jms.JMSFactory;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
 import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
+import org.springframework.jms.core.JmsTemplate;
+import org.springframework.jms.core.MessageCreator;
 
 /**
  * 
@@ -62,8 +69,8 @@
         return service.getPort(qPortName, portTypeClass);
     }
 
-    public void checkJMSProperties(Message message, MessagePropertiesType messageProperties,
-                                   boolean noResponse) throws JMSException {
+    public void checkJMSProperties(Message message, MessagePropertiesType messageProperties)
+        throws JMSException {
         // todo messagetype
         // todo messageid
         if (messageProperties.isSetDeliveryMode()) {
@@ -83,10 +90,6 @@
             && !messageProperties.getCorrelationID().trim().equals("")) {
             assertEquals(message.getJMSCorrelationID(), messageProperties.getCorrelationID());
         }
-        if (noResponse) {
-            assertEquals(message.getJMSReplyTo(), null);
-            assertEquals(message.getJMSCorrelationID(), null);
-        }
         if (messageProperties.isSetDestination()
             && !messageProperties.getDestination().trim().equals("")) {
             assertEquals(message.getJMSDestination().toString(), messageProperties.getDestination());
@@ -120,7 +123,7 @@
                          messageProperties.getRequestURI().trim());
         }
         if (messageProperties.isSetIsFault()) {
-            assertEquals(message.getStringProperty(JMSSpecConstants.ISFAULT_FIELD),
+            assertEquals(message.getBooleanProperty(JMSSpecConstants.ISFAULT_FIELD),
                          messageProperties.isIsFault());
         }
         // todo messagebody
@@ -197,4 +200,45 @@
         }
         // todo messagebody
     }
+    
+    public void twoWayTestWithCreateMessage(final TestCaseType testcase) throws Exception {
+        String address = testcase.getAddress();
+        JMSConfiguration jmsConfig = JMSTestUtil.getInitJMSConfiguration(address);
+        final JmsTemplate jmsTemplate = JMSFactory.createJmsTemplate(jmsConfig, null);
+        
+        final Destination replyToDestination = JMSFactory.resolveOrCreateDestination(jmsTemplate,
+                                                                                     null, false);
+        class JMSConduitMessageCreator implements MessageCreator {
+            private javax.jms.Message jmsMessage;
+
+            public javax.jms.Message createMessage(Session session) throws JMSException {
+                jmsMessage = JMSTestUtil.buildJMSMessageFromTestCase(testcase, session, replyToDestination);
+                return jmsMessage;
+            }
+
+            public String getMessageID() {
+                if (jmsMessage != null) {
+                    try {
+                        return jmsMessage.getJMSMessageID();
+                    } catch (JMSException e) {
+                        return null;
+                    }
+                }
+                return null;
+            }
+        }
+        JMSConduitMessageCreator messageCreator = new JMSConduitMessageCreator();    
+
+        jmsTemplate.send(jmsConfig.getTargetDestination(), messageCreator);
+        String messageId = messageCreator.getMessageID();
+
+        String messageSelector = "JMSCorrelationID = '" + messageId + "'";
+        javax.jms.Message replyMessage = jmsTemplate.receiveSelected(replyToDestination,
+                                                                     messageSelector);
+        checkReplyMessage(replyMessage, testcase);
+    }
+
+    private void checkReplyMessage(Message replyMessage, TestCaseType testcase) throws JMSException {
+        checkJMSProperties(replyMessage, testcase.getResponseMessage());
+    }
 }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteClientTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteClientTest.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteClientTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteClientTest.java Wed Aug 12 08:22:47 2009
@@ -72,7 +72,7 @@
 
         Message message = jmsTemplate.receive(dest);
         try {
-            checkJMSProperties(message, testcase.getRequestMessage(), true);
+            checkJMSProperties(message, testcase.getRequestMessage());
         } catch (Exception ex) {
             ex.printStackTrace();
         }
@@ -99,7 +99,7 @@
         serviceThread.start();
 
         Message message = jmsTemplate.receive(dest);
-        checkJMSProperties(message, testcase.getRequestMessage(), false);
+        checkJMSProperties(message, testcase.getRequestMessage());
 
         serviceThread.interrupt();
     }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteServerTest.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteServerTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteServerTest.java Wed Aug 12 08:22:47 2009
@@ -50,28 +50,4 @@
     public void test001() {
         // do nothing here , just to make the surefire happy.
     }
-
-/*    @Test
-    public void test0002() throws Exception {
-        TestCaseType testcase = JMSTestUtil.getTestCase("test0002");
-        final JMSSimplePortType simplePort = getPort("JMSSimpleService", "SimplePort",
-                                                     JMSSimpleService.class,
-                                                     JMSSimplePortType.class);
-        InvocationHandler handler = Proxy.getInvocationHandler(simplePort);
-        BindingProvider bp = null;
-
-        if (handler instanceof BindingProvider) {
-            bp = (BindingProvider)handler;
-        }
-
-        String response = simplePort.echo("test");
-        assertEquals(response, "test");
-
-        if (bp != null) {
-            Map<String, Object> responseContext = bp.getResponseContext();
-            Message m = (Message)responseContext
-                .get(JMSConstants.JMS_CLIENT_RESPONSE_JMSMESSAGE);
-            checkJMSProperties(m, testcase.getResponseMessage(), false);
-        }
-    }*/
 }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java Wed Aug 12 08:22:47 2009
@@ -248,4 +248,46 @@
             assertTrue(e.getMessage().contains("Unrecognized BindingVersion"));
         }
     }
+    
+    @Test
+    public void test1002() throws Exception {
+        TestCaseType testcase = JMSTestUtil.getTestCase("test1002");
+        
+        twoWayTestWithCreateMessage(testcase);
+    }
+    
+    @Test
+    public void test1003() throws Exception {
+        TestCaseType testcase = JMSTestUtil.getTestCase("test1003");
+        
+        twoWayTestWithCreateMessage(testcase);
+    }
+    
+    @Test
+    public void test1004() throws Exception {
+        TestCaseType testcase = JMSTestUtil.getTestCase("test1004");
+        
+        twoWayTestWithCreateMessage(testcase);
+    }
+    
+    @Test
+    public void test1006() throws Exception {
+        TestCaseType testcase = JMSTestUtil.getTestCase("test1006");
+        
+        twoWayTestWithCreateMessage(testcase);
+    }
+    
+    @Test
+    public void test1007() throws Exception {
+        TestCaseType testcase = JMSTestUtil.getTestCase("test1007");
+        
+        twoWayTestWithCreateMessage(testcase);
+    }
+    
+    @Test
+    public void test1008() throws Exception {
+        TestCaseType testcase = JMSTestUtil.getTestCase("test1008");
+        
+        twoWayTestWithCreateMessage(testcase);
+    }
 }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java Wed Aug 12 08:22:47 2009
@@ -28,22 +28,24 @@
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.Session;
+import javax.jms.StreamMessage;
 import javax.jms.TextMessage;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.Unmarshaller;
 
+import org.apache.cxf.testsuite.testcase.MessagePropertiesType;
 import org.apache.cxf.testsuite.testcase.TestCaseType;
 import org.apache.cxf.testsuite.testcase.TestCasesType;
 import org.apache.cxf.transport.jms.JMSConfiguration;
 import org.apache.cxf.transport.jms.JMSFactory;
 import org.apache.cxf.transport.jms.JMSOldConfigHolder;
 import org.apache.cxf.transport.jms.JNDIConfiguration;
+import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
 import org.apache.cxf.transport.jms.uri.JMSEndpoint;
 import org.apache.cxf.transport.jms.uri.JMSEndpointParser;
 import org.apache.cxf.transport.jms.uri.JMSURIConstants;
 import org.springframework.jms.core.JmsTemplate;
-import org.springframework.jms.core.MessageCreator;
 import org.springframework.jms.support.destination.JndiDestinationResolver;
 import org.springframework.jndi.JndiTemplate;
 
@@ -56,26 +58,7 @@
 
     private JMSTestUtil() {
     }
-
-    public static void createSession(String address) throws Exception {
-        JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(address);
-        try {
-            JmsTemplate jmsTemplate = JMSFactory
-                .createJmsTemplate(getInitJMSConfiguration(address), null);
-            Destination dest = JMSFactory.resolveOrCreateDestination(jmsTemplate, endpoint
-                .getDestinationName(), false);
-            jmsTemplate.send(dest, new MessageCreator() {
-                public Message createMessage(Session session) throws JMSException {
-                    TextMessage message = session.createTextMessage();
-                    message.setText("This is message " + 1);
-                    return message;
-                }
-            });
-        } catch (JMSException e) {
-            System.out.println("Exception occurred: " + e.toString());
-        }
-    }
-
+    
     public static List<TestCaseType> getTestCases() {
         try {
             if (testcases == null) {
@@ -119,7 +102,7 @@
         return JMSFactory.resolveOrCreateDestination(jmsTemplate, destinationName, pubSubDomain);
     }
 
-    private static JMSConfiguration getInitJMSConfiguration(String address) throws Exception {
+    public static JMSConfiguration getInitJMSConfiguration(String address) throws Exception {
         JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(address);
 
         JMSConfiguration jmsConfig = new JMSConfiguration();
@@ -169,4 +152,75 @@
         }
         return jmsConfig;
     }
+
+    /**
+     * @param testcase
+     * @param session
+     * @param rtd
+     * @return
+     * @throws JMSException 
+     */
+    public static Message buildJMSMessageFromTestCase(TestCaseType testcase, Session session,
+                                                      Destination rtd) throws JMSException {
+        MessagePropertiesType messageProperties = testcase.getRequestMessage();
+        Message jmsMessage = null;
+        String messageType = messageProperties.getMessageType();
+        if ("text".equals(messageType)) {
+            jmsMessage = session.createTextMessage();
+            ((TextMessage)jmsMessage).setText("test");
+        } else if ("byte".equals(messageType)) {
+            jmsMessage = session.createBytesMessage();
+        } else if ("stream".equals(messageType)) {
+            jmsMessage = session.createStreamMessage();
+            ((StreamMessage)jmsMessage).writeString("test");
+        } else {
+            jmsMessage = session.createBytesMessage();
+        }
+
+        jmsMessage.setJMSReplyTo(rtd);
+
+        if (messageProperties.isSetDeliveryMode()) {
+            jmsMessage.setJMSDeliveryMode(messageProperties.getDeliveryMode());
+        }
+        if (messageProperties.isSetExpiration()) {
+            jmsMessage.setJMSExpiration(messageProperties.getExpiration());
+        }
+        if (messageProperties.isSetPriority()) {
+            jmsMessage.setJMSPriority(messageProperties.getPriority());
+        }
+        if (messageProperties.isSetExpiration()) {
+            jmsMessage.setJMSPriority(messageProperties.getExpiration());
+        }
+        
+        if (messageProperties.isSetTargetService()
+            && !"".equals(messageProperties.getTargetService().trim())) {
+            jmsMessage.setStringProperty(JMSSpecConstants.TARGETSERVICE_FIELD, messageProperties
+                .getTargetService().trim());
+        }
+
+        if (messageProperties.isSetBindingVersion()
+            && !"".equals(messageProperties.getBindingVersion().trim())) {
+            jmsMessage.setStringProperty(JMSSpecConstants.BINDINGVERSION_FIELD, messageProperties
+                                         .getBindingVersion().trim());
+        }
+
+        if (messageProperties.isSetContentType()
+            && !"".equals(messageProperties.getContentType().trim())) {
+            jmsMessage.setStringProperty(JMSSpecConstants.CONTENTTYPE_FIELD, messageProperties
+                .getContentType().trim());
+        }
+
+        if (messageProperties.isSetSoapAction()
+            && !"".equals(messageProperties.getSoapAction().trim())) {
+            jmsMessage.setStringProperty(JMSSpecConstants.SOAPACTION_FIELD, messageProperties
+                .getSoapAction().trim());
+        }
+
+        if (messageProperties.isSetRequestURI()
+            && !"".equals(messageProperties.getRequestURI().trim())) {
+            jmsMessage.setStringProperty(JMSSpecConstants.REQUESTURI_FIELD, messageProperties
+                .getRequestURI().trim());
+        }
+        return jmsMessage;
+    }
 }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/jms/testsuite/util/testcases.xml Wed Aug 12 08:22:47 2009
@@ -266,4 +266,231 @@
 			<messageBody></messageBody>
 		</responseMessage>
 	</testCase>
+	
+	<testCase id="test1002" mep="inout">
+		<address>jms:jndi:dynamicQueues/testqueue1002?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+		<requestMessage>
+			<messageType>stream</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination>queue://testqueue1002</destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1002
+			</requestURI>
+			<messageBody></messageBody>
+		</requestMessage>
+		<responseMessage>
+			<messageType>byte</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination></destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1002</requestURI>
+			<isFault>true</isFault>
+			<messageBody></messageBody>
+		</responseMessage>
+	</testCase>
+	
+	<testCase id="test1003" mep="inout">
+		<address>jms:jndi:dynamicQueues/testqueue1003?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+		<requestMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination>queue://testqueue1003</destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/plain; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1003
+			</requestURI>
+			<messageBody></messageBody>
+		</requestMessage>
+		<responseMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination></destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1003</requestURI>
+			<isFault>true</isFault>
+			<messageBody></messageBody>
+		</responseMessage>
+	</testCase>
+	
+	<testCase id="test1004" mep="inout">
+		<address>jms:jndi:dynamicQueues/testqueue1004?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+		<requestMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination>queue://testqueue1004</destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:domain:dynamicQueues/testqueue1004
+			</requestURI>
+			<messageBody></messageBody>
+		</requestMessage>
+		<responseMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination></destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:domain:dynamicQueues/testqueue1004</requestURI>
+			<isFault>true</isFault>
+			<messageBody></messageBody>
+		</responseMessage>
+	</testCase>
+	
+	<testCase id="test1006" mep="inout">
+		<address>jms:jndi:dynamicQueues/testqueue1006?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+		<requestMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination>queue://testqueue1006</destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType></contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1006
+			</requestURI>
+			<messageBody></messageBody>
+		</requestMessage>
+		<responseMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination></destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1006</requestURI>
+			<isFault>true</isFault>
+			<messageBody></messageBody>
+		</responseMessage>
+	</testCase>
+	
+	<testCase id="test1007" mep="inout">
+		<address>jms:jndi:dynamicQueues/testqueue1007?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+		<requestMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination>queue://testqueue1007</destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI></requestURI>
+			<messageBody></messageBody>
+		</requestMessage>
+		<responseMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination></destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI></requestURI>
+			<isFault>true</isFault>
+			<messageBody></messageBody>
+		</responseMessage>
+	</testCase>
+	
+	<testCase id="test1008" mep="inout">
+		<address>jms:jndi:dynamicQueues/testqueue1008?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500</address>
+		<requestMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination>queue://testqueue1008</destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI>jms:jndi:dynamicQueues/testqueue1008?targetService=EchoPort
+			</requestURI>
+			<messageBody></messageBody>
+		</requestMessage>
+		<responseMessage>
+			<messageType>text</messageType>
+			<deliveryMode>2</deliveryMode>
+			<priority>4</priority>
+			<expiration>0</expiration>
+			<replyTo></replyTo>
+			<correlationID></correlationID>
+			<destination></destination>
+			<redelivered>false</redelivered>
+			<bindingVersion>1.0</bindingVersion>
+			<targetService></targetService>
+			<contentType>text/xml; charset=UTF-8</contentType>
+			<soapAction></soapAction>
+			<requestURI></requestURI>
+			<isFault>true</isFault>
+			<messageBody></messageBody>
+		</responseMessage>
+	</testCase>
 </testCases>
\ No newline at end of file

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java Wed Aug 12 08:22:47 2009
@@ -675,7 +675,7 @@
         }
     
         for (Thread t : threads) {
-            t.join(10000);
+            t.join(1000);
         }
 
         Throwable e = (engClient.getException() != null) 
@@ -823,7 +823,7 @@
         }
     
         for (Thread t : threads) {
-            t.join(10000);
+            t.join(1000);
         }
 
         for (ClientRunnable client : clients) {
@@ -864,7 +864,7 @@
         }
     
         for (Thread t : threads) {
-            t.join(10000);
+            t.join(1000);
         }
 
         for (ClientRunnable client : clients) {

Modified: cxf/trunk/testutils/src/main/resources/wsdl/jms_spec_testsuite.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/jms_spec_testsuite.wsdl?rev=803410&r1=803409&r2=803410&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/resources/wsdl/jms_spec_testsuite.wsdl (original)
+++ cxf/trunk/testutils/src/main/resources/wsdl/jms_spec_testsuite.wsdl Wed Aug 12 08:22:47 2009
@@ -218,4 +218,40 @@
             <soap:address location="jms:jndi:dynamicQueues/testqueue1001?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
         </wsdl:port>
     </wsdl:service>
+    
+    <wsdl:service name="JMSSimpleService1002">
+        <wsdl:port binding="tns:JMSSimplePortBinding" name="SimplePort">
+            <soap:address location="jms:jndi:dynamicQueues/testqueue1002?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+    <wsdl:service name="JMSSimpleService1003">
+        <wsdl:port binding="tns:JMSSimplePortBinding" name="SimplePort">
+            <soap:address location="jms:jndi:dynamicQueues/testqueue1003?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+   <wsdl:service name="JMSSimpleService1004">
+        <wsdl:port binding="tns:JMSSimplePortBinding" name="SimplePort">
+            <soap:address location="jms:jndi:dynamicQueues/testqueue1004?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+    <wsdl:service name="JMSSimpleService1006">
+        <wsdl:port binding="tns:JMSSimplePortBinding" name="SimplePort">
+            <soap:address location="jms:jndi:dynamicQueues/testqueue1006?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+    <wsdl:service name="JMSSimpleService1007">
+        <wsdl:port binding="tns:JMSSimplePortBinding" name="SimplePort">
+            <soap:address location="jms:jndi:dynamicQueues/testqueue1007?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+    <wsdl:service name="JMSSimpleService1008">
+        <wsdl:port binding="tns:JMSSimplePortBinding" name="SimplePort">
+            <soap:address location="jms:jndi:dynamicQueues/testqueue1008?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500"/>
+        </wsdl:port>
+    </wsdl:service>
 </wsdl:definitions>
\ No newline at end of file



Mime
View raw message