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/internal/matchers/TypeSafeMatcher.java
package org.junit.internal.matchers; import java.lang.reflect.Method; import org.hamcrest.BaseMatcher; import org.junit.internal.MethodSorter; /** * Convenient base class for Matchers that require a non-null value of a specific type. * This simply implements the null check, checks the type and then casts. * * @author Joe Walnes * @deprecated Please use {@link org.hamcrest.TypeSafeMatcher}. */ @Deprecated public abstract class TypeSafeMatcher<T> extends BaseMatcher<T> { private Class<?> expectedType; /** * Subclasses should implement this. The item will already have been checked for * the specific type and will never be null. */ public abstract boolean matchesSafely(T item); protected TypeSafeMatcher() { expectedType = findExpectedType(getClass()); } private static Class<?> findExpectedType(Class<?> fromClass) { for (Class<?> c = fromClass; c != Object.class; c = c.getSuperclass()) { for (Method method : MethodSorter.getDeclaredMethods(c)) { if (isMatchesSafelyMethod(method)) { return method.getParameterTypes()[0]; } } } throw new Error("Cannot determine correct type for matchesSafely() method."); } private static boolean isMatchesSafelyMethod(Method method) { return "matchesSafely".equals(method.getName()) && method.getParameterTypes().length == 1 && !method.isSynthetic(); } protected TypeSafeMatcher(Class<T> expectedType) { this.expectedType = expectedType; } /** * Method made final to prevent accidental override. * If you need to override this, there's no point on extending TypeSafeMatcher. * Instead, extend the {@link BaseMatcher}. */ @SuppressWarnings({"unchecked"}) public final boolean matches(Object item) { return item != null && expectedType.isInstance(item) && matchesSafely((T) item); } }
⏎ org/junit/internal/matchers/TypeSafeMatcher.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, 10775👍, 0💬
Popular Posts:
XML Serializer, Release 2.7.1, allows you to write out XML, HTML etc. as a stream of characters from...
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module. JDK 11 JFR module compiled class files a...
What Is commons-lang3-3.1.jar? commons-lang3-3.1.jar is the JAR file for Apache Commons Lang 3.1, wh...
Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON. This allows nea...
Java Servlet 3.0 Specification API. JAR File Size and Download Location: File name: servlet-api.jar,...