#20 new
ffff

Collapse ParameterizedAssertionErrors and their cause

Reported by ffff | November 29th, 2009 @ 01:47 AM

The problem markers for failing jUnit theories don't have a terribly helpful message, because the real failure is hidden in the cause of the org.junit.experimental.theories.internal.ParameterizedAssertionError. The purpose of the PEA class is to give hints to which data-point that caused the theory to fail. This information is useful as well, so I suggest that the problem marker message should the concatenation of the PEA message, a new-line and then the message from the cause.

Here is an example that demonstrates the problem:

@RunWith(Theories.class)
public class TheoryExample {
  @DataPoint public static String msg = "this should not be hidden";
  
  @Theory public void
  shouldFailWith(String message) {
    throw new RuntimeException(message);
  }
}

Comments and changes to this ticket

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.

New-ticket 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

Referenced by

Pages