Skip to content

Commit

Permalink
debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
J3fftw1 committed Nov 21, 2023
1 parent 1d55918 commit 06c0ec9
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,34 @@ public void runTests(@Nonnull String packageName) {
// Invoke
try {
testsRan++;
System.out.println("run test: " + method.getName());
logMessage("run test: " + method.getName());

method.setAccessible(true);
Object instance = method.getDeclaringClass().getDeclaredConstructor().newInstance();
if (threadSafe) {
System.out.println("we are safe no question");
logMessage("we are safe no question");
method.invoke(instance);
} else {
System.out.println("we arent safe");
logMessage("we arent safe");
Bukkit.getScheduler().runTask(E2ETester.getInstance(), () -> {
try {
System.out.println("before invocation");
logMessage("before invocation");
method.invoke(instance);
System.out.println("after invocation");
logMessage("after invocation");
latch.countDown();
} catch (IllegalAccessException | InvocationTargetException e) {
latch.countDown();
System.out.println("caught exception");
logMessage("caught exception");
if (e.getCause() instanceof TestFailException) {
System.out.println("test fail exception");
logMessage("test fail exception");
throw (TestFailException) e.getCause();
}
throw new RuntimeException(e);
}
});
System.out.println("we are waiting");
logMessage("we are waiting");
latch.await();
System.out.println("we are finished waiting");
logMessage("we are finished waiting");
}

testsPassed++;
Expand Down

0 comments on commit 06c0ec9

Please sign in to comment.