mockito-core-2.23.4.jar
登录
|
org.mockito:mockito-core:2.23.4
META-INF
org
mockito
session
package-info.java
MockitoSession.java
MockitoAnnotations.java
internal
session
package-info.java
configuration
creation
matchers
MockitoCore.java
reporting
util
InternalMockHandler.java
handler
listeners
exceptions
framework
runners
invocation
package-info.java
DefaultInvocationFactory.java
finder
ArgumentMatcherAction.java
MockitoMethod.java
StubInfoImpl.java
AbstractAwareMethod.java
TypeSafeMatching.java
ArgumentsProcessor.java
MatcherApplicationStrategy.java
RealMethod.java
SerializableMethod.java
InvocationsFinder.java
InvocationMarker.java
InvocationMatcher.java
MatchersBinder.java
InterceptedInvocation.java
UnusedStubsFinder.java
InvocationComparator.java
mockref
stubbing
debugging
progress
junit
verification
hamcrest
InOrderImpl.java
Matchers.java
configuration
creation
Captor.java
InjectMocks.java
plugins
ArgumentMatchers.java
InOrder.java
Incubating.java
BDDMockito.java
MockitoFramework.java
MockingDetails.java
quality
AdditionalMatchers.java
ArgumentCaptor.java
Spy.java
codegen
mock
NotExtensible.java
listeners
exceptions
Mockito.java
runners
invocation
CheckReturnValue.java
stubbing
Answers.java
Mock.java
ArgumentMatcher.java
junit
AdditionalAnswers.java
verification
hamcrest
MockSettings.java
MockitoDebugger.java
LICENSE
SerializableMethod.java
清空
类结构
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.invocation; import org.mockito.exceptions.base.
MockitoException
; import org.mockito.internal.creation.
SuspendMethod
; import java.io.
Serializable
; import java.lang.reflect.
Method
; import java.lang.reflect.
Modifier
; import java.util.
Arrays
; public class
SerializableMethod
implements
Serializable
,
MockitoMethod
{ private static final long
serialVersionUID
= 6005610965006048445L; private final
Class
<?>
declaringClass
; private final
String
methodName
; private final
Class
<?>[]
parameterTypes
; private final
Class
<?>
returnType
; private final
Class
<?>[]
exceptionTypes
; private final boolean
isVarArgs
; private final boolean
isAbstract
; private volatile transient
Method
method
; public
SerializableMethod
(
Method
method
) { this.
method
=
method
;
declaringClass
=
method
.
getDeclaringClass
();
methodName
=
method
.
getName
();
parameterTypes
=
SuspendMethod
.
trimSuspendParameterTypes
(
method
.
getParameterTypes
());
returnType
=
method
.
getReturnType
();
exceptionTypes
=
method
.
getExceptionTypes
();
isVarArgs
=
method
.
isVarArgs
();
isAbstract
= (
method
.
getModifiers
() &
Modifier
.
ABSTRACT
) != 0; } public
String
getName
() { return
methodName
; } public
Class
<?>
getReturnType
() { return
returnType
; } public
Class
<?>[]
getParameterTypes
() { return
parameterTypes
; } public
Class
<?>[]
getExceptionTypes
() { return
exceptionTypes
; } public boolean
isVarArgs
() { return
isVarArgs
; } public boolean
isAbstract
() { return
isAbstract
; } public
Method
getJavaMethod
() { if (
method
!= null) { return
method
; } try {
method
=
declaringClass
.
getDeclaredMethod
(
methodName
,
parameterTypes
); return
method
; } catch (
SecurityException
e
) {
String
message
=
String
.
format
( "The method %1$s.%2$s is probably private or protected and cannot be mocked.\n" + "Please report this as a defect with an example of how to reproduce it.",
declaringClass
,
methodName
); throw new
MockitoException
(
message
,
e
); } catch (
NoSuchMethodException
e
) {
String
message
=
String
.
format
( "The method %1$s.%2$s does not exists and you should not get to this point.\n" + "Please report this as a defect with an example of how to reproduce it.",
declaringClass
,
methodName
); throw new
MockitoException
(
message
,
e
); } } @
Override
public int
hashCode
() { return 1; } @
Override
public boolean
equals
(
Object
obj
) { if (this ==
obj
) return true; if (
obj
== null) return false; if (
getClass
() !=
obj
.
getClass
()) return false;
SerializableMethod
other
= (
SerializableMethod
)
obj
; if (
declaringClass
== null) { if (
other
.
declaringClass
!= null) return false; } else if (!
declaringClass
.
equals
(
other
.
declaringClass
)) return false; if (
methodName
== null) { if (
other
.
methodName
!= null) return false; } else if (!
methodName
.
equals
(
other
.
methodName
)) return false; if (!
Arrays
.
equals
(
parameterTypes
,
other
.
parameterTypes
)) return false; if (
returnType
== null) { if (
other
.
returnType
!= null) return false; } else if (!
returnType
.
equals
(
other
.
returnType
)) return false; return true; } }
查找资源
Jre/Lib
输入类名或文件名
类结构窗口