use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method getHistoryHashtagTest.
@Test
@LargeTest
public void getHistoryHashtagTest() {
long startTime = System.currentTimeMillis();
ChatListener historyListeners = new ChatListener() {
@Override
public void onGetHistory(String content, ChatResponse<ResultHistory> history) {
System.out.println("onGetHistory: ");
Logger.json(history.getJson());
Assert.assertTrue(true);
resumeProcess();
}
};
chat.setListener(historyListeners);
RequestGetHistory request = new RequestGetHistory.Builder(8085).offset(0).count(25).order("desc").build();
presenter.getHistory(request, null);
pauseProcess();
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method getAssistantTest.
@Test
@LargeTest
public void getAssistantTest() {
long startTime = System.currentTimeMillis();
ChatListener historyListeners = new ChatListener() {
@Override
public void onGetAssistants(ChatResponse<List<AssistantVo>> response) {
System.out.println("onGetAssistants: " + response);
Assert.assertTrue(true);
}
};
chat.addListener(historyListeners);
getAssistants();
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method deActiveAssistantTest.
@Test
@LargeTest
public void deActiveAssistantTest() {
long startTime = System.currentTimeMillis();
ChatListener historyListeners = new ChatListener() {
@Override
public void onDeActiveAssistant(ChatResponse<List<AssistantVo>> response) {
System.out.println("onDeActiveAssistant: " + response);
Assert.assertTrue(true);
}
};
chat.addListener(historyListeners);
deActiveAssistant();
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class ContactCacheTest method createChat.
@Before
public void createChat() {
view = Mockito.mock(ChatContract.view.class);
chatActivity = chatActivityRule.getActivity();
presenter = new ChatPresenter(appContext, view, chatActivity);
RequestConnect rc = new RequestConnect.Builder(socketAddress, APP_ID, serverName, TOKEN, ssoHost, platformHost, fileServer, "podSpaceServer").build();
chatListeners = new ChatListener() {
@Override
public void onChatState(String state) {
if (state.equals(CHAT_READY)) {
resumeProcess();
}
}
};
chat.addListener(chatListeners);
chat.connect(rc);
chat.isCacheables(CACHE);
pauseProcess();
}
use of com.fanap.podchat.chat.ChatListener in project pod-chat-android-sdk by FanapSoft.
the class ContactCacheTest method populateContactsFromServer.
public void populateContactsFromServer() {
chatListeners = new ChatListener() {
@Override
public void onGetContacts(String content, ChatResponse<ResultContact> response) {
if (!response.isCache()) {
System.out.println("Received List: " + content);
serverContacts.addAll(response.getResult().getContacts());
chat.removeListener(chatListeners);
resumeProcess();
}
}
};
chat.setListener(chatListeners);
RequestGetContact request = new RequestGetContact.Builder().count(50).offset(0).build();
chat.getContacts(request, null);
pauseProcess();
System.out.println("Received List: " + serverContacts.size());
}
Aggregations