java - expect static call with some certain result -


I have found some steady calls from system functions in my system

long current data Milliseconds

How to test this call and set some specific results to use the powermaker?

I mean something like

  System.currentTimeMillis (); . ExpectLastCall () andReturn (leftBound); // I hope to return a certain amount of milliseconds  

Good ... I ' Done this way

  fake (System.class); Hope (System.currentTimeMillis ()) andReturn (rightBound.getTime ()) replay all(); AssertTrue (DateUtils.isInRange (Leftbound, Rightbound)); VerifyAll ();  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -