mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
minor tweaks to test classes
This commit is contained in:
parent
8573619720
commit
8463bb4056
@ -14,7 +14,7 @@ public class Continuations {
|
||||
expect(callWithCurrentContinuation(new CallbackReceiver<Integer>() {
|
||||
public Integer receive(Callback<Integer> continuation) {
|
||||
continuation.handleResult(42);
|
||||
throw new RuntimeException("unreachable");
|
||||
throw new AssertionError();
|
||||
}
|
||||
}) == 42);
|
||||
|
||||
@ -28,10 +28,10 @@ public class Continuations {
|
||||
callWithCurrentContinuation(new CallbackReceiver<Integer>() {
|
||||
public Integer receive(Callback<Integer> continuation) {
|
||||
continuation.handleException(new MyException());
|
||||
throw new RuntimeException("unreachable");
|
||||
throw new AssertionError();
|
||||
}
|
||||
});
|
||||
throw new RuntimeException("unreachable");
|
||||
throw new AssertionError();
|
||||
} catch (MyException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class Continuations {
|
||||
throw new MyException();
|
||||
}
|
||||
});
|
||||
throw new RuntimeException("unreachable");
|
||||
throw new AssertionError();
|
||||
} catch (MyException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -33,13 +33,13 @@ public class Coroutines {
|
||||
|
||||
state.consumeNext.handleResult(c);
|
||||
|
||||
throw new RuntimeException("unreachable");
|
||||
throw new AssertionError();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Producer<Character> producer = new Producer<Character>() {
|
||||
final Producer<Character> producer = new Producer<Character>() {
|
||||
public Character produce() throws Exception {
|
||||
return callWithCurrentContinuation(new CallbackReceiver<Character>() {
|
||||
public Character receive(Callback<Character> continuation)
|
||||
@ -53,7 +53,7 @@ public class Coroutines {
|
||||
state.produceNext.handleResult(null);
|
||||
}
|
||||
|
||||
throw new RuntimeException("unreachable");
|
||||
throw new AssertionError();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -63,7 +63,7 @@ public class Coroutines {
|
||||
}
|
||||
|
||||
private static class CoroutineState<T> {
|
||||
public Callback<T> produceNext;
|
||||
public Callback produceNext;
|
||||
public Callback<T> consumeNext;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user