tiebin-zhang / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Mocking static functions fails with combination of powermock 1.4.12 and spring 3.1.1.RELEASE #388

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce:
1. Setup example from 
http://powermock.googlecode.com/svn/tags/powermock-1.4.12/examples/spring-mockit
o/
2. Update spring dependency in pom.xml from 3.0.5 to 3.1.1
3. Run the test in the example.
4. Observe how the test fails with runtime exception

The development environment used:
 - eclipse 3.6.2
 - windows 7, 64 bit

Original issue reported on code.google.com by hannu.re...@op.fi on 6 Jun 2012 at 8:02

GoogleCodeExporter commented 9 years ago
Forgot to mention that I'm using java6.

Original comment by hannu.re...@op.fi on 6 Jun 2012 at 8:11

GoogleCodeExporter commented 9 years ago
Actually it looks like it is not possible to run tests at all with 
SpringJUnit4ClassRunner (Spring 3.1.1.RELEASE) and use PowerMockRule. The 
following test fails to run also:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:test-config.xml")
public class SomeTest
{
    @Rule
    public PowerMockRule rule = new PowerMockRule();

    @Test
    public void testDummy()
    {
        assertTrue(true);
    }
}

Original comment by hannu.re...@op.fi on 8 Jun 2012 at 2:13

GoogleCodeExporter commented 9 years ago
What error message do you get?

Original comment by johan.ha...@gmail.com on 13 Jul 2012 at 7:12