Improve GuiActionRunner

Open
#242 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
testing

Research direction

Locate GuiActionRunner and inspect the end-of-method handling for RuntimeException and Error. Review the existing tests, then focus on AssertionError and preservation of the original stack trace; the work is done when the selected behavior is covered and the test suite passes.

Written by the indexing model from the issue text.

Description

At the end of GuiActionRunner there is the following code:

    if (caughtException instanceof RuntimeException) {
      appendStackTraceInCurrentThreadToThrowable(caughtException, "execute");
      throw (RuntimeException) caughtException;
    }
    if (caughtException instanceof Error) {
      caughtException.fillInStackTrace();
      throw (Error) caughtException;
    }

I think it is not reasonable to fill in the stack trace for the Errors, throwing away the original stack trace: Errors should be treated the same as RuntimeExceptions. Or - if there is some reason for doing so - then at least don't throw away the stack trace of AssertionErrors, they are normal and expected during testing.

Dominant language
Java
Stars
121
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assertj/assertj-swing

All issues in assertj/assertj-swing

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.