camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1461664 - in /camel/trunk/components/camel-smpp/src: main/java/org/apache/camel/component/smpp/SmppComponent.java test/java/org/apache/camel/component/smpp/SmppComponentTest.java
Date Wed, 27 Mar 2013 15:48:57 GMT
Author: cmueller
Date: Wed Mar 27 15:48:56 2013
New Revision: 1461664

URL: http://svn.apache.org/r1461664
Log:
CAMEL-6117: Allow empty service_type and system_type

Modified:
    camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
    camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java

Modified: camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java?rev=1461664&r1=1461663&r2=1461664&view=diff
==============================================================================
--- camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
(original)
+++ camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
Wed Mar 27 15:48:56 2013
@@ -52,11 +52,17 @@ public class SmppComponent extends Defau
         SmppConfiguration config = this.configuration.copy();
 
         config.configureFromURI(new URI(uri));
+        // TODO Camel 3.0 cmueller: We should change the default in Camel 3.0 to '' so that
we can remove this special handling
         // special handling to set the system type to an empty string
         if (parameters.containsKey("systemType") && parameters.get("systemType")
== null) {
             config.setSystemType("");
             parameters.remove("systemType");
         }
+        // special handling to set the service type to an empty string
+        if (parameters.containsKey("serviceType") && parameters.get("serviceType")
== null) {
+            config.setServiceType("");
+            parameters.remove("serviceType");
+        }
         setProperties(config, parameters);
 
         return createEndpoint(uri, config);

Modified: camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java?rev=1461664&r1=1461663&r2=1461664&view=diff
==============================================================================
--- camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java
(original)
+++ camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java
Wed Mar 27 15:48:56 2013
@@ -125,13 +125,15 @@ public class SmppComponentTest {
     }
 
     @Test
-    public void allowEmptySystemTypeOption() throws Exception {
+    public void allowEmptySystemTypeAndServiceTypeOption() throws Exception {
         Map<String, String> parameters = new HashMap<String, String>();
         parameters.put("systemType", null);
-        Endpoint endpoint = component.createEndpoint("smpp://smppclient@localhost:2775",
"?systemType=", parameters);
+        parameters.put("serviceType", null);
+        Endpoint endpoint = component.createEndpoint("smpp://smppclient@localhost:2775",
"?systemType=&serviceType=", parameters);
         SmppEndpoint smppEndpoint = (SmppEndpoint) endpoint;
 
         assertEquals("", smppEndpoint.getConfiguration().getSystemType());
+        assertEquals("", smppEndpoint.getConfiguration().getServiceType());
     }
 
     @Test



Mime
View raw message