ericmckean / dexmaker

Automatically exported from code.google.com/p/dexmaker
0 stars 0 forks source link

Add support for Mockito 1.10.+ #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Use Mockito 1.10.10, dexmaker 1.1, dexmaker-mockito 1.1 in an Android test 
project, along with Android Gradle Plugin 0.14.2
2. Try to run tests
3. Get NPE

What is the expected output? What do you see instead?
- Expected output is for the tests to run correctly, instead we get an NPE:

11-14 00:14:10.856 I/TestRunner(  895): java.lang.NullPointerException
11-14 00:14:10.856 I/TestRunner(  895):     at 
com.google.dexmaker.mockito.DexmakerMockMaker.getInvocationHandlerAdapter(Dexmak
erMockMaker.java:83)
11-14 00:14:10.856 I/TestRunner(  895):     at 
com.google.dexmaker.mockito.DexmakerMockMaker.getHandler(DexmakerMockMaker.java:
78)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.util.MockUtil.isMockitoMock(MockUtil.java:73)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.util.MockUtil.isMock(MockUtil.java:65)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.injection.scanner.MockScanner.isMockOrSpy(Moc
kScanner.java:86)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.injection.scanner.MockScanner.preparedMock(Mo
ckScanner.java:72)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.injection.scanner.MockScanner.scan(MockScanne
r.java:61)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.injection.scanner.MockScanner.addPreparedMock
s(MockScanner.java:47)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.InjectingAnnotationEngine.injectMocks(Injecti
ngAnnotationEngine.java:96)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.InjectingAnnotationEngine.processInjectMocks(
InjectingAnnotationEngine.java:62)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.internal.configuration.InjectingAnnotationEngine.process(InjectingAn
notationEngine.java:56)
11-14 00:14:10.856 I/TestRunner(  895):     at 
org.mockito.MockitoAnnotations.initMocks(MockitoAnnotations.java:108)

What version of the product are you using? On what operating system?
Ubuntu 14.04

Original issue reported on code.google.com by m...@zavislak.net on 14 Nov 2014 at 12:21

GoogleCodeExporter commented 9 years ago
Same NPE happens with dexmaker 1.2, dexmaker-mockito 1.2 and Android Gradle 
Plugin 1.0.0

Original comment by m...@zavislak.net on 11 Dec 2014 at 9:48