Exemplo n.º 1
0
 public void testUpdateSuccessfully() throws Exception {
   ProductStatis productStatis = productStatisFactory.newInstance("taobao123");
   productStatis.setClickedNum(2);
   productStatis.setCollectedNum(3);
   productStatis.setPurchasedNum(4);
   productStatisDAO.update(productStatis);
   ProductStatis updateProductStatis = productStatisDAO.getProductStatisByProductId("taobao123");
   assertNotNull(updateProductStatis);
   assertEquals(3, updateProductStatis.getClickedNum());
   assertEquals(4, updateProductStatis.getCollectedNum());
   assertEquals(5, updateProductStatis.getPurchasedNum());
 }
Exemplo n.º 2
0
 public void testGetProductStatisByProductId() throws Exception {
   ProductStatis productStatis = productStatisDAO.getProductStatisByProductId("taobao123");
   assertEquals(new Long(1), productStatis.getId());
   assertEquals(1, productStatis.getClickedNum());
   assertEquals(1, productStatis.getCollectedNum());
   assertEquals(1, productStatis.getPurchasedNum());
 }
Exemplo n.º 3
0
 public void testSaveSuccessfully() throws Exception {
   ProductStatis productStatis = productStatisFactory.newInstance("123");
   productStatisDAO.save(productStatis);
   assertNotNull(productStatis.getId());
   assertEquals(new Long(2), productStatis.getId());
 }