blob: 96c12cbd861d1a4717eaa2f68989320b2745d83f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.test;
import com.yahoo.jdisc.handler.CompletionHandler;
import org.junit.Test;
import static org.junit.Assert.fail;
/**
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
public class NonWorkingCompletionHandlerTestCase {
@Test
public void requireThatCompletedThrowsException() {
CompletionHandler completion = new NonWorkingCompletionHandler();
try {
completion.completed();
fail();
} catch (UnsupportedOperationException e) {
}
}
@Test
public void requireThatFailedThrowsException() {
CompletionHandler completion = new NonWorkingCompletionHandler();
try {
completion.failed(null);
fail();
} catch (UnsupportedOperationException e) {
}
completion = new NonWorkingCompletionHandler();
try {
completion.failed(new Throwable());
fail();
} catch (UnsupportedOperationException e) {
}
}
}
|