Created
November 4, 2014 11:11
-
-
Save amixpal/06c0373f40c8b801f36d to your computer and use it in GitHub Desktop.
vishal check karo..aise likh rahe hai...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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