My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 54: Full support for TestNG
15 people starred this issue and may be notified of changes. Back to list
 
Reported by grant.j....@gmail.com, Oct 30, 2008
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.


Oct 31, 2008
Project Member #1 johan.ha...@gmail.com
This is definitely something that we should do! It'll require much work though.
Status: Accepted
Labels: -Type-Defect Type-Enhancement Milestone-Future
Oct 31, 2008
Project Member #2 johan.ha...@gmail.com
(No comment was entered for this change.)
Jun 26, 2009
Project Member #3 johan.ha...@gmail.com
(No comment was entered for this change.)
Status: Started
Sep 7, 2009
Project Member #4 johan.ha...@gmail.com
Include chunking support
Summary: Full support for TestNG
Oct 1, 2009
Project Member #5 johan.ha...@gmail.com
Experimental support will probably be available in 1.3
Labels: -Milestone-Future Milestone-Release1.4
Oct 1, 2009
Project Member #6 johan.ha...@gmail.com
(No comment was entered for this change.)
Owner: johan.haleby
Jul 20, 2010
Project Member #7 johan.ha...@gmail.com
(No comment was entered for this change.)
Labels: -Milestone-Release1.4 Milestone-Release1.5
Jul 22, 2010
Project Member #8 johan.ha...@gmail.com
(No comment was entered for this change.)
Labels: -Milestone-Release1.5 Milestone-Release1.6
Sep 8, 2010
#9 adam.spi...@gmail.com
Please can you clarify the status of TestNG support?  The wiki claims that there is basic support since 1.3.5:

https://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!
PowerMock-TestNG-constructor-stubbing-bug.zip
3.6 MB   Download
Sep 12, 2010
Project Member #10 johan.ha...@gmail.com
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.
Jun 13, 2013
#11 jonatan....@softhouse.se
This should clean up the state better.
issue54_clean_up_state_after_failed_tests.patch
4.4 KB   View   Download
Sign in to add a comment

Powered by Google Project Hosting