Skip to content

AssertException.assertThrows false positive #51

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
subject.assertThrows(AssertionError.class, new Runnable() {
    public void run() {
        // don't throw
    }
});

What is the expected output? What do you see instead?

Expect an AssertionError, but nothing is thrown.

In fact, the assertThrows method detects nothing is thrown, but then throws 
an AssertionError, which then renders the assert successful.

Original issue reported on code.google.com by jem.maw...@gmail.com on 8 Mar 2010 at 3:04

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions