New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerMock broken with Robolectric 3.1+ #2208

Closed
karlicoss opened this Issue Jan 13, 2016 · 30 comments

Comments

Projects
None yet
@karlicoss
Contributor

karlicoss commented Jan 13, 2016

Turns out 3.0 worked fine, so it broke quite recently. I've created a simple demo project: https://github.com/karlicoss/RobolectricPowermock

It fails with the following exception:

com.thoughtworks.xstream.converters.ConversionException: Cannot convert type org.apache.tools.ant.Project to type org.apache.tools.ant.Project
---- Debugging information ----
class               : org.apache.tools.ant.Project$1
required-type       : org.apache.tools.ant.Project$1
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /org.powermock.modules.junit4.rule.PowerMockStatement$1/outer-class/fNext/this$1/outer-class/dependencyResolver/dependencyResolver/project/isLoggingMessage/outer-class
line number         : 198
class[1]            : org.apache.tools.ant.Project
class[2]            : org.robolectric.internal.dependency.MavenDependencyResolver
class[3]            : org.robolectric.internal.dependency.CachedDependencyResolver
class[4]            : org.robolectric.RobolectricGradleTestRunner
class[5]            : org.robolectric.RobolectricTestRunner$HelperTestRunner
class[6]            : org.robolectric.RobolectricTestRunner$HelperTestRunner$1
class[7]            : org.powermock.modules.junit4.rule.PowerMockStatement
class[8]            : org.powermock.modules.junit4.rule.PowerMockStatement$1
version             : not available
-------------------------------
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:439)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:480)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:412)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1052)
    at org.powermock.classloading.DeepCloner.clone(DeepCloner.java:54)
    at org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:89)
    at org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:78)
    at org.powermock.modules.junit4.rule.PowerMockStatement.evaluate(PowerMockRule.java:49)
    at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:255)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:185)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:151)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
@karlicoss

This comment has been minimized.

Show comment
Hide comment
@karlicoss

karlicoss Jan 15, 2016

Contributor

