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
⏎ junit/framework/JUnit4TestAdapterCache.java
package junit.framework;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
public class JUnit4TestAdapterCache extends HashMap<Description, Test> {
private static final long serialVersionUID = 1L;
private static final JUnit4TestAdapterCache fInstance = new JUnit4TestAdapterCache();
public static JUnit4TestAdapterCache getDefault() {
return fInstance;
}
public Test asTest(Description description) {
if (description.isSuite()) {
return createTest(description);
} else {
if (!containsKey(description)) {
put(description, createTest(description));
}
return get(description);
}
}
Test createTest(Description description) {
if (description.isTest()) {
return new JUnit4TestCaseFacade(description);
} else {
TestSuite suite = new TestSuite(description.getDisplayName());
for (Description child : description.getChildren()) {
suite.addTest(asTest(child));
}
return suite;
}
}
public RunNotifier getNotifier(final TestResult result, final JUnit4TestAdapter adapter) {
RunNotifier notifier = new RunNotifier();
notifier.addListener(new RunListener() {
@Override
public void testFailure(Failure failure) throws Exception {
result.addError(asTest(failure.getDescription()), failure.getException());
}
@Override
public void testFinished(Description description) throws Exception {
result.endTest(asTest(description));
}
@Override
public void testStarted(Description description) throws Exception {
result.startTest(asTest(description));
}
});
return notifier;
}
public List<Test> asTestList(Description description) {
if (description.isTest()) {
return Arrays.asList(asTest(description));
} else {
List<Test> returnThis = new ArrayList<Test>();
for (Description child : description.getChildren()) {
returnThis.add(asTest(child));
}
return returnThis;
}
}
}⏎ junit/framework/JUnit4TestAdapterCache.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, ≈51🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
JDK 8 tools.jar is the JAR file for JDK 8 tools. It contains Java classes to support different JDK t...
What Is HttpComponents httpcore-4.2.2.jar? HttpComponents httpcore-4.2.2.jar is the JAR file for Apa...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache...