@@ -0,0 +1,2050 @@
+package com.dianping.cat.report.service;%0A%0Aimport java.util.Date;%0A%0Aimport org.junit.Test;%0Aimport org.unidal.dal.jdbc.DalException;%0Aimport org.unidal.lookup.ComponentTestCase;%0A%0Aimport com.dianping.cat.core.dal.DailyReport;%0Aimport com.dianping.cat.core.dal.DailyReportDao;%0Aimport com.dianping.cat.core.dal.HourlyReport;%0Aimport com.dianping.cat.core.dal.HourlyReportDao;%0Aimport com.dianping.cat.core.dal.MonthlyReport;%0Aimport com.dianping.cat.core.dal.MonthlyReportDao;%0Aimport com.dianping.cat.core.dal.WeeklyReport;%0Aimport com.dianping.cat.core.dal.WeeklyReportDao;%0A%0Apublic class ReportDaoTest  extends ComponentTestCase%7B%0A%0A%09@Test%0A%09public void test() throws DalException%7B%0A%09%09HourlyReportDao dao = lookup(HourlyReportDao.class);%0A%09%09HourlyReport proto = new HourlyReport();%0A%09%09%0A%09%09proto.setCreationDate(new Date());%0A%09%09proto.setDomain(%22domain%22);%0A%09%09proto.setEndDate(new Date());%0A%09%09proto.setName(%22name%22);%0A%09%09proto.setIp(%22ip%22);%0A%09%09proto.setPeriod(new Date());%0A%09%09proto.setType(1);%0A%09%09dao.insert(proto);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testDaily() throws DalException%7B%0A%09%09DailyReportDao dao = lookup(DailyReportDao.class);%0A%09%09DailyReport proto = new DailyReport();%0A%09%09%0A%09%09proto.setCreationDate(new Date());%0A%09%09proto.setDomain(%22domain%22);%0A%09%09proto.setEndDate(new Date());%0A%09%09proto.setName(%22name%22);%0A%09%09proto.setIp(%22ip%22);%0A%09%09proto.setPeriod(new Date());%0A%09%09proto.setType(1);%0A%09%09dao.insert(proto);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testWeek() throws DalException%7B%0A%09%09WeeklyReportDao dao = lookup(WeeklyReportDao.class);%0A%09%09WeeklyReport proto = new WeeklyReport();%0A%09%09%0A%09%09proto.setCreationDate(new Date());%0A%09%09proto.setDomain(%22domain%22);%0A%09%09proto.setName(%22name%22);%0A%09%09proto.setIp(%22ip%22);%0A%09%09proto.setPeriod(new Date());%0A%09%09proto.setType(1);%0A%09%09dao.insert(proto);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testMonth() throws DalException%7B%0A%09%09MonthlyReportDao dao = lookup(MonthlyReportDao.class);%0A%09%09MonthlyReport proto = new MonthlyReport();%0A%09%09%0A%09%09proto.setCreationDate(new Date());%0A%09%09proto.setDomain(%22domain%22);%0A%09%09proto.setName(%22name%22);%0A%09%09proto.setIp(%22ip%22);%0A%09%09proto.setPeriod(new Date());%0A%09%09proto.setType(1);%0A%09%09dao.insert(proto);%0A%09%7D%0A%7D%0A

modify the dao