diff options
author | Danny van Heumen <danny@dannyvanheumen.nl> | 2014-01-26 22:27:23 +0100 |
---|---|---|
committer | Danny van Heumen <danny@dannyvanheumen.nl> | 2014-07-30 18:30:00 +0200 |
commit | 2d527dbef2026e5b4fee4cd7e5dd126405b95aee (patch) | |
tree | 6f9f5b60dcf5bd934eabb28e69d1602e76ca1a9d /test | |
parent | 1b86d1a29479e68a8a7e547de7e543ad502a7718 (diff) | |
download | jitsi-2d527dbef2026e5b4fee4cd7e5dd126405b95aee.zip jitsi-2d527dbef2026e5b4fee4cd7e5dd126405b95aee.tar.gz jitsi-2d527dbef2026e5b4fee4cd7e5dd126405b95aee.tar.bz2 |
Use Result instance for synchronization while getting list to handle
spurious wakeups.
Diffstat (limited to 'test')
-rw-r--r-- | test/net/java/sip/communicator/impl/protocol/irc/ResultTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
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<Object, Exception> result = + new Result<Object, Exception>(initial); + Assert.assertNotNull(result); + Assert.assertFalse(result.isDone()); + Assert.assertSame(initial, result.getValue()); + Assert.assertNull(result.getException()); + } public void testSetDone() { |