nkxiaochuan / powermock

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

Full support for TestNG #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This isn't a bug but an enhancement. Currently Powermock only supports
JUnit. TestNG is the other popular unit testing framework available and it
would be nice if Powermock supported it.

Original issue reported on code.google.com by grant.j....@gmail.com on 30 Oct 2008 at 10:59

GoogleCodeExporter commented 9 years ago
This is definitely something that we should do! It'll require much work though.

Original comment by johan.ha...@gmail.com on 31 Oct 2008 at 7:56

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 31 Oct 2008 at 7:57

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 26 Jun 2009 at 10:47

GoogleCodeExporter commented 9 years ago
Include chunking support

Original comment by johan.ha...@gmail.com on 7 Sep 2009 at 2:51

GoogleCodeExporter commented 9 years ago
Experimental support will probably be available in 1.3

Original comment by johan.ha...@gmail.com on 1 Oct 2009 at 10:54

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 1 Oct 2009 at 10:54

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 20 Jul 2010 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 22 Jul 2010 at 9:16

GoogleCodeExporter commented 9 years ago
Please can you clarify the status of TestNG support?  The wiki claims that 
there is basic support since 1.3.5:

http://code.google.com/p/powermock/wiki/TestNG_usage

However if I stub a constructor via @BeforeMethod then I see very odd behaviour 
unless my test case extends PowerMockTestCase.  I only stumbled upon that base 
class by accident after about 4 hours of puzzlement - other than the javadoc, I 
only found it mentioned here:

http://blog.jayway.com/2009/12/14/powermock-testng-true/

The odd behaviour is that restubbing a constructor in a test run after a 
failing test causes the stub from the previous failing test to be executed 
during the whenNew(...) code.  I've attached a zip of a test case demonstrating 
this issue.

If subclassing PowerMockTestClass is required then please update the wiki page, 
thanks!

Original comment by adam.spi...@gmail.com on 8 Sep 2010 at 5:40

Attachments:

GoogleCodeExporter commented 9 years ago
I totally understand the frustration you feel after 4h of investigation.. It 
looks to me that it some state is retained by PowerMock that ought to be 
cleared when the previous test failed. Does it work if you extend from the 
PowerMockTestClass? Also thanks a for the example, that always make things 
easier for us.

Original comment by johan.ha...@gmail.com on 12 Sep 2010 at 2:47

GoogleCodeExporter commented 9 years ago
This should clean up the state better.

Original comment by jonatan....@softhouse.se on 13 Jun 2013 at 8:07

Attachments: