camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1363532 - in /camel/branches/camel-2.9.x/components/camel-smpp/src: main/java/org/apache/camel/component/smpp/ test/java/org/apache/camel/component/smpp/
Date Thu, 19 Jul 2012 20:36:08 GMT
Author: cmueller
Date: Thu Jul 19 20:36:08 2012
New Revision: 1363532

URL: http://svn.apache.org/viewvc?rev=1363532&view=rev
Log:
CAMEL-5455: Allow configuring dataCoding independend of alphabet

Modified:
    camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConfiguration.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConfigurationTest.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
    camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConfiguration.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConfiguration.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConfiguration.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConfiguration.java
Thu Jul 19 20:36:08 2012
@@ -38,7 +38,7 @@ public class SmppConfiguration implement
     private String systemId = "smppclient";
     private String password = "password";
     private String systemType = "cp";
-    // TODO: document deleting of dataCoding
+    private byte dataCoding = (byte) 0;
     private byte alphabet = Alphabet.ALPHA_DEFAULT.value();
     private String encoding = "ISO-8859-1";
     private Integer enquireLinkTimer = 5000;
@@ -116,6 +116,14 @@ public class SmppConfiguration implement
         return password;
     }
     
+    public byte getDataCoding() {
+        return dataCoding;
+    }
+
+    public void setDataCoding(byte dataCoding) {
+        this.alphabet = dataCoding;
+    }
+    
     public byte getAlphabet() {
         return alphabet;
     }
@@ -345,6 +353,7 @@ public class SmppConfiguration implement
             + ", port=" + port 
             + ", systemId=" + systemId 
             + ", systemType=" + systemType
+            + ", dataCoding=" + dataCoding
             + ", alphabet=" + alphabet
             + ", encoding=" + encoding
             + ", transactionTimer=" + transactionTimer

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppDataSmCommand.java
Thu Jul 19 20:36:08 2012
@@ -18,9 +18,9 @@ package org.apache.camel.component.smpp;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
+import org.jsmpp.bean.DataCoding;
 import org.jsmpp.bean.DataSm;
 import org.jsmpp.bean.ESMClass;
-import org.jsmpp.bean.GeneralDataCoding;
 import org.jsmpp.bean.NumberingPlanIndicator;
 import org.jsmpp.bean.RegisteredDelivery;
 import org.jsmpp.bean.TypeOfNumber;
@@ -51,7 +51,7 @@ public class SmppDataSmCommand extends A
                     dataSm.getDestAddress(),
                     new ESMClass(dataSm.getEsmClass()),
                     new RegisteredDelivery(dataSm.getRegisteredDelivery()),
-                    new GeneralDataCoding(dataSm.getDataCoding()));
+                    DataCoding.newInstance(dataSm.getDataCoding()));
         } catch (Exception e) {
             throw new SmppException(e);
         }
@@ -67,6 +67,12 @@ public class SmppDataSmCommand extends A
         Message in = exchange.getIn();
         DataSm dataSm = new DataSm();
 
