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, 14048👍, 0💬
Popular Posts:
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...
JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the ...
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
How to read XML document from socket connections with the socket\DelayedInput.java provided in the A...