aboutsummaryrefslogtreecommitdiffstats
path: root/test/net/java
diff options
context:
space:
mode:
Diffstat (limited to 'test/net/java')
-rw-r--r--test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
index b81d1e0..d78a912 100644
--- a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
+++ b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java
@@ -94,6 +94,8 @@ public class TestMsgHistoryService
suite.addTest(
new TestMsgHistoryService("specialChars"));
suite.addTest(
+ new TestMsgHistoryService("insertRecords"));
+ suite.addTest(
new TestMsgHistoryService("writeRecordsToMultiChat"));
suite.addTest(
new TestMsgHistoryService("readRecordsFromMultiChat"));
@@ -436,6 +438,26 @@ public class TestMsgHistoryService
msgs.contains(messagesToSend[6].getContent()));
}
+ /**
+ * Inserts a message between the control dates and queries to check
+ * of the expected number of messages.
+ */
+ public void insertRecords()
+ {
+ if(!(msgHistoryService instanceof MessageHistoryAdvancedService))
+ return;
+
+ ((MessageHistoryAdvancedService)msgHistoryService).insertMessage(
+ "out", null, testContact, messagesToSend[1],
+ new Date(controlDate1.getTime() + 50), false);
+
+ Collection<EventObject> rs
+ = msgHistoryService.findByPeriod(
+ testMetaContact, controlDate1, controlDate2);
+ List<String> msgs = getMessages(rs);
+ assertEquals("Messages must be 3", 3, msgs.size());
+ }
+
private static void waitWrite(long timeout)
{
synchronized (lock)