package jp.agentec.sinaburocast.service; import javax.annotation.Resource; import jp.agentec.sinaburocast.entity.EnqueteSummary; import jp.agentec.sinaburocast.form.admin.enquete.EnqueteResultForm; import junit.framework.TestSuite; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.seasar.dao.unit.S2DaoTestCase; public class EnqueteSummaryServiceTest extends S2DaoTestCase { @Resource private EnqueteSummaryService enqueteSummaryService; public EnqueteSummaryServiceTest(String string) { super(string); } public static TestSuite suite() { TestSuite suite = new TestSuite("EnqueteSummaryServiceTest"); suite.addTest(new EnqueteSummaryServiceTest("findById")); suite.addTest(new EnqueteSummaryServiceTest("insertEnqueteSummaryTx")); suite.addTest(new EnqueteSummaryServiceTest("findAllOrderById")); suite.addTest(new EnqueteSummaryServiceTest("findAllByEnqueteId")); suite.addTest(new EnqueteSummaryServiceTest("deleteByEnqueteIdTx")); suite.addTest(new EnqueteSummaryServiceTest("getEnqueteSummary")); suite.addTest(new EnqueteSummaryServiceTest("deleteByEnqueteId1Tx")); suite.addTest(new EnqueteSummaryServiceTest("deleteInsertTx")); return suite; } /** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { } /** * @throws java.lang.Exception */ @AfterClass public static void tearDownAfterClass() throws Exception { } /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { include("app.dicon"); } /** * @throws java.lang.Exception */ @After public void tearDown() throws Exception { } public void findById() { System.out.println(enqueteSummaryService.findById(1)); } public void insertEnqueteSummaryTx() { EnqueteSummary enqueteSummary = new EnqueteSummary(); enqueteSummary.enqueteId = 10; System.out.println(enqueteSummaryService.insertEnqueteSummary(enqueteSummary,"CLASSTEST")); } public void findAllOrderById() { System.out.println(enqueteSummaryService.findAllOrderById()); } public void findAllByEnqueteId() { System.out.println(enqueteSummaryService.findAllByEnqueteId("10")); } public void deleteByEnqueteIdTx() { System.out.println(enqueteSummaryService.deleteByEnqueteId("10")); } public void getEnqueteSummary() { EnqueteResultForm enqueteResultForm = new EnqueteResultForm(); enqueteResultForm.eid = "10"; System.out.println(enqueteSummaryService.getEnqueteSummary(enqueteResultForm)); } public void deleteByEnqueteId1Tx() { System.out.println(enqueteSummaryService.deleteByEnqueteId("10")); } public void deleteInsertTx() { EnqueteSummary enqueteSummary = new EnqueteSummary(); enqueteSummary.enqueteId = 10; System.out.println(enqueteSummaryService.deleteInsert(enqueteSummary,"CLASSTEST")); } }