aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/test/CommandTest.java
diff options
context:
space:
mode:
authorJ08nY2017-12-05 18:28:25 +0100
committerJ08nY2017-12-05 18:28:25 +0100
commit861c80be829b1160ee2d9e64076e7ead16312984 (patch)
tree940bdfe87e952afba4dfe0987cbe03ffd698e679 /src/cz/crcs/ectester/reader/test/CommandTest.java
parentbe9c68b2ec522f6e7efda9fad325ab88bd0e8a93 (diff)
downloadECTester-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.java20
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();
}