* "excludes" all methods.
*/
public void testFormWithCustomOnsubmitEnabledWithValidateEnabled2() throws Exception {
com.opensymphony.xwork2.config.Configuration originalConfiguration = configurationManager.getConfiguration();
ObjectFactory originalObjectFactory = ObjectFactory.getObjectFactory();
try {
// used to determined if the form action needs js validation
configurationManager.setConfiguration(new com.opensymphony.xwork2.config.impl.DefaultConfiguration() {
public RuntimeConfiguration getRuntimeConfiguration() {
return new RuntimeConfiguration() {
public ActionConfig getActionConfig(String namespace, String name) {
ActionConfig actionConfig = new ActionConfig() {
public List getInterceptors() {
List interceptors = new ArrayList();
ValidationInterceptor validationInterceptor = new ValidationInterceptor();
validationInterceptor.setExcludeMethods("*");
InterceptorMapping interceptorMapping = new InterceptorMapping();
interceptorMapping.setName("validation");
interceptorMapping.setInterceptor(validationInterceptor);
interceptors.add(interceptorMapping);
return interceptors;
}
};
return actionConfig;
}
public Map getActionConfigs() {
return null;
}
};
}
});
// used by form tag to get "actionClass" parameter
ObjectFactory.setObjectFactory(new ObjectFactory() {
public Class getClassInstance(String className) throws ClassNotFoundException {
if (DefaultActionMapper.class.getName().equals(className)) {
return DefaultActionMapper.class;
}
return ActionSupport.class;