public void printTestCase() { System.out.println(testName); element.printElementDetails(); System.out.println("Actions : "); for (Object x : actionList.keySet()) { System.out.println(x.toString() + " : " + actionList.get(x)); } if (errorMessage.length() > 0) { System.out.println(errorMessage); } }
@Test public void testPageElement() throws Exception { TemplateFunctions functions = new TemplateFunctions(applicationContext, viewResolver, localeResolver); PageElement pageElement = new PageElement(); assertTrue(pageElement.excludedAttributes().isEmpty()); pageElement.addRegion("region_list", Arrays.asList(new PlainTextElement("List"))); pageElement.addRegion("region_single", new PlainTextElement("Single")); pageElement.addRegion("region_add", new PlainTextElement("Add")); pageElement.addRegion("region_add", new PlainTextElement(" ")); pageElement.addRegion("region_add", new PlainTextElement("This")); String output = functions.render(new MockHttpServletRequest(), pageElement); Document doc = Jsoup.parse(output); assertEquals("List", doc.select(".region-region_list").text()); assertEquals("Single", doc.select(".region-region_single").text()); assertEquals("Add This", doc.select(".region-region_add").text()); }