Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

powermock : ProcessBuilder redirectErrorStream giving nullPointerException

 
Kaustubh Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Experts ?? any clues why is this happening ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic