mloayzagahona / powermock

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

Javadoc not consistent with actual behavior #452

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Java doc at 
http://powermock.googlecode.com/svn/docs/powermock-1.3.7/apidocs/org/powermock/a
pi/mockito/expectation/PowerMockitoStubber.html#when%28java.lang.Class%29 

Allows to choose a static method when stubbing in 
doThrow()|doAnswer()|doNothing()|doReturn() style
Example:

 doThrow(new RuntimeException()).when();
 StaticList.clear();

In example given above, there are no arguments to when(). While correct 
behavior is it accepts Class type argument of clss containing static method.

What is the expected output? What do you see instead?
 doThrow(new RuntimeException()).when(StaticList.class);

What version of the product are you using? On what operating system?
1.3.7

OS irrelevant.

Original issue reported on code.google.com by jeet.lo...@gmail.com on 6 Aug 2013 at 9:13

GoogleCodeExporter commented 9 years ago
Please help out and update the javadoc and provide a patch and I'll include it 
in the next release.

Original comment by johan.ha...@gmail.com on 19 Aug 2013 at 7:58

GoogleCodeExporter commented 9 years ago
I would be happy to do it. Can you please share wiki on how to submit patches.

Original comment by jeet.lo...@gmail.com on 19 Aug 2013 at 8:06

GoogleCodeExporter commented 9 years ago
Great! Just checkout the latest version from the subversion repo, make your 
changes then follow the guide here: 
https://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion/

Original comment by johan.ha...@gmail.com on 20 Aug 2013 at 5:05

GoogleCodeExporter commented 9 years ago
Here is the patch. Please let me know if this looks fine.

Original comment by jeet.lo...@gmail.com on 20 Aug 2013 at 6:16

GoogleCodeExporter commented 9 years ago
Sorry. Here is the file.

Original comment by jeet.lo...@gmail.com on 20 Aug 2013 at 6:17

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for your help :)

Original comment by johan.ha...@gmail.com on 20 Aug 2013 at 6:24

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 21 Sep 2013 at 3:52