diff options
author | Damian Minkov <damencho@jitsi.org> | 2006-09-04 13:23:08 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2006-09-04 13:23:08 +0000 |
commit | 53f2aae096704d4a78707cc13d5df4f548a982a0 (patch) | |
tree | 89193abc7b6f6691af8ea0c507da26ff700607a6 /test | |
parent | 1d2f145a005faf8d4b98667c857bba9b9003e33f (diff) | |
download | jitsi-53f2aae096704d4a78707cc13d5df4f548a982a0.zip jitsi-53f2aae096704d4a78707cc13d5df4f548a982a0.tar.gz jitsi-53f2aae096704d4a78707cc13d5df4f548a982a0.tar.bz2 |
History Service does not leaves content after testing.
Added method in History Service for removing content.
Diffstat (limited to 'test')
-rw-r--r-- | test/net/java/sip/communicator/slick/history/HistoryServiceLick.java | 2 | ||||
-rw-r--r-- | test/net/java/sip/communicator/slick/history/TestHistoryService.java | 37 |
2 files changed, 37 insertions, 2 deletions
diff --git a/test/net/java/sip/communicator/slick/history/HistoryServiceLick.java b/test/net/java/sip/communicator/slick/history/HistoryServiceLick.java index d74b685..f50581b 100644 --- a/test/net/java/sip/communicator/slick/history/HistoryServiceLick.java +++ b/test/net/java/sip/communicator/slick/history/HistoryServiceLick.java @@ -39,7 +39,7 @@ public class HistoryServiceLick extends TestSuite implements BundleActivator { Hashtable properties = new Hashtable(); properties.put("service.pid", getName()); - addTestSuite(TestHistoryService.class); + addTest(TestHistoryService.suite()); bundleContext.registerService(getClass().getName(), this, properties); logger.debug("Successfully registered " + getClass().getName()); diff --git a/test/net/java/sip/communicator/slick/history/TestHistoryService.java b/test/net/java/sip/communicator/slick/history/TestHistoryService.java index 9ca2833..dad96c1 100644 --- a/test/net/java/sip/communicator/slick/history/TestHistoryService.java +++ b/test/net/java/sip/communicator/slick/history/TestHistoryService.java @@ -30,11 +30,22 @@ public class TestHistoryService extends TestCase { private Random random = new Random(); public TestHistoryService(String name) - throws Exception { super(name); } + public static Test suite() + { + TestSuite suite = new TestSuite(); + + suite.addTest(new TestHistoryService("testCreateDB")); + suite.addTest(new TestHistoryService("testWriteRecords")); + suite.addTest(new TestHistoryService("testReadRecords")); + suite.addTest(new TestHistoryService("testPurgeLocallyStoredHistory")); + + return suite; + } + protected void setUp() throws Exception { @@ -110,6 +121,17 @@ public class TestHistoryService extends TestCase { { fail("Could not create database with id " + id + " with error " + e); } + + try + { + // after creating, remove it - do not leave content + this.historyService.purgeLocallyStoredHistory(id); + } + catch (Exception ex) + { + fail("Cannot delete local history with id " + this.history.getID() + + " : " + ex.getMessage()); + } } public void testWriteRecords() @@ -155,4 +177,17 @@ public class TestHistoryService extends TestCase { } } } + + public void testPurgeLocallyStoredHistory() + { + try + { + this.historyService.purgeLocallyStoredHistory(this.history.getID()); + } + catch (Exception ex) + { + fail("Cannot delete local history with id " + this.history.getID() + + " : " + ex.getMessage()); + } + } } |