aspose file tools*
The moose likes Testing and the fly likes  powermock : ProcessBuilder redirectErrorStream giving nullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark " powermock : ProcessBuilder redirectErrorStream giving nullPointerException" Watch " powermock : ProcessBuilder redirectErrorStream giving nullPointerException" New topic
Author

powermock : ProcessBuilder redirectErrorStream giving nullPointerException

Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
I am using powermock to mock some native command invocation using process builder. the strange thing is these test pass sometimes and fail sometimes giving a NPE. Is this a powermock issue or some gotcha in the program.

the snippet of the class under test is..

and the unit test case is ..

I get an error on execution an the test case fails..


Note : I do not get this error on all executions. Sometimes it passes and sometimes it fails. I am not able to understand this behavior.
Also, I have camouflaged some variable names because of the copyright issues.. Please bear !!




Kaustubh. Mumbai, India.
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
Experts ?? any clues why is this happening ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: powermock : ProcessBuilder redirectErrorStream giving nullPointerException