From 2d527dbef2026e5b4fee4cd7e5dd126405b95aee Mon Sep 17 00:00:00 2001 From: Danny van Heumen Date: Sun, 26 Jan 2014 22:27:23 +0100 Subject: Use Result instance for synchronization while getting list to handle spurious wakeups. --- .../java/sip/communicator/impl/protocol/irc/ResultTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/net/java/sip/communicator/impl/protocol/irc/ResultTest.java b/test/net/java/sip/communicator/impl/protocol/irc/ResultTest.java index 64b6127..611fd9e 100644 --- a/test/net/java/sip/communicator/impl/protocol/irc/ResultTest.java +++ b/test/net/java/sip/communicator/impl/protocol/irc/ResultTest.java @@ -13,6 +13,17 @@ public class ResultTest Assert.assertNull(result.getValue()); Assert.assertNull(result.getException()); } + + public void testConstructionWithInitialValue() + { + Object initial = new Object(); + Result result = + new Result(initial); + Assert.assertNotNull(result); + Assert.assertFalse(result.isDone()); + Assert.assertSame(initial, result.getValue()); + Assert.assertNull(result.getException()); + } public void testSetDone() { -- cgit v1.1