本文整理汇总了Java中org.jsmpp.bean.DataCodings类的典型用法代码示例。如果您正苦于以下问题:Java DataCodings类的具体用法?Java DataCodings怎么用?Java DataCodings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataCodings类属于org.jsmpp.bean包,在下文中一共展示了DataCodings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeWithConfigurationData
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitSm");
exchange.getIn().setHeader(SmppConstants.ID, "1");
exchange.getIn().setBody("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
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(DataCodings.newInstance((byte) 0)), eq((byte) 0),
aryEq("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890".getBytes())))
.andReturn("1");
replay(session);
command.execute(exchange);
verify(session);
assertEquals(Arrays.asList("1"), exchange.getOut().getHeader(SmppConstants.ID));
assertEquals(1, exchange.getOut().getHeader(SmppConstants.SENT_MESSAGE_COUNT));
}
示例2: alphabetUpdatesDataCoding
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void alphabetUpdatesDataCoding() throws Exception {
final byte incorrectDataCoding = (byte)0x00;
byte[] body = {'A', 'B', 'C'};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitSm");
exchange.getIn().setHeader(SmppConstants.ALPHABET, Alphabet.ALPHA_8_BIT.value());
exchange.getIn().setBody(body);
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()), not(eq(DataCodings.newInstance(incorrectDataCoding))), eq((byte) 0), aryEq(body)))
.andReturn("1");
replay(session);
command.execute(exchange);
verify(session);
}
示例3: executeWithConfigurationData
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "DataSm");
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(DataCodings.newInstance((byte) 0))))
.andReturn(new DataSmResult(new MessageId("1"), null));
replay(session);
command.execute(exchange);
verify(session);
assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
assertNull(exchange.getOut().getHeader(SmppConstants.OPTIONAL_PARAMETERS));
}
示例4: execute
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void execute() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "DataSm");
exchange.getIn().setHeader(SmppConstants.SERVICE_TYPE, "XXX");
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_TON, TypeOfNumber.NATIONAL.value());
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_NPI, NumberingPlanIndicator.NATIONAL.value());
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR, "1818");
exchange.getIn().setHeader(SmppConstants.DEST_ADDR_TON, TypeOfNumber.INTERNATIONAL.value());
exchange.getIn().setHeader(SmppConstants.DEST_ADDR_NPI, NumberingPlanIndicator.INTERNET.value());
exchange.getIn().setHeader(SmppConstants.DEST_ADDR, "1919");
exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE).value());
expect(session.dataShortMessage(eq("XXX"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL), eq("1818"),
eq(TypeOfNumber.INTERNATIONAL), eq(NumberingPlanIndicator.INTERNET), eq("1919"), eq(new ESMClass()),
eq(new RegisteredDelivery((byte) 2)), eq(DataCodings.newInstance((byte) 0))))
.andReturn(new DataSmResult(new MessageId("1"), null));
replay(session);
command.execute(exchange);
verify(session);
assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
assertNull(exchange.getOut().getHeader(SmppConstants.OPTIONAL_PARAMETERS));
}
示例5: executeWithConfigurationData
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.ID, "1");
exchange.getIn().setBody("short message body");
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(DataCodings.newInstance((byte) 0)), eq((byte) 0), aryEq("short message body".getBytes())))
.andReturn(new SubmitMultiResult("1", new UnsuccessDelivery(new Address(TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, "1717"), 0)));
replay(session);
command.execute(exchange);
verify(session);
assertEquals(Arrays.asList("1"), exchange.getOut().getHeader(SmppConstants.ID));
assertEquals(1, exchange.getOut().getHeader(SmppConstants.SENT_MESSAGE_COUNT));
assertNotNull(exchange.getOut().getHeader(SmppConstants.ERROR));
}
示例6: messageWaitingDiscardMessageInactiveVoicemail
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageInactiveVoicemail() {
// 11010000
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.INACTIVE,
IndicationType.VOICEMAIL_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xd0;
assertEquals(dataCoding.toByte(), expected, "Datacoding differs");
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例7: messageWaitingDiscardMessageInactiveFax
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageInactiveFax() {
// 11010001
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.INACTIVE,
IndicationType.FAX_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xd1;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例8: messageWaitingDiscardMessageInactiveElecmail
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageInactiveElecmail() {
// 11010010
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.INACTIVE,
IndicationType.ELECTRONIC_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xd2;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例9: messageWaitingDiscardMessageInactiveOther
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageInactiveOther() {
// 11010011
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.INACTIVE,
IndicationType.OTHER_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xd3;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例10: messageWaitingDiscardMessageActiveVoicemail
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageActiveVoicemail() {
// 11011000
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.ACTIVE,
IndicationType.VOICEMAIL_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xd8;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例11: messageWaitingDiscardMessageActiveFax
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageActiveFax() {
// 11011001
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.ACTIVE,
IndicationType.FAX_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xd9;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例12: messageWaitingDiscardMessageActiveElecmail
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageActiveElecmail() {
// 11011010
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.ACTIVE,
IndicationType.ELECTRONIC_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xda;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例13: messageWaitingDiscardMessageActiveOther
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageActiveOther() {
// 11011011
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.ACTIVE,
IndicationType.OTHER_MESSAGE_WAITING,
Alphabet.ALPHA_DEFAULT);
byte expected = (byte)0xdb;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaDefaultTest.java
示例14: messageWaitingDiscardMessageInactiveVoicemail
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageInactiveVoicemail() {
// 11100000
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.INACTIVE,
IndicationType.VOICEMAIL_MESSAGE_WAITING,
Alphabet.ALPHA_UCS2);
byte expected = (byte)0xe0;
assertEquals(dataCoding.toByte(), expected, "Datacoding differs");
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaUCS2Test.java
示例15: messageWaitingDiscardMessageInactiveFax
import org.jsmpp.bean.DataCodings; //导入依赖的package包/类
@Test
public void messageWaitingDiscardMessageInactiveFax() {
// 11100001
MessageWaitingDataCoding dataCoding = new MessageWaitingDataCoding(
IndicationSense.INACTIVE,
IndicationType.FAX_MESSAGE_WAITING,
Alphabet.ALPHA_UCS2);
byte expected = (byte)0xe1;
assertEquals(dataCoding.toByte(), expected);
DataCoding buildedInstance = DataCodings.newInstance(dataCoding.toByte());
assertEquals(buildedInstance, dataCoding);
assertTrue(dataCoding.isStoreMessage());
}
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:17,代码来源:MessageWaitingDataCodingStoreMessageAlphaUCS2Test.java