Ok so I think I bisected the commit responsible for this regression: c4d5d29 (PR #2039)

Contributor

karlicoss commented Jan 15, 2016

Ok so I think I bisected the commit responsible for this regression: c4d5d29 (PR #2039)

@karlicoss

This comment has been minimized.

Show comment
Hide comment
@karlicoss

karlicoss Jan 15, 2016

Contributor

Apparently, this is somehow related #2153

Contributor

karlicoss commented Jan 15, 2016

Apparently, this is somehow related #2153

@hzsweers

This comment has been minimized.

Show comment
Hide comment
@hzsweers

hzsweers Mar 11, 2016

@erd @jongerrish is anyone looking into this? Would be a dealbreaker for a lot of people considering how many static classes android has (Compat classes, BuildConfig, etc)

hzsweers commented Mar 11, 2016

@erd @jongerrish is anyone looking into this? Would be a dealbreaker for a lot of people considering how many static classes android has (Compat classes, BuildConfig, etc)

@jongerrish

This comment has been minimized.

Show comment
Hide comment
@jongerrish

jongerrish Mar 22, 2016

Contributor

@hzsweers I think we should make Robolectric support PowerMock. For code outside the Android framework certainly. For code inside the Framework using PowerMock shouldn't be necessary if there is adequate shadow support. Can you give some examples of when you'd like to use PowerMock on the Android framework?

My feeling is that if possible refactor your own code to use DI and Mockito where possible. In cases where this is not possible use PowerMock. For Framework code, Robolectric shadows.

I don't know if anyone is working on this, I guess it needs someone to step up and volunteer ;-)

Contributor

jongerrish commented Mar 22, 2016

@hzsweers I think we should make Robolectric support PowerMock. For code outside the Android framework certainly. For code inside the Framework using PowerMock shouldn't be necessary if there is adequate shadow support. Can you give some examples of when you'd like to use PowerMock on the Android framework?

My feeling is that if possible refactor your own code to use DI and Mockito where possible. In cases where this is not possible use PowerMock. For Framework code, Robolectric shadows.

I don't know if anyone is working on this, I guess it needs someone to step up and volunteer ;-)

@karlicoss

This comment has been minimized.

Show comment
Hide comment
@karlicoss

karlicoss Mar 23, 2016

Contributor

@jongerrish I tried fixing it, but apparently it didn't work. Although, there are couple questions about Robolectric internals in the PR comments #2213, so if you could elaborate on them, would be great, it might help me to figure out what exactly broke it.

Also, look at this test https://github.com/robolectric/robolectric/pull/2213/files#diff-ca1cf49ca80a766d69778b93b3d16db9R1. It doesn't try to invoke Powermock on Robolectric-instrumented classes, so it looks broken for all classes if your tests are under Robolectric runner.

Contributor

karlicoss commented Mar 23, 2016

@jongerrish I tried fixing it, but apparently it didn't work. Although, there are couple questions about Robolectric internals in the PR comments #2213, so if you could elaborate on them, would be great, it might help me to figure out what exactly broke it.

Also, look at this test https://github.com/robolectric/robolectric/pull/2213/files#diff-ca1cf49ca80a766d69778b93b3d16db9R1. It doesn't try to invoke Powermock on Robolectric-instrumented classes, so it looks broken for all classes if your tests are under Robolectric runner.

@karlicoss

This comment has been minimized.

Show comment
Hide comment
@karlicoss

karlicoss Mar 27, 2016

Contributor

@hzsweers I guess I finally fixed that :D #2390
@jongerrish could you please take a look?

Contributor

karlicoss commented Mar 27, 2016

@hzsweers I guess I finally fixed that :D #2390
@jongerrish could you please take a look?

@marklapasa

This comment has been minimized.

Show comment
Hide comment
@marklapasa

marklapasa Jul 28, 2016

+1 Please fix

marklapasa commented Jul 28, 2016

+1 Please fix

@marklapasa

This comment has been minimized.

Show comment
Hide comment
@marklapasa

marklapasa Jul 28, 2016

@jongerrish: "For code inside the Framework using PowerMock shouldn't be necessary if there is adequate shadow support."

I am trying to use PowerMock/Robolectric with java.security.KeyStore. There has been no support for KeyStore for a long time now.

marklapasa commented Jul 28, 2016

@jongerrish: "For code inside the Framework using PowerMock shouldn't be necessary if there is adequate shadow support."

I am trying to use PowerMock/Robolectric with java.security.KeyStore. There has been no support for KeyStore for a long time now.

@jongerrish

This comment has been minimized.

Show comment
Hide comment
@jongerrish

jongerrish Jul 30, 2016

Contributor

Correct. You should not need to mock, regular Mockito or power mock
framework methods. If there is missing support for keystore we'd welcome a
pull request to add it :-)

On Jul 28, 2016 2:16 PM, "Mark Lapasa" notifications@github.com wrote:

@jongerrish https://github.com/jongerrish: "For code inside the
Framework using PowerMock shouldn't be necessary if there is adequate
shadow support."

I am trying to use PowerMock/Robolectric with java.security.KeyStore.
There has been no support for KeyStore for a long time now.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2208 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGBaeFD0dcFcIdbrHuOSe92lhfre5zNyks5qaRwXgaJpZM4HEMEQ
.

Contributor

jongerrish commented Jul 30, 2016

Correct. You should not need to mock, regular Mockito or power mock
framework methods. If there is missing support for keystore we'd welcome a
pull request to add it :-)

On Jul 28, 2016 2:16 PM, "Mark Lapasa" notifications@github.com wrote:

@jongerrish https://github.com/jongerrish: "For code inside the
Framework using PowerMock shouldn't be necessary if there is adequate
shadow support."

I am trying to use PowerMock/Robolectric with java.security.KeyStore.
There has been no support for KeyStore for a long time now.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2208 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGBaeFD0dcFcIdbrHuOSe92lhfre5zNyks5qaRwXgaJpZM4HEMEQ
.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Aug 11, 2016

@marklapasa
Have you tried to ingnore the "javax.crypto.* package"?
`@RunWith(RobolectricTestRunner.class)

@PowerMockIgnore({ "org.mockito.", "org.robolectric.", "android.", "javax.crypto." })

@PrepareForTest(YourStatic.class)
public class MyFoo {

}`

ghost commented Aug 11, 2016

@marklapasa
Have you tried to ingnore the "javax.crypto.* package"?
`@RunWith(RobolectricTestRunner.class)

@PowerMockIgnore({ "org.mockito.", "org.robolectric.", "android.", "javax.crypto." })

@PrepareForTest(YourStatic.class)
public class MyFoo {

}`

@dhiren-mudgil-olx

This comment has been minimized.

Show comment
Hide comment
@dhiren-mudgil-olx

dhiren-mudgil-olx Aug 20, 2016

Please fix. As i am using clover sdk and there is a static class to this which i need to mock.

