public void testDoEndTagInfo() throws JspException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException { TxNode root = new TxNode(); root.addValue(1); tst.setQuestionsTxNodeName("SurveyNodeName"); TxNode node = new TxNode(); node.addValue(1); node.addMsg("INFO"); node.addMsg("Why did you decide not to subscribe to Premium Navigation?"); node.addMsg("1"); TxNode childNode = new TxNode(); childNode.addMsg("Don't need these features"); childNode.addMsg("Price is too high"); node.addChild(childNode); root.addChild(node); IMocksControl RequestControl = EasyMock.createControl(); HttpServletRequest request = RequestControl.createMock(HttpServletRequest.class); EasyMock.expect(request.getAttribute(tst.getQuestionsTxNodeName())).andReturn(root).anyTimes(); RequestControl.replay(); IMocksControl pageContextControl = EasyMock.createControl(); javax.servlet.jsp.PageContext pageContext = pageContextControl.createMock(javax.servlet.jsp.PageContext.class); EasyMock.expect(pageContext.getRequest()).andReturn(request).anyTimes(); IMocksControl JspWritersControl = EasyMock.createControl(); JspWriter jspwriter = JspWritersControl.createMock(JspWriter.class); EasyMock.expect(pageContext.getOut()).andReturn(jspwriter); pageContextControl.replay(); tst.setPageContext(pageContext); tst.setPageNumber(1); tst.doEndTag(); String strActual = ((StringBuilder) getValue(tst, "outputText")).toString(); assertEquals("", strActual); }
public void testClean() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { tst.clean(); assertEquals(0, ((StringBuilder) getValue(tst, "outputText")).length()); assertEquals(1, tst.getPageNumber()); assertEquals(1, tst.getPageSize()); assertEquals("", tst.getChoiceLabel()); assertEquals("", tst.getQuestionsTxNodeName()); assertEquals("", tst.getQuestionLabel()); }
public void testGetChoiceLabel() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { String choiceLabel = (String) setValue(tst, "choiceLabel", "This is test!"); assertEquals(choiceLabel, tst.getChoiceLabel()); }
public void testSetSubValue() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { String subValue = "This is test2!"; tst.setSubValue(subValue); assertEquals(subValue, (String) getValue(tst, "subValue")); }
public void testGetSubValue() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { String subValue = (String) setValue(tst, "subValue", "This is test!"); assertEquals(subValue, tst.getSubValue()); }
public void testSetComments() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { String comments = "This is test2!"; tst.setComments(comments); assertEquals(comments, (String) getValue(tst, "comments")); }
public void testGetComments() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { String comments = (String) setValue(tst, "comments", "This is test!"); assertEquals(comments, tst.getComments()); }
public void testDoStartTag() throws JspException { assertEquals(0, tst.doStartTag()); }
public void testSetPageNumber() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { int pageNumber = 100; tst.setPageNumber(pageNumber); assertEquals(pageNumber, getValue(tst, "pageNumber")); }
public void testGetPageNumber() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Object pageNumber = setValue(tst, "pageNumber", 100); assertEquals(pageNumber, tst.getPageNumber()); }
public void testSetPageSize() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { int pageSize = 100; tst.setPageSize(pageSize); assertEquals(pageSize, getValue(tst, "pageSize")); }
public void testSetQuestionsTxNodeName() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { String questionsTxNodeName = "This is test2!"; tst.setQuestionsTxNodeName(questionsTxNodeName); assertEquals(questionsTxNodeName, (String) getValue(tst, "questionsTxNodeName")); }
public void testGetQuestionsTxNodeName() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { String questionsTxNodeName = (String) setValue(tst, "questionsTxNodeName", "This is test!"); assertEquals(questionsTxNodeName, tst.getQuestionsTxNodeName()); }
public void testSetQuestionLabel() throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException { String questionLabel = "This is test2!"; tst.setQuestionLabel(questionLabel); assertEquals(questionLabel, (String) getValue(tst, "questionLabel")); }