minor tweaks to test classes

This commit is contained in:
Joel Dice 2009-05-16 21:41:27 -06:00
parent 8573619720
commit 8463bb4056
2 changed files with 8 additions and 8 deletions

View File

@ -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();
} }

View File

@ -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;
} }