public void testFormWithCustomOnsubmitEnabledWithValidateEnabled2() throws Exception {
com.opensymphony.xwork2.config.Configuration originalConfiguration = configurationManager.getConfiguration();
ObjectFactory originalObjectFactory = ObjectFactory.getObjectFactory();
final Container cont = container;
try {
// used to determined if the form action needs js validation
configurationManager.setConfiguration(new DefaultConfiguration() {
private DefaultConfiguration self = this;
public Container getContainer() {
return new Container() {
public <T> T inject(Class<T> implementation) {return null;}
public void removeScopeStrategy() {}
public void setScopeStrategy(Strategy scopeStrategy) {}
public <T> T getInstance(Class<T> type, String name) {return null;}
public <T> T getInstance(Class<T> type) {return cont.getInstance(type);}
public Set<String> getInstanceNames(Class<?> type) {return null;}
public void inject(Object o) {
cont.inject(o);
if (o instanceof Form) {
((Form)o).setConfiguration(self);
}
}
};