/** Testing <code>GreaterThanTag</code> using name and property attribute in the request scope. */ public void testRequestScopePropertyGreaterThan() throws ServletException, JspException { GreaterThanTag gt = new GreaterThanTag(); String testKey = "testRequestScopePropertyGreaterThan"; LabelValueBean lvb = new LabelValueBean("The Key", GREATER_VAL); pageContext.setAttribute(testKey, lvb, PageContext.REQUEST_SCOPE); gt.setPageContext(pageContext); gt.setName(testKey); gt.setScope("request"); gt.setProperty("value"); gt.setValue(LESSER_VAL); assertTrue( "Value (" + LESSER_VAL + ") is greater than value (" + GREATER_VAL + ")", gt.condition()); }
/** Testing <code>GreaterThanTag</code> using name attribute in the request scope. */ public void testRequestScopeNameGreaterThan() throws ServletException, JspException { GreaterThanTag gt = new GreaterThanTag(); String testKey = "testRequestScopeNameGreaterThan"; Integer itgr = new Integer(GREATER_VAL); pageContext.setAttribute(testKey, itgr, PageContext.REQUEST_SCOPE); gt.setPageContext(pageContext); gt.setName(testKey); gt.setScope("request"); gt.setValue(LESSER_VAL); assertTrue( "Request scope value from name (" + GREATER_VAL + ") is greater than value (" + LESSER_VAL + ")", gt.condition()); }