Home
last modified time | relevance | path

Searched refs:typeToMock (Results 1 – 9 of 9) sorted by relevance

/external/dexmaker/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/
DInlineStaticMockMaker.java140 Class<T> typeToMock = settings.getTypeToMock(); in createMock() local
141 if (!typeToMock.equals(mockingInProgressClass.get()) || Modifier.isAbstract(typeToMock in createMock()
149 classTransformer.mockClass(MockFeatures.withMockFeatures(typeToMock, interfacesSet)); in createMock()
156 mock = instantiator.newInstance(typeToMock); in createMock()
158 throw new MockitoException("Unable to create mock instance of type '" + typeToMock in createMock()
162 if (classToMarker.containsKey(typeToMock)) { in createMock()
163 throw new MockitoException(typeToMock + " is already mocked"); in createMock()
165 classToMarker.put(typeToMock, mock); in createMock()
/external/mockito/src/main/java/org/mockito/internal/creation/bytebuddy/
DByteBuddyCrossClassLoaderSerializationSupport.java161 private final Class<?> typeToMock; field in ByteBuddyCrossClassLoaderSerializationSupport.CrossClassLoaderSerializationProxy
184 this.typeToMock = mockSettings.getTypeToMock(); in CrossClassLoaderSerializationProxy()
199 …tInputStream objectInputStream = new MockitoMockObjectInputStream(bis, typeToMock, extraInterfaces… in readResolve()
209 …"Mockito mock cannot be deserialized to a mock of '" + typeToMock.getCanonicalName() + "'. The err… in readResolve()
241 private final Class<?> typeToMock; field in ByteBuddyCrossClassLoaderSerializationSupport.MockitoMockObjectInputStream
244 …public MockitoMockObjectInputStream(InputStream in, Class<?> typeToMock, Set<Class<?>> extraInterf… in MockitoMockObjectInputStream() argument
246 this.typeToMock = typeToMock; in MockitoMockObjectInputStream()
274 .setTypeToMock(typeToMock) in resolveClass()
DSubclassByteBuddyMockMaker.java86 Class<T> typeToMock = settings.getTypeToMock(); in ensureMockIsAssignableToMockedType() local
87 return typeToMock.cast(mock); in ensureMockIsAssignableToMockedType()
/external/mockito/src/main/java/org/mockito/internal/creation/settings/
DCreationSettings.java25 protected Class<T> typeToMock; field in CreationSettings
46 this.typeToMock = copy.typeToMock; in CreationSettings()
64 return typeToMock; in getTypeToMock()
67 public CreationSettings<T> setTypeToMock(Class<T> typeToMock) { in setTypeToMock() argument
68 this.typeToMock = typeToMock; in setTypeToMock()
/external/mockito/src/main/java/org/mockito/internal/creation/
DMockSettingsImpl.java221 return typeToMock; in getTypeToMock()
225 public <T> MockCreationSettings<T> build(Class<T> typeToMock) { in build() argument
226 return validatedSettings(typeToMock, (CreationSettings<T>) this); in build()
235 …private static <T> CreationSettings<T> validatedSettings(Class<T> typeToMock, CreationSettings<T> … in validatedSettings() argument
238 validator.validateType(typeToMock); in validatedSettings()
239 validator.validateExtraInterfaces(typeToMock, source.getExtraInterfaces()); in validatedSettings()
240 validator.validateMockedType(typeToMock, source.getSpiedInstance()); in validatedSettings()
250 settings.setMockName(new MockNameImpl(source.getName(), typeToMock)); in validatedSettings()
251 settings.setTypeToMock(typeToMock); in validatedSettings()
/external/dexmaker/dexmaker-mockito/src/main/java/com/android/dx/mockito/
DDexmakerMockMaker.java84 Class<T> typeToMock = settings.getTypeToMock(); in createMock() local
89 if (typeToMock.isInterface()) { in createMock()
92 classesToMock[0] = typeToMock; in createMock()
96 …T mock = (T) Proxy.newProxyInstance(typeToMock.getClassLoader(), classesToMock, invocationHandler); in createMock()
102 ProxyBuilder builder = ProxyBuilder.forClass(typeToMock) in createMock()
121 throw new MockitoException("Failed to mock " + typeToMock, e); in createMock()
/external/dexmaker/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/
DInlineDexmakerMockMaker.java247 Class<T> typeToMock = settings.getTypeToMock(); in createMock() local
253 if (typeToMock.isInterface()) { in createMock()
256 classesToMock[0] = typeToMock; in createMock()
260 mock = (T) Proxy.newProxyInstance(typeToMock.getClassLoader(), classesToMock, in createMock()
264 || Modifier.isAbstract(typeToMock.getModifiers()); in createMock()
267 classTransformer.mockClass(MockFeatures.withMockFeatures(typeToMock, interfacesSet)); in createMock()
277 ProxyBuilder builder = ProxyBuilder.forClass(typeToMock).implementing in createMock()
289 throw new MockitoException("Failed to mock " + typeToMock, e); in createMock()
306 mock = instantiator.newInstance(typeToMock); in createMock()
309 + typeToMock.getSimpleName() + "'", e); in createMock()
/external/mockito/src/main/java/org/mockito/internal/
DMockitoCore.java59 public boolean isTypeMockable(Class<?> typeToMock) { in isTypeMockable() argument
60 return typeMockabilityOf(typeToMock).mockable(); in isTypeMockable()
63 public <T> T mock(Class<T> typeToMock, MockSettings settings) { in mock() argument
68 MockCreationSettings<T> creationSettings = impl.build(typeToMock); in mock()
/external/mockito/src/main/java/org/mockito/
DMockSettings.java321 <T> MockCreationSettings<T> build(Class<T> typeToMock); in build() argument