Setting result prior to counting down latch.
This commit is contained in:
@@ -42,11 +42,9 @@ public class AdapterTests {
|
||||
sink.setLatch(latch);
|
||||
assertNull(sink.get());
|
||||
context.start();
|
||||
String result = null;
|
||||
latch.await(3000, TimeUnit.MILLISECONDS);
|
||||
assertEquals("latch should have counted down within allotted time", 0, latch.getCount());
|
||||
result = sink.get();
|
||||
assertNotNull(result);
|
||||
assertNotNull(sink.get());
|
||||
context.close();
|
||||
}
|
||||
|
||||
@@ -58,11 +56,9 @@ public class AdapterTests {
|
||||
sink.setLatch(latch);
|
||||
assertNull(sink.get());
|
||||
context.start();
|
||||
String result = null;
|
||||
latch.await(3000, TimeUnit.MILLISECONDS);
|
||||
assertEquals("latch should have counted down within allotted time", 0, latch.getCount());
|
||||
result = sink.get();
|
||||
assertNotNull(result);
|
||||
assertNotNull(sink.get());
|
||||
context.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,10 @@ public class TestSink {
|
||||
}
|
||||
|
||||
public void store(String s) {
|
||||
this.result = s;
|
||||
if (this.latch != null) {
|
||||
this.latch.countDown();
|
||||
}
|
||||
this.result = s;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
|
||||
Reference in New Issue
Block a user