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

mysql - How to enter php data into a html multiple select box -

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

c++ - Cassandra datastax cpp driver - avoiding unnecessary copies -