This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit b03cc9aed77620f5c617745a32bc442eebfecb07 Author: servantie <servantie.c@gmail.com> Date: Thu Jun 23 18:05:35 2016 +0200 tests for addition/removal of SyncInfo in tasks --- .../org/chorem/jtimer/entities/TimerTaskTest.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/test/java/org/chorem/jtimer/entities/TimerTaskTest.java b/src/test/java/org/chorem/jtimer/entities/TimerTaskTest.java index 87cc0e1..6db7cb0 100644 --- a/src/test/java/org/chorem/jtimer/entities/TimerTaskTest.java +++ b/src/test/java/org/chorem/jtimer/entities/TimerTaskTest.java @@ -116,4 +116,46 @@ public class TimerTaskTest extends AbstractJTimerTest { Assert.assertEquals(task.getSubTasks().size(), 1); Assert.assertEquals(clonedTask.getSubTasks().size(), 0); } + + /** + * Test that no URL is present twice for a task + */ + @Test + public void addSyncInfoTest() { + TimerTask task = new TimerTask(); + String url1 = "localhost/test"; + String url2 = "localhost/test"; + + task.addSyncInfo(url1); + task.addSyncInfo(url2); + + Assert.assertTrue(task.getSynchronizingInfoList().size() == 1); + + String url3 = "localhost"; + task.addSyncInfo(url3); + + Assert.assertTrue(task.getSynchronizingInfoList().size() == 2); + } + + /** + * Test that removal of URL works ? + */ + @Test + public void removeSyncInfoTest() { + TimerTask task = new TimerTask(); + + String url1 = "localhost/test"; + String url2 = "localhost/other"; + + task.addSyncInfo(url1); + task.addSyncInfo(url2); + + Assert.assertTrue(task.getSynchronizingInfoList().size() == 2); + + task.removeSyncInfo(url1); + + Assert.assertTrue(task.getSynchronizingInfoList().size() == 1); + Assert.assertTrue(task.getSynchronizingURLList().contains(url2)); + + } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.