/** Test of delete method, of class TemplateControllerBean. */ public void testDelete() { System.out.println("delete"); TemplateControllerBean instance = new TemplateControllerBean(); instance.delete(); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
/** Test of save method, of class TemplateControllerBean. */ public void testSave() { System.out.println("save"); TemplateControllerBean instance = new TemplateControllerBean(); String expResult = ""; String result = instance.save(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
@Test public void testSetFormData() { Template tmp = new Template(); tmp.setId(1); tmp.setName("testname"); tmp.setHtml("testHtml"); tmp.setDeleteFlg(1); tmp.setMemo("testMemo"); controllerBean.setFormData(tmp); assertTrue( viewBean.getTemplateId() == 1 && viewBean.getTemplateName().equals("testname") && viewBean.getTemplateHtml().equals("testHtml") && viewBean.getTemplateMemo().equals("testMemo") && viewBean.getTemplateDelFlg() == true); }
@Test public void testGetFormData() { viewBean.setTemplateId(1); viewBean.setTemplateName(" testname "); viewBean.setTemplateHtml("testHtml"); viewBean.setTemplateDelFlg(true); viewBean.setTemplateMemo(" testMemo "); viewBean.setSelectedTemplate(new Template(1, 1, new Date())); Template tmp = controllerBean.getFormData(); assertTrue( tmp.getId() == 1 && tmp.getName().equals("testname") && tmp.getHtml().equals("testHtml") && tmp.getMemo().equals("testMemo") && tmp.getDeleteFlg() == 1); }
@BeforeClass public static void setUpClass() { controllerBean = new TemplateControllerBean(); viewBean = new TemplateViewBean(); controllerBean.setTemplateViewBean(viewBean); }