Package mockit
Class DelegateTest
java.lang.Object
mockit.DelegateTest
The Class DelegateTest.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Attempt to use constructor delegate with private methods only.void
Consecutive results through delegates having different values.void
consecutiveReturnValuesThroughDelegatesUsingSingleReturnsWithVarargs
(mockit.DelegateTest.Collaborator collaborator) Consecutive return values through delegates using single returns with varargs.void
Constructor delegate with multiple methods.void
Constructor delegate with single method.void
Convert value returned from delegate when returns types differ.void
delegateCallingMockedMethodLaterVerified
(mockit.DelegateTest.Collaborator collaborator, Runnable action) Delegate calling mocked method later verified.void
Delegate causing concurrent mock invocation.void
Delegate for final method.void
delegateForMethodWithCompatibleButDistinctParameterType
(mockit.DelegateTest.Collaborator collaborator) Delegate for method with compatible but distinct parameter type.void
Delegate for native method.void
Delegate for static method.void
Delegate receiving null arguments.void
Delegate which calls another mocked method.void
Delegate which calls another mocked method injectable mocking.void
Delegate which calls another mocked method partial mocking of instance.void
delegateWhichCallsAnotherMockedMethodProducingACascadedInstance
(mockit.DelegateTest.Collaborator mock) Delegate which calls another mocked method producing A cascaded instance.void
Delegate which calls the same mocked method.void
Delegate with one method having different parameters.void
Delegate with single method having A different name.void
Delegate with single method having no parameters.void
delegateWithSingleMethodHavingNoParametersExceptForInvocationContext
(mockit.DelegateTest.Collaborator collaborator) Delegate with single method having no parameters except for invocation context.void
Delegate with static method.void
delegateWithTwoMethods
(mockit.DelegateTest.Collaborator collaborator) Delegate with two methods.void
Delegate with two non private methods.void
resultFromDelegate
(mockit.DelegateTest.Collaborator collaborator) Result from delegate.void
Result with multiple return values through single delegate.void
Return byte array from delegate method.void
Return inconvertible value from delegate when returns types differ.void
returnValueOfCorrectTypeFromDelegateMethodReturningASupertype
(mockit.DelegateTest.Collaborator mock) Return value of correct type from delegate method returning A supertype.void
returnVoidFromDelegateMethodForRecordedMethodHavingPrimitiveReturnType
(mockit.DelegateTest.Collaborator mock) Return void from delegate method for recorded method having primitive return type.
-
Field Details
-
thrown
public final org.junit.rules.ExpectedException thrownThe thrown.
-
-
Constructor Details
-
DelegateTest
public DelegateTest()
-
-
Method Details
-
resultFromDelegate
Result from delegate.- Parameters:
collaborator
- the collaborator
-
consecutiveResultsThroughDelegatesHavingDifferentValues
public void consecutiveResultsThroughDelegatesHavingDifferentValues(mockit.DelegateTest.Collaborator mock) Consecutive results through delegates having different values.- Parameters:
mock
- the mock
-
consecutiveReturnValuesThroughDelegatesUsingSingleReturnsWithVarargs
public void consecutiveReturnValuesThroughDelegatesUsingSingleReturnsWithVarargs(mockit.DelegateTest.Collaborator collaborator) Consecutive return values through delegates using single returns with varargs.- Parameters:
collaborator
- the collaborator
-
resultWithMultipleReturnValuesThroughSingleDelegate
public void resultWithMultipleReturnValuesThroughSingleDelegate(mockit.DelegateTest.Collaborator collaborator) Result with multiple return values through single delegate.- Parameters:
collaborator
- the collaborator
-
constructorDelegateWithSingleMethod
Constructor delegate with single method.- Parameters:
mock
- the mock
-
constructorDelegateWithMultipleMethods
Constructor delegate with multiple methods.- Parameters:
mock
- the mock
-
attemptToUseConstructorDelegateWithPrivateMethodsOnly
public void attemptToUseConstructorDelegateWithPrivateMethodsOnly(mockit.DelegateTest.Collaborator mock) Attempt to use constructor delegate with private methods only.- Parameters:
mock
- the mock
-
delegateForStaticMethod
Delegate for static method.- Parameters:
unused
- the unused
-
delegateWithStaticMethod
Delegate with static method.- Parameters:
mock
- the mock
-
delegateForNativeMethod
Delegate for native method.- Parameters:
mock
- the mock
-
delegateForFinalMethod
Delegate for final method.- Parameters:
mock
- the mock
-
delegateForMethodWithCompatibleButDistinctParameterType
public void delegateForMethodWithCompatibleButDistinctParameterType(mockit.DelegateTest.Collaborator collaborator) Delegate for method with compatible but distinct parameter type.- Parameters:
collaborator
- the collaborator
-
delegateReceivingNullArguments
Delegate receiving null arguments.- Parameters:
collaborator
- the collaborator
-
delegateWithTwoMethods
Delegate with two methods.- Parameters:
collaborator
- the collaborator
-
delegateWithSingleMethodHavingADifferentName
public void delegateWithSingleMethodHavingADifferentName(mockit.DelegateTest.Collaborator collaborator) Delegate with single method having A different name.- Parameters:
collaborator
- the collaborator
-
delegateWithSingleMethodHavingNoParameters
public void delegateWithSingleMethodHavingNoParameters(mockit.DelegateTest.Collaborator collaborator) Delegate with single method having no parameters.- Parameters:
collaborator
- the collaborator
-
delegateWithSingleMethodHavingNoParametersExceptForInvocationContext
public void delegateWithSingleMethodHavingNoParametersExceptForInvocationContext(mockit.DelegateTest.Collaborator collaborator) Delegate with single method having no parameters except for invocation context.- Parameters:
collaborator
- the collaborator
-
delegateWithOneMethodHavingDifferentParameters
public void delegateWithOneMethodHavingDifferentParameters(mockit.DelegateTest.Collaborator collaborator) Delegate with one method having different parameters.- Parameters:
collaborator
- the collaborator
-
delegateWithTwoNonPrivateMethods
Delegate with two non private methods.- Parameters:
collaborator
- the collaborator
-
delegateCausingConcurrentMockInvocation
Delegate causing concurrent mock invocation.- Parameters:
mock
- the mock
-
delegateWhichCallsTheSameMockedMethod
Delegate which calls the same mocked method.- Parameters:
mock
- the mock
-
delegateWhichCallsAnotherMockedMethod
Delegate which calls another mocked method.- Parameters:
mock
- the mock
-
delegateWhichCallsAnotherMockedMethod_partialMockingOfInstance
public void delegateWhichCallsAnotherMockedMethod_partialMockingOfInstance()Delegate which calls another mocked method partial mocking of instance. -
delegateWhichCallsAnotherMockedMethod_injectableMocking
public void delegateWhichCallsAnotherMockedMethod_injectableMocking(mockit.DelegateTest.Collaborator mock) Delegate which calls another mocked method injectable mocking.- Parameters:
mock
- the mock
-
delegateWhichCallsAnotherMockedMethodProducingACascadedInstance
public void delegateWhichCallsAnotherMockedMethodProducingACascadedInstance(mockit.DelegateTest.Collaborator mock) Delegate which calls another mocked method producing A cascaded instance.- Parameters:
mock
- the mock
-
delegateCallingMockedMethodLaterVerified
public void delegateCallingMockedMethodLaterVerified(mockit.DelegateTest.Collaborator collaborator, Runnable action) Delegate calling mocked method later verified.- Parameters:
collaborator
- the collaboratoraction
- the action
-
convertValueReturnedFromDelegateWhenReturnsTypesDiffer
public void convertValueReturnedFromDelegateWhenReturnsTypesDiffer(mockit.DelegateTest.Collaborator mock) Convert value returned from delegate when returns types differ.- Parameters:
mock
- the mock
-
returnInconvertibleValueFromDelegateWhenReturnsTypesDiffer
public void returnInconvertibleValueFromDelegateWhenReturnsTypesDiffer(mockit.DelegateTest.Collaborator mock) Return inconvertible value from delegate when returns types differ.- Parameters:
mock
- the mock
-
returnVoidFromDelegateMethodForRecordedMethodHavingPrimitiveReturnType
public void returnVoidFromDelegateMethodForRecordedMethodHavingPrimitiveReturnType(mockit.DelegateTest.Collaborator mock) Return void from delegate method for recorded method having primitive return type.- Parameters:
mock
- the mock
-
returnByteArrayFromDelegateMethod
Return byte array from delegate method.- Parameters:
mock
- the mock
-
returnValueOfCorrectTypeFromDelegateMethodReturningASupertype
public void returnValueOfCorrectTypeFromDelegateMethodReturningASupertype(mockit.DelegateTest.Collaborator mock) Return value of correct type from delegate method returning A supertype.- Parameters:
mock
- the mock
-