aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/test/CommandTest.java
diff options
context:
space:
mode:
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();
}