camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject git commit: CAMEL-6655: SMPP - add support of Vendor Specific Optional Parameter
Date Sun, 25 Aug 2013 13:42:25 GMT
Updated Branches:
  refs/heads/master 05d3301cc -> 2fb5de834


CAMEL-6655: SMPP - add support of Vendor Specific Optional Parameter


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2fb5de83
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2fb5de83
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2fb5de83

Branch: refs/heads/master
Commit: 2fb5de834578b769d101b27651c1972744b72c9f
Parents: 05d3301
Author: cmueller <cmueller@apache.org>
Authored: Sun Aug 25 15:41:52 2013 +0200
Committer: cmueller <cmueller@apache.org>
Committed: Sun Aug 25 15:42:16 2013 +0200

----------------------------------------------------------------------
 .../component/smpp/AbstractSmppCommand.java     | 20 ++----
 .../camel/component/smpp/SmppBinding.java       | 73 +++++++++++++++-----
 .../camel/component/smpp/SmppConstants.java     |  3 +-
 .../camel/component/smpp/SmppDataSmCommand.java | 14 ++--
 .../component/smpp/SmppSubmitMultiCommand.java  | 14 ++--
 .../component/smpp/SmppSubmitSmCommand.java     | 14 ++--
 .../camel/component/smpp/SmppBindingTest.java   | 15 +++-
 .../component/smpp/SmppDataSmCommandTest.java   |  2 +-
 .../smpp/SmppSubmitMultiCommandTest.java        |  2 +-
 .../component/smpp/SmppSubmitSmCommandTest.java |  2 +-
 10 files changed, 106 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/AbstractSmppCommand.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/AbstractSmppCommand.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/AbstractSmppCommand.java
