コード例 #1
0
ファイル: Chat.java プロジェクト: sujithchakka/linphone-h264
  @SmallTest
  @MediumTest
  @LargeTest
  public void testEReceiveTextMessage() {
    goToChat();
    solo.clickOnText(iContext.getString(org.linphone.test.R.string.account_test_calls_login));

    LinphoneChatRoom chatRoom =
        LinphoneTestManager.getLc()
            .getOrCreateChatRoom(
                "sip:"
                    + iContext.getString(R.string.account_linphone_login)
                    + "@"
                    + iContext.getString(R.string.account_linphone_domain));
    LinphoneChatMessage msg =
        chatRoom.createLinphoneChatMessage(iContext.getString(R.string.chat_test_text_received));
    chatRoom.sendMessage(
        msg,
        new LinphoneChatMessage.StateListener() {
          @Override
          public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state) {
            Log.e("Chat message state = " + state.toString());
          }
        });

    solo.sleep(1000);
    Assert.assertTrue(solo.searchText(iContext.getString(R.string.chat_test_text_received)));
  }
コード例 #2
0
ファイル: Chat.java プロジェクト: sujithchakka/linphone-h264
  @SmallTest
  @MediumTest
  @LargeTest
  public void testCSendTextMessage() {
    goToChat();

    solo.enterText(
        0,
        "sip:"
            + iContext.getString(R.string.account_test_calls_login)
            + "@"
            + iContext.getString(R.string.account_test_calls_domain));
    solo.clickOnView(solo.getView(org.linphone.R.id.newDiscussion));

    solo.enterText(
        (EditText) solo.getView(org.linphone.R.id.message),
        iContext.getString(R.string.chat_test_text_sent));
    solo.clickOnView(solo.getView(org.linphone.R.id.sendMessage));

    solo.sleep(1000);
    Assert.assertTrue(solo.searchText(iContext.getString(R.string.chat_test_text_sent)));
    Assert.assertEquals(
        iContext.getString(R.string.chat_test_text_sent),
        LinphoneTestManager.getInstance().lastMessageReceived);
  }