Search in sources :

Example 16 with Callback

use of com.fanap.podchat.util.Callback in project pod-chat-android-sdk by FanapSoft.

the class DbTest method updateMessagesWithMessageId.

@Test
public void updateMessagesWithMessageId() {
    long threadId = 2;
    Callback callback = new Callback();
    List<MessageVO> messageVOS = new ArrayList<>();
    callback.setMessageId(6181);
    callback.setOrder("asc");
    messageDatabaseHelper.updateGetHistoryResponse(callback, messageVOS, threadId, null);
}
Also used : Callback(com.fanap.podchat.util.Callback) ArrayList(java.util.ArrayList) MessageVO(com.fanap.podchat.mainmodel.MessageVO) CacheMessageVO(com.fanap.podchat.cachemodel.CacheMessageVO) Test(org.junit.Test)

Example 17 with Callback

use of com.fanap.podchat.util.Callback in project pod-chat-android-sdk by FanapSoft.

the class DbTest method justFirstMsgIdset2.

// first message id conditional 2
@Test
public void justFirstMsgIdset2() {
    Callback callback = new Callback();
    long threadId = 2;
    List<MessageVO> messageVOS = new ArrayList<>();
    // MessageVO messageVO = new MessageVO(
    // 5653,
    // false,
    // false,
    // false,
    // false,
    // false,
    // "91efe7da-547f-4c5f-c34b-0442951ffbbc",
    // 0,
    // 5652,
    // "",
    // null,
    // 13354321,
    // 321000000,
    // "",
    // null,
    // null,
    // null,
    // null
    // );
    callback.setOffset(0);
    callback.setCount(2);
    callback.setOrder("asc");
    callback.setFirstMessageId(9236);
    messageDatabaseHelper.updateGetHistoryResponse(callback, null, threadId, null);
}
Also used : Callback(com.fanap.podchat.util.Callback) ArrayList(java.util.ArrayList) MessageVO(com.fanap.podchat.mainmodel.MessageVO) CacheMessageVO(com.fanap.podchat.cachemodel.CacheMessageVO) Test(org.junit.Test)

Example 18 with Callback

use of com.fanap.podchat.util.Callback in project pod-chat-android-sdk by FanapSoft.

the class DbTest method updateCacheFAndLConditional3.

// first messsage and last message
// Conditional 3
// cache siz more than one but server size is more than 1
@Test
public void updateCacheFAndLConditional3() {
    long threadId = 2;
    Callback callback = new Callback();
    List<MessageVO> messageVOS = new ArrayList<>();
    // MessageVO messageVO = new MessageVO(
    // 5653,
    // false,
    // false,
    // false,
    // false,
    // false,
    // "91efe7da-547f-4c5f-c34b-0442951ffbbc",
    // 0,
    // 5652,
    // "",
    // null,
    // 13354321,
    // 321000000,
    // "",
    // null,
    // null,
    // null,
    // null
    // );
    // messageVOS.add(messageVO);
    callback.setOffset(0);
    callback.setCount(50);
    callback.setOrder("asc");
    callback.setFirstMessageId(5652);
    callback.setLastMessageId(5653);
    messageDatabaseHelper.updateGetHistoryResponse(callback, messageVOS, threadId, null);
}
Also used : Callback(com.fanap.podchat.util.Callback) ArrayList(java.util.ArrayList) MessageVO(com.fanap.podchat.mainmodel.MessageVO) CacheMessageVO(com.fanap.podchat.cachemodel.CacheMessageVO) Test(org.junit.Test)

Aggregations

Callback (com.fanap.podchat.util.Callback)18 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)7 CacheMessageVO (com.fanap.podchat.cachemodel.CacheMessageVO)5 MessageVO (com.fanap.podchat.mainmodel.MessageVO)5 PodChatException (com.fanap.podchat.util.PodChatException)5 RoomIntegrityException (com.fanap.podchat.persistance.RoomIntegrityException)4 JsonSyntaxException (com.google.gson.JsonSyntaxException)4 SentryException (io.sentry.core.protocol.SentryException)4 IOException (java.io.IOException)4 JSONException (org.json.JSONException)4 ChatResponse (com.fanap.podchat.model.ChatResponse)3 ResultMessage (com.fanap.podchat.model.ResultMessage)3 SendingQueueCache (com.fanap.podchat.cachemodel.queue.SendingQueueCache)1 ChatMessage (com.fanap.podchat.mainmodel.ChatMessage)1 Constants (com.fanap.podchat.util.ChatMessageType.Constants)1