test with mock data or real data?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Prashant_Neginahal
Posted On:   Tuesday, August 14, 2007 05:51 AM

Hi All, I am kind of confused while writing the certain test cases for CMP beans. We are using MockEJB to test CMP beans and it is out-container testing. In our test cases we are creating the proxy objects(mock data objects hard coded with data base data). These proxy data objects are nothing but value objects hard coded with particular database row. Ex. Lets say I am testing Account CMP bean. I will create the proxy account object and fill it with values in Account table correspond to say Account Id = 100. Then I test the create method of account bean for Account No=100 using Mock EJB. My question is it correct approach of unit testing? I am also thinking why should I create the proxy objects. I should follow som   More>>

Hi All,

I am kind of confused while writing the certain test cases for CMP beans. We are using MockEJB to test CMP beans and it is out-container testing.

In our test cases we are creating the proxy objects(mock data objects hard coded with data base data). These proxy data objects are nothing but value objects hard coded with particular database row.

Ex. Lets say I am testing Account CMP bean. I will create the proxy account object and fill it with values in Account table correspond to say Account Id = 100. Then I test the create method of account bean for Account No=100 using Mock EJB.

My question is it correct approach of unit testing? I am also thinking why should I create the proxy objects. I should follow some way of getting the real data from database (may be through Hibernet)and then compare this data with data returned by CMP. This is in-container testing.

What should be the correct approach for testing CMP beans?

Thanks,
Prashant

   <<Less
About | Sitemap | Contact