use of com.opensymphony.xwork2.util.Foo in project struts by apache.
the class FetchMetadataInterceptorTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
container.inject(interceptor);
interceptor.setExemptedPaths("/foo,/bar");
ServletActionContext.setRequest(request);
ServletActionContext.setResponse(response);
ActionContext context = ServletActionContext.getActionContext();
mai.setInvocationContext(context);
}
use of com.opensymphony.xwork2.util.Foo in project struts by apache.
the class ServletRedirectResultTest method setUp.
protected void setUp() throws Exception {
super.setUp();
configurationManager.getConfiguration().addPackageConfig("foo", new PackageConfig.Builder("foo").namespace("/namespace").build());
view = new ServletRedirectResult();
container.inject(view);
responseMock = new Mock(HttpServletResponse.class);
requestMock = new Mock(HttpServletRequest.class);
requestMock.matchAndReturn("getContextPath", "/context");
ResultConfig resultConfig = new ResultConfig.Builder("", "").build();
Map<String, ResultConfig> results = new HashMap<>();
results.put("myResult", resultConfig);
ActionConfig actionConfig = new ActionConfig.Builder("", "", "").addResultConfigs(results).build();
ActionContext ac = ActionContext.getContext();
ac.withServletRequest((HttpServletRequest) requestMock.proxy());
ac.withServletResponse((HttpServletResponse) responseMock.proxy());
MockActionInvocation ai = new MockActionInvocation();
ai.setInvocationContext(ac);
ai.setResultCode("myResult");
ActionProxy mockActionProxy = createNiceMock(ActionProxy.class);
ai.setProxy(mockActionProxy);
expect(mockActionProxy.getConfig()).andReturn(actionConfig).anyTimes();
replay(mockActionProxy);
ai.setStack(ActionContext.getContext().getValueStack());
this.ai = ai;
}
use of com.opensymphony.xwork2.util.Foo in project struts by apache.
the class PrefixBasedActionProxyFactoryTest method testFallbackToDefault.
public void testFallbackToDefault() throws Exception {
initFactory("/ns1:prefix1");
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.emptyMap(), false, true);
assertTrue(proxy1 instanceof Prefix1ActionProxy);
ActionProxy proxy2 = factory.createActionProxy("", "Foo", "", Collections.emptyMap(), false, true);
assertTrue(proxy2 instanceof StrutsActionProxy);
}
use of com.opensymphony.xwork2.util.Foo in project struts by apache.
the class CoepInterceptorTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
container.inject(interceptor);
interceptor.setExemptedPaths("/foo");
ServletActionContext.setRequest(request);
ServletActionContext.setResponse(response);
ActionContext context = ServletActionContext.getActionContext();
Map<String, Object> session = new HashMap<>();
context.withSession(session);
mai.setInvocationContext(context);
}
use of com.opensymphony.xwork2.util.Foo in project struts by apache.
the class PropertiesConfigurationProviderTest method testRegister_NoLocale.
public void testRegister_NoLocale() {
ContainerBuilder builder = new ContainerBuilder();
builder.constant("foo", "bar");
PropertiesConfigurationProvider prov = new PropertiesConfigurationProvider();
prov.register(builder, new LocatableProperties());
Container container = builder.create(true);
String localeStr = container.getInstance(String.class, StrutsConstants.STRUTS_LOCALE);
assertNull(localeStr);
}
Aggregations