当前位置: 首页>>代码示例>>Java>>正文


Java SmsMessage类代码示例

本文整理汇总了Java中com.musala.atmosphere.commons.SmsMessage的典型用法代码示例。如果您正苦于以下问题:Java SmsMessage类的具体用法?Java SmsMessage怎么用?Java SmsMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SmsMessage类属于com.musala.atmosphere.commons包,在下文中一共展示了SmsMessage类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assertReceivedSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
/**
 * Asserts that the sent sms message is successfully received by device
 *
 * @param message
 *        - message to be displayed if assertion fails.
 * @param smsMessage
 *        - the expected message to be received.
 *
 * @throws UiElementFetchingException
 */
public static void assertReceivedSms(String message, SmsMessage smsMessage) throws UiElementFetchingException {
    UiElementSelector senderPhoneSelector = createSelectorByTextAndContentDescriptor(ContentDescriptor.SMS_SENDER_PHONE_BOX,
                                                                                     smsMessage.getPhoneNumber()
                                                                                               .toString());
    UiElementSelector smsTextSelector = createSelectorByTextAndContentDescriptor(ContentDescriptor.SMS_TEXT_BOX,
                                                                                 smsMessage.getText());

    assertElementExists(message, senderPhoneSelector);
    assertElementExists(message, smsTextSelector);
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-integration-tests,代码行数:21,代码来源:OnDeviceValidatorAssert.java

示例2: testReceiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Test
public void testReceiveSms() throws Exception {
    PhoneNumber phoneNumber = new PhoneNumber(SENDER_PHONE);
    SmsMessage sms = new SmsMessage(phoneNumber, SMS_TEXT);
    assertTrue("Sending SMS returned false.", testDevice.receiveSms(sms));
    assertReceivedSms("Sms message was not received properly.", sms);
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-integration-tests,代码行数:8,代码来源:ReceiveSmsTest.java

示例3: receiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Override
protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException {
    // We can't simulate that a real device has received SMS.
    throw new CommandFailedException("Can not send SMS to real devices.");
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:6,代码来源:RealWrapDevice.java

示例4: receiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Override
protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException {
    ExtendedEmulatorConsole emulatorConsole = prepareEmulatorConsole();
    emulatorConsole.receiveSms(smsMessage);
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:6,代码来源:EmulatorWrapDevice.java

示例5: receiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Override
protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException {
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:4,代码来源:AbstractWrapDeviceTest.java

示例6: testThrowsExceptionOnReceiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Test(expected = ServerConnectionFailedException.class)
public void testThrowsExceptionOnReceiveSms() {
    PhoneNumber phoneNumber = new PhoneNumber("123");
    SmsMessage smsMessage = new SmsMessage(phoneNumber, "");
    testDevice.receiveSms(smsMessage);
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-client,代码行数:7,代码来源:ReconnectDeviceTest.java

示例7: receiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
/**
 * Sends SMS to the emulator.
 *
 * @param smsMessage
 *        - the SMS message, that will be sent to emulator.
 *
 * @throws CommandFailedException
 *         In case of an error in the execution
 */
public synchronized void receiveSms(SmsMessage smsMessage) throws CommandFailedException {
    adaptAndExecuteCommand(EmulatorCommand.SEND_SMS,
                           smsMessage.getPhoneNumber(),
                           new StringCommandParameter(smsMessage.getText()));
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:15,代码来源:ExtendedEmulatorConsole.java

示例8: receiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
/**
 * Sends SMS to this device.<br>
 * Can only be applied on <b>emulators</b>.
 *
 * @param smsMessage
 *        - {@link SmsMessage}, that will be sent to the device.
 * @return <code>true</code> if the SMS receiving is successful, <code>false</code> if it fails.
 */
public boolean receiveSms(SmsMessage smsMessage) {
    Object result = communicator.sendAction(RoutingAction.SMS_RECEIVE, smsMessage);
    return result == DeviceCommunicator.VOID_SUCCESS;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-client,代码行数:13,代码来源:Device.java

示例9: receiveSms

import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
abstract protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException; 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:2,代码来源:AbstractWrapDevice.java


注:本文中的com.musala.atmosphere.commons.SmsMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。