1   package org.jmage.tags;
2   
3   import org.jmage.tags.filter.color.BrightenTagHandler;
4   import org.jmage.ApplicationContext;
5   
6   import javax.servlet.jsp.PageContext;
7   
8   /***
9    * TagHandlerConfigurableServletContextTest
10   */
11  public class TagHandlerConfigurableServletContextTest extends GenericTagHandlerTests {
12      protected void setUp() throws Exception {
13          super.setUp();
14          jmageTagHandler = new BrightenTagHandler();
15          jmageTagHandler.setPageContext((PageContext) mockPageContext.proxy());
16          jmageTagHandler.setImage("image.gif");
17          jmageTagHandler.setEncode("jpg");
18          jmageTagHandler.setWidth("100");
19          jmageTagHandler.setHeight("200");
20          jmageTagHandler.setId("1");
21          ((BrightenTagHandler) jmageTagHandler).setAdjust("10");
22  
23          ApplicationContext.getContext().setProperty("contextPath", "/test");
24      }
25  
26      protected String getTagResult() {
27          return "<img width=\"100\" " +
28                     "height=\"200\" " +
29                     "src=\"/test/jmage?image=image.gif&encode=jpg&chain=org.jmage.filter.color.BrightenFilter&ADJUST=10\" " +
30                     "id=\"1\"/>";
31      }
32  }