+        if (in.getHeaders().containsKey(SmppConstants.DATA_CODING)) {
+            dataSm.setDataCoding(in.getHeader(SmppConstants.DATA_CODING, Byte.class));
+        } else {
+            dataSm.setDataCoding(config.getDataCoding());
+        }
+
         if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR)) {
             dataSm.setDestAddress(in.getHeader(SmppConstants.DEST_ADDR, String.class));
         } else {

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
Thu Jul 19 20:36:08 2012
@@ -35,11 +35,9 @@ public abstract class SmppSmCommand exte
     protected byte getProvidedAlphabet(Exchange exchange) {
         Message in = exchange.getIn();
 
-        byte alphabet = SmppConstants.UNKNOWN_ALPHABET;
+        byte alphabet = config.getAlphabet();
         if (in.getHeaders().containsKey(SmppConstants.ALPHABET)) {
             alphabet = in.getHeader(SmppConstants.ALPHABET, Byte.class);
-        } else {
-            alphabet = config.getAlphabet();
         }
 
         return alphabet;

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitMultiCommand.java
Thu Jul 19 20:36:08 2012
@@ -31,8 +31,6 @@ import org.jsmpp.bean.Alphabet;
 import org.jsmpp.bean.DataCoding;
 import org.jsmpp.bean.ESMClass;
 import org.jsmpp.bean.GSMSpecificFeature;
-import org.jsmpp.bean.GeneralDataCoding;
-import org.jsmpp.bean.MessageClass;
 import org.jsmpp.bean.MessageMode;
 import org.jsmpp.bean.MessageType;
 import org.jsmpp.bean.NumberingPlanIndicator;
@@ -74,7 +72,7 @@ public class SmppSubmitMultiCommand exte
                         submitMulti.getValidityPeriod(),
                         new RegisteredDelivery(submitMulti.getRegisteredDelivery()),
                         new ReplaceIfPresentFlag(submitMulti.getReplaceIfPresentFlag()),
-                        new GeneralDataCoding(submitMulti.getDataCoding()),
+                        DataCoding.newInstance(submitMulti.getDataCoding()),
                         submitMulti.getSmDefaultMsgId(),
                         submitMulti.getShortMessage(),
                         new OptionalParameter[0]);
@@ -129,9 +127,7 @@ public class SmppSubmitMultiCommand exte
 
         byte[][] segments = splitter.split(body.getBytes(charset));
 
-        DataCoding dataCoding = new GeneralDataCoding(false, true, MessageClass.CLASS1, determinedAlphabet);
         ESMClass esmClass;
-
         // multipart message
         if (segments.length > 1) {
             esmClass = new ESMClass(MessageMode.DEFAULT, MessageType.DEFAULT, GSMSpecificFeature.UDHI);
@@ -145,7 +141,7 @@ public class SmppSubmitMultiCommand exte
         for (int i = 0; i < segments.length; i++) {
             SubmitMulti submitMulti = SmppUtils.copySubmitMulti(template);
             submitMulti.setEsmClass(esmClass.value());
-            submitMulti.setDataCoding(dataCoding.value());
+            submitMulti.setDataCoding(template.getDataCoding());
             submitMulti.setShortMessage(segments[i]);
             submitMulties[i] = submitMulti;
         }
@@ -158,6 +154,12 @@ public class SmppSubmitMultiCommand exte
         Message in = exchange.getIn();
         SubmitMulti submitMulti = new SubmitMulti();
 
+        if (in.getHeaders().containsKey(SmppConstants.DATA_CODING)) {
+            submitMulti.setDataCoding(in.getHeader(SmppConstants.DATA_CODING, Byte.class));
+        } else {
+            submitMulti.setDataCoding(config.getDataCoding());
+        }
+
         byte destAddrTon;
         if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_TON)) {
             destAddrTon = in.getHeader(SmppConstants.DEST_ADDR_TON, Byte.class);

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java
Thu Jul 19 20:36:08 2012
@@ -24,10 +24,9 @@ import java.util.List;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.jsmpp.bean.Alphabet;
+import org.jsmpp.bean.DataCoding;
 import org.jsmpp.bean.ESMClass;
 import org.jsmpp.bean.GSMSpecificFeature;
-import org.jsmpp.bean.GeneralDataCoding;
-import org.jsmpp.bean.MessageClass;
 import org.jsmpp.bean.MessageMode;
 import org.jsmpp.bean.MessageType;
 import org.jsmpp.bean.NumberingPlanIndicator;
@@ -69,7 +68,7 @@ public class SmppSubmitSmCommand extends
                         submitSm.getValidityPeriod(),
                         new RegisteredDelivery(submitSm.getRegisteredDelivery()),
                         submitSm.getReplaceIfPresent(),
-                        new GeneralDataCoding(submitSm.getDataCoding()),
+                        DataCoding.newInstance(submitSm.getDataCoding()),
                         (byte) 0,
                         submitSm.getShortMessage(),
                         submitSm.getOptionalParametes());
@@ -100,8 +99,6 @@ public class SmppSubmitSmCommand extends
         SmppSplitter splitter = createSplitter(exchange);
         byte[][] segments = splitter.split(shortMessage);
 
