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/JUnit4TestAdapter.java
package junit.framework;
import java.util.List;
import org.junit.Ignore;
import org.junit.runner.Describable;
import org.junit.runner.Description;
import org.junit.runner.Request;
import org.junit.runner.Runner;
import org.junit.runner.manipulation.Filter;
import org.junit.runner.manipulation.Filterable;
import org.junit.runner.manipulation.Orderer;
import org.junit.runner.manipulation.InvalidOrderingException;
import org.junit.runner.manipulation.NoTestsRemainException;
import org.junit.runner.manipulation.Orderable;
import org.junit.runner.manipulation.Sorter;
/**
* The JUnit4TestAdapter enables running JUnit-4-style tests using a JUnit-3-style test runner.
*
* <p> To use it, add the following to a test class:
* <pre>
public static Test suite() {
return new JUnit4TestAdapter(<em>YourJUnit4TestClass</em>.class);
}
</pre>
*/
public class JUnit4TestAdapter implements Test, Filterable, Orderable, Describable {
private final Class<?> fNewTestClass;
private final Runner fRunner;
private final JUnit4TestAdapterCache fCache;
public JUnit4TestAdapter(Class<?> newTestClass) {
this(newTestClass, JUnit4TestAdapterCache.getDefault());
}
public JUnit4TestAdapter(final Class<?> newTestClass, JUnit4TestAdapterCache cache) {
fCache = cache;
fNewTestClass = newTestClass;
fRunner = Request.classWithoutSuiteMethod(newTestClass).getRunner();
}
public int countTestCases() {
return fRunner.testCount();
}
public void run(TestResult result) {
fRunner.run(fCache.getNotifier(result, this));
}
// reflective interface for Eclipse
public List<Test> getTests() {
return fCache.asTestList(getDescription());
}
// reflective interface for Eclipse
public Class<?> getTestClass() {
return fNewTestClass;
}
public Description getDescription() {
Description description = fRunner.getDescription();
return removeIgnored(description);
}
private Description removeIgnored(Description description) {
if (isIgnored(description)) {
return Description.EMPTY;
}
Description result = description.childlessCopy();
for (Description each : description.getChildren()) {
Description child = removeIgnored(each);
if (!child.isEmpty()) {
result.addChild(child);
}
}
return result;
}
private boolean isIgnored(Description description) {
return description.getAnnotation(Ignore.class) != null;
}
@Override
public String toString() {
return fNewTestClass.getName();
}
public void filter(Filter filter) throws NoTestsRemainException {
filter.apply(fRunner);
}
public void sort(Sorter sorter) {
sorter.apply(fRunner);
}
/**
* {@inheritDoc}
*
* @since 4.13
*/
public void order(Orderer orderer) throws InvalidOrderingException {
orderer.apply(fRunner);
}
}⏎ junit/framework/JUnit4TestAdapter.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, ≈71🔥, 0💬
Popular Posts:
How to download and install ojdbc14.jar for Oracle 10g R2? ojdbc14.jar for Oracle 10g R2 is a Java 1...
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...
JDK 11 jdk.jdeps.jmod is the JMOD file for JDK 11 JDeps tool, which can be invoked by the "jdeps" co...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
commons-net.jar is the bytecode of Apache Commons Net library, which implements the client side of m...