Skip to content

Option to assert the exception message in generated tests #103

@vmassol

Description

@vmassol

Example of generated test:

    @Test(timeout = 4000)
    public void test00() throws Throwable
    {
        Document document0 = XMLUtils.createDOMDocument();
        // Undeclared exception!
        try {
            XMLUtils.extractXML(document0, (-1164), (-1164));
            fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
            //
            // Failed to extract XML
            //
        }
    }

It would be nice to assert the exception message in the catch, as in:

        } catch (RuntimeException e) {
            //
            // Failed to extract XML
            //
            assertEquals("Failed to extract XML", e.getMessage());
        }

I noticed that you put the message in comment so you must have considered it would be a problem to add the assertion. Maybe make it optional at least?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions