use of org.apache.struts.action.ActionForm in project sonarqube by SonarSource.
the class TestRequestUtils method testCreateActionForm1b.
// Second module -- No ActionForm should be created
public void testCreateActionForm1b() {
request.setPathElements("/myapp", "/2/noform.do", null, null);
ActionMapping mapping = (ActionMapping) moduleConfig2.findActionConfig("/noform");
assertNotNull("Found /noform mapping", mapping);
ActionForm form = RequestUtils.createActionForm(request, mapping, moduleConfig2, null);
assertNull("No ActionForm returned", form);
}
use of org.apache.struts.action.ActionForm in project sonarqube by SonarSource.
the class TestRequestUtils method testCreateActionForm3b.
// Second module -- Dynamic ActionForm should be created
public void testCreateActionForm3b() {
request.setPathElements("/myapp", "/2/dynamic2.do", null, null);
ActionMapping mapping = (ActionMapping) moduleConfig2.findActionConfig("/dynamic2");
assertNotNull("Found /dynamic2 mapping", mapping);
assertNotNull("Mapping has non-null name", mapping.getName());
assertEquals("Mapping has correct name", "dynamic2", mapping.getName());
assertNotNull("AppConfig has form bean " + mapping.getName(), moduleConfig2.findFormBeanConfig(mapping.getName()));
ActionForm form = RequestUtils.createActionForm(request, mapping, moduleConfig2, null);
assertNotNull("ActionForm returned", form);
assertTrue("ActionForm of correct type", form instanceof DynaActionForm);
}
use of org.apache.struts.action.ActionForm in project sonarqube by SonarSource.
the class TestRequestUtils method testCreateActionForm2b.
// Second module -- Standard ActionForm should be created
public void testCreateActionForm2b() {
request.setPathElements("/myapp", "/2/static.do", null, null);
ActionMapping mapping = (ActionMapping) moduleConfig2.findActionConfig("/static");
assertNotNull("Found /static mapping", mapping);
assertNotNull("Mapping has non-null name", mapping.getName());
assertEquals("Mapping has correct name", "static", mapping.getName());
assertNotNull("AppConfig has form bean " + mapping.getName(), moduleConfig.findFormBeanConfig(mapping.getName()));
ActionForm form = RequestUtils.createActionForm(request, mapping, moduleConfig2, null);
assertNotNull("ActionForm returned", form);
assertTrue("ActionForm of correct type", form instanceof MockFormBean);
}
use of org.apache.struts.action.ActionForm in project sonarqube by SonarSource.
the class TestRequestUtils method testCreateActionForm3a.
// Default module -- Dynamic ActionForm should be created
public void testCreateActionForm3a() {
request.setPathElements("/myapp", "/dynamic.do", null, null);
ActionMapping mapping = (ActionMapping) moduleConfig.findActionConfig("/dynamic");
assertNotNull("Found /dynamic mapping", mapping);
assertNotNull("Mapping has non-null name", mapping.getName());
assertEquals("Mapping has correct name", "dynamic", mapping.getName());
assertNotNull("AppConfig has form bean " + mapping.getName(), moduleConfig.findFormBeanConfig(mapping.getName()));
ActionForm form = RequestUtils.createActionForm(request, mapping, moduleConfig, null);
assertNotNull("ActionForm returned", form);
assertTrue("ActionForm of correct type", form instanceof DynaActionForm);
}
use of org.apache.struts.action.ActionForm in project sonarqube by SonarSource.
the class TestRequestUtils method testCreateActionForm2a.
// Default module -- Standard ActionForm should be created
public void testCreateActionForm2a() {
request.setPathElements("/myapp", "/static.do", null, null);
ActionMapping mapping = (ActionMapping) moduleConfig.findActionConfig("/static");
assertNotNull("Found /static mapping", mapping);
assertNotNull("Mapping has non-null name", mapping.getName());
assertEquals("Mapping has correct name", "static", mapping.getName());
assertNotNull("AppConfig has form bean " + mapping.getName(), moduleConfig.findFormBeanConfig(mapping.getName()));
ActionForm form = RequestUtils.createActionForm(request, mapping, moduleConfig, null);
assertNotNull("ActionForm returned", form);
assertTrue("ActionForm of correct type", form instanceof MockFormBean);
}
Aggregations