use of org.apache.struts.config.FormBeanConfig in project sonarqube by SonarSource.
the class ModuleConfigImpl method freeze.
/**
* <p> Freeze the configuration of this module. After this method
* returns, any attempt to modify the configuration will return an
* IllegalStateException. </p>
*/
public void freeze() {
super.freeze();
ActionConfig[] aconfigs = findActionConfigs();
for (int i = 0; i < aconfigs.length; i++) {
aconfigs[i].freeze();
}
matcher = new ActionConfigMatcher(aconfigs);
getControllerConfig().freeze();
ExceptionConfig[] econfigs = findExceptionConfigs();
for (int i = 0; i < econfigs.length; i++) {
econfigs[i].freeze();
}
FormBeanConfig[] fbconfigs = findFormBeanConfigs();
for (int i = 0; i < fbconfigs.length; i++) {
fbconfigs[i].freeze();
}
ForwardConfig[] fconfigs = findForwardConfigs();
for (int i = 0; i < fconfigs.length; i++) {
fconfigs[i].freeze();
}
MessageResourcesConfig[] mrconfigs = findMessageResourcesConfigs();
for (int i = 0; i < mrconfigs.length; i++) {
mrconfigs[i].freeze();
}
PlugInConfig[] piconfigs = findPlugInConfigs();
for (int i = 0; i < piconfigs.length; i++) {
piconfigs[i].freeze();
}
}
use of org.apache.struts.config.FormBeanConfig in project sonarqube by SonarSource.
the class TestDynaActionFormClass method setUp.
// ----------------------------------------------------- Setup and Teardown
public void setUp() {
// Construct a FormBeanConfig to be used
beanConfig = new FormBeanConfig();
beanConfig.setName("dynaForm");
beanConfig.setType("org.apache.struts.action.DynaActionForm");
// Add relevant property definitions
for (int i = 0; i < dynaProperties.length; i++) {
beanConfig.addFormPropertyConfig(dynaProperties[i]);
}
// Construct a corresponding DynaActionFormClass
dynaClass = new DynaActionFormClass(beanConfig);
}
use of org.apache.struts.config.FormBeanConfig in project sonarqube by SonarSource.
the class TestActionServlet method testProcessFormBeanConfigClassSubFormCustomClass.
/**
* Make sure processFormBeanConfigClass() returns the same class instance
* if the base config isn't using a custom class.
*/
public void testProcessFormBeanConfigClassSubFormCustomClass() throws Exception {
moduleConfig.addFormBeanConfig(baseFormBean);
FormBeanConfig customSub = new FormBeanConfig();
customSub.setName("customSub");
customSub.setExtends("baseForm");
moduleConfig.addFormBeanConfig(customSub);
FormBeanConfig result = actionServlet.processFormBeanConfigClass(customSub, moduleConfig);
assertSame("The instance returned should be the param given it.", customSub, result);
}
Aggregations