Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save Throwable as Java object for each failure #151

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

leonardhusmann
Copy link

Hi,
the Throwable which is causing the test to fail is saved as an object. This allows for easier and more robust analysis and classification of the failures later.

Example:

TestResult result = EntryPoint.runTests(classpath, "org.example.TestMain");
Set<Failure> failures = result.getFailingTests();
for (Failure failure : failures) {
    if (failure.throwable instanceof AssertionError) {
        // handle failed assertions --> test failures
    } else if (failure.throwable instanceof RuntimeException) {
        //handle Runtime errors --> test errors
    }
}

@monperrus
Copy link
Member

thanks @leonardhusmann

CI is failing, could you fix it?

@leonardhusmann
Copy link
Author

Looking into it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants