org.junit.experimental.theories.internal.ParameterizedAssertionError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit Show documentation
Show all versions of junit Show documentation
JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck.
package org.junit.experimental.theories.internal;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
public class ParameterizedAssertionError extends AssertionError {
private static final long serialVersionUID = 1L;
public ParameterizedAssertionError(Throwable targetException,
String methodName, Object... params) {
super(String.format("%s(%s)", methodName, join(", ", params)));
this.initCause(targetException);
}
@Override
public boolean equals(Object obj) {
return obj instanceof ParameterizedAssertionError && toString().equals(obj.toString());
}
@Override
public int hashCode() {
return toString().hashCode();
}
public static String join(String delimiter, Object... params) {
return join(delimiter, Arrays.asList(params));
}
public static String join(String delimiter, Collection