01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.interceptor;
06:
07: import com.opensymphony.xwork.ActionProxy;
08: import com.opensymphony.xwork.Action;
09: import com.opensymphony.webwork.TestConfigurationProvider;
10:
11: /**
12: * Unit test for {@link TokenSessionStoreInterceptor}.
13: *
14: * @author Claus Ibsen
15: */
16: public class TokenSessionStoreInterceptorTest extends
17: TokenInterceptorTest {
18:
19: public void testCAllExecute2Times() throws Exception {
20: ActionProxy proxy = buildProxy(getActionName());
21: setToken(request);
22: assertEquals(Action.SUCCESS, proxy.execute());
23:
24: ActionProxy proxy2 = buildProxy(getActionName());
25: // must not call setToken
26: // double post will just return success and render the same view as the first execute
27: // see TokenInterceptor where a 2nd call will return invalid.token code instead
28: assertEquals(Action.SUCCESS, proxy2.execute());
29: }
30:
31: protected String getActionName() {
32: return TestConfigurationProvider.TOKEN_SESSION_ACTION_NAME;
33: }
34:
35: }
|