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/experimental/results/PrintableResult.java
package org.junit.experimental.results;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.List;
import org.junit.internal.TextListener;
import org.junit.runner.JUnitCore;
import org.junit.runner.Request;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
/**
* A test result that prints nicely in error messages.
* This is only intended to be used in JUnit self-tests.
* For example:
*
* <pre>
* assertThat(testResult(HasExpectedException.class), isSuccessful());
* </pre>
*/
public class PrintableResult {
private Result result;
/**
* The result of running JUnit on {@code type}
*/
public static PrintableResult testResult(Class<?> type) {
return testResult(Request.aClass(type));
}
/**
* The result of running JUnit on Request {@code request}
*/
public static PrintableResult testResult(Request request) {
return new PrintableResult(new JUnitCore().run(request));
}
/**
* A result that includes the given {@code failures}
*/
public PrintableResult(List<Failure> failures) {
this(new FailureList(failures).result());
}
private PrintableResult(Result result) {
this.result = result;
}
/**
* Returns the number of failures in this result.
*/
public int failureCount() {
return result.getFailures().size();
}
/**
* Returns the failures in this result.
*
* @since 4.13
*/
public List<Failure> failures() {
return result.getFailures();
}
@Override
public String toString() {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
new TextListener(new PrintStream(stream)).testRunFinished(result);
return stream.toString();
}
}⏎ org/junit/experimental/results/PrintableResult.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, ≈113🔥, 0💬
Popular Posts:
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool, which can be invoked by the "jlink" co...
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module. JDK 11 Desktop module compiled ...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
JDK 17 java.xml.crypto.jmod is the JMOD file for JDK 17 XML (eXtensible Markup Language) Crypto modu...
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...