Re: how to write Unit test which requires DB setup

2013-02-11 Thread Min Chen
> -Original Message- >> From: Alex Huang >> Sent: Monday, February 11, 2013 5:36 PM >> To: Alex Huang; Anthony Xu; cloudstack-dev@incubator.apache.org >> Subject: RE: how to write Unit test which requires DB setup >> >> SecurityGroupManagerImpl2Te

RE: how to write Unit test which requires DB setup

2013-02-11 Thread Anthony Xu
ck methods to return values. > > http://code.google.com/p/mockito/ > > --Alex > > > -Original Message- > > From: Alex Huang [mailto:alex.hu...@citrix.com] > > Sent: Monday, February 11, 2013 4:22 PM > > To: Anthony Xu; cloudstack-dev@incubat

RE: how to write Unit test which requires DB setup

2013-02-11 Thread Alex Huang
nal Message- > From: Alex Huang [mailto:alex.hu...@citrix.com] > Sent: Monday, February 11, 2013 4:22 PM > To: Anthony Xu; cloudstack-dev@incubator.apache.org > Subject: RE: how to write Unit test which requires DB setup > > Mock your db access. Basically mock up the Dao

RE: how to write Unit test which requires DB setup

2013-02-11 Thread Anthony Xu
Is there any example in Cloudstack? Anthony > -Original Message- > From: Alex Huang > Sent: Monday, February 11, 2013 4:22 PM > To: Anthony Xu; cloudstack-dev@incubator.apache.org > Subject: RE: how to write Unit test which requires DB setup > > Mock your db acces

RE: how to write Unit test which requires DB setup

2013-02-11 Thread Alex Huang
Mock your db access. Basically mock up the Dao objects to return the results you expect. --Alex > -Original Message- > From: Anthony Xu [mailto:xuefei...@citrix.com] > Sent: Monday, February 11, 2013 2:27 PM > To: cloudstack-dev@incubator.apache.org > Subject: how to write Unit test whi