aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2013-07-24 14:57:29 +0200
committerDamian Minkov <damencho@jitsi.org>2013-07-24 14:57:29 +0200
commite130c9ece95aadd5c156f05259144c5b695e457c (patch)
tree3f5c8a936b7247d8192fecd64280e1a3bb9f25af /test
parent1a94b834ddce542a289a570ffd02a39ec1a38695 (diff)
downloadjitsi-e130c9ece95aadd5c156f05259144c5b695e457c.zip
jitsi-e130c9ece95aadd5c156f05259144c5b695e457c.tar.gz
jitsi-e130c9ece95aadd5c156f05259144c5b695e457c.tar.bz2
Fixes some history searches where some files were skipped if the the start timestamp we filter is the same as the filename (filename is the time it was created) and filtering some dates by period now is inclusive for the start of the period.
Diffstat (limited to 'test')
-rw-r--r--test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java53
1 files changed, 29 insertions, 24 deletions
diff --git a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
index 53129cd..edaf188 100644
--- a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
+++ b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
@@ -199,6 +199,7 @@ public class TestMsgHistoryService
mockBImOpSet.deliverMessage(TEST_CONTACT_NAME_2, messagesToSend[0]);
TestMsgHistoryService.controlDate1 = new Date();
+ logger.info("controlDate1:" + controlDate1.getTime());
Object lock = new Object();
synchronized (lock)
@@ -218,6 +219,7 @@ public class TestMsgHistoryService
mockBImOpSet.deliverMessage(TEST_CONTACT_NAME_2, messagesToSend[2]);
TestMsgHistoryService.controlDate2 = new Date();
+ logger.info("controlDate2:" + controlDate1.getTime());
synchronized (lock)
{
// wait a moment
@@ -314,7 +316,7 @@ public class TestMsgHistoryService
msgs = getMessages(rs);
- assertEquals("Messages must be 2", msgs.size(), 2);
+ assertEquals("Messages must be 2", 2, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[1].getContent()));
@@ -331,7 +333,7 @@ public class TestMsgHistoryService
msgs = getMessages(rs);
- assertEquals("Messages must be 1", msgs.size(), 1);
+ assertEquals("Messages must be 1", 1, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[1].getContent()));
@@ -342,7 +344,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found findByStartDate", !rs.isEmpty());
msgs = getMessages(rs);
- assertEquals("Messages must be 2", msgs.size(), 2);
+ assertEquals("Messages must be 2", 2, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[3].getContent()));
assertTrue("Message no found",
@@ -355,7 +357,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found 8", !rs.isEmpty());
msgs = getMessages(rs);
- assertEquals("Messages must be 3", msgs.size(), 3);
+ assertEquals("Messages must be 3", 3, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[2].getContent()));
assertTrue("Message no found",
@@ -370,7 +372,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found 9", !rs.isEmpty());
msgs = getMessages(rs);
- assertEquals("Messages must be 3", msgs.size(), 3);
+ assertEquals("Messages must be 3", 3, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[1].getContent()));
assertTrue("Message no found",
@@ -385,7 +387,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found 10", !rs.isEmpty());
msgs = getMessages(rs);
- assertEquals("Messages must be 3", msgs.size(), 3);
+ assertEquals("Messages must be 3", 3, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[0].getContent()));
assertTrue("Message no found",
@@ -408,7 +410,7 @@ public class TestMsgHistoryService
}
}
}
-
+
public void writeRecordsToMultiChat()
{
try
@@ -422,28 +424,31 @@ public class TestMsgHistoryService
// First deliver message, so they are stored by the message history service
room.sendMessage(messagesToSend[0]);
+ waitWrite(100);
+
TestMsgHistoryService.controlDate1 = new Date();
+ logger.info("controlDate1:" + controlDate1.getTime());
- waitWrite(200);
-
+ waitWrite(100);
room.sendMessage(messagesToSend[1]);
- waitWrite(200);
-
+ waitWrite(100);
+
room.sendMessage(messagesToSend[2]);
TestMsgHistoryService.controlDate2 = new Date();
-
- waitWrite(200);
+ logger.info("controlDate2:" + controlDate2.getTime());
+
+ waitWrite(100);
room.sendMessage(messagesToSend[3]);
-
- waitWrite(200);
-
+
+ waitWrite(100);
+
room.sendMessage(messagesToSend[4]);
-
- waitWrite(200);
+
+ waitWrite(100);
}
catch(OperationFailedException ex)
{
@@ -542,7 +547,7 @@ public class TestMsgHistoryService
msgs = getChatMessages(rs);
- assertEquals("Messages must be 2", msgs.size(), 2);
+ assertEquals("Messages must be 2", 2, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[1].getContent()));
@@ -559,7 +564,7 @@ public class TestMsgHistoryService
msgs = getChatMessages(rs);
- assertEquals("Messages must be 1", msgs.size(), 1);
+ assertEquals("Messages must be 1", 1, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[1].getContent()));
@@ -570,7 +575,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found findByStartDate", !rs.isEmpty());
msgs = getChatMessages(rs);
- assertEquals("Messages must be 2", msgs.size(), 2);
+ assertEquals("Messages must be 2", 2, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[3].getContent()));
assertTrue("Message no found",
@@ -583,7 +588,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found 8", !rs.isEmpty());
msgs = getChatMessages(rs);
- assertEquals("Messages must be 3", msgs.size(), 3);
+ assertEquals("Messages must be 3", 3, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[2].getContent()));
assertTrue("Message no found",
@@ -598,7 +603,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found 9", !rs.isEmpty());
msgs = getChatMessages(rs);
- assertEquals("Messages must be 3", msgs.size(), 3);
+ assertEquals("Messages must be 3", 3, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[1].getContent()));
assertTrue("Message no found",
@@ -613,7 +618,7 @@ public class TestMsgHistoryService
assertTrue("Nothing found 10", !rs.isEmpty());
msgs = getChatMessages(rs);
- assertEquals("Messages must be 3", msgs.size(), 3);
+ assertEquals("Messages must be 3", 3, msgs.size());
assertTrue("Message no found",
msgs.contains(messagesToSend[0].getContent()));
assertTrue("Message no found",