@Test
public void testInsert() throws SQLException, IllegalAccessException, InvocationTargetException{

	
	//testInsert(Product product);
	ShopProduct product = new ShopProduct();
	product.setContent("content");
	product.setIsValid("Y");
	product.setIsRecommend("Y");
	product.setIsHotProduct("Y");
	product.setMarketPrice(Long.valueOf(11L));
	product.setPointChange(Long.valueOf(12L));
	product.setStocks(Long.valueOf(13L));
	product.setPictures("pictures");
	product.setProductCode("productCode");
	product.setProductName("productName");
	product.setProductType(Constant.SHOP_PRODUCT_TYPE.COUPON.name());
	Long id = shopProductDAO.insert(product);
	String sql = "select * from SHOP_PRODUCT where PRODUCT_ID = " + id;
	Statement stat = conn.createStatement();
	ResultSet rs = stat.executeQuery(sql);
	rs.next();
	Assert.assertEquals("productCode", rs.getString("PRODUCT_CODE"));
	Assert.assertEquals("productName", rs.getString("PRODUCT_NAME"));
	Assert.assertEquals(Constant.SHOP_PRODUCT_TYPE.COUPON.name(), rs.getString("PRODUCT_TYPE"));
	Assert.assertEquals("Y", rs.getString("IS_VALID"));
	Assert.assertEquals("Y", rs.getString("IS_HOT_PRODUCT"));
	Assert.assertEquals("Y", rs.getString("IS_RECOMMEND"));
	Assert.assertEquals("pictures", rs.getString("PICTURES"));
	Assert.assertEquals("content", rs.getString("CONTENT"));
	Assert.assertEquals("11", String.valueOf(rs.getLong("MARKET_PRICE")));
	Assert.assertEquals("12", String.valueOf(rs.getLong("POINT_CHANGE")));
	Assert.assertEquals("13", String.valueOf(rs.getLong("STOCKS")));
	
	//testInsert(CouponProduct product);
	ShopProductCoupon couponProduct = new ShopProductCoupon();
	product.setCreateTime(new Date());
	product.setModifyTime(new Date());
	BeanUtils.copyProperties(couponProduct, product);
	couponProduct.setProductId(null);
	couponProduct.setCouponId(Long.valueOf(14L));
	Long cpId = shopProductDAO.insert(couponProduct);
	String cpSql = "select p.PRODUCT_NAME PRODUCT_NAME, p.PRODUCT_TYPE PRODUCT_TYPE, cp.COUPON_ID COUPON_ID from SHOP_PRODUCT p, SHOP_PRODUCT_COUPON cp where p.PRODUCT_ID = cp.PRODUCT_ID AND p.PRODUCT_ID = " + cpId;
	ResultSet cpRs = stat.executeQuery(cpSql);
	cpRs.next();
	
	Assert.assertEquals("productName", cpRs.getString("PRODUCT_NAME"));
	Assert.assertEquals("14", String.valueOf(cpRs.getLong("COUPON_ID")));
	Assert.assertEquals(Constant.SHOP_PRODUCT_TYPE.COUPON.name(), cpRs.getString("PRODUCT_TYPE"));
}