Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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/runner/manipulation/Sorter.java
package org.junit.runner.manipulation; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.junit.runner.Description; /** * A <code>Sorter</code> orders tests. In general you will not need * to use a <code>Sorter</code> directly. Instead, use * {@link org.junit.runner.Request#sortWith(Comparator)}. * * @since 4.0 */ public class Sorter extends Ordering implements Comparator<Description> { /** * NULL is a <code>Sorter</code> that leaves elements in an undefined order */ public static final Sorter NULL = new Sorter(new Comparator<Description>() { public int compare(Description o1, Description o2) { return 0; } }); private final Comparator<Description> comparator; /** * Creates a <code>Sorter</code> that uses <code>comparator</code> * to sort tests * * @param comparator the {@link Comparator} to use when sorting tests * @since 4.0 */ public Sorter(Comparator<Description> comparator) { this.comparator = comparator; } /** * Sorts the tests in <code>target</code> using <code>comparator</code>. * * @since 4.0 */ @Override public void apply(Object target) { /* * Note that all runners that are Orderable are also Sortable (because * Orderable extends Sortable). Sorting is more efficient than ordering, * so we override the parent behavior so we sort instead. */ if (target instanceof Sortable) { Sortable sortable = (Sortable) target; sortable.sort(this); } } public int compare(Description o1, Description o2) { return comparator.compare(o1, o2); } /** * {@inheritDoc} * * @since 4.13 */ @Override protected final List<Description> orderItems(Collection<Description> descriptions) { /* * In practice, we will never get here--Sorters do their work in the * compare() method--but the Liskov substitution principle demands that * we obey the general contract of Orderable. Luckily, it's trivial to * implement. */ List<Description> sorted = new ArrayList<Description>(descriptions); Collections.sort(sorted, this); // Note: it would be incorrect to pass in "comparator" return sorted; } /** * {@inheritDoc} * * @since 4.13 */ @Override boolean validateOrderingIsCorrect() { return false; } }
⏎ org/junit/runner/manipulation/Sorter.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, 17424👍, 0💬
Popular Posts:
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. ...
What Is poi-ooxml-5.2.3.jar? poi-ooxml-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which...
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...