dhiren-mudgil-olx commented Aug 20, 2016

Please fix. As i am using clover sdk and there is a static class to this which i need to mock.

@liupengking1

This comment has been minimized.

Show comment
Hide comment
@liupengking1

liupengking1 Aug 24, 2016

+1 Please fix

liupengking1 commented Aug 24, 2016

+1 Please fix

@poldz123

This comment has been minimized.

Show comment
Hide comment
@poldz123

poldz123 commented Sep 12, 2016

+1

@ending0421

This comment has been minimized.

Show comment
Hide comment
@ending0421

ending0421 commented Sep 21, 2016

+1

@jamesneville

This comment has been minimized.

Show comment
Hide comment
@jamesneville

jamesneville Sep 24, 2016

+1 to fix this, please.

jamesneville commented Sep 24, 2016

+1 to fix this, please.

@CoderSpinoza

This comment has been minimized.

Show comment
Hide comment
@CoderSpinoza

CoderSpinoza Sep 30, 2016

+1 to fix this!

CoderSpinoza commented Sep 30, 2016

+1 to fix this!

clement-leprovost added a commit to algolia/algoliasearch-client-android that referenced this issue Oct 3, 2016

[test] Remove `PowerMockTestCase`
It is causing weird errors similar to [this one](robolectric/robolectric#2208):

```
Cannot convert type org.apache.tools.ant.Project to type org.apache.tools.ant.Project
```

And it doesn’t seem to serve a real purpose—at least not any longer.
@YorkShen

This comment has been minimized.

Show comment
Hide comment
@YorkShen

YorkShen Oct 20, 2016

+1 to fix this, pls

YorkShen commented Oct 20, 2016

+1 to fix this, pls

@epool

This comment has been minimized.

Show comment
Hide comment
@epool

epool Oct 26, 2016

I still getting a similar error on 3.1.3:

com.thoughtworks.xstream.converters.ConversionException: Failed calling method
---- Debugging information ----
message             : Failed calling method
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : Failed calling method
method              : org.apache.tools.ant.Project$AntRefTable.writeObject()
-------------------------------

    at com.thoughtworks.xstream.core.util.SerializationMembers.callWriteObject(SerializationMembers.java:151)
    at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:257)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
...

epool commented Oct 26, 2016

I still getting a similar error on 3.1.3:

com.thoughtworks.xstream.converters.ConversionException: Failed calling method
---- Debugging information ----
message             : Failed calling method
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : Failed calling method
method              : org.apache.tools.ant.Project$AntRefTable.writeObject()
-------------------------------

    at com.thoughtworks.xstream.core.util.SerializationMembers.callWriteObject(SerializationMembers.java:151)
    at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:257)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
...
@daniellAlgar

This comment has been minimized.

Show comment
Hide comment
@daniellAlgar

daniellAlgar Nov 19, 2016

Same here on 3.1.4

com.thoughtworks.xstream.converters.ConversionException: Cannot convert type org.apache.tools.ant.Project to type org.apache.tools.ant.Project
---- Debugging information ----
class               : org.apache.tools.ant.Project$1
required-type       : org.apache.tools.ant.Project$1
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /org.powermock.modules.junit4.rule.PowerMockStatement$1/outer-class/fNext/next/this$1/outer-class/dependencyResolver/dependencyResolver/project/isLoggingMessage/outer-class
line number         : 331
class[1]            : org.apache.tools.ant.Project
class[2]            : org.robolectric.internal.dependency.MavenDependencyResolver
class[3]            : org.robolectric.internal.dependency.CachedDependencyResolver
class[4]            : org.robolectric.RobolectricTestRunner
class[5]            : org.robolectric.RobolectricTestRunner$HelperTestRunner
class[6]            : org.robolectric.RobolectricTestRunner$HelperTestRunner$1
class[7]            : org.junit.internal.runners.statements.RunBefores
class[8]            : org.powermock.modules.junit4.rule.PowerMockStatement
class[9]            : org.powermock.modules.junit4.rule.PowerMockStatement$1
version             : not available
-------------------------------

at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:439)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
...

daniellAlgar commented Nov 19, 2016

Same here on 3.1.4

