Open GoogleCodeExporter opened 9 years ago
Thanks for reporting. Could you please attach a small example that demonstrates
the issue? Otherwise it's hard to debug and to know when it's fixed (I don't
even have Eclipse anymore).
Original comment by johan.ha...@gmail.com
on 10 Feb 2011 at 7:07
I can reproduce the problem with running powermock with maven/tycho, which
spawns a new OSGi runtime for the tests.
Original comment by sesam...@googlemail.com
on 7 Apr 2011 at 10:57
The problem is that in an OSGI envoronment the LastControl.class and the
MocksControl.class are not loaded by the current or the system class loader,
but by the class loader of the bundle the classes are into. It may help to use:
...
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
final Class<?> lastControlClassBySystemCL =
Class.forName(LastControl.class.getName(), true, classLoader);
final Class<?> mocksControlClassBySystemCL = Class.forName(MocksControl.class.getName(), true, classLoader);
...
Original comment by sesam...@googlemail.com
on 7 Apr 2011 at 11:11
It might help but it's hard for me to verify it without help. If I commit it to
trunk could you build PowerMock from source (it's easy, mvn clean install will
work) and give it a try in your project?
Original comment by johan.ha...@gmail.com
on 7 Apr 2011 at 11:29
I'd forgotten this was our blocker for upgrading version of PowerMock. If you
commit changes, I can test it. I have a trunk checkout already and have built
many times before.
Original comment by dmeibu...@gmail.com
on 7 Apr 2011 at 1:03
Awesome. I'll try to find time to try it out it later this evening.
Original comment by johan.ha...@gmail.com
on 7 Apr 2011 at 1:18
I've committed the changes to trunk now. Please verify if it solves the problem
for you.
Original comment by johan.ha...@gmail.com
on 7 Apr 2011 at 8:29
I have the same issue when running a test through an Ant-script. Instead of
building successful it says "build failed" with a similar stack trace (due to
PowerMock clean up).
I made my 1st PowerMock-built from the trunk, replaced the 1.4.8.jar with the
newly built jar and ran the Ant-script again. Now the script runs successfully,
so problem is solved (for me).
Original comment by roel.de.nijs@gmail.com
on 11 Apr 2011 at 11:23
Great! Thanks for helping out.
Original comment by johan.ha...@gmail.com
on 11 Apr 2011 at 11:54
I'm closing the issue now.
Original comment by johan.ha...@gmail.com
on 11 Apr 2011 at 8:26
Original issue reported on code.google.com by
dmeibu...@gmail.com
on 25 Jan 2011 at 6:34Attachments: