Thoppan / powermock

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

The usage of PowerMockObjectFactory causes failure, if expectedExceptions attribute is used #348

Closed GoogleCodeExporter closed 9 years ago

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

1. Create a test class, which has the object factory method:
@ObjectFactory
    public IObjectFactory getObjectFactory() {
        return new org.powermock.modules.testng.PowerMockObjectFactory();
    }
2.
Create a test case, which has the expectedExceptions attribute. Throw the 
expected exception inside the method.
3. Run it

What is the expected output? What do you see instead?

The test case should pass, but it fails. I have got the following exception:
org.testng.TestException: 
Expected exception package.name.NoSuchManagedObjectException but got 
package.name.NoSuchManagedObjectException

What version of the product are you using? On what operating system?
Windows Vista 32 bit
Powermock: 1.4.10
TestNG: 6.2

Please provide any additional information below.

If you remove the object factory method, then the test case passes.

Original issue reported on code.google.com by csadam85@gmail.com on 12 Oct 2011 at 10:57

GoogleCodeExporter commented 9 years ago
BTW I can't reproduce it with testng 6.7, 
powermock-api-mockito/powermock-module-testng 1.4.12 and mockito 1.9.0

Original comment by slava.se...@gmail.com on 6 Aug 2012 at 7:46

GoogleCodeExporter commented 9 years ago
Thanks for letting us know

Original comment by johan.ha...@jayway.com on 6 Aug 2012 at 7:59

GoogleCodeExporter commented 9 years ago
Looks like this issue was duplicated with #366, which is resolved now.

Original comment by majorpe...@gmail.com on 21 Jan 2014 at 3:46

GoogleCodeExporter commented 9 years ago
Thanks

Original comment by johan.ha...@gmail.com on 21 Jan 2014 at 8:11