334 |
|
TestSubscriber s = new TestSubscriber(); |
335 |
|
SubmissionPublisher<Integer> p = basicPublisher(); |
336 |
|
s.throwOnCall = true; |
337 |
< |
try { |
338 |
< |
p.subscribe(s); |
339 |
< |
} catch (Exception ok) {} |
337 |
> |
p.subscribe(s); |
338 |
|
s.awaitError(); |
339 |
|
assertEquals(0, s.nexts); |
340 |
|
assertEquals(1, s.errors); |
402 |
|
*/ |
403 |
|
public void testCancel() { |
404 |
|
SubmissionPublisher<Integer> p = |
405 |
< |
new SubmissionPublisher<Integer>(basicExecutor, 4); // must be < 20 |
405 |
> |
new SubmissionPublisher<>(basicExecutor, 4); // must be < 20 |
406 |
|
TestSubscriber s1 = new TestSubscriber(); |
407 |
|
TestSubscriber s2 = new TestSubscriber(); |
408 |
|
p.subscribe(s1); |
983 |
|
* cvs update -D '2017-11-25' src/main/java/util/concurrent/SubmissionPublisher.java && ant -Djsr166.expensiveTests=true -Djsr166.tckTestClass=SubmissionPublisherTest -Djsr166.methodFilter=testMissedSignal tck; cvs update -A src/main/java/util/concurrent/SubmissionPublisher.java |
984 |
|
*/ |
985 |
|
public void testMissedSignal_8187947() throws Exception { |
986 |
+ |
if (!atLeastJava9()) return; // backport to jdk8 too hard |
987 |
|
final int N = expensiveTests ? (1 << 20) : (1 << 10); |
988 |
|
final CountDownLatch finished = new CountDownLatch(1); |
989 |
|
final SubmissionPublisher<Boolean> pub = new SubmissionPublisher<>(); |
1002 |
|
public void onComplete() {} |
1003 |
|
} |
1004 |
|
pub.subscribe(new Sub()); |
1005 |
< |
CompletableFuture.runAsync(() -> pub.submit(Boolean.TRUE)); |
1005 |
> |
checkTimedGet( |
1006 |
> |
CompletableFuture.runAsync(() -> pub.submit(Boolean.TRUE)), |
1007 |
> |
null); |
1008 |
|
await(finished); |
1009 |
|
} |
1010 |
|
} |