use of com.fanap.podchat.mainmodel.Thread in project pod-chat-android-sdk by FanapSoft.
the class AssistantCacheTest method populateMessagesFromCache.
public void populateMessagesFromCache() {
populateThreadsListFromServerOnly();
assert threads.size() > 0;
Thread thread = threads.get(0);
chatListeners = new ChatListener() {
@Override
public void onGetHistory(String content, ChatResponse<ResultHistory> history) {
if (history.isCache()) {
print("Received Message List Cache: " + content);
threadMessagesList.addAll(history.getResult().getHistory());
chat.removeListener(chatListeners);
resumeProcess();
}
}
};
chat.addListener(chatListeners);
RequestGetHistory requestGetHistory = new RequestGetHistory.Builder(thread.getId()).build();
chat.getHistory(requestGetHistory, null);
pauseProcess();
}
use of com.fanap.podchat.mainmodel.Thread in project pod-chat-android-sdk by FanapSoft.
the class ChatTestIntegration method getAllThreadsHistories.
@Test
@LargeTest
public // performance should be acceptable
void getAllThreadsHistories() {
populateThreadsListFromServerOrCache();
long startTime = System.currentTimeMillis();
for (Thread thread : new ArrayList<>(threads)) {
System.out.println("NEXT: " + thread.getTitle());
System.out.println(thread.getId());
getThreadFullHistory(thread);
}
// getThreadFullHistory(threads.get(0));
long endTime = System.currentTimeMillis();
Assert.assertTrue(true);
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
System.out.println("TEST IS DONE FOR ");
System.out.println(threads.size());
System.out.println("THREADS IN");
System.out.println(endTime - startTime + " MILLISECONDS");
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
}
use of com.fanap.podchat.mainmodel.Thread in project pod-chat-android-sdk by FanapSoft.
the class ChatTestIntegration method getUserRolesInThread.
@Test
@LargeTest
public void getUserRolesInThread() {
populateThreadsListFromServerOrCache();
for (Thread t : threads) {
if (t.getAdmin()) {
System.out.println("Get roles in " + t.getId());
getCurrentUserRoles(t.getId());
break;
}
}
System.out.println("** Get roles in " + threads.get(0).getId());
getCurrentUserRoles(threads.get(0).getId());
}
use of com.fanap.podchat.mainmodel.Thread in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method getThreadHistoryIns.
@Test
@LargeTest
public void getThreadHistoryIns() {
populateThreadsListFromServerOrCache();
System.out.println("** Get history of " + threads.get(0).getId());
for (Thread thread : new ArrayList<>(threads)) {
getThreadHistory(thread.getId());
}
// getThreadHistory(threads.get(0).getId());
}
use of com.fanap.podchat.mainmodel.Thread in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method getAllThreadsHistories.
@Test
@LargeTest
public // performance should be acceptable
void getAllThreadsHistories() {
populateThreadsListFromServerOrCache();
long startTime = System.currentTimeMillis();
for (Thread thread : new ArrayList<>(threads)) {
System.out.println("NEXT: " + thread.getTitle());
System.out.println(thread.getId());
getThreadFullHistory(thread);
}
// getThreadFullHistory(threads.get(0));
long endTime = System.currentTimeMillis();
Assert.assertTrue(true);
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
System.out.println("TEST IS DONE FOR ");
System.out.println(threads.size());
System.out.println("THREADS IN");
System.out.println(endTime - startTime + " MILLISECONDS");
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
System.out.println(">>> >>> >>>");
}
Aggregations