This is the action class: public class HelloWorldTest extends BaseStrutsTestCase { HelloWorld hello; Map testSession; @Before public void setUp() throws Exception { super.setUp(); hello = createAction( HelloWorld.class, "/","HelloWorld" ); testSession = new HashMap(); testSession.put("username", "admin"); testSession.put("password", "sifre"); proxy.getInvocation().getInvocationContext().setParameters(testSession); }
@Test public void testHelloWorldAction() throws Exception { assertTrue("SUCCESS".equals(proxy.execute())); } If you look at the link, you can understand the problem. Whose initialization is the one that you can't understand? Antonio Petrelli-3 wrote: > > 2008/6/26 ezgi <[EMAIL PROTECTED]>: >> >> In my action, I have a reference to Http request and it requires to >> access >> the HttpServletRequest object, so I can not easily test the action with >> just >> calling the execute method and comparing the result. So, I have found out >> a >> solution from the link that I refere before, I did not write the >> BaseStrutsTestCase, I modified the class. It creates mock objects and >> helps >> to test my action outside of the server environment. It takes the >> advantage >> of the ActionProxy. All I did was to simulate some user input, and >> remaining part is handled by this helper class. > > And the initialization? I still cannot understand. > > Antonio > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/jUnit-Testing-Problem-with-Tiles-tp18131822p18133751.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]