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


package org.junit.runners.model;

import java.util.List;

 * Thrown by {@link org.junit.runner.Runner}s in case the class under test is not valid.
 * <p>
 * Its message conveniently lists all of the validation errors.
 * @since 4.13
public class InvalidTestClassError extends InitializationError {
    private static final long serialVersionUID = 1L;

    private final String message;

    public InvalidTestClassError(Class<?> offendingTestClass, List<Throwable> validationErrors) {
        this.message = createMessage(offendingTestClass, validationErrors);

    private static String createMessage(Class<?> testClass, List<Throwable> validationErrors) {
        StringBuilder sb = new StringBuilder();
        sb.append(String.format("Invalid test class '%s':", testClass.getName()));
        int i = 1;
        for (Throwable error : validationErrors) {
            sb.append("\n  " + (i++) + ". " + error.getMessage());
        return sb.toString();

     * @return a message with a list of all of the validation errors
    public String getMessage() {
        return message;



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 and Install junit-4.12.jar

Download and Install junit-4.13.2.jar

Download and Install JUnit (Java Unit) Testing

⇑⇑ FAQ for JUnit (Java Unit) Testing

2016-03-28, 10988👍, 0💬