Add SimpleTestRunner as a test runner.
continuous-integration/drone/tag Build is failing

This commit is contained in:
2023-09-24 21:48:49 +03:00
parent 1549f85a49
commit 9a14ea6486
3 changed files with 122 additions and 0 deletions
@@ -0,0 +1,6 @@
package space.kklochko.simple_jbdd.tests.runners;
public abstract class AbstractTestRunner {
public abstract boolean run();
}
@@ -0,0 +1,29 @@
package space.kklochko.simple_jbdd.tests.runners;
import space.kklochko.simple_jbdd.tests.Test;
import space.kklochko.simple_jbdd.tests.commands.AbstractTestCommand;
public class SimpleTestRunner extends AbstractTestRunner {
AbstractTestCommand<Test> command;
public SimpleTestRunner(AbstractTestCommand<Test> command) {
this.command = command;
}
public boolean run() {
try {
return getCommand().test();
}catch (AssertionError e) {
return false;
}
}
public AbstractTestCommand<Test> getCommand() {
return command;
}
public void setCommand(AbstractTestCommand<Test> command) {
this.command = command;
}
}