cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1568249 [1/2] - in /cxf/trunk: rt/transports/jms/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/ rt/transports/jms/src/main/resources/schemas/wsdl/ rt/transpo...
Date Fri, 14 Feb 2014 11:44:10 GMT
Author: cschneider
Date: Fri Feb 14 11:44:09 2014
New Revision: 1568249

URL: http://svn.apache.org/r1568249
Log:
CXF-5543 Refactoring JMSEndpoint to not be generated from xsd, not using vm activemq for tests as it is sometimes using kahadb

Added:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSURIParser.java
      - copied, changed from r1567869, cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/URISupport.java
    cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java   (with props)
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SoapJmsSpecTest.java   (with props)
Removed:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpointParser.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSURIConstants.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/URISupport.java
    cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms-uri.xjb
    cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms-uri.xsd
Modified:
    cxf/trunk/rt/transports/jms/pom.xml
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.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/UnsafeUriCharactersEncoder.java
    cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSSharedQueueTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java
    cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/swa/ClientServerSwaTest.java
    cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/EmbeddedJMSBrokerLauncher.java

Modified: cxf/trunk/rt/transports/jms/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/pom.xml?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/pom.xml (original)
+++ cxf/trunk/rt/transports/jms/pom.xml Fri Feb 14 11:44:09 2014
@@ -158,14 +158,6 @@
                                     </extensionArgs>
                                 </xsdOption>
                                 <xsdOption>
