Skip to content

Instantly share code, notes, and snippets.

@amixpal
Created November 4, 2014 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amixpal/06c0373f40c8b801f36d to your computer and use it in GitHub Desktop.
Save amixpal/06c0373f40c8b801f36d to your computer and use it in GitHub Desktop.
vishal check karo..aise likh rahe hai...
@Test
public void getAllProductsTest()
{
List<Product> productTest = commonDBDAO.getList("select p from Product p", null, false);
List<Product> product = billingDBDAO.getAllProducts();
LOGGER.info("Testing BillingDBDAO.getAllProductsTest()... ");
try{
if(null!=product&&null!=productTest&&(product.size()!=product.size())){
Assert.fail();
}
if(null==product&&null==productTest&&(product.size()!=productTest.size())){
Assert.fail();
}
if((null!=product && null==productTest) || (null!=productTest&&null==product)){
Assert.fail();
}
if(null!=product&&null!=productTest){
for(int i=0;i<product.size();i++){
if(!CommonTestUtil.compareObjects(product.get(i), productTest.get(i))){
Assert.fail("TestBillingDBDAO.getAllproducts()..failed");
}
}
}
}catch(Exception ex){
LOGGER.error("", ex);
Assert.fail();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment