mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Get rid of references to removed @Skip annotation
This commit is contained in:
parent
84af092401
commit
1acf340f79
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user