com.thoughtworks.xstream.converters.ConversionException: Cannot convert type org.apache.tools.ant.Project to type org.apache.tools.ant.Project
---- Debugging information ----
class               : org.apache.tools.ant.Project$1
required-type       : org.apache.tools.ant.Project$1
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /org.powermock.modules.junit4.rule.PowerMockStatement$1/outer-class/fNext/next/this$1/outer-class/dependencyResolver/dependencyResolver/project/isLoggingMessage/outer-class
line number         : 331
class[1]            : org.apache.tools.ant.Project
class[2]            : org.robolectric.internal.dependency.MavenDependencyResolver
class[3]            : org.robolectric.internal.dependency.CachedDependencyResolver
class[4]            : org.robolectric.RobolectricTestRunner
class[5]            : org.robolectric.RobolectricTestRunner$HelperTestRunner
class[6]            : org.robolectric.RobolectricTestRunner$HelperTestRunner$1
class[7]            : org.junit.internal.runners.statements.RunBefores
class[8]            : org.powermock.modules.junit4.rule.PowerMockStatement
class[9]            : org.powermock.modules.junit4.rule.PowerMockStatement$1
version             : not available
-------------------------------

at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:439)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:263)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
...
@bartoszwilk

This comment has been minimized.

Show comment
Hide comment
@bartoszwilk

bartoszwilk commented Nov 22, 2016

+1

@itanoss

This comment has been minimized.

Show comment
Hide comment
@itanoss

itanoss commented Nov 24, 2016

+1

@kmenager

This comment has been minimized.

Show comment
Hide comment
@kmenager

kmenager Dec 20, 2016

I've got the same issue with Realm and Unit test.
I just change the @PowerMockIgnore
from
@PowerMockIgnore({"org.mockito.", "org.robolectric.", "android."})
to
@PowerMockIgnore({"org.mockito.
", "android.*"})

And now, I can run my Realm static test with powermock
Hope this help pending a new release.

kmenager commented Dec 20, 2016

I've got the same issue with Realm and Unit test.
I just change the @PowerMockIgnore
from
@PowerMockIgnore({"org.mockito.", "org.robolectric.", "android."})
to
@PowerMockIgnore({"org.mockito.
", "android.*"})

And now, I can run my Realm static test with powermock
Hope this help pending a new release.

@abhikmitra

This comment has been minimized.

Show comment
Hide comment
@abhikmitra

abhikmitra commented Dec 20, 2016

+1

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Jan 5, 2017

Member

Deduping: #2677 [actually not a dupe].

Member

xian commented Jan 5, 2017

Deduping: #2677 [actually not a dupe].

@xian xian closed this Jan 5, 2017

@xian xian reopened this Jan 6, 2017

@xian xian changed the title from Robolectric 3.1-SNAPSHOT doesn't work in conjunction with PowerMock to PowerMock broken with Robolectric 3.1+ Jan 6, 2017

@xian xian added the defect label Jan 6, 2017

@xian xian added this to the 3.2.2 milestone Jan 6, 2017

@xian xian self-assigned this Jan 10, 2017

@xian

This comment has been minimized.

Show comment
Hide comment
Member

xian commented Jan 10, 2017

@xian xian removed this from the 3.2.2 milestone Jan 11, 2017

@xian xian modified the milestones: 3.3.1, 3.2.2, 3.3 Jan 11, 2017

@daidai513260

This comment has been minimized.

Show comment
Hide comment
@daidai513260

daidai513260 Jan 20, 2017

I'm not sure if this issue get fixed, but I still got the same error message under org.robolectric:robolectric:3.2.2

daidai513260 commented Jan 20, 2017

I'm not sure if this issue get fixed, but I still got the same error message under org.robolectric:robolectric:3.2.2

@benmarten

This comment has been minimized.

Show comment
Hide comment
@benmarten

benmarten Feb 22, 2017

Still running into this issue; Any insights?

benmarten commented Feb 22, 2017

Still running into this issue; Any insights?

@xian xian closed this in #2905 Feb 22, 2017

@xian

This comment has been minimized.

Show comment
Hide comment
@xian

xian Feb 22, 2017

Member

Fixed on master. We'll be rolling up a release very soon.

Member

xian commented Feb 22, 2017

Fixed on master. We'll be rolling up a release very soon.

@sumancodeme

This comment has been minimized.

Show comment
Hide comment
@sumancodeme

sumancodeme Feb 27, 2017

@xian Is the fix rolled out ?

sumancodeme commented Feb 27, 2017

@xian Is the fix rolled out ?

@jongerrish

This comment has been minimized.

Show comment
Hide comment
@jongerrish

jongerrish Feb 27, 2017

Contributor
Contributor

jongerrish commented Feb 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment