diff options
| author | J08nY | 2017-12-05 18:28:25 +0100 |
|---|---|---|
| committer | J08nY | 2017-12-05 18:28:25 +0100 |
| commit | 861c80be829b1160ee2d9e64076e7ead16312984 (patch) | |
| tree | 940bdfe87e952afba4dfe0987cbe03ffd698e679 /src/cz/crcs/ectester/reader/test/CommandTest.java | |
| parent | be9c68b2ec522f6e7efda9fad325ab88bd0e8a93 (diff) | |
| download | ECTester-861c80be829b1160ee2d9e64076e7ead16312984.tar.gz ECTester-861c80be829b1160ee2d9e64076e7ead16312984.tar.zst ECTester-861c80be829b1160ee2d9e64076e7ead16312984.zip | |
Fix suites with new CommandTest.
Diffstat (limited to 'src/cz/crcs/ectester/reader/test/CommandTest.java')
| -rw-r--r-- | src/cz/crcs/ectester/reader/test/CommandTest.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/cz/crcs/ectester/reader/test/CommandTest.java b/src/cz/crcs/ectester/reader/test/CommandTest.java index 5f3dcac..e88f476 100644 --- a/src/cz/crcs/ectester/reader/test/CommandTest.java +++ b/src/cz/crcs/ectester/reader/test/CommandTest.java @@ -16,7 +16,15 @@ public class CommandTest extends SimpleTest<CommandTestable> { super(command, callback); } - public CommandTest expect(CommandTestable command, Result.ExpectedValue expected, String ok, String nok) { + public static CommandTest function(CommandTestable command, TestCallback<CommandTestable> callback) { + return new CommandTest(command, callback); + } + + public static CommandTest function(Command command, TestCallback<CommandTestable> callback) { + return function(new CommandTestable(command), callback); + } + + public static CommandTest expect(CommandTestable command, Result.ExpectedValue expected, String ok, String nok) { return new CommandTest(command, new TestCallback<CommandTestable>() { @Override public Result apply(CommandTestable commandTestable) { @@ -27,10 +35,18 @@ public class CommandTest extends SimpleTest<CommandTestable> { }); } - public CommandTest expect(CommandTestable command, Result.ExpectedValue expected) { + public static CommandTest expect(Command command, Result.ExpectedValue expectedValue, String ok, String nok) { + return expect(new CommandTestable(command), expectedValue, ok, nok); + } + + public static CommandTest expect(CommandTestable command, Result.ExpectedValue expected) { return expect(command, expected, null, null); } + public static CommandTest expect(Command command, Result.ExpectedValue expectedValue) { + return expect(command, expectedValue, null, null); + } + public Command getCommand() { return testable.getCommand(); } |
