#34 new
roufamatic

Tests succeed when a new Error() is thrown

Reported by roufamatic | January 27th, 2010 @ 06:31 PM

Problem:
runtime errors (throw new Error()) in tested methods are ignored by infinitest. Tests are reported as succeeding even though they don't.

Expected Behavior:
Uncaught exceptions -- including runtime errors -- should cause tests to blow up.

Steps to reproduce:
Try creating these two classes. Infinitest will say the test passes, while Eclipse's junit test runner shows the failure.

public class ClassToTest {

public void doTestWithError() {
    throw new Error();
}

}

public class TestHarness {

@Test
public void testThatErrorsAreHandled() {
    (new ClassToTest()).doTestWithError();
}

}

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Continuous Test Runner for Java

Shared Ticket Bins

People watching this ticket

Pages