-        template.setDataCoding(new GeneralDataCoding(false, true, MessageClass.CLASS1, determinedAlphabet).value());
-        
         // multipart message
         if (segments.length > 1) {
             template.setEsmClass(new ESMClass(MessageMode.DEFAULT, MessageType.DEFAULT, GSMSpecificFeature.UDHI).value());
@@ -121,6 +118,12 @@ public class SmppSubmitSmCommand extends
         Message in = exchange.getIn();
         SubmitSm submitSm = new SubmitSm();
 
+        if (in.getHeaders().containsKey(SmppConstants.DATA_CODING)) {
+            submitSm.setDataCoding(in.getHeader(SmppConstants.DATA_CODING, Byte.class));
+        } else {
+            submitSm.setDataCoding(config.getDataCoding());
+        }
+
         if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR)) {
             submitSm.setDestAddress(in.getHeader(SmppConstants.DEST_ADDR, String.class));
         } else {

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConfigurationTest.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConfigurationTest.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppConfigurationTest.java
Thu Jul 19 20:36:08 2012
@@ -167,6 +167,7 @@ public class SmppConfigurationTest {
                 + "port=2775, "
                 + "systemId=smppclient, "
                 + "systemType=cp, "
+                + "dataCoding=0, "
                 + "alphabet=0, "
                 + "encoding=ISO-8859-1, "
                 + "transactionTimer=10000, "

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitMultiCommandTest.java
Thu Jul 19 20:36:08 2012
@@ -25,10 +25,8 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.DefaultExchange;
 import org.jsmpp.bean.Address;
-import org.jsmpp.bean.Alphabet;
+import org.jsmpp.bean.DataCoding;
 import org.jsmpp.bean.ESMClass;
-import org.jsmpp.bean.GeneralDataCoding;
-import org.jsmpp.bean.MessageClass;
 import org.jsmpp.bean.NumberingPlanIndicator;
 import org.jsmpp.bean.OptionalParameter;
 import org.jsmpp.bean.RegisteredDelivery;
@@ -44,12 +42,12 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import static org.easymock.EasyMock.aryEq;
+import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.eq;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.isNull;
-import static org.easymock.classextension.EasyMock.createMock;
-import static org.easymock.classextension.EasyMock.replay;
-import static org.easymock.classextension.EasyMock.verify;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -93,7 +91,7 @@ public class SmppSubmitMultiCommandTest 
         expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
                 aryEq(new Address[]{new Address(TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN,
"1717")}),
                 eq(new ESMClass()), eq((byte) 0), eq((byte) 1), (String) isNull(), (String)
isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
-                eq(ReplaceIfPresentFlag.DEFAULT), eq(new GeneralDataCoding(false, true, MessageClass.CLASS1,
Alphabet.ALPHA_DEFAULT)), eq((byte) 0), aryEq("short message body".getBytes()),
+                eq(ReplaceIfPresentFlag.DEFAULT), eq(DataCoding.newInstance((byte) 0)), eq((byte)
0), aryEq("short message body".getBytes()),
                 aryEq(new OptionalParameter[0])))
                 .andReturn(new SubmitMultiResult("1", new UnsuccessDelivery(new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN, "1717"), 0)));
         
@@ -129,7 +127,7 @@ public class SmppSubmitMultiCommandTest 
         expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL),
eq("1818"),
                 aryEq(new Address[]{new Address(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.INTERNET,
"1919")}),
                 eq(new ESMClass()), eq((byte) 1), eq((byte) 2), eq("-300101001831100-"),
eq("-300101003702200-"), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS)),
-                eq(ReplaceIfPresentFlag.REPLACE), eq(new GeneralDataCoding(false, true, MessageClass.CLASS1,
Alphabet.ALPHA_DEFAULT)), eq((byte) 0), aryEq("short message body".getBytes()),
+                eq(ReplaceIfPresentFlag.REPLACE), eq(DataCoding.newInstance((byte) 0)), eq((byte)
0), aryEq("short message body".getBytes()),
                 aryEq(new OptionalParameter[0])))
                 .andReturn(new SubmitMultiResult("1"));
         
@@ -165,7 +163,7 @@ public class SmppSubmitMultiCommandTest 
         expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL),
eq("1818"),
                 aryEq(new Address[]{new Address(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.INTERNET,
"1919")}),
                 eq(new ESMClass()), eq((byte) 1), eq((byte) 2), eq("-300101001831100-"),
