assertj / assertj/assertj-swing

Assertj-Swing: GuiActionRunner - numRetries/waitBetweenRetries

Open
#204 10 comments 0 reactions 1 assignee Claimed by @andyhayder View on GitHub
Dominant language
Java
Stars
121
Forks
52
PR merge metrics
No merged PRs in 30d

Description

Hi,
unfortunately i miss following feature. I have the problem that some actions creating a new GUI form/element runs a lot of time (SwingWorker, DynamicTreeNode(s)). So i implemented following workaround, which works fine.

Example
public static void execute(@Nonnull GuiTask task) {
if (!executeInEDT) {
executeInCurrentThread(task);
return;
}
for (int i = 0; i < # ConfigAssertJ.numRetries - 1; i++) {
run(task);
if (task.catchedException() == null) {
break;
}
// Error -> retry
System.out.println("Retry " + task);
try {
Thread.sleep(ConfigAssertJ.waitBetweenRetries);
} catch (Exception e) {
// TODO: handle exception
}
}
rethrowCaughtExceptionIn(task);
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.