Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JUnit 4.13.2 Source Code Files
JUnit Source Code Files are provided in the
source package file, junit-4.13.2-sources.jar.
You can browse JUnit Source Code files below:
✍: FYIcenter.com
⏎ org/junit/runners/model/MultipleFailureException.java
package org.junit.runners.model;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.TestCouldNotBeSkippedException;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.Throwables;
/**
* Collects multiple {@code Throwable}s into one exception.
*
* @since 4.9
*/
public class MultipleFailureException extends Exception {
private static final long serialVersionUID = 1L;
/*
* We have to use the f prefix until the next major release to ensure
* serialization compatibility.
* See https://github.com/junit-team/junit4/issues/976
*/
private final List<Throwable> fErrors;
public MultipleFailureException(List<Throwable> errors) {
if (errors.isEmpty()) {
throw new IllegalArgumentException(
"List of Throwables must not be empty");
}
this.fErrors = new ArrayList<Throwable>(errors.size());
for (Throwable error : errors) {
if (error instanceof AssumptionViolatedException) {
error = new TestCouldNotBeSkippedException((AssumptionViolatedException) error);
}
fErrors.add(error);
}
}
public List<Throwable> getFailures() {
return Collections.unmodifiableList(fErrors);
}
@Override
public String getMessage() {
StringBuilder sb = new StringBuilder(
String.format("There were %d errors:", fErrors.size()));
for (Throwable e : fErrors) {
sb.append(String.format("%n %s(%s)", e.getClass().getName(), e.getMessage()));
}
return sb.toString();
}
@Override
public void printStackTrace() {
for (Throwable e: fErrors) {
e.printStackTrace();
}
}
@Override
public void printStackTrace(PrintStream s) {
for (Throwable e: fErrors) {
e.printStackTrace(s);
}
}
@Override
public void printStackTrace(PrintWriter s) {
for (Throwable e: fErrors) {
e.printStackTrace(s);
}
}
/**
* Asserts that a list of throwables is empty. If it isn't empty,
* will throw {@link MultipleFailureException} (if there are
* multiple throwables in the list) or the first element in the list
* (if there is only one element).
*
* @param errors list to check
* @throws Exception or Error if the list is not empty
*/
@SuppressWarnings("deprecation")
public static void assertEmpty(List<Throwable> errors) throws Exception {
if (errors.isEmpty()) {
return;
}
if (errors.size() == 1) {
throw Throwables.rethrowAsException(errors.get(0));
}
/*
* Many places in the code are documented to throw
* org.junit.internal.runners.model.MultipleFailureException.
* That class now extends this one, so we throw the internal
* exception in case developers have tests that catch
* MultipleFailureException.
*/
throw new org.junit.internal.runners.model.MultipleFailureException(errors);
}
}
⏎ org/junit/runners/model/MultipleFailureException.java
Or download all of them as a single archive file:
File name: junit-4.13.2-sources.jar File size: 234540 bytes Release date: 2021-02-13 Download
⇒ Download and Install junit-4.12.jar
⇐ Download and Install junit-4.13.2.jar
2016-03-28, ≈101🔥, 0💬
Popular Posts:
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...
maven-model-builder-3.5. 4.jaris the JAR file for Apache Maven 3.5.4 Model Builder module. Apache Ma...
commons-lang-1.0.1.jar is the JAR file for Apache Commons Lang 1.0.1, which provides a host of helpe...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
How to download and install mysql-connector-j-8.0.31 .zip?Connector/J Java library is a JDBC Driver ...