From 73af477a8774e1ede5dd8de6491eb353dc0b12bd Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 22 Mar 2024 23:58:55 +0100 Subject: Basic Gradle setup. --- src/cz/crcs/ectester/common/test/Test.java | 83 ------------------------------ 1 file changed, 83 deletions(-) delete mode 100644 src/cz/crcs/ectester/common/test/Test.java (limited to 'src/cz/crcs/ectester/common/test/Test.java') diff --git a/src/cz/crcs/ectester/common/test/Test.java b/src/cz/crcs/ectester/common/test/Test.java deleted file mode 100644 index 8bf9502..0000000 --- a/src/cz/crcs/ectester/common/test/Test.java +++ /dev/null @@ -1,83 +0,0 @@ -package cz.crcs.ectester.common.test; - -import static cz.crcs.ectester.common.test.Result.Value; - -/** - * An abstract test that can be run and has a Result. - * - * @author Jan Jancar johny@neuromancer.sk - */ -public abstract class Test implements Testable, Cloneable { - protected boolean hasRun; - protected boolean hasStarted; - protected Result result; - - public Result getResult() { - return result; - } - - public boolean ok() { - if (result == null) { - return true; - } - return result.ok(); - } - - @Override - public boolean error() { - if (result == null) { - return false; - } - return result.compareTo(Value.ERROR); - } - - @Override - public Object errorCause() { - if (result == null || !result.compareTo(Value.ERROR)) { - return null; - } - return result.getCause(); - } - - @Override - public boolean hasRun() { - return hasRun; - } - - public boolean hasStarted() { - return hasStarted; - } - - @Override - public void reset() { - hasRun = false; - hasStarted = false; - result = null; - } - - public abstract String getDescription(); - - @Override - public Test clone() throws CloneNotSupportedException { - return (Test) super.clone(); - } - - @Override - public void run() { - if (hasRun) - return; - try { - hasStarted = true; - runSelf(); - hasRun = true; - } catch (TestException e) { - result = new Result(Value.ERROR, e); - throw e; - } catch (Exception e) { - result = new Result(Value.ERROR, e); - throw new TestException(e); - } - } - - protected abstract void runSelf(); -} -- cgit v1.2.3-70-g09d2