-                                    <xsd>${basedir}/src/main/resources/schemas/wsdl/jms-uri.xsd</xsd>
-                                    <bindingFile>${basedir}/src/main/resources/schemas/wsdl/jms-uri.xjb</bindingFile>
-                                    <catalog>${basedir}/src/main/build-resources/catalog.cat</catalog>
-                                    <deleteDirs>
-                                        <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
-                                    </deleteDirs>
-                                </xsdOption>
-                                <xsdOption>
                                     <xsd>${basedir}/src/main/resources/schemas/wsdl/spec/jms-spec-wsdl.xsd</xsd>
                                     <bindingFile>${basedir}/src/main/resources/schemas/wsdl/spec/jms-spec-wsdl.xjb</bindingFile>
                                 </xsdOption>

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java Fri Feb 14 11:44:09 2014
@@ -49,7 +49,7 @@ public class JMSConfiguration {
     private boolean messageIdEnabled = true;
     private boolean messageTimestampEnabled = true;
     private boolean pubSubNoLocal;
-    private Long clientReceiveTimeout = 0L;
+    private Long clientReceiveTimeout = 60000L;
     private Long serverReceiveTimeout;
     private boolean explicitQosEnabled;
     private int deliveryMode = Message.DEFAULT_DELIVERY_MODE;

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java Fri Feb 14 11:44:09 2014
@@ -201,12 +201,12 @@ public final class JMSFactory {
         Session session = null;
         try {
             Connection connection = createConnection(jmsConfig);
+            connection.start();
             session = connection.createSession(jmsConfig.isSessionTransacted(), Session.AUTO_ACKNOWLEDGE);
             Destination destination = jmsConfig.getTargetDestination(session);
             MessageListenerContainer container = new MessageListenerContainer(connection, destination, listenerHandler);
             container.setMessageSelector(jmsConfig.getMessageSelector());
             container.start();
-            connection.start();
             return container;
         } catch (JMSException e) {
             throw JMSUtil.convertJmsException(e);

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java Fri Feb 14 11:44:09 2014
@@ -51,7 +51,6 @@ import org.apache.cxf.message.MessageUti
 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.apache.cxf.transport.jms.util.JMSMessageConverter;
 import org.apache.cxf.transport.jms.util.JMSUtil;
 
@@ -203,8 +202,8 @@ final class JMSMessageUtils {
                 inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
             }
             try {
-                JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(jmsMessage
-                    .getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
+                String requestURI = jmsMessage.getStringProperty(JMSSpecConstants.REQUESTURI_FIELD);
+                JMSEndpoint endpoint = new JMSEndpoint(requestURI);
                 if (endpoint.getParameter(JMSSpecConstants.TARGETSERVICE_PARAMETER_NAME) != null) {
                     headers.put(JMSSpecConstants.TARGET_SERVICE_IN_REQUESTURI,
                                 Collections.singletonList("true"));

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java Fri Feb 14 11:44:09 2014
@@ -30,15 +30,12 @@ import javax.naming.Context;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 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.apache.cxf.transport.jms.util.JMSDestinationResolver;
 import org.apache.cxf.transport.jms.util.JndiHelper;
 import org.apache.cxf.transport.jms.wsdl.DeliveryModeType;
@@ -131,9 +128,7 @@ public class JMSOldConfigHolder {
         JMSEndpoint endpoint = null;
         String adr = target == null ? endpointInfo.getAddress() : target.getAddress().getValue();
         try {           
-            endpoint = StringUtils.isEmpty(adr) || "jms://".equals(adr) || !adr.startsWith("jms") 
-                ?  new JMSEndpoint()
-                : JMSEndpointParser.createEndpoint(adr);                
+            endpoint = new JMSEndpoint(adr);
         } catch (RuntimeException ex) {
             throw ex;
         } catch (Exception e) {
@@ -195,21 +190,16 @@ public class JMSOldConfigHolder {
             jmsConfig = new JMSConfiguration();
         }
 
-        if (endpoint.isSetDeliveryMode()) {
-            int deliveryMode = endpoint.getDeliveryMode()
-                .equals(JMSURIConstants.DELIVERYMODE_PERSISTENT)
-                ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
-            jmsConfig.setDeliveryMode(deliveryMode);
-        }
+        int deliveryMode = endpoint.getDeliveryMode() 
+            == org.apache.cxf.transport.jms.uri.JMSEndpoint.DeliveryModeType.PERSISTENT
+            ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
+        jmsConfig.setDeliveryMode(deliveryMode);
 
-        if (endpoint.isSetPriority()) {
-            int priority = endpoint.getPriority();
-            jmsConfig.setPriority(priority);
-        }
+        jmsConfig.setPriority(endpoint.getPriority());
 
         if (jmsConfig.isUsingEndpointInfo()) {
             JndiHelper jt = new JndiHelper(JMSOldConfigHolder.getInitialContextEnv(endpoint));
-            boolean pubSubDomain = endpoint.getJmsVariant().contains(JMSURIConstants.TOPIC);
+            boolean pubSubDomain = endpoint.getJmsVariant().contains(JMSEndpoint.TOPIC);
             JNDIConfiguration jndiConfig = new JNDIConfiguration();
             jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
             jmsConfig.setJndiTemplate(jt);
@@ -218,9 +208,7 @@ public class JMSOldConfigHolder {
             jndiConfig.setConnectionPassword(endpoint.getPassword());
 
             jmsConfig.setJndiConfig(jndiConfig);
-            if (endpoint.isSetReconnectOnException()) {
-                jmsConfig.setReconnectOnException(endpoint.isReconnectOnException());
-            }
+            jmsConfig.setReconnectOnException(endpoint.isReconnectOnException());
             jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
             jmsConfig.setExplicitQosEnabled(true);
             if (jmsConfig.getMessageSelector() == null) {
@@ -262,17 +250,11 @@ public class JMSOldConfigHolder {
             if (sessionPool.isSetLowWaterMark()) {
                 jmsConfig.setConcurrentConsumers(sessionPool.getLowWaterMark());
             }
-            if (endpoint.isSetTimeToLive()) {
-                long timeToLive = endpoint.getTimeToLive();
-                jmsConfig.setTimeToLive(timeToLive);
-            }
-            if (endpoint.isSetUseJMS11()) {
-                LOG.log(Level.WARNING, "Use of jms:endpoint[@useJms11] is no longer supported");
-            }
+            jmsConfig.setTimeToLive(endpoint.getTimeToLive());
             if (serverBehavior.isSetTransactional()) {
                 jmsConfig.setSessionTransacted(serverBehavior.isTransactional());
             }
-            boolean useJndi = endpoint.getJmsVariant().contains(JMSURIConstants.JNDI);
+            boolean useJndi = endpoint.getJmsVariant().contains(JMSEndpoint.JNDI);
             if (useJndi) {
                 // Setup Destination jndi destination resolver
                 final JMSDestinationResolver jndiDestinationResolver = new JMSDestinationResolver();
@@ -314,9 +296,9 @@ public class JMSOldConfigHolder {
     private static void mapAddressToEndpoint(AddressType address, JMSEndpoint endpoint) {
         boolean pubSubDomain = DestinationStyleType.TOPIC == address.getDestinationStyle();
         if (address.isSetDestinationStyle()) {
-            endpoint.setJmsVariant(pubSubDomain ? JMSURIConstants.TOPIC : JMSURIConstants.QUEUE);
+            endpoint.setJmsVariant(pubSubDomain ? JMSEndpoint.TOPIC : JMSEndpoint.QUEUE);
         } else {
-            endpoint.setJmsVariant(JMSURIConstants.QUEUE);
+            endpoint.setJmsVariant(JMSEndpoint.QUEUE);
         }
         if (address.isSetJndiConnectionFactoryName()) {
             endpoint.setJndiConnectionFactoryName(address.getJndiConnectionFactoryName());
@@ -335,7 +317,7 @@ public class JMSOldConfigHolder {
         }
         boolean useJndi = address.isSetJndiDestinationName();
         if (useJndi) {
-            endpoint.setJmsVariant(pubSubDomain ? JMSURIConstants.JNDI_TOPIC : JMSURIConstants.JNDI);
+            endpoint.setJmsVariant(pubSubDomain ? JMSEndpoint.JNDI_TOPIC : JMSEndpoint.JNDI);
             endpoint.setDestinationName(address.getJndiDestinationName());
             endpoint.setReplyToName(address.getJndiReplyDestinationName());
         } else {
@@ -366,14 +348,14 @@ public class JMSOldConfigHolder {
                                               jndiContextParameterType.getValue().trim());
         }
         
-        if (!endpoint.isSetJndiConnectionFactoryName()) {
+        if (endpoint.getJndiConnectionFactoryName() == null) {
             JndiConnectionFactoryNameType jndiConnectionFactoryNameType = getWSDLExtensor(
                 ei, JndiConnectionFactoryNameType.class);
             if (jndiConnectionFactoryNameType != null) {
                 endpoint.setJndiConnectionFactoryName(jndiConnectionFactoryNameType.getValue().trim());
             }
         }
-        if (!endpoint.isSetJndiInitialContextFactory()) {
+        if (endpoint.getJndiInitialContextFactory() == null) {
             JndiInitialContextFactoryType jndiInitialContextFactoryType = 
                 getWSDLExtensor(ei, JndiInitialContextFactoryType.class);
             if (jndiInitialContextFactoryType != null) {
@@ -381,7 +363,7 @@ public class JMSOldConfigHolder {
             }
         }
         
-        if (!endpoint.isSetJndiURL()) {
+        if (endpoint.getJndiURL() == null) {
             JndiURLType jndiURLType = getWSDLExtensor(ei, JndiURLType.class);
             if (jndiURLType != null) {
                 endpoint.setJndiURL(jndiURLType.getValue().trim());
@@ -392,7 +374,7 @@ public class JMSOldConfigHolder {
             DeliveryModeType deliveryModeType = getWSDLExtensor(ei, DeliveryModeType.class);
             if (deliveryModeType != null) {
                 String deliveryMode = deliveryModeType.getValue().trim();
-                endpoint.setDeliveryMode(org.apache.cxf.transport.jms.uri.DeliveryModeType
+                endpoint.setDeliveryMode(org.apache.cxf.transport.jms.uri.JMSEndpoint.DeliveryModeType
                     .valueOf(deliveryMode));
             }
         }
@@ -404,21 +386,21 @@ public class JMSOldConfigHolder {
             }
         }
         
-        if (!endpoint.isSetTimeToLive()) {
+        if (endpoint.getTimeToLive() == 0) {
             TimeToLiveType timeToLiveType = getWSDLExtensor(ei, TimeToLiveType.class);
             if (timeToLiveType != null) {
                 endpoint.setTimeToLive(timeToLiveType.getValue()); 
             }
         }
         
-        if (!endpoint.isSetReplyToName()) {
+        if (endpoint.getReplyToName() == null) {
             ReplyToNameType replyToNameType = getWSDLExtensor(ei, ReplyToNameType.class);
             if (replyToNameType != null) {
                 endpoint.setReplyToName(replyToNameType.getValue());
             }
         }
         
-        if (!endpoint.isSetTopicReplyToName()) {
+        if (endpoint.getTopicReplyToName() == null) {
             TopicReplyToNameType topicReplyToNameType = getWSDLExtensor(ei, TopicReplyToNameType.class);
             if (topicReplyToNameType != null) {
                 endpoint.setTopicReplyToName(topicReplyToNameType.getValue());
@@ -449,10 +431,10 @@ public class JMSOldConfigHolder {
     
     public static Properties getInitialContextEnv(JMSEndpoint endpoint) {
         Properties env = new Properties();
-        if (endpoint.isSetJndiInitialContextFactory()) {
+        if (endpoint.getJndiInitialContextFactory() != null) {
             env.put(Context.INITIAL_CONTEXT_FACTORY, endpoint.getJndiInitialContextFactory());
         }
-        if (endpoint.isSetJndiURL()) {
+        if (endpoint.getJndiURL() != null) {
             env.put(Context.PROVIDER_URL, endpoint.getJndiURL());
         }
         for (Map.Entry<String, String> ent : endpoint.getJndiParameters().entrySet()) {

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=1568249&r1=1568248&r2=1568249&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 Fri Feb 14 11:44:09 2014
@@ -22,31 +22,165 @@ package org.apache.cxf.transport.jms.uri
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.jms.Message;
+
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
 
 /**
  * 
  */
-public class JMSEndpoint extends JMSEndpointType {
+public class JMSEndpoint {
+    public static final String JNDI = "jndi";
+    public static final String TOPIC = "topic";
+    public static final String QUEUE = "queue";
+    public static final String JNDI_TOPIC = "jndi-topic";
+
+    // shared parameters
+    public static final String DELIVERYMODE_PARAMETER_NAME = "deliveryMode";
+    public static final String TIMETOLIVE_PARAMETER_NAME = "timeToLive";
+    public static final String PRIORITY_PARAMETER_NAME = "priority";
+    public static final String REPLYTONAME_PARAMETER_NAME = "replyToName";
+    // The new configuration to set the message type of jms message body
+    public static final String MESSAGE_TYPE_PARAMETER_NAME = "messageType";
+
+    // default parameters
+    public static final DeliveryModeType DELIVERYMODE_DEFAULT = DeliveryModeType.PERSISTENT;
+    public static final long TIMETOLIVE_DEFAULT = Message.DEFAULT_TIME_TO_LIVE;
+    public static final int PRIORITY_DEFAULT = Message.DEFAULT_PRIORITY;
+
+    // jndi parameters ? need to be sure.
+    public static final String JNDICONNECTIONFACTORYNAME_PARAMETER_NAME = "jndiConnectionFactoryName";
+    public static final String JNDIINITIALCONTEXTFACTORY_PARAMETER_NAME = "jndiInitialContextFactory";
+    public static final String JNDIURL_PARAMETER_NAME = "jndiURL";
+    public static final String JNDI_PARAMETER_NAME_PREFIX = "jndi-";
+
+    // queue and topic parameters
+    public static final String TOPICREPLYTONAME_PARAMETER_NAME = "topicReplyToName";
+    
     Map<String, String> jndiParameters = new HashMap<String, String>();
     Map<String, String> parameters = new HashMap<String, String>();
+    
+    private String endpointUri;
+    private String jmsVariant;
+    private String destinationName;
+    private DeliveryModeType deliveryMode;
+    private MessageType messageType;
+    private long timeToLive;
+    private Integer priority;
+    private String replyToName;
+    private String topicReplyToName;
+    private String jndiConnectionFactoryName;
+    private String jndiInitialContextFactory;
+    private String jndiURL;
+    private String username;
+    private String password;
+    private boolean reconnectOnException = true;
 
     /**
      * @param uri
      * @param subject
      */
-    public JMSEndpoint(String endpointUri, String jmsVariant, String destinationName) {
-        this.endpointUri = endpointUri;
-        this.jmsVariant = jmsVariant;
-        this.destinationName = destinationName;
+    public JMSEndpoint(String endpointUri) {
+        this();
+        if (!(StringUtils.isEmpty(endpointUri) || "jms://".equals(endpointUri) || !endpointUri.startsWith("jms"))) {
+            this.endpointUri = endpointUri;
+            JMSURIParser parsed = new JMSURIParser(endpointUri);
+            setJmsVariant(parsed.getVariant());
+            this.destinationName = parsed.getDestination();
+            configureProperties(this, parsed.parseQuery());
+        }
     }
+    
     public JMSEndpoint() {
-        jmsVariant = JMSURIConstants.QUEUE;
+        this.jmsVariant = JMSEndpoint.QUEUE;
+    }
+
+    /**
+     * @param endpoint
+     * @param params
+     */
+    private static void configureProperties(JMSEndpoint endpoint, Map<String, String> params) {
+        String deliveryMode = getAndRemoveParameter(params,
+                                                    JMSEndpoint.DELIVERYMODE_PARAMETER_NAME);
+        String timeToLive = getAndRemoveParameter(params,
+                                                  JMSEndpoint.TIMETOLIVE_PARAMETER_NAME);
+        String priority = getAndRemoveParameter(params, JMSEndpoint.PRIORITY_PARAMETER_NAME);
+        String replyToName = getAndRemoveParameter(params,
+                                                   JMSEndpoint.REPLYTONAME_PARAMETER_NAME);
+        String topicReplyToName = getAndRemoveParameter(params,
+                                                   JMSEndpoint.TOPICREPLYTONAME_PARAMETER_NAME);
+        String jndiConnectionFactoryName = getAndRemoveParameter(
+                                                                 params,
+                                                JMSEndpoint.JNDICONNECTIONFACTORYNAME_PARAMETER_NAME);
+        String jndiInitialContextFactory = getAndRemoveParameter(
+                                                                 params,
+                                                JMSEndpoint.JNDIINITIALCONTEXTFACTORY_PARAMETER_NAME);
+        String jndiUrl = getAndRemoveParameter(params, JMSEndpoint.JNDIURL_PARAMETER_NAME);
+
+        String messageType = getAndRemoveParameter(params, JMSEndpoint.MESSAGE_TYPE_PARAMETER_NAME);
+        
+        if (deliveryMode != null) {
+            endpoint.setDeliveryMode(DeliveryModeType.valueOf(deliveryMode));
+        }
+        if (timeToLive != null) {
+            endpoint.setTimeToLive(Long.valueOf(timeToLive));
+        }
+        if (priority != null) {
+            endpoint.setPriority(Integer.valueOf(priority));
+        }
+        if (replyToName != null && topicReplyToName != null) {
+            throw new IllegalArgumentException(
+                "The replyToName and topicReplyToName should not be defined at the same time.");
+        }
+        if (replyToName != null) {
+            endpoint.setReplyToName(replyToName);
+        }
+        if (topicReplyToName != null) {
+            endpoint.setTopicReplyToName(topicReplyToName);
+        }
+        if (jndiConnectionFactoryName != null) {
+            endpoint.setJndiConnectionFactoryName(jndiConnectionFactoryName);
+        }
+        if (jndiInitialContextFactory != null) {
+            endpoint.setJndiInitialContextFactory(jndiInitialContextFactory);
+        }
+        if (jndiUrl != null) {
+            endpoint.setJndiURL(jndiUrl);
+        }
+        if (messageType != null) {
+            endpoint.setMessageType(MessageType.fromValue(messageType));
+        }
+
+        for (String key : params.keySet()) {
+            String value = params.get(key);
+            if (value == null || value.equals("")) {
+                continue;
+            }
+            if (key.startsWith(JMSEndpoint.JNDI_PARAMETER_NAME_PREFIX)) {
+                key = key.substring(5);
+                endpoint.putJndiParameter(key, value);
+            } else {
+                endpoint.putParameter(key, value);
+            }
+        }
+    }
+
+    /**
+     * @param parameters
+     * @param deliverymodeParameterName
+     * @return
+     */
+    private static String getAndRemoveParameter(Map<String, String> parameters,
+                                                String parameterName) {
+        String value = parameters.get(parameterName);
+        parameters.remove(parameterName);
+        return value;
     }
 
     public String getRequestURI() {
         StringBuilder requestUri = new StringBuilder("jms:");
-        if (jmsVariant == JMSURIConstants.JNDI_TOPIC) {
+        if (jmsVariant == JNDI_TOPIC) {
             requestUri.append("jndi");
         } else {
             requestUri.append(jmsVariant);
@@ -57,7 +191,7 @@ public class JMSEndpoint extends JMSEndp
             // now we just skip the MESSAGE_TYPE_PARAMETER_NAME 
             // and TARGETSERVICE_PARAMETER_NAME
             if (JMSSpecConstants.TARGETSERVICE_PARAMETER_NAME.equals(key) 
-                || JMSURIConstants.MESSAGE_TYPE_PARAMETER_NAME.equals(key)) {
+                || MESSAGE_TYPE_PARAMETER_NAME.equals(key)) {
                 continue;
             }
             String value = parameters.get(key);
@@ -101,4 +235,133 @@ public class JMSEndpoint extends JMSEndp
     public Map<String, String> getParameters() {
         return parameters;
     }
+
+    public String getEndpointUri() {
+        return endpointUri;
+    }
+    public void setEndpointUri(String endpointUri) {
+        this.endpointUri = endpointUri;
+    }
+    public String getJmsVariant() {
+        return jmsVariant;
+    }
+    public void setJmsVariant(String jmsVariant) {
+        if (jmsVariant == null) {
+            this.jmsVariant = QUEUE;
+        }
+        if (!(QUEUE.equals(jmsVariant) || TOPIC.equals(jmsVariant)
+            || JNDI.equals(jmsVariant) || JNDI_TOPIC.equals(jmsVariant))) {
+            throw new IllegalArgumentException("Unknow JMS Variant " + jmsVariant);
+        }
+        this.jmsVariant = jmsVariant;
+    }
+    public String getDestinationName() {
+        return destinationName;
+    }
+    public void setDestinationName(String destinationName) {
+        this.destinationName = destinationName;
+    }
+    public boolean isSetDeliveryMode() {
+        return deliveryMode != null;
+    }
+    public DeliveryModeType getDeliveryMode() {
+        return deliveryMode == null ? DeliveryModeType.PERSISTENT : deliveryMode;
+    }
+    public void setDeliveryMode(DeliveryModeType deliveryMode) {
+        this.deliveryMode = deliveryMode;
+    }
+    public MessageType getMessageType() {
+        return messageType == null ? MessageType.BYTE : messageType;
+    }
+    public void setMessageType(MessageType messageType) {
+        this.messageType = messageType;
+    }
+    public long getTimeToLive() {
+        return timeToLive;
+    }
+    public void setTimeToLive(long timeToLive) {
+        this.timeToLive = timeToLive;
+    }
+    public boolean isSetPriority() {
+        return priority != null;
+    }
+    public int getPriority() {
+        return priority == null ?  Message.DEFAULT_PRIORITY : priority;
+    }
+    public void setPriority(int priority) {
+        this.priority = priority;
+    }
+    public String getReplyToName() {
+        return replyToName;
+    }
+    public void setReplyToName(String replyToName) {
+        this.replyToName = replyToName;
+    }
+    public String getTopicReplyToName() {
+        return topicReplyToName;
+    }
+    public void setTopicReplyToName(String topicReplyToName) {
+        this.topicReplyToName = topicReplyToName;
+    }
+    public String getJndiConnectionFactoryName() {
+        return jndiConnectionFactoryName;
+    }
+    public void setJndiConnectionFactoryName(String jndiConnectionFactoryName) {
+        this.jndiConnectionFactoryName = jndiConnectionFactoryName;
+    }
+    public String getJndiInitialContextFactory() {
+        return jndiInitialContextFactory;
+    }
+    public void setJndiInitialContextFactory(String jndiInitialContextFactory) {
+        this.jndiInitialContextFactory = jndiInitialContextFactory;
+    }
+    public String getJndiURL() {
+        return jndiURL;
+    }
+    public void setJndiURL(String jndiURL) {
+        this.jndiURL = jndiURL;
+    }
+    public String getUsername() {
+        return username;
+    }
+    public void setUsername(String username) {
+        this.username = username;
+    }
+    public String getPassword() {
+        return password;
+    }
+    public void setPassword(String password) {
+        this.password = password;
+    }
+    public boolean isReconnectOnException() {
+        return reconnectOnException;
+    }
+    public void setReconnectOnException(boolean reconnectOnException) {
+        this.reconnectOnException = reconnectOnException;
+    }
+    public enum DeliveryModeType { PERSISTENT, NON_PERSISTENT };
+    
+    public enum MessageType {
+        BYTE("byte"),
+        BINARY("binary"),
+        TEXT("text");
+        private final String value;
+
+        MessageType(String v) {
+            value = v;
+        }
+
+        public String value() {
+            return value;
+        }
+
+        public static MessageType fromValue(String v) {
+            for (MessageType c: MessageType.values()) {
+                if (c.value.equals(v)) {
+                    return c;
+                }
+            }
+            throw new IllegalArgumentException(v);
+        }
+    }
 }

Copied: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSURIParser.java (from r1567869, cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/URISupport.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSURIParser.java?p2=cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSURIParser.java&p1=cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/URISupport.java&r1=1567869&r2=1568249&rev=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/URISupport.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSURIParser.java Fri Feb 14 11:44:09 2014
@@ -19,276 +19,98 @@
 package org.apache.cxf.transport.jms.uri;
 
 import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 
 /**
- * URI utilities.
- *
+ * Unfortunately soap/jms URIs are not recognized correctly in URI.
+ * So this class is specialized on parsing jms uris into their parts
  */
-public final class URISupport {
+final class JMSURIParser {
+    private static final Logger LOG = LogUtils.getL7dLogger(JMSURIParser.class);
     
-    private URISupport() {
-        // Helper class
-    }
-
-    /**
-     * Holder to get parts of the URI.
-     */
-    public static class CompositeData {
-        private String host;
-
-        private String scheme;
-        private String path;
-        private URI components[];
-        private Map<String, String> parameters;
-        private String fragment;
-
-        public URI[] getComponents() {
-            return components;
-        }
-
-        public String getFragment() {
-            return fragment;
-        }
-
-        public Map<String, String> getParameters() {
-            return parameters;
-        }
-
-        public String getScheme() {
-            return scheme;
-        }
-
-        public String getPath() {
-            return path;
-        }
-
-        public String getHost() {
-            return host;
-        }
-
-        public URI toURI() throws URISyntaxException {
-            StringBuilder sb = new StringBuilder();
-            if (scheme != null) {
-                sb.append(scheme);
-                sb.append(':');
-            }
-
-            if (host != null && host.length() != 0) {
-                sb.append(host);
-            } else if (components != null) {
-                sb.append('(');
-                for (int i = 0; i < components.length; i++) {
-                    if (i != 0) {
-                        sb.append(',');
-                    }
-                    sb.append(components[i].toString());
-                }
-                sb.append(')');
-            }
-
-            if (path != null) {
-                sb.append('/');
-                sb.append(path);
-            }
-            if (!parameters.isEmpty()) {
-                sb.append("?");
-                sb.append(createQueryString(parameters));
-            }
-            if (fragment != null) {
-                sb.append("#");
-                sb.append(fragment);
-            }
-            return new URI(sb.toString());
-        }
-    }
-
-    public static Map<String, String> parseQuery(String uri) throws URISyntaxException {
-        try {
-            Map<String, String> rc = new HashMap<String, String>();
-            if (uri != null) {
-                String[] parameters = StringUtils.split(uri, "&");
-                for (String parameter : parameters) {
-                    int p = parameter.indexOf("=");
-                    if (p >= 0) {
-                        String name = URLDecoder.decode(parameter.substring(0, p), "UTF-8");
-                        String value = URLDecoder.decode(parameter.substring(p + 1), "UTF-8");
-                        rc.put(name, value);
-                    } else {
-                        rc.put(parameter, null);
-                    }
-                }
-            }
-            return rc;
-        } catch (UnsupportedEncodingException e) {
-            URISyntaxException se = new URISyntaxException(e.toString(), "Invalid encoding");
-            se.initCause(e);
-            throw se;
-        }
-    }
-
-    public static Map<String, String> parseParameters(URI uri) throws URISyntaxException {
-        String query = uri.getQuery();
-        if (query == null) {
-            String schemeSpecificPart = uri.getSchemeSpecificPart();
-            int idx = schemeSpecificPart.lastIndexOf('?');
-            if (idx < 0) {
-                return Collections.emptyMap();
-            } else {
-                query = schemeSpecificPart.substring(idx + 1);
-            }
+    String uri;
+    int pos;
+    private String scheme;
+    private String variant;
+    private String destination;
+    private String query;
+    
+    public JMSURIParser(String uri) {
+        this.uri = UnsafeUriCharactersEncoder.encode(uri);
+        this.scheme = parseUntil(":");
+        this.variant = parseUntil(":");
+        this.destination = parseUntil("?");
+        String rest = parseToEnd();
+        if (this.destination == null) {
+            this.destination = rest;
+            this.query = null;
         } else {
-            query = stripPrefix(query, "?");
+            this.query = rest;
         }
-        return parseQuery(query);
+        LOG.log(Level.FINE, "Creating endpoint uri=[" + uri + "], destination=[" + destination
+                + "], query=[" + query + "]");
     }
-
-    /**
-     * Removes any URI query from the given uri
-     */
-    public static URI removeQuery(URI uri) throws URISyntaxException {
-        return createURIWithQuery(uri, null);
-    }
-
-    /**
-     * Creates a URI with the given query
-     */
-    public static URI createURIWithQuery(URI uri, String query) throws URISyntaxException {
-        return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
-                       query, uri.getFragment());
-    }
-
-    public static CompositeData parseComposite(URI uri) throws URISyntaxException {
-
-        CompositeData rc = new CompositeData();
-        rc.scheme = uri.getScheme();
-        String ssp = stripPrefix(uri.getSchemeSpecificPart().trim(), "//").trim();
-
-        parseComposite(uri, rc, ssp);
-
-        rc.fragment = uri.getFragment();
-        return rc;
+    
+    private String parseToEnd() {
+        return uri.substring(pos, uri.length());
     }
 
-    private static void parseComposite(URI uri, CompositeData rc, String ssp) throws URISyntaxException {
-        String params;
-
-        if (!checkParenthesis(ssp)) {
-            throw new URISyntaxException(uri.toString(), "Not a matching number of '(' and ')' parenthesis");
-        }
-
-        int p;
-        int intialParen = ssp.indexOf("(");
-        if (intialParen == 0) {
-            rc.host = ssp.substring(0, intialParen);
-            p = rc.host.indexOf("/");
-            if (p >= 0) {
-                rc.path = rc.host.substring(p);
-                rc.host = rc.host.substring(0, p);
-            }
-            p = ssp.lastIndexOf(")");
-            params = ssp.substring(p + 1).trim();
+    private String parseUntil(String separator) {
+        int separatorPos = uri.indexOf(separator, pos);
+        if (separatorPos != -1) {
+            String found = uri.substring(pos, separatorPos);
+            pos = separatorPos + 1;
+            return found;
         } else {
-            params = "";
-        }
-
-        p = params.indexOf("?");
-        if (p >= 0) {
-            if (p > 0) {
-                rc.path = stripPrefix(params.substring(0, p), "/");
-            }
-            rc.parameters = parseQuery(params.substring(p + 1));
-        } else {
-            if (params.length() > 0) {
-                rc.path = stripPrefix(params, "/");
-            }
-            rc.parameters = Collections.emptyMap();
+            return null;
         }
     }
 
-    public static String stripPrefix(String value, String prefix) {
-        if (value.startsWith(prefix)) {
-            return value.substring(prefix.length());
+    public Map<String, String> parseQuery() {
+        Map<String, String> rc = new HashMap<String, String>();
+        if (query != null) {
+            String[] parameters = StringUtils.split(query, "&");
+            for (String parameter : parameters) {
+                int p = parameter.indexOf("=");
+                if (p >= 0) {
+                    String name = urldecode(parameter.substring(0, p));
+                    String value = urldecode(parameter.substring(p + 1));
+                    rc.put(name, value);
+                } else {
+                    rc.put(parameter, null);
+                }
+            }
         }
-        return value;
-    }
+        return rc;
 
-    public static URI stripScheme(URI uri) throws URISyntaxException {
-        return new URI(stripPrefix(uri.getSchemeSpecificPart().trim(), "//"));
     }
-
-    public static String createQueryString(Map<String, String> options) throws URISyntaxException {
+    
+    private static String urldecode(String s) {
         try {
-            if (options.size() > 0) {
-                StringBuilder rc = new StringBuilder();
-                boolean first = true;
-                for (String key : options.keySet()) {
-                    if (first) {
-                        first = false;
-                    } else {
-                        rc.append("&");
-                    }
-
-                    String value = options.get(key);
-                    rc.append(URLEncoder.encode(key, "UTF-8"));
-                    rc.append("=");
-                    rc.append(URLEncoder.encode(value, "UTF-8"));
-                }
-                return rc.toString();
-            } else {
-                return "";
-            }
+            return URLDecoder.decode(s, "UTF-8");
         } catch (UnsupportedEncodingException e) {
-            URISyntaxException se = new URISyntaxException(e.toString(), "Invalid encoding");
-            se.initCause(e);
-            throw se;
+            throw new IllegalArgumentException("Encoding UTF-8 not supported");
         }
     }
 
-    /**
-     * Creates a URI from the original URI and the remaining parameters
-     */
-    public static URI createRemainingURI(URI originalURI, Map<String, String> params) 
-        throws URISyntaxException {
-        String s = createQueryString(params);
-        if (s.length() == 0) {
-            s = null;
-        }
-        return createURIWithQuery(originalURI, s);
+    public String getScheme() {
+        return scheme;
     }
 
-    public static URI changeScheme(URI bindAddr, String scheme) throws URISyntaxException {
-        return new URI(scheme, bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr
-            .getPath(), bindAddr.getQuery(), bindAddr.getFragment());
+    public String getVariant() {
+        return variant;
     }
 
-    public static boolean checkParenthesis(String str) {
-        boolean result = true;
-        if (str != null) {
-            int open = 0;
-            int closed = 0;
-
-            int i = 0;
-            while ((i = str.indexOf('(', i)) >= 0) {
-                i++;
-                open++;
-            }
-            i = 0;
-            while ((i = str.indexOf(')', i)) >= 0) {
-                i++;
-                closed++;
-            }
-            result = open == closed;
-        }
-        return result;
+    public String getDestination() {
+        return destination;
     }
-   
+
+    
 }

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/UnsafeUriCharactersEncoder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/UnsafeUriCharactersEncoder.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/UnsafeUriCharactersEncoder.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/UnsafeUriCharactersEncoder.java Fri Feb 14 11:44:09 2014
@@ -28,7 +28,7 @@ import org.apache.cxf.common.logging.Log
 /**
  * Encoder for unsafe URI characters.
  */
-public final class UnsafeUriCharactersEncoder {
+final class UnsafeUriCharactersEncoder {
     private static BitSet unsafeCharacters;
     private static final Logger LOG = LogUtils.getL7dLogger(UnsafeUriCharactersEncoder.class);
     private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',

Modified: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java (original)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/JMSEndpointTest.java Fri Feb 14 11:44:09 2014
@@ -21,6 +21,7 @@ package org.apache.cxf.transport.jms.uri
 
 import java.util.Map;
 
+import org.apache.cxf.transport.jms.uri.JMSEndpoint.DeliveryModeType;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -28,18 +29,18 @@ public class JMSEndpointTest extends Ass
 
     @Test
     public void testBasicQueue() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:queue:Foo.Bar");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
-        assertEquals(endpoint.getDestinationName(), "Foo.Bar");
-        assertEquals(endpoint.getJmsVariant(), JMSURIConstants.QUEUE);
+        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
+        assertEquals("Foo.Bar", endpoint.getDestinationName());
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
     }
 
     @Test
     public void testQueueParameters() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:queue:Foo.Bar?foo=bar&foo2=bar2");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar?foo=bar&foo2=bar2");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals(endpoint.getDestinationName(), "Foo.Bar");
-        assertEquals(endpoint.getJmsVariant(), JMSURIConstants.QUEUE);
+        assertEquals(endpoint.getJmsVariant(), JMSEndpoint.QUEUE);
         assertEquals(endpoint.getParameters().size(), 2);
         assertEquals(endpoint.getParameter("foo"), "bar");
         assertEquals(endpoint.getParameter("foo2"), "bar2");
@@ -47,16 +48,16 @@ public class JMSEndpointTest extends Ass
 
     @Test
     public void testBasicTopic() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:topic:Foo.Bar");
-        assertEquals(JMSURIConstants.TOPIC, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:topic:Foo.Bar");
+        assertEquals(JMSEndpoint.TOPIC, endpoint.getJmsVariant());
         assertEquals(endpoint.getDestinationName(), "Foo.Bar");
-        assertEquals(endpoint.getJmsVariant(), JMSURIConstants.TOPIC);
+        assertEquals(endpoint.getJmsVariant(), JMSEndpoint.TOPIC);
     }
 
     @Test
     public void testTopicParameters() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:topic:Foo.Bar?foo=bar&foo2=bar2");
-        assertEquals(JMSURIConstants.TOPIC, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:topic:Foo.Bar?foo=bar&foo2=bar2");
+        assertEquals(JMSEndpoint.TOPIC, endpoint.getJmsVariant());
         assertEquals(endpoint.getParameters().size(), 2);
         assertEquals(endpoint.getParameter("foo"), "bar");
         assertEquals(endpoint.getParameter("foo2"), "bar2");
@@ -64,19 +65,19 @@ public class JMSEndpointTest extends Ass
 
     @Test
     public void testBasicJNDI() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:jndi:Foo.Bar");
-        assertEquals(JMSURIConstants.JNDI, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:jndi:Foo.Bar");
+        assertEquals(JMSEndpoint.JNDI, endpoint.getJmsVariant());
         assertEquals(endpoint.getDestinationName(), "Foo.Bar");
-        assertEquals(endpoint.getJmsVariant(), JMSURIConstants.JNDI);
+        assertEquals(endpoint.getJmsVariant(), JMSEndpoint.JNDI);
     }
 
     @Test
     public void testJNDIParameters() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:jndi:Foo.Bar?" + "jndiInitialContextFactory"
-                                               + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-                                               + "&jndiConnectionFactoryName=ConnectionFactory"
-                                               + "&jndiURL=tcp://localhost:61616");
-        assertEquals(JMSURIConstants.JNDI, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:jndi:Foo.Bar?" + "jndiInitialContextFactory"
+            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+            + "&jndiConnectionFactoryName=ConnectionFactory"
+            + "&jndiURL=tcp://localhost:61616");
+        assertEquals(JMSEndpoint.JNDI, endpoint.getJmsVariant());
         assertEquals(endpoint.getParameters().size(), 0);
         assertEquals(endpoint.getDestinationName(), "Foo.Bar");
         assertEquals(endpoint.getJndiInitialContextFactory(),
@@ -88,19 +89,19 @@ public class JMSEndpointTest extends Ass
     
     @Test
     public void testReplyToNameParameters() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:queue:Foo.Bar?replyToName=FOO.Tar");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar?replyToName=FOO.Tar");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals("Foo.Bar", endpoint.getDestinationName());
         assertNull(endpoint.getTopicReplyToName());
         assertEquals("FOO.Tar", endpoint.getReplyToName());
         try {
-            resolveEndpoint("jms:queue:Foo.Bar?replyToName=FOO.Tar&topicReplyToName=FOO.Zar");
+            new JMSEndpoint("jms:queue:Foo.Bar?replyToName=FOO.Tar&topicReplyToName=FOO.Zar");
             fail("Expecting exception here");
         } catch (IllegalArgumentException ex) {
             // expect the exception
         }
         
-        endpoint = resolveEndpoint("jms:queue:Foo.Bar?topicReplyToName=FOO.Zar");
+        endpoint = new JMSEndpoint("jms:queue:Foo.Bar?topicReplyToName=FOO.Zar");
         assertEquals("Foo.Bar", endpoint.getDestinationName());
         assertNull(endpoint.getReplyToName());
         assertEquals("FOO.Zar", endpoint.getTopicReplyToName());
@@ -108,12 +109,12 @@ public class JMSEndpointTest extends Ass
     
     @Test
     public void testJNDIWithAdditionalParameters() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:jndi:Foo.Bar?" + "jndiInitialContextFactory"
-                                               + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-                                               + "&jndiConnectionFactoryName=ConnectionFactory"
-                                               + "&jndiURL=tcp://localhost:61616"
-                                               + "&jndi-com.sun.jndi.someParameter=someValue");
-        assertEquals(JMSURIConstants.JNDI, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:jndi:Foo.Bar?" + "jndiInitialContextFactory"
+            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+            + "&jndiConnectionFactoryName=ConnectionFactory"
+            + "&jndiURL=tcp://localhost:61616"
+            + "&jndi-com.sun.jndi.someParameter=someValue");
+        assertEquals(JMSEndpoint.JNDI, endpoint.getJmsVariant());
         assertEquals(endpoint.getParameters().size(), 0);
         assertEquals(endpoint.getJndiInitialContextFactory(),
                      "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
@@ -126,12 +127,12 @@ public class JMSEndpointTest extends Ass
 
     @Test
     public void testSharedParameters() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:queue:Foo.Bar?" + "deliveryMode=NON_PERSISTENT"
-                                               + "&timeToLive=100" + "&priority=5" + "&replyToName=foo.bar2");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar?" + "deliveryMode=NON_PERSISTENT"
+            + "&timeToLive=100" + "&priority=5" + "&replyToName=foo.bar2");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals(endpoint.getParameters().size(), 0);
-        assertEquals(endpoint.getDeliveryMode().toString(),
-                     JMSURIConstants.DELIVERYMODE_NON_PERSISTENT.toString());
+        assertEquals(endpoint.getDeliveryMode(),
+                     DeliveryModeType.NON_PERSISTENT);
         assertEquals(endpoint.getTimeToLive(), 100);
         assertEquals(endpoint.getPriority(), 5);
         assertEquals(endpoint.getReplyToName(), "foo.bar2");
@@ -139,15 +140,15 @@ public class JMSEndpointTest extends Ass
 
     @Test
     public void testRequestUri() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:jndi:Foo.Bar?" + "jndiInitialContextFactory"
-                                               + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-                                               + "&targetService=greetMe"
-                                               + "&replyToName=replyQueue"
-                                               + "&timeToLive=1000"
-                                               + "&priority=3"
-                                               + "&foo=bar"
-                                               + "&foo2=bar2");
-        assertEquals(JMSURIConstants.JNDI, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:jndi:Foo.Bar?" + "jndiInitialContextFactory"
+            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+            + "&targetService=greetMe"
+            + "&replyToName=replyQueue"
+            + "&timeToLive=1000"
+            + "&priority=3"
+            + "&foo=bar"
+            + "&foo2=bar2");
+        assertEquals(JMSEndpoint.JNDI, endpoint.getJmsVariant());
         assertEquals(endpoint.getParameters().size(), 3);
         String requestUri = endpoint.getRequestURI();
         // Checking what's the request uri should have
@@ -163,21 +164,24 @@ public class JMSEndpointTest extends Ass
     
     @Test
     public void testRequestUriWithMessageType() throws Exception {
-        JMSEndpoint endpoint = resolveEndpoint("jms:queue:Foo.Bar?messageType=text");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
+        JMSEndpoint endpoint = new JMSEndpoint("jms:queue:Foo.Bar?messageType=text");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals("text", endpoint.getMessageType().value());
         
-        endpoint = resolveEndpoint("jms:queue:Foo.Bar");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
+        endpoint = new JMSEndpoint("jms:queue:Foo.Bar");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals("byte", endpoint.getMessageType().value());
         
-        endpoint = resolveEndpoint("jms:queue:Foo.Bar?messageType=binary");
-        assertEquals(JMSURIConstants.QUEUE, endpoint.getJmsVariant());
+        endpoint = new JMSEndpoint("jms:queue:Foo.Bar?messageType=binary");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
         assertEquals("binary", endpoint.getMessageType().value());
         
     }
-    
-    private JMSEndpoint resolveEndpoint(String uri) throws Exception {
-        return JMSEndpointParser.createEndpoint(uri);
+
+    @Test
+    public void nonSoapJMS() throws Exception {
+        JMSEndpoint endpoint = new JMSEndpoint("jms://");
+        assertEquals(JMSEndpoint.QUEUE, endpoint.getJmsVariant());
     }
+    
 }

Added: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java?rev=1568249&view=auto
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java (added)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java Fri Feb 14 11:44:09 2014
@@ -0,0 +1,101 @@
+/**
+ * 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.transport.jms.uri;
+
+import javax.jms.ConnectionFactory;
+
+import org.apache.activemq.pool.PooledConnectionFactory;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.jms.JMSConduit;
+import org.apache.cxf.transport.jms.JMSConfiguration;
+import org.apache.cxf.transport.jms.JMSConstants;
+import org.apache.cxf.transport.jms.JMSMessageHeadersType;
+import org.apache.cxf.transport.jms.JMSOldConfigHolder;
+import org.apache.cxf.transport.jms.util.TestReceiver;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Checks if a CXF client works correlates requests and responses correctly if the server sets the message id
+ * as correlation id on the response message
+ */
+public class URIConfiguredConduitTest {
+    private static final String SERVICE_QUEUE = "test";
+    private static final String BROKER_URI = "vm://localhost?broker.persistent=false";
+    private ConnectionFactory connectionFactory;
+
+    @Test
+    public void testSendReceive() throws Exception {
+        sendAndReceive(true, "testreply");
+    }
+    
+    public void sendAndReceive(boolean synchronous, String replyDestination) throws Exception {
+        BusFactory bf = BusFactory.newInstance();
+        Bus bus = bf.createBus();
+        BusFactory.setDefaultBus(bus);
+        EndpointReferenceType target = new EndpointReferenceType();
+
+        connectionFactory = new PooledConnectionFactory(BROKER_URI);
+        TestReceiver receiver = new TestReceiver(connectionFactory, SERVICE_QUEUE, true);
+        receiver.runAsync();
+
+        JMSOldConfigHolder holder = new JMSOldConfigHolder();
+        EndpointInfo ei = new EndpointInfo();
+        String address = "jms:jndi:dynamicQueues/" + SERVICE_QUEUE
+            + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+            + "&replyToName=dynamicQueues/" + replyDestination
+            + "&messageType=text"
+            + "&jndiConnectionFactoryName=ConnectionFactory"
+            + "&jndiURL=" + BROKER_URI;
+        ei.setAddress(address);
+        JMSConfiguration jmsConfig = holder.createJMSConfigurationFromEndpointInfo(bus, ei , null, true);
+        JMSConduit conduit = new JMSConduit(target, jmsConfig, bus);
+        Exchange exchange = new ExchangeImpl();
+        exchange.setSynchronous(synchronous);
+        Message message = new MessageImpl();
+        exchange.setOutMessage(message);
+        conduit.sendExchange(exchange, "Request");
+        waitForAsyncReply(exchange);
+        receiver.close();
+        if (exchange.getInMessage() == null) {
+            throw new RuntimeException("No reply received within 2 seconds");
+        }
+        JMSMessageHeadersType inHeaders = (JMSMessageHeadersType)exchange.getInMessage()
+            .get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
+        Assert.assertEquals(receiver.getRequestMessageId(), inHeaders.getJMSCorrelationID());
+        conduit.close();
+        bus.shutdown(true);
+    }
+
+    private void waitForAsyncReply(Exchange exchange) throws InterruptedException {
+        int count = 0;
+        while (exchange.getInMessage() == null && count <= 20) {
+            Thread.sleep(100);
+            count++;
+        }
+    }
+
+}

Propchange: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/uri/URIConfiguredConduitTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java (original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SOAPJMSTestSuiteTest.java Fri Feb 14 11:44:09 2014
@@ -57,6 +57,7 @@ import org.apache.cxf.jms_simple.JMSSimp
 import org.apache.cxf.jms_simple.JMSSimpleService1101;
 import org.apache.cxf.jms_simple.JMSSimpleService1105;
 import org.apache.cxf.jms_simple.JMSSimpleService1109;
+import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.testsuite.testcase.MessagePropertiesType;
 import org.apache.cxf.testsuite.testcase.TestCaseType;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -65,6 +66,7 @@ import org.apache.cxf.transport.jms.JMSC
 import org.apache.cxf.transport.jms.JMSConstants;
 import org.apache.cxf.transport.jms.JMSFactory;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
+import org.apache.cxf.transport.jms.JMSOldConfigHolder;
 import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
 import org.apache.cxf.transport.jms.util.JMSSender;
 import org.apache.cxf.transport.jms.util.JMSUtil;
@@ -83,8 +85,9 @@ public class SOAPJMSTestSuiteTest extend
     
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher("vm://SOAPJMSTestSuiteTest?broker.persistent=false");
+        broker = new EmbeddedJMSBrokerLauncher();
         launchServer(broker);
+        JMSTestUtil.setJndiUrl(broker.getEncodedBrokerURL());
         assertTrue("server did not launch correctly", launchServer(Server.class, true));
         createStaticBus();
     }
@@ -592,25 +595,11 @@ public class SOAPJMSTestSuiteTest extend
             if (header.isSetJMSDeliveryMode()) {
                 dm = header.getJMSDeliveryMode();
             }
-            assertEquals(dm, 
-                         messageProperties.getDeliveryMode().intValue());
+            assertEquals(dm, messageProperties.getDeliveryMode().intValue());
         }
         if (messageProperties.isSetPriority()) {
             assertEquals(header.getJMSPriority(), messageProperties.getPriority().intValue());
         }
-        /*
-         * if (messageProperties.isSetExpiration()) { assertEquals(header.getJMSExpiration(),
-         * messageProperties.getExpiration().intValue()); }
-         */
-        /*
-         * if (messageProperties.isSetReplyTo() && !messageProperties.getReplyTo().trim().equals("")) {
-         * assertEquals(header.getJMSReplyTo().toString(), messageProperties.getReplyTo()); }
-         */
-        // correlationid
-        /*
-         * if (messageProperties.isSetDestination() && !messageProperties.getDestination().trim().equals(""))
-         * { assertEquals(header.get.toString(), messageProperties.getDestination()); }
-         */
         if (messageProperties.isSetBindingVersion()
             && !messageProperties.getBindingVersion().trim().equals("")) {
             assertEquals(header.getSOAPJMSBindingVersion(), messageProperties.getBindingVersion());
@@ -639,7 +628,12 @@ public class SOAPJMSTestSuiteTest extend
     
     public void twoWayTestWithCreateMessage(final TestCaseType testcase) throws Exception {
         String address = testcase.getAddress();
-        JMSConfiguration jmsConfig = JMSTestUtil.getInitJMSConfiguration(address);
+        
+        EndpointInfo endpointInfo = new EndpointInfo();
+        endpointInfo.setAddress(address);
+        JMSOldConfigHolder oldConfig = new JMSOldConfigHolder();
+        JMSConfiguration jmsConfig = oldConfig
+            .createJMSConfigurationFromEndpointInfo(staticBus, endpointInfo , null, true);
         
         ResourceCloser closer = new ResourceCloser();
         try {

Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SoapJmsSpecTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SoapJmsSpecTest.java?rev=1568249&view=auto
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SoapJmsSpecTest.java (added)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SoapJmsSpecTest.java Fri Feb 14 11:44:09 2014
@@ -0,0 +1,253 @@
+/**
+ * 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.testcases;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.jms.DeliveryMode;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.jms_greeter.JMSGreeterPortType;
+import org.apache.cxf.jms_greeter.JMSGreeterService;
+import org.apache.cxf.jms_greeter.JMSGreeterService2;
+import org.apache.cxf.systest.jms.Hello;
+import org.apache.cxf.systest.jms.Server;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher;
+import org.apache.cxf.transport.jms.JMSConfiguration;
+import org.apache.cxf.transport.jms.JMSConstants;
+import org.apache.cxf.transport.jms.JMSMessageHeadersType;
+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.util.JndiHelper;
+import org.apache.cxf.transport.jms.util.TestReceiver;
+import org.apache.hello_world_doc_lit.Greeter;
+import org.apache.hello_world_doc_lit.SOAPService7;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SoapJmsSpecTest extends AbstractBusClientServerTestBase {
+
+    private static EmbeddedJMSBrokerLauncher broker;
+    private String wsdlString;
+    
+    public URL getWSDLURL(String s) throws Exception {
+        URL u = getClass().getResource(s);
+        if (u == null) {
+            throw new IllegalArgumentException("WSDL classpath resource not found " + s);
+        }
+        wsdlString = u.toString().intern();
+        broker.updateWsdl(getBus(), wsdlString);
+        return u;
+    }
+
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        broker = new EmbeddedJMSBrokerLauncher();
+        launchServer(broker);
+        launchServer(new Server(broker));
+        createStaticBus();
+    }
+    
+    @Test
+    public void testSpecJMS() throws Exception {
+        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService");
+        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort");
+        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
+        JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
+
+        String response1 = new String("Hello Milestone-");
+        String response2 = new String("Bonjour");
+        JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
+        for (int idx = 0; idx < 5; idx++) {
+
+            greeter.greetMeOneWay("test String");
+
+            String greeting = greeter.greetMe("Milestone-" + idx);
+            assertNotNull("no response received from service", greeting);
+            String exResponse = response1 + idx;
+            assertEquals(exResponse, greeting);
+
+            String reply = greeter.sayHi();
+            assertNotNull("no response received from service", reply);
+            assertEquals(response2, reply);
+        }
+    }
+    
+    @Test
+    public void testWsdlExtensionSpecJMS() throws Exception {
+        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService");
+        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort");
+        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
+        assertNotNull(wsdl);
+
+        JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
+        assertNotNull(service);
+
+        String response = new String("Bonjour");
+        try {
+            JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
+            Map<String, Object> requestContext = ((BindingProvider)greeter).getRequestContext();
+            JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
+            requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
+            
+            String reply = greeter.sayHi();
+            assertNotNull("no response received from service", reply);
+            assertEquals(response, reply);
+            
+            requestContext = ((BindingProvider)greeter).getRequestContext();
+            requestHeader = (JMSMessageHeadersType)requestContext
+                .get(JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
+            assertEquals(requestHeader.getSOAPJMSBindingVersion(), "1.0");
+            assertEquals(requestHeader.getSOAPJMSSOAPAction(), "\"test\"");
+            assertEquals(requestHeader.getTimeToLive(), 3000);
+            assertEquals(requestHeader.getJMSDeliveryMode(), DeliveryMode.PERSISTENT);
+            assertEquals(requestHeader.getJMSPriority(), 7);
+            
+            Map<String, Object> responseContext = ((BindingProvider)greeter).getResponseContext();
+            JMSMessageHeadersType responseHeader = (JMSMessageHeadersType)responseContext
+                .get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
+            assertEquals(responseHeader.getSOAPJMSBindingVersion(), "1.0");
+            assertEquals(responseHeader.getSOAPJMSSOAPAction(), null);
+            assertEquals(responseHeader.getJMSDeliveryMode(), DeliveryMode.PERSISTENT);
+            assertEquals(responseHeader.getJMSPriority(), 7);
+            
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+
+    @Test
+    public void testWsdlExtensionSpecJMSPortError() throws Exception {
+        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService2");
+        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort2");
+        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
+        assertNotNull(wsdl);
+
+        JMSGreeterService2 service = new JMSGreeterService2(wsdl, serviceName);
+        assertNotNull(service);
+
+        String response = new String("Bonjour");
+        JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);    
+        String reply = greeter.sayHi();
+        assertNotNull("no response received from service", reply);
+        assertEquals(response, reply); 
+    }
+    
+    @Test 
+    public void testSpecNoWsdlService() throws Exception {
+        specNoWsdlService(null);
+    }
+    
+    @Test
+    public void testSpecNoWsdlServiceWithDifferentMessageType() throws Exception {
+        specNoWsdlService("text");
+        specNoWsdlService("byte");
+        specNoWsdlService("binary");
+    }
+    
+    private void specNoWsdlService(String messageType) throws Exception {
+        String address = "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue3"
+            + "?jndiInitialContextFactory"
+            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+            + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=" 
+            + broker.getEncodedBrokerURL();
+        if (messageType != null) {
+            address = address + "&messageType=" + messageType;
+        }
+
+        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
+        factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
+        factory.setServiceClass(Hello.class);
+        factory.setAddress(address);
+        Hello client = (Hello)factory.create();
+        String reply = client.sayHi(" HI");
+        assertEquals(reply, "get HI");
+    }
+    
+    @Test
+    public void testBindingVersionError() throws Exception {
+        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService");
+        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort");
+        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
+
+        JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
+
+        JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
+        BindingProvider  bp = (BindingProvider)greeter;
+        
+        Map<String, Object> requestContext = bp.getRequestContext();
+        JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
+        requestHeader.setSOAPJMSBindingVersion("0.3");
+        requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
+ 
+        try {
+            greeter.greetMe("Milestone-");
+            fail("Should have thrown a fault");
+        } catch (SOAPFaultException ex) {
+            assertTrue(ex.getMessage().contains("0.3"));
+            Map<String, Object> responseContext = bp.getResponseContext();
+            JMSMessageHeadersType responseHdr = 
+                 (JMSMessageHeadersType)responseContext.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
+            if (responseHdr == null) {
+                fail("response Header should not be null");
+            }
+            assertTrue(responseHdr.isSOAPJMSIsFault());
+        }
+
+    }
+    
+    @Test
+    public void testReplyToConfig() throws Exception {
+        JMSEndpoint endpoint = new JMSEndpoint();
+        endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+        endpoint.setJndiURL(broker.getBrokerURL());
+        endpoint.setJndiConnectionFactoryName("ConnectionFactory");
+
+        final JMSConfiguration jmsConfig = new JMSConfiguration();        
+        JndiHelper jt = new JndiHelper(JMSOldConfigHolder.getInitialContextEnv(endpoint));
+        
+        JNDIConfiguration jndiConfig = new JNDIConfiguration();
+        jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
+        jmsConfig.setJndiTemplate(jt);
+        jmsConfig.setJndiConfig(jndiConfig);
+        
+        TestReceiver receiver = new TestReceiver(jmsConfig.getConnectionFactory(), 
+                                                 "dynamicQueues/SoapService7.replyto.queue", false);
+        receiver.setStaticReplyQueue("dynamicQueues/SoapService7.reply.queue");
+        receiver.runAsync();
+        
+        QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService7");
+        QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort7");
+        URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
+        SOAPService7 service = new SOAPService7(wsdl, serviceName);        
+        Greeter greeter = service.getPort(portName, Greeter.class);
+        String name = "FooBar";
+        String reply = greeter.greetMe(name);
+        assertEquals(reply, "Hello " + name);
+    }
+}

Propchange: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/testcases/SoapJmsSpecTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java (original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java Fri Feb 14 11:44:09 2014
@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -37,15 +36,7 @@ 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.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.apache.cxf.transport.jms.util.JMSDestinationResolver;
-import org.apache.cxf.transport.jms.util.JndiHelper;
 
 /**
  * 
@@ -53,10 +44,15 @@ import org.apache.cxf.transport.jms.util
 public final class JMSTestUtil {
 
     private static TestCasesType testcases;
+    private static String jndiUrl;
 
     private JMSTestUtil() {
     }
     
+    public static void setJndiUrl(String jndiUrl) {
+        JMSTestUtil.jndiUrl = jndiUrl;
+    }
+
     public static List<TestCaseType> getTestCases() {
         try {
             if (testcases == null) {
@@ -96,7 +92,7 @@ public final class JMSTestUtil {
                 if (idx != -1) {
                     int idx2 = add.indexOf("&", idx);
                     add = add.substring(0, idx)
-                        + "jndiURL=vm://SOAPJMSTestSuiteTest"
+                        + "jndiURL=" + jndiUrl
                         + (idx2 == -1 ? "" : add.substring(idx2));
                     tct.setAddress(add);
                 }
@@ -104,56 +100,6 @@ public final class JMSTestUtil {
         }
     }
 
-    public static JMSConfiguration getInitJMSConfiguration(String address) throws Exception {
-        JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(address);
-
-        JMSConfiguration jmsConfig = new JMSConfiguration();
-
-        if (endpoint.isSetDeliveryMode()) {
-            int deliveryMode = endpoint.getDeliveryMode()
-                .equals(JMSURIConstants.DELIVERYMODE_PERSISTENT)
-                ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
-            jmsConfig.setDeliveryMode(deliveryMode);
-        }
-
-        if (endpoint.isSetPriority()) {
-            int priority = endpoint.getPriority();
-            jmsConfig.setPriority(priority);
-        }
-
-        if (endpoint.isSetTimeToLive()) {
-            long timeToLive = endpoint.getTimeToLive();
-            jmsConfig.setTimeToLive(timeToLive);
-        }
-
-        if (jmsConfig.isUsingEndpointInfo()) {
-            JndiHelper jt = new JndiHelper(JMSOldConfigHolder.getInitialContextEnv(endpoint));
-            boolean pubSubDomain = false;
-            pubSubDomain = endpoint.getJmsVariant().equals(JMSURIConstants.TOPIC);
-            JNDIConfiguration jndiConfig = new JNDIConfiguration();
-            jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
-            jmsConfig.setJndiTemplate(jt);
-            jmsConfig.setJndiConfig(jndiConfig);
-            jmsConfig.setExplicitQosEnabled(true);
-            jmsConfig.setPubSubDomain(pubSubDomain);
-            jmsConfig.setPubSubNoLocal(true);
-            boolean useJndi = endpoint.getJmsVariant().equals(JMSURIConstants.JNDI);
-            if (useJndi) {
-                // Setup Destination jndi destination resolver
-                final JMSDestinationResolver jndiDestinationResolver = new JMSDestinationResolver();
-                jndiDestinationResolver.setJndiTemplate(jt);
-                jmsConfig.setDestinationResolver(jndiDestinationResolver);
-                jmsConfig.setTargetDestination(endpoint.getDestinationName());
-                jmsConfig.setReplyDestination(endpoint.getReplyToName());
-            } else {
-                // Use the default dynamic destination resolver
-                jmsConfig.setTargetDestination(endpoint.getDestinationName());
-                jmsConfig.setReplyDestination(endpoint.getReplyToName());
-            }
-        }
-        return jmsConfig;
-    }
-
     /**
      * @param testcase
      * @param session

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java (original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java Fri Feb 14 11:44:09 2014
@@ -42,8 +42,6 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JMSClientServerGzipTest extends AbstractBusClientServerTestBase {
-    private static final String BROKER_URI = "vm://" + JMSClientServerGzipTest.class.getSimpleName() 
-        + "?broker.persistent=false";
     private static EmbeddedJMSBrokerLauncher broker;
     private String wsdlString;
     
@@ -65,7 +63,7 @@ public class JMSClientServerGzipTest ext
     }
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher(BROKER_URI);
+        broker = new EmbeddedJMSBrokerLauncher();
         launchServer(broker);
         assertTrue("server did not launch correctly", 
                    launchServer(GzipServer.class, true));



Mime
View raw message