Get rid of references to removed @Skip annotation

This commit is contained in:
ghubstan 2020-07-14 10:35:14 -03:00
parent 84af092401
commit 1acf340f79
No known key found for this signature in database
GPG Key ID: E35592D6800A861E

View File

@ -17,43 +17,16 @@
package bisq.apitest;
import java.util.function.Predicate;
import java.lang.reflect.Method;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import bisq.apitest.annotation.Skip;
public class ApiTestCase {
protected static final char CHECK = '\u2714';
protected static final char CROSS_MARK = '\u274c';
public int countTestCases;
public int countFailedTestCases;
public int countSkippedTestCases;
public int countPassedTestCases;
private final Predicate<Class<?>> skipAll = (c) -> c.getAnnotation(Skip.class) != null;
private final Predicate<Method> skip = (m) -> m.getAnnotation(Skip.class) != null;
protected boolean isSkipped(String methodName) {
try {
if (skipAll.test(this.getClass()) || skip.test(getMethod(methodName))) {
countSkippedTestCases++;
return true;
} else {
return false;
}
} finally {
countTestCases++; // Increment the test case count, skipped or not.
}
}
protected Method getMethod(String methodName) {
try {
return this.getClass().getMethod(methodName);
@ -63,15 +36,7 @@ public class ApiTestCase {
ex);
}
}
protected String reportString() {
return format("Total %d Passed %d Failed %d Skipped %d",
countTestCases,
countPassedTestCases,
countFailedTestCases,
countSkippedTestCases);
}
protected void sleep(long ms) {
try {
MILLISECONDS.sleep(ms);