diff options
author | Andre Dietisheim | 2010-01-04 13:39:43 +0000 |
---|---|---|
committer | Andre Dietisheim | 2010-01-04 13:39:43 +0000 |
commit | 72b27586ff34a6fda0d91c7cebd84577c9a991fe (patch) | |
tree | 5803f1a461ae0e385bf92cbc6cf8730e7041d38c /plugins | |
parent | a0abcc14a5574ee778ebfda8683e409cd8f78b73 (diff) | |
download | cdo-72b27586ff34a6fda0d91c7cebd84577c9a991fe.tar.gz cdo-72b27586ff34a6fda0d91c7cebd84577c9a991fe.tar.xz cdo-72b27586ff34a6fda0d91c7cebd84577c9a991fe.zip |
[262875] [Net4j] : java.nio.BufferUnderFlowException
https://bugs.eclipse.org/bugs/show_bug.cgi?id=262875
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla262875_Test.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla262875_Test.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla262875_Test.java index 2f743c4c1e..5839b1c756 100644 --- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla262875_Test.java +++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bugzilla/Bugzilla262875_Test.java @@ -30,6 +30,9 @@ import org.eclipse.net4j.util.tests.AbstractOMTest; import org.eclipse.spi.net4j.ServerProtocolFactory; import java.nio.BufferUnderflowException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; /** * @author David Bonneau @@ -64,16 +67,17 @@ public class Bugzilla262875_Test extends AbstractOMTest public void testBufferUnderflowException() throws Exception { - final boolean[] failed = { false }; + final AtomicBoolean failed = new AtomicBoolean(false); + final CountDownLatch latch = new CountDownLatch(1); IErrorHandler oldErrorHandler = Worker.setGlobalErrorHandler(new IErrorHandler() { public void handleError(Throwable t) { t.printStackTrace(); - failed[0] |= t instanceof BufferUnderflowException; + failed.set(t instanceof BufferUnderflowException); + latch.countDown(); } }); - try { TestProtocol protocol = new TestProtocol(); @@ -81,13 +85,13 @@ public class Bugzilla262875_Test extends AbstractOMTest TestProtocol.Request request = new TestProtocol.Request(protocol); request.send(); + latch.await(100000, TimeUnit.MILLISECONDS); + assertEquals(false, failed.get()); } finally { Worker.setGlobalErrorHandler(oldErrorHandler); } - - assertEquals(false, failed[0]); } /** |