mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +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>() {
|
expect(callWithCurrentContinuation(new CallbackReceiver<Integer>() {
|
||||||
public Integer receive(Callback<Integer> continuation) {
|
public Integer receive(Callback<Integer> continuation) {
|
||||||
continuation.handleResult(42);
|
continuation.handleResult(42);
|
||||||
throw new RuntimeException("unreachable");
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
}) == 42);
|
}) == 42);
|
||||||
|
|
||||||
@ -28,10 +28,10 @@ public class Continuations {
|
|||||||
callWithCurrentContinuation(new CallbackReceiver<Integer>() {
|
callWithCurrentContinuation(new CallbackReceiver<Integer>() {
|
||||||
public Integer receive(Callback<Integer> continuation) {
|
public Integer receive(Callback<Integer> continuation) {
|
||||||
continuation.handleException(new MyException());
|
continuation.handleException(new MyException());
|
||||||
throw new RuntimeException("unreachable");
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
throw new RuntimeException("unreachable");
|
throw new AssertionError();
|
||||||
} catch (MyException e) {
|
} catch (MyException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ public class Continuations {
|
|||||||
throw new MyException();
|
throw new MyException();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
throw new RuntimeException("unreachable");
|
throw new AssertionError();
|
||||||
} catch (MyException e) {
|
} catch (MyException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,13 @@ public class Coroutines {
|
|||||||
|
|
||||||
state.consumeNext.handleResult(c);
|
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 {
|
public Character produce() throws Exception {
|
||||||
return callWithCurrentContinuation(new CallbackReceiver<Character>() {
|
return callWithCurrentContinuation(new CallbackReceiver<Character>() {
|
||||||
public Character receive(Callback<Character> continuation)
|
public Character receive(Callback<Character> continuation)
|
||||||
@ -53,7 +53,7 @@ public class Coroutines {
|
|||||||
state.produceNext.handleResult(null);
|
state.produceNext.handleResult(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RuntimeException("unreachable");
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ public class Coroutines {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class CoroutineState<T> {
|
private static class CoroutineState<T> {
|
||||||
public Callback<T> produceNext;
|
public Callback produceNext;
|
||||||
public Callback<T> consumeNext;
|
public Callback<T> consumeNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user