eq("000003000000000R"), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS)),
-                eq(ReplaceIfPresentFlag.REPLACE), eq(new GeneralDataCoding(false, true, MessageClass.CLASS1,
Alphabet.ALPHA_DEFAULT)), eq((byte) 0), aryEq("short message body".getBytes()),
+                eq(ReplaceIfPresentFlag.REPLACE), eq(DataCoding.newInstance((byte) 0)), eq((byte)
0), aryEq("short message body".getBytes()),
                 aryEq(new OptionalParameter[0])))
                 .andReturn(new SubmitMultiResult("1"));
         

Modified: camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java?rev=1363532&r1=1363531&r2=1363532&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSubmitSmCommandTest.java
Thu Jul 19 20:36:08 2012
@@ -24,12 +24,9 @@ import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.DefaultExchange;
-import org.jsmpp.bean.Alphabet;
+import org.jsmpp.bean.DataCoding;
 import org.jsmpp.bean.ESMClass;
-import org.jsmpp.bean.GeneralDataCoding;
-import org.jsmpp.bean.MessageClass;
 import org.jsmpp.bean.NumberingPlanIndicator;
-import org.jsmpp.bean.OptionalParameter;
 import org.jsmpp.bean.RegisteredDelivery;
 import org.jsmpp.bean.ReplaceIfPresentFlag;
 import org.jsmpp.bean.SMSCDeliveryReceipt;
@@ -89,7 +86,7 @@ public class SmppSubmitSmCommandTest {
         expect(session.submitShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
                 eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1717"),
eq(new ESMClass()), eq((byte) 0), eq((byte) 1),
                 (String) isNull(), (String) isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
eq(ReplaceIfPresentFlag.DEFAULT.value()),
-                eq(new GeneralDataCoding(false, true, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT)),
eq((byte) 0),
+                eq(DataCoding.newInstance((byte) 0)), eq((byte) 0),
                 aryEq("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890".getBytes())))
                 .andReturn("1");
         
@@ -104,7 +101,7 @@ public class SmppSubmitSmCommandTest {
     }
     
     @Test
-    @Ignore("TODO: easymock fails")
+    @Ignore()
     public void executeLongBody() throws Exception {
         byte[] firstSM = new byte[]{5, 0, 3, 1, 2, 1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50,
51, 52, 53, 54,
             55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
48, 49, 50,
@@ -119,12 +116,12 @@ public class SmppSubmitSmCommandTest {
         expect(session.submitShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
                 eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1717"),
eq(new ESMClass()), eq((byte) 0), eq((byte) 1),
                 (String) isNull(), (String) isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
eq(ReplaceIfPresentFlag.DEFAULT.value()),
-                eq(new GeneralDataCoding(false, true, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT)),
eq((byte) 0), aryEq(firstSM), aryEq(new OptionalParameter[0])))
+                eq(DataCoding.newInstance((byte) 0)), eq((byte) 0), aryEq(firstSM)))
                 .andReturn("1");
         expect(session.submitShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
                 eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1717"),
eq(new ESMClass()), eq((byte) 0), eq((byte) 1),
                 (String) isNull(), (String) isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
eq(ReplaceIfPresentFlag.DEFAULT.value()),
-                eq(new GeneralDataCoding(false, true, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT)),
eq((byte) 0), eq(secondSM)))
+                eq(DataCoding.newInstance((byte) 0)), eq((byte) 0), eq(secondSM)))
                 .andReturn("2");
         
         replay(session);
@@ -158,7 +155,7 @@ public class SmppSubmitSmCommandTest {
         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)),
-                eq(ReplaceIfPresentFlag.REPLACE.value()), eq(new GeneralDataCoding(false,
true, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT)), eq((byte) 0), aryEq("short message body".getBytes())))
+                eq(ReplaceIfPresentFlag.REPLACE.value()), eq(DataCoding.newInstance((byte)
0)), eq((byte) 0), aryEq("short message body".getBytes())))
                 .andReturn("1");
         
         replay(session);
@@ -192,7 +189,7 @@ public class SmppSubmitSmCommandTest {
         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("000003000000000R"), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS)),
-                eq(ReplaceIfPresentFlag.REPLACE.value()), eq(new GeneralDataCoding(false,
true, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT)), eq((byte) 0), aryEq("short message body".getBytes())))
+                eq(ReplaceIfPresentFlag.REPLACE.value()), eq(DataCoding.newInstance((byte)
0)), eq((byte) 0), aryEq("short message body".getBytes())))
                 .andReturn("1");
         
         replay(session);



Mime
View raw message