Browse Source

Clean up spring-webmvc-portlet tests warnings

Clean up compiler warnings in the tests of spring-webmvc-portlet. This
commit adds type parameters to all the types (mostly `List` and `Map`).

After this commit the only warnings in spring-web left are the
subclasses of `MyCommandProvidingFormController`.
pull/520/merge
Philippe Marschall 11 years ago committed by Stephane Nicoll
parent
commit
5ae1c8a242
  1. 6
      spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java
  2. 18
      spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java
  3. 6
      spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java
  4. 17
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java
  5. 46
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java
  6. 6
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java
  7. 14
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java
  8. 11
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java
  9. 12
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java
  10. 7
      spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java

6
spring-webmvc-portlet/src/test/java/org/springframework/context/BeanThatListens.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,7 +24,7 @@ import java.util.Map; @@ -24,7 +24,7 @@ import java.util.Map;
* @author Thomas Risberg
* @author Juergen Hoeller
*/
public class BeanThatListens implements ApplicationListener {
public class BeanThatListens implements ApplicationListener<ApplicationEvent> {
private BeanThatBroadcasts beanThatBroadcasts;
@ -36,7 +36,7 @@ public class BeanThatListens implements ApplicationListener { @@ -36,7 +36,7 @@ public class BeanThatListens implements ApplicationListener {
public BeanThatListens(BeanThatBroadcasts beanThatBroadcasts) {
this.beanThatBroadcasts = beanThatBroadcasts;
Map beans = beanThatBroadcasts.applicationContext.getBeansOfType(BeanThatListens.class);
Map<String, BeanThatListens> beans = beanThatBroadcasts.applicationContext.getBeansOfType(BeanThatListens.class);
if (!beans.isEmpty()) {
throw new IllegalStateException("Shouldn't have found any BeanThatListens instances");
}

18
spring-webmvc-portlet/src/test/java/org/springframework/context/TestListener.java

@ -1,3 +1,19 @@ @@ -1,3 +1,19 @@
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context;
import org.springframework.context.ApplicationEvent;
@ -9,7 +25,7 @@ import org.springframework.context.ApplicationListener; @@ -9,7 +25,7 @@ import org.springframework.context.ApplicationListener;
* @author Rod Johnson
* @since January 21, 2001
*/
public class TestListener implements ApplicationListener {
public class TestListener implements ApplicationListener<ApplicationEvent> {
private int eventCount;

6
spring-webmvc-portlet/src/test/java/org/springframework/mock/web/portlet/MockPortletRequest.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -271,8 +271,8 @@ public class MockPortletRequest implements PortletRequest { @@ -271,8 +271,8 @@ public class MockPortletRequest implements PortletRequest {
@Override
public String getProperty(String key) {
Assert.notNull(key, "Property key must not be null");
List list = this.properties.get(key);
return (list != null && list.size() > 0 ? (String) list.get(0) : null);
List<String> list = this.properties.get(key);
return (list != null && list.size() > 0 ? list.get(0) : null);
}
@Override

17
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -39,6 +39,7 @@ import javax.portlet.ResourceResponse; @@ -39,6 +39,7 @@ import javax.portlet.ResourceResponse;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.config.BeanReference;
import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.ManagedList;
@ -118,14 +119,14 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo @@ -118,14 +119,14 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo
ParameterMappingInterceptor parameterMappingInterceptor = new ParameterMappingInterceptor();
parameterMappingInterceptor.setParameterName("interceptingParam");
List interceptors = new ArrayList();
List<HandlerInterceptor> interceptors = new ArrayList<HandlerInterceptor>(4);
interceptors.add(parameterMappingInterceptor);
interceptors.add(userRoleInterceptor);
interceptors.add(new MyHandlerInterceptor1());
interceptors.add(new MyHandlerInterceptor2());
MutablePropertyValues pvs = new MutablePropertyValues();
Map portletModeMap = new ManagedMap();
Map<String, BeanReference> portletModeMap = new ManagedMap<String, BeanReference>();
portletModeMap.put("view", new RuntimeBeanReference("viewController"));
portletModeMap.put("edit", new RuntimeBeanReference("editController"));
pvs.add("portletModeMap", portletModeMap);
@ -133,7 +134,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo @@ -133,7 +134,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo
registerSingleton("handlerMapping3", PortletModeHandlerMapping.class, pvs);
pvs = new MutablePropertyValues();
Map parameterMap = new ManagedMap();
Map<String, BeanReference> parameterMap = new ManagedMap<String, BeanReference>();
parameterMap.put("test1", new RuntimeBeanReference("testController1"));
parameterMap.put("test2", new RuntimeBeanReference("testController2"));
parameterMap.put("requestLocaleChecker", new RuntimeBeanReference("requestLocaleCheckingController"));
@ -148,10 +149,10 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo @@ -148,10 +149,10 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo
registerSingleton("handlerMapping2", ParameterHandlerMapping.class, pvs);
pvs = new MutablePropertyValues();
Map innerMap = new ManagedMap();
Map<String, Object> innerMap = new ManagedMap<String, Object>();
innerMap.put("help1", new RuntimeBeanReference("helpController1"));
innerMap.put("help2", new RuntimeBeanReference("helpController2"));
Map outerMap = new ManagedMap();
Map<String, Object> outerMap = new ManagedMap<String, Object>();
outerMap.put("help", innerMap);
pvs.add("portletModeParameterMap", outerMap);
pvs.add("order", "1");
@ -171,7 +172,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo @@ -171,7 +172,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo
pvs.add("exceptionMappings",
"java.lang.Exception=failed-exception\n" +
"java.lang.RuntimeException=failed-runtime");
List mappedHandlers = new ManagedList();
List<BeanReference> mappedHandlers = new ManagedList<BeanReference>();
mappedHandlers.add(new RuntimeBeanReference("exceptionThrowingHandler1"));
pvs.add("mappedHandlers", mappedHandlers);
pvs.add("defaultErrorView", "failed-default-0");
@ -533,7 +534,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo @@ -533,7 +534,7 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo
}
public static class TestApplicationListener implements ApplicationListener {
public static class TestApplicationListener implements ApplicationListener<ApplicationEvent> {
public int counter = 0;

46
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/DispatcherPortletTests.java

@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.portlet;
@ -125,7 +125,7 @@ public class DispatcherPortletTests extends TestCase { @@ -125,7 +125,7 @@ public class DispatcherPortletTests extends TestCase {
request.setPortletMode(PortletMode.HELP);
request.setParameter("action", "help3");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
assertTrue(model.get("exception").getClass().equals(NoHandlerFoundException.class));
InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE);
assertEquals("failed-unavailable", view.getBeanName());
@ -164,7 +164,7 @@ public class DispatcherPortletTests extends TestCase { @@ -164,7 +164,7 @@ public class DispatcherPortletTests extends TestCase {
request.setParameter("action", "not mapped");
request.setParameter("myParam", "not mapped");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
assertEquals("view was here", model.get("result"));
InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE);
assertEquals("someViewName", view.getBeanName());
@ -178,7 +178,7 @@ public class DispatcherPortletTests extends TestCase { @@ -178,7 +178,7 @@ public class DispatcherPortletTests extends TestCase {
request.setParameter("action", "not mapped");
request.setParameter("myParam", "not mapped");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Exception exception = (Exception) model.get("exception");
assertNotNull(exception);
assertTrue(exception.getClass().equals(PortletSecurityException.class));
@ -222,7 +222,7 @@ public class DispatcherPortletTests extends TestCase { @@ -222,7 +222,7 @@ public class DispatcherPortletTests extends TestCase {
MockRenderResponse response = new MockRenderResponse();
request.setParameter("myParam", "unknown");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Exception exception = (Exception)model.get("exception");
assertTrue(exception.getClass().equals(PortletException.class));
assertTrue(exception.getMessage().indexOf("No adapter for handler") != -1);
@ -255,7 +255,7 @@ public class DispatcherPortletTests extends TestCase { @@ -255,7 +255,7 @@ public class DispatcherPortletTests extends TestCase {
MockRenderResponse response = new MockRenderResponse();
request.setParameter("myParam", "test1");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Exception exception = (Exception) model.get("exception");
assertTrue(exception.getClass().equals(NoHandlerFoundException.class));
InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE);
@ -333,7 +333,7 @@ public class DispatcherPortletTests extends TestCase { @@ -333,7 +333,7 @@ public class DispatcherPortletTests extends TestCase {
request.setParameter("myParam", "requestLocaleChecker");
request.addPreferredLocale(Locale.ENGLISH);
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Exception exception = (Exception) model.get("exception");
assertTrue(exception.getClass().equals(PortletException.class));
assertEquals("Incorrect Locale in RenderRequest", exception.getMessage());
@ -356,7 +356,7 @@ public class DispatcherPortletTests extends TestCase { @@ -356,7 +356,7 @@ public class DispatcherPortletTests extends TestCase {
request.setParameter("myParam", "contextLocaleChecker");
request.addPreferredLocale(Locale.ENGLISH);
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Exception exception = (Exception) model.get("exception");
assertTrue(exception.getClass().equals(PortletException.class));
assertEquals("Incorrect Locale in LocaleContextHolder", exception.getMessage());
@ -401,7 +401,7 @@ public class DispatcherPortletTests extends TestCase { @@ -401,7 +401,7 @@ public class DispatcherPortletTests extends TestCase {
request.addUserRole("role1");
request.addParameter("noView", "false");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
assertEquals("view was here", model.get("result"));
InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE);
assertEquals("someViewName", view.getBeanName());
@ -414,7 +414,7 @@ public class DispatcherPortletTests extends TestCase { @@ -414,7 +414,7 @@ public class DispatcherPortletTests extends TestCase {
request.addUserRole("role1");
request.addParameter("noView", "true");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Map<?, ?> model = (Map<?, ?>) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
assertNull(model);
InternalResourceView view = (InternalResourceView) request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE);
assertNull(view);

6
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestDataBinderTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -166,7 +166,7 @@ public class PortletRequestDataBinderTests extends TestCase { @@ -166,7 +166,7 @@ public class PortletRequestDataBinderTests extends TestCase {
public void testBindingSet() {
TestBean bean = new TestBean();
Set set = new LinkedHashSet<>(2);
Set<TestBean> set = new LinkedHashSet<TestBean>(2);
set.add(new TestBean("test1"));
set.add(new TestBean("test2"));
bean.setSomeSet(set);
@ -181,7 +181,7 @@ public class PortletRequestDataBinderTests extends TestCase { @@ -181,7 +181,7 @@ public class PortletRequestDataBinderTests extends TestCase {
assertNotNull(bean.getSomeSet());
assertEquals(2, bean.getSomeSet().size());
Iterator iter = bean.getSomeSet().iterator();
Iterator<?> iter = bean.getSomeSet().iterator();
TestBean bean1 = (TestBean) iter.next();
assertEquals("test1", bean1.getName());

14
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/context/PortletWebRequestTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -56,13 +56,13 @@ public class PortletWebRequestTests { @@ -56,13 +56,13 @@ public class PortletWebRequestTests {
assertEquals("value2", request.getParameterValues("param2")[0]);
assertEquals("value2a", request.getParameterValues("param2")[1]);
Map paramMap = request.getParameterMap();
Map<String, String[]> paramMap = request.getParameterMap();
assertEquals(2, paramMap.size());
assertEquals(1, ((String[]) paramMap.get("param1")).length);
assertEquals("value1", ((String[]) paramMap.get("param1"))[0]);
assertEquals(2, ((String[]) paramMap.get("param2")).length);
assertEquals("value2", ((String[]) paramMap.get("param2"))[0]);
assertEquals("value2a", ((String[]) paramMap.get("param2"))[1]);
assertEquals(1, paramMap.get("param1").length);
assertEquals("value1", paramMap.get("param1")[0]);
assertEquals(2, paramMap.get("param2").length);
assertEquals("value2", paramMap.get("param2")[0]);
assertEquals("value2a", paramMap.get("param2")[1]);
}
@Test

11
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/Portlet20AnnotationControllerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,6 +23,7 @@ import java.util.Date; @@ -23,6 +23,7 @@ import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.EventResponse;
@ -173,7 +174,7 @@ public class Portlet20AnnotationControllerTests { @@ -173,7 +174,7 @@ public class Portlet20AnnotationControllerTests {
doTestAdaptedHandleMethods(MyAdaptedController4.class);
}
private void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception {
private void doTestAdaptedHandleMethods(final Class<?> controllerClass) throws Exception {
DispatcherPortlet portlet = new DispatcherPortlet() {
@Override
protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
@ -1233,7 +1234,7 @@ public class Portlet20AnnotationControllerTests { @@ -1233,7 +1234,7 @@ public class Portlet20AnnotationControllerTests {
private static class TestView {
public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception {
public void render(String viewName, Map<String, Object> model, PortletRequest request, MimeResponse response) throws Exception {
TestBean tb = (TestBean) model.get("testBean");
if (tb == null) {
tb = (TestBean) model.get("myCommand");
@ -1248,9 +1249,9 @@ public class Portlet20AnnotationControllerTests { @@ -1248,9 +1249,9 @@ public class Portlet20AnnotationControllerTests {
if (errors.hasFieldErrors("date")) {
throw new IllegalStateException();
}
List<TestBean> testBeans = (List<TestBean>) model.get("testBeanList");
List<?> testBeans = (List<?>) model.get("testBeanList");
response.getWriter().write(viewName + "-" + tb.getName() + "-" + errors.getFieldError("age").getCode() +
"-" + testBeans.get(0).getName() + "-" + model.get("myKey"));
"-" + ((TestBean) testBeans.get(0)).getName() + "-" + model.get("myKey"));
}
}

12
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/mvc/annotation/PortletAnnotationControllerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -114,7 +114,7 @@ public class PortletAnnotationControllerTests extends TestCase { @@ -114,7 +114,7 @@ public class PortletAnnotationControllerTests extends TestCase {
doTestAdaptedHandleMethods(MyAdaptedController3.class);
}
public void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception {
public void doTestAdaptedHandleMethods(final Class<?> controllerClass) throws Exception {
DispatcherPortlet portlet = new DispatcherPortlet() {
@Override
protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
@ -796,7 +796,7 @@ public class PortletAnnotationControllerTests extends TestCase { @@ -796,7 +796,7 @@ public class PortletAnnotationControllerTests extends TestCase {
private static class TestView {
public void render(String viewName, Map model, PortletRequest request, MimeResponse response) throws Exception {
public void render(String viewName, Map<String, Object> model, PortletRequest request, MimeResponse response) throws Exception {
TestBean tb = (TestBean) model.get("testBean");
if (tb == null) {
tb = (TestBean) model.get("myCommand");
@ -811,9 +811,9 @@ public class PortletAnnotationControllerTests extends TestCase { @@ -811,9 +811,9 @@ public class PortletAnnotationControllerTests extends TestCase {
if (errors.hasFieldErrors("date")) {
throw new IllegalStateException();
}
List<TestBean> testBeans = (List<TestBean>) model.get("testBeanList");
List<?> testBeans = (List<?>) model.get("testBeanList");
response.getWriter().write(viewName + "-" + tb.getName() + "-" + errors.getFieldError("age").getCode() +
"-" + testBeans.get(0).getName() + "-" + model.get("myKey"));
"-" + ((TestBean) testBeans.get(0)).getName() + "-" + model.get("myKey"));
}
}
@ -830,7 +830,7 @@ public class PortletAnnotationControllerTests extends TestCase { @@ -830,7 +830,7 @@ public class PortletAnnotationControllerTests extends TestCase {
@Override
public org.springframework.web.servlet.ModelAndView resolveModelAndView(Method handlerMethod,
Class handlerType,
Class<?> handlerType,
Object returnValue,
ExtendedModelMap implicitModel,
NativeWebRequest webRequest) {

7
spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/util/PortletUtilsTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -245,8 +245,7 @@ public final class PortletUtilsTests { @@ -245,8 +245,7 @@ public final class PortletUtilsTests {
public void testClearAllRenderParametersDoesNotPropagateExceptionIfRedirectAlreadySentAtTimeOfCall() throws Exception {
MockActionResponse response = new MockActionResponse() {
@Override
@SuppressWarnings("unchecked")
public void setRenderParameters(Map parameters) {
public void setRenderParameters(Map<String, String[]> parameters) {
throw new IllegalStateException();
}
};
@ -302,7 +301,6 @@ public final class PortletUtilsTests { @@ -302,7 +301,6 @@ public final class PortletUtilsTests {
PortletUtils.exposeRequestAttributes(new MockPortletRequest(), null);
}
@SuppressWarnings("unchecked")
@Test
public void testExposeRequestAttributesSunnyDay() throws Exception {
MockPortletRequest request = new MockPortletRequest();
@ -314,7 +312,6 @@ public final class PortletUtilsTests { @@ -314,7 +312,6 @@ public final class PortletUtilsTests {
assertEquals("Roy Fokker", request.getAttribute("mentor"));
}
@SuppressWarnings("unchecked")
@Test
public void testExposeRequestAttributesWithEmptyAttributesMapIsAnIdempotentOperation() throws Exception {
MockPortletRequest request = new MockPortletRequest();

Loading…
Cancel
Save