Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > help testing st...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 16079 of 16590
Post > Topic >>

help testing state

by mike <mikaelpetterson@[EMAIL PROTECTED] > May 13, 2008 at 11:38 AM

Hi,

We have the following method that we need to test ( see code snippet).

I know about junit ( using 4 here) and Jmock, but all hints are
welcome.
How can I write a test that excerises createNewHome

public void createNewHome(String address){

 Address newAddress = aHome.create();

switch(state) {
             case INITIAL:
               //Do stuff
               //Set state to INVITE
             case INVITE:
                 //Do something else
                 //Set state to TERMINATE
             case TERMINATE:
                 //Do something other
                 //Set state to INTIAL
                 break;
             default:
                 System.out.println("Not a valid state");
         }
 //More code .......

}
 




 3 Posts in Topic:
help testing state
mike <mikaelpetterson@  2008-05-13 11:38:06 
Re: help testing state
Daniel Pitts <newsgrou  2008-05-13 16:31:03 
Re: help testing state
Roedy Green <see_websi  2008-05-14 05:38:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:08:59 CST 2008.