FileDocCategorySizeDatePackage
ResourceUtilTest.javaAPI DocExample1949Mon Jul 23 13:26:16 BST 2007org.apache.struts2.views.util

ResourceUtilTest

public class ResourceUtilTest extends TestCase
ResourceUtilTest

Fields Summary
private org.easymock.MockControl
control
private HttpServletRequest
requestMock
Constructors Summary
Methods Summary
protected voidsetUp()

        control = MockControl.createControl(HttpServletRequest.class);
        requestMock = (HttpServletRequest) control.getMock();
    
public voidtestGetResourceBase()

        control.expectAndReturn(requestMock.getServletPath(), "/mycontext/");
        control.replay();
        assertEquals("/mycontext", ResourceUtil.getResourceBase(requestMock));
        control.verify();

        control.reset();

        control.expectAndReturn(requestMock.getServletPath(), "/mycontext/test.jsp");
        control.replay();
        assertEquals("/mycontext", ResourceUtil.getResourceBase(requestMock));
        control.verify();