index 145ce46..c6ad202 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/AbstractSmppCommand.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/AbstractSmppCommand.java
@@ -55,20 +55,6 @@ public abstract class AbstractSmppCommand implements SmppCommand {
         return message;
     }
 
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    protected List<OptionalParameter> createOptionalParameters(Map optinalParamaters)
{
-        if (optinalParamaters == null || optinalParamaters.isEmpty()) {
-            return new ArrayList<OptionalParameter>();
-        }
-
-        Object firstKey = optinalParamaters.keySet().iterator().next();
-        if (firstKey instanceof String) {
-            return createOptionalParametersByName(optinalParamaters);
-        } else {
-            return createOptionalParametersByCode(optinalParamaters);
-        }
-    }
-
     protected List<OptionalParameter> createOptionalParametersByCode(Map<Short,
Object> optinalParamaters) {
         List<OptionalParameter> optParams = new ArrayList<OptionalParameter>();
 
@@ -104,8 +90,12 @@ public abstract class AbstractSmppCommand implements SmppCommand {
         return optParams;
     }
 
+    /**
+     * @deprecated will be removed in Camel 2.13.0/3.0.0 - use createOptionalParametersByCode
instead
+     * @param optinalParamaters
+     * @return
+     */
     @SuppressWarnings("rawtypes")
-    @Deprecated
     protected List<OptionalParameter> createOptionalParametersByName(Map<String,
String> optinalParamaters) {
         List<OptionalParameter> optParams = new ArrayList<OptionalParameter>();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
index 5c86c9c..c1a8a8e 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java
@@ -106,26 +106,15 @@ public class SmppBinding {
             smppMessage.setHeader(SmppConstants.SUBMIT_DATE, smscDeliveryReceipt.getSubmitDate());
             smppMessage.setHeader(SmppConstants.SUBMITTED, smscDeliveryReceipt.getSubmitted());
             smppMessage.setHeader(SmppConstants.FINAL_STATUS, smscDeliveryReceipt.getFinalStatus());
+
             if (deliverSm.getOptionalParametes() != null && deliverSm.getOptionalParametes().length
> 0) {
-                List<OptionalParameter> oplist = Arrays.asList(deliverSm.getOptionalParametes());
+                // the deprecated way
+                Map<String, Object> optionalParameters = createOptionalParameterByName(deliverSm);
+                smppMessage.setHeader(SmppConstants.OPTIONAL_PARAMETERS, optionalParameters);
 
-                Map<String, Object> optParams = new HashMap<String, Object>();
-                for (OptionalParameter optPara : oplist) {
-                    if (OctetString.class.isInstance(optPara)) {
-                        optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(),
((OctetString) optPara).getValueAsString());
-                    } else if (org.jsmpp.bean.OptionalParameter.COctetString.class.isInstance(optPara))
{
-                        optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(),
((COctetString) optPara).getValueAsString());
-                    } else if (org.jsmpp.bean.OptionalParameter.Byte.class.isInstance(optPara))
{
-                        optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(),
Byte.valueOf(((org.jsmpp.bean.OptionalParameter.Byte) optPara).getValue()));
-                    } else if (org.jsmpp.bean.OptionalParameter.Short.class.isInstance(optPara))
{
-                        optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(),
Short.valueOf(((org.jsmpp.bean.OptionalParameter.Short) optPara).getValue()));
-                    } else if (org.jsmpp.bean.OptionalParameter.Int.class.isInstance(optPara))
{
-                        optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(),
Integer.valueOf(((org.jsmpp.bean.OptionalParameter.Int) optPara).getValue()));
-                    } else if (Null.class.isInstance(optPara)) {
-                        optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(),
null);
-                    }
-                }
-                smppMessage.setHeader(SmppConstants.OPTIONAL_PARAMETERS, optParams);
+                // the new way
+                Map<Short, Object> optionalParameter = createOptionalParameterByCode(deliverSm);
+                smppMessage.setHeader(SmppConstants.OPTIONAL_PARAMETER, optionalParameter);
             }
         } else {
             smppMessage.setHeader(SmppConstants.MESSAGE_TYPE, SmppMessageType.DeliverSm.toString());
@@ -162,7 +151,53 @@ public class SmppBinding {
 
         return smppMessage;
     }
-    
+
+    private Map<String, Object> createOptionalParameterByName(DeliverSm deliverSm)
{
+        List<OptionalParameter> oplist = Arrays.asList(deliverSm.getOptionalParametes());
+
+        Map<String, Object> optParams = new HashMap<String, Object>();
+        for (OptionalParameter optPara : oplist) {
+            if (COctetString.class.isInstance(optPara)) {
+                optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(), ((COctetString)
optPara).getValueAsString());
+            } else if (org.jsmpp.bean.OptionalParameter.OctetString.class.isInstance(optPara))
{
+                optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(), ((OctetString)
optPara).getValueAsString());
+            } else if (org.jsmpp.bean.OptionalParameter.Byte.class.isInstance(optPara)) {
+                optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(), Byte.valueOf(((org.jsmpp.bean.OptionalParameter.Byte)
optPara).getValue()));
+            } else if (org.jsmpp.bean.OptionalParameter.Short.class.isInstance(optPara))
{
+                optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(), Short.valueOf(((org.jsmpp.bean.OptionalParameter.Short)
optPara).getValue()));
+            } else if (org.jsmpp.bean.OptionalParameter.Int.class.isInstance(optPara)) {
+                optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(), Integer.valueOf(((org.jsmpp.bean.OptionalParameter.Int)
optPara).getValue()));
+            } else if (Null.class.isInstance(optPara)) {
+                optParams.put(OptionalParameter.Tag.valueOf(optPara.tag).toString(), null);
+            }
+        }
+
+        return optParams;
+    }
+
+    private Map<Short, Object> createOptionalParameterByCode(DeliverSm deliverSm) {
+        List<OptionalParameter> oplist = Arrays.asList(deliverSm.getOptionalParametes());
+
+        Map<Short, Object> optParams = new HashMap<Short, Object>();
+        for (OptionalParameter optPara : oplist) {
+            if (COctetString.class.isInstance(optPara)) {
+                optParams.put(Short.valueOf(optPara.tag), ((COctetString) optPara).getValueAsString());
+            } else if (org.jsmpp.bean.OptionalParameter.OctetString.class.isInstance(optPara))
{
+                optParams.put(Short.valueOf(optPara.tag), ((OctetString) optPara).getValue());
+            } else if (org.jsmpp.bean.OptionalParameter.Byte.class.isInstance(optPara)) {
+                optParams.put(Short.valueOf(optPara.tag), Byte.valueOf(((org.jsmpp.bean.OptionalParameter.Byte)
optPara).getValue()));
+            } else if (org.jsmpp.bean.OptionalParameter.Short.class.isInstance(optPara))
{
+                optParams.put(Short.valueOf(optPara.tag), Short.valueOf(((org.jsmpp.bean.OptionalParameter.Short)
optPara).getValue()));
+            } else if (org.jsmpp.bean.OptionalParameter.Int.class.isInstance(optPara)) {
+                optParams.put(Short.valueOf(optPara.tag), Integer.valueOf(((org.jsmpp.bean.OptionalParameter.Int)
optPara).getValue()));
+            } else if (Null.class.isInstance(optPara)) {
+                optParams.put(Short.valueOf(optPara.tag), null);
+            }
+        }
+
+        return optParams;
+    }
+
     public SmppMessage createSmppMessage(DataSm dataSm, String smppMessageId) {
         SmppMessage smppMessage = new SmppMessage(dataSm, configuration);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConstants.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConstants.java
index 32555cc..7099c3a 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConstants.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConstants.java
@@ -58,7 +58,8 @@ public interface SmppConstants {
     String PASSWORD = "CamelSmppSystemId";
     String VALIDITY_PERIOD = "CamelSmppValidityPeriod";
     String OPTIONAL_PARAMETERS = "CamelSmppOptionalParameters";
-    
+    String OPTIONAL_PARAMETER = "CamelSmppOptionalParameter";
+
     String UCS2_ENCODING = "UTF-16BE";
     byte UNKNOWN_ALPHABET = -1;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
index b33fa2a..a29a388 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
@@ -168,12 +168,18 @@ public class SmppDataSmCommand extends AbstractSmppCommand {
             dataSm.setRegisteredDelivery(config.getRegisteredDelivery());
         }
 
-        Map<String, String> optinalParamaters = in.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
-        if (optinalParamaters != null) {
-            List<OptionalParameter> optParams = createOptionalParameters(optinalParamaters);
+        Map<java.lang.Short, Object> optinalParamater = in.getHeader(SmppConstants.OPTIONAL_PARAMETER,
Map.class);
+        if (optinalParamater != null) {
+            List<OptionalParameter> optParams = createOptionalParametersByCode(optinalParamater);
             dataSm.setOptionalParametes(optParams.toArray(new OptionalParameter[optParams.size()]));
         } else {
-            dataSm.setOptionalParametes();
+            Map<String, String> optinalParamaters = in.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
+            if (optinalParamaters != null) {
+                List<OptionalParameter> optParams = createOptionalParametersByName(optinalParamaters);
+                dataSm.setOptionalParametes(optParams.toArray(new OptionalParameter[optParams.size()]));
+            } else {
+                dataSm.setOptionalParametes();
+            }
         }
 
         return dataSm;

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
index 00c8638..f541dab 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
@@ -246,12 +246,18 @@ public class SmppSubmitMultiCommand extends SmppSmCommand {
             submitMulti.setReplaceIfPresentFlag(config.getReplaceIfPresentFlag());
         }
 
-        Map<String, String> optinalParamaters = in.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
-        if (optinalParamaters != null) {
-            List<OptionalParameter> optParams = createOptionalParameters(optinalParamaters);
+        Map<java.lang.Short, Object> optinalParamater = in.getHeader(SmppConstants.OPTIONAL_PARAMETER,
Map.class);
+        if (optinalParamater != null) {
+            List<OptionalParameter> optParams = createOptionalParametersByCode(optinalParamater);
             submitMulti.setOptionalParameters(optParams.toArray(new OptionalParameter[optParams.size()]));
         } else {
-            submitMulti.setOptionalParameters(new OptionalParameter[]{});
+            Map<String, String> optinalParamaters = in.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
+            if (optinalParamaters != null) {
+                List<OptionalParameter> optParams = createOptionalParametersByName(optinalParamaters);
+                submitMulti.setOptionalParameters(optParams.toArray(new OptionalParameter[optParams.size()]));
+            } else {
+                submitMulti.setOptionalParameters(new OptionalParameter[]{});
+            }
         }
 
         return submitMulti;

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
index 4a8166e..ac5f4f1 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
@@ -206,12 +206,18 @@ public class SmppSubmitSmCommand extends SmppSmCommand {
 
         submitSm.setEsmClass(new ESMClass().value());
 
-        Map<String, String> optinalParamaters = in.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
-        if (optinalParamaters != null) {
-            List<OptionalParameter> optParams = createOptionalParameters(optinalParamaters);
+        Map<java.lang.Short, Object> optinalParamater = in.getHeader(SmppConstants.OPTIONAL_PARAMETER,
Map.class);
+        if (optinalParamater != null) {
+            List<OptionalParameter> optParams = createOptionalParametersByCode(optinalParamater);
             submitSm.setOptionalParametes(optParams.toArray(new OptionalParameter[optParams.size()]));
         } else {
-            submitSm.setOptionalParametes();
+            Map<String, String> optinalParamaters = in.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
+            if (optinalParamaters != null) {
+                List<OptionalParameter> optParams = createOptionalParametersByName(optinalParamaters);
+                submitSm.setOptionalParametes(optParams.toArray(new OptionalParameter[optParams.size()]));
+            } else {
+                submitSm.setOptionalParametes();
+            }
         }
 
         return submitSm;

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppBindingTest.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppBindingTest.java
b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppBindingTest.java
index f427522..b440831 100644
--- a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppBindingTest.java
+++ b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppBindingTest.java
@@ -139,7 +139,7 @@ public class SmppBindingTest {
         SmppMessage smppMessage = binding.createSmppMessage(deliverSm);
 
         assertEquals("Hello SMPP world!", smppMessage.getBody());
-        assertEquals(9, smppMessage.getHeaders().size());
+        assertEquals(10, smppMessage.getHeaders().size());
         assertEquals("2", smppMessage.getHeader(SmppConstants.ID));
         assertEquals(1, smppMessage.getHeader(SmppConstants.DELIVERED));
         // To avoid the test failure when running in different TimeZone
@@ -149,8 +149,8 @@ public class SmppBindingTest {
         assertEquals(1, smppMessage.getHeader(SmppConstants.SUBMITTED));
         assertEquals(DeliveryReceiptState.DELIVRD, smppMessage.getHeader(SmppConstants.FINAL_STATUS));
         assertEquals(SmppMessageType.DeliveryReceipt.toString(), smppMessage.getHeader(SmppConstants.MESSAGE_TYPE));
-        
-        Map<String, String> optionalParameters = smppMessage.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
+
+        Map<String, Object> optionalParameters = smppMessage.getHeader(SmppConstants.OPTIONAL_PARAMETERS,
Map.class);
         assertEquals(6, optionalParameters.size());
         assertEquals("OctetString", optionalParameters.get("SOURCE_SUBADDRESS"));
         assertEquals("COctetStrin", optionalParameters.get("ADDITIONAL_STATUS_INFO_TEXT"));
@@ -158,6 +158,15 @@ public class SmppBindingTest {
         assertEquals(Short.valueOf((short) 1), optionalParameters.get("DEST_TELEMATICS_ID"));
         assertEquals(Integer.valueOf(1), optionalParameters.get("QOS_TIME_TO_LIVE"));
         assertNull("0x00", optionalParameters.get("ALERT_ON_MESSAGE_DELIVERY"));
+
+        Map<Short, Object> optionalParameter = smppMessage.getHeader(SmppConstants.OPTIONAL_PARAMETER,
Map.class);
+        assertEquals(6, optionalParameter.size());
+        assertArrayEquals("OctetString".getBytes("UTF-8"), (byte[]) optionalParameter.get(Short.valueOf((short)
0x0202)));
+        assertEquals("COctetStrin", optionalParameter.get(Short.valueOf((short) 0x001D)));
+        assertEquals(Byte.valueOf((byte) 0x01), optionalParameter.get(Short.valueOf((short)
0x0005)));
+        assertEquals(Short.valueOf((short) 1), optionalParameter.get(Short.valueOf((short)
0x0008)));
+        assertEquals(Integer.valueOf(1), optionalParameter.get(Short.valueOf((short) 0x0017)));
+        assertNull("0x00", optionalParameter.get(Short.valueOf((short) 0x130C)));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppDataSmCommandTest.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppDataSmCommandTest.java
b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppDataSmCommandTest.java
index 5374753..8fe3193 100644
--- a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppDataSmCommandTest.java
+++ b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppDataSmCommandTest.java
@@ -196,7 +196,7 @@ public class SmppDataSmCommandTest {
         optionalParameters.put(Short.valueOf((short) 0x2153), Short.valueOf((short) 9));
         optionalParameters.put(Short.valueOf((short) 0x2154), Integer.valueOf(7400000));
         optionalParameters.put(Short.valueOf((short) 0x2155), null);
-        exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETERS, optionalParameters);
+        exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETER, optionalParameters);
         expect(session.dataShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
                 eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1717"),
eq(new ESMClass()),
                 eq(new RegisteredDelivery((byte) 1)), eq(DataCoding.newInstance((byte) 0)),

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
index 3434d40..c6ff222 100644
--- a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
+++ b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
@@ -506,7 +506,7 @@ public class SmppSubmitMultiCommandTest {
         optionalParameters.put(Short.valueOf((short) 0x2153), Short.valueOf((short) 9));
         optionalParameters.put(Short.valueOf((short) 0x2154), Integer.valueOf(7400000));
         optionalParameters.put(Short.valueOf((short) 0x2155), null);
-        exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETERS, optionalParameters);
+        exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETER, optionalParameters);
         exchange.getIn().setBody("short message body");
         expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL),
eq("1818"),
                 aryEq(new Address[]{new Address(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.INTERNET,
"1919")}),

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb5de83/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
index 9f32a95..c74ca76 100644
--- a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
+++ b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
@@ -253,7 +253,7 @@ public class SmppSubmitSmCommandTest {
         optionalParameters.put(Short.valueOf((short) 0x2153), Short.valueOf((short) 9));
         optionalParameters.put(Short.valueOf((short) 0x2154), Integer.valueOf(7400000));
         optionalParameters.put(Short.valueOf((short) 0x2155), null);
-        exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETERS, optionalParameters);
+        exchange.getIn().setHeader(SmppConstants.OPTIONAL_PARAMETER, optionalParameters);
         expect(session.submitShortMessage(eq("CMT"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL),
eq("1818"),
                 eq(TypeOfNumber.INTERNATIONAL), eq(NumberingPlanIndicator.INTERNET), eq("1919"),
                 eq(new ESMClass()), eq((byte) 1), eq((byte) 2), eq("-300101001831100-"),
eq("-300101003702200-"), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS)),


Mime
View raw message