本文整理汇总了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);
}
示例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);
}
示例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.");
}
示例4: receiveSms
import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Override
protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException {
ExtendedEmulatorConsole emulatorConsole = prepareEmulatorConsole();
emulatorConsole.receiveSms(smsMessage);
}
示例5: receiveSms
import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
@Override
protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException {
}
示例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);
}
示例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()));
}
示例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;
}
示例9: receiveSms
import com.musala.atmosphere.commons.SmsMessage; //导入依赖的package包/类
abstract protected void receiveSms(SmsMessage smsMessage) throws CommandFailedException;