() {{
@@ -425,7 +448,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
assertTrue("Modified Dispatcher devMode state not true ?", du2.isDevMode());
}
- public void testGetLocale_With_DefaultLocale_FromConfiguration() throws Exception {
+ public void testGetLocale_With_DefaultLocale_FromConfiguration() {
// Given
Mock mock = new Mock(HttpServletRequest.class);
MockHttpSession mockHttpSession = new MockHttpSession();
@@ -451,7 +474,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
mock.verify();
}
- public void testGetLocale_With_DefaultLocale_fr_CA() throws Exception {
+ public void testGetLocale_With_DefaultLocale_fr_CA() {
// Given
Mock mock = new Mock(HttpServletRequest.class);
MockHttpSession mockHttpSession = new MockHttpSession();
@@ -477,7 +500,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
mock.verify();
}
- public void testGetLocale_With_BadDefaultLocale_RequestLocale_en_UK() throws Exception {
+ public void testGetLocale_With_BadDefaultLocale_RequestLocale_en_UK() {
// Given
Mock mock = new Mock(HttpServletRequest.class);
MockHttpSession mockHttpSession = new MockHttpSession();
@@ -505,7 +528,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
mock.verify();
}
- public void testGetLocale_With_BadDefaultLocale_And_RuntimeException() throws Exception {
+ public void testGetLocale_With_BadDefaultLocale_And_RuntimeException() {
// Given
Mock mock = new Mock(HttpServletRequest.class);
MockHttpSession mockHttpSession = new MockHttpSession();
@@ -533,7 +556,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
mock.verify();
}
- public void testGetLocale_With_NullDefaultLocale() throws Exception {
+ public void testGetLocale_With_NullDefaultLocale() {
// Given
Mock mock = new Mock(HttpServletRequest.class);
MockHttpSession mockHttpSession = new MockHttpSession();
@@ -563,7 +586,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
mock.verify();
}
- public void testGetLocale_With_NullDefaultLocale_And_RuntimeException() throws Exception {
+ public void testGetLocale_With_NullDefaultLocale_And_RuntimeException() {
// Given
Mock mock = new Mock(HttpServletRequest.class);
MockHttpSession mockHttpSession = new MockHttpSession();
@@ -595,19 +618,14 @@ public class DispatcherTest extends StrutsInternalTestCase {
/**
* Create a test context Map from a Dispatcher instance.
- *
+ *
* The method directly calls getParameterMap() and getSession(true) on the HttpServletRequest.
- *
+ *
* The method indirectly calls getLocale(request) on the Dispatcher instance, allowing a test of that code path.
* The derived Struts Dispatcher Locale can be retrieved from the Map afterwards.
- *
- * @param dispatcher
- * @param request
- * @param response
- * @return
*/
protected static Map createTestContextMap(Dispatcher dispatcher,
- HttpServletRequest request, HttpServletResponse response) {
+ HttpServletRequest request, HttpServletResponse response) {
if (dispatcher == null) {
throw new IllegalArgumentException("Cannot create a test ContextMap from a null Dispatcher");
}
@@ -619,31 +637,31 @@ public class DispatcherTest extends StrutsInternalTestCase {
}
return dispatcher.createContextMap(new RequestMap(request),
- HttpParameters.create(request.getParameterMap()).build(),
- new SessionMap(request),
- new ApplicationMap(request.getSession(true).getServletContext()),
- request,
- response);
+ HttpParameters.create(request.getParameterMap()).build(),
+ new SessionMap(request),
+ new ApplicationMap(request.getSession(true).getServletContext()),
+ request,
+ response);
}
- class InternalConfigurationManager extends ConfigurationManager {
- public boolean destroyConfiguration = false;
+ static class InternalConfigurationManager extends ConfigurationManager {
+ public boolean destroyConfiguration = false;
public InternalConfigurationManager(String name) {
super(name);
}
@Override
- public synchronized void destroyConfiguration() {
- super.destroyConfiguration();
- destroyConfiguration = true;
- }
+ public synchronized void destroyConfiguration() {
+ super.destroyConfiguration();
+ destroyConfiguration = true;
+ }
}
- class DispatcherListenerState {
- public boolean isInitialized = false;
- public boolean isDestroyed = false;
+ static class DispatcherListenerState {
+ public boolean isInitialized = false;
+ public boolean isDestroyed = false;
}
public static class InnerDestroyableObjectFactory extends ObjectFactory implements ObjectFactoryDestroyable {