[chore] Remove commented out code
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
8025122906
commit
a9c97a7ebc
@ -14,7 +14,6 @@ import java.util.function.Supplier;
|
|||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
import net.bigeon.test.junitmt.FunctionalTestRunnable;
|
||||||
import net.bigeon.test.junitmt.ThreadTest;
|
import net.bigeon.test.junitmt.ThreadTest;
|
||||||
import net.bigeon.test.junitmt.api.TestFunction;
|
|
||||||
|
|
||||||
/** @author Emmanuel Bigeon */
|
/** @author Emmanuel Bigeon */
|
||||||
public final class InputContract {
|
public final class InputContract {
|
||||||
@ -38,24 +37,17 @@ public final class InputContract {
|
|||||||
// Test interruption contract
|
// Test interruption contract
|
||||||
final ConsoleInput input2 = inputs.get();
|
final ConsoleInput input2 = inputs.get();
|
||||||
final FunctionalTestRunnable prompting = new FunctionalTestRunnable(
|
final FunctionalTestRunnable prompting = new FunctionalTestRunnable(
|
||||||
new TestFunction() {
|
() -> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void apply() throws Exception {
|
|
||||||
try {
|
try {
|
||||||
input2.prompt();
|
input2.prompt();
|
||||||
fail("Interrupted prompt should throw INterruptedIOException");
|
fail("Interrupted prompt should throw INterruptedIOException");
|
||||||
} catch (final InterruptedIOException e) {
|
} catch (final InterruptedIOException e) {
|
||||||
// ok
|
// ok
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
final Thread th = new Thread(prompting);
|
final Thread th = new Thread(prompting);
|
||||||
th.start();
|
th.start();
|
||||||
// while (!input2.isPrompting()) {
|
|
||||||
th.join(200);
|
th.join(200);
|
||||||
//
|
|
||||||
// }
|
|
||||||
input2.interruptPrompt();
|
input2.interruptPrompt();
|
||||||
ThreadTest.assertRuns(th, prompting);
|
ThreadTest.assertRuns(th, prompting);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user