From 51b307681a8ee7d89180f58f967856b9c4bf9232 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 4 Jan 2013 11:04:54 +0100 Subject: [PATCH 1/6] Fix warnings due to unused import statements Issue: SPR-9431 --- .../CustomizableTraceInterceptorTests.java | 4 +--- .../SimpleTraceInterceptorTests.java | 4 +--- .../support/BeanFactoryGenericsTests.java | 2 -- .../beans/support/PagedListHolderTests.java | 2 -- .../beans/CollectingReaderEventListener.java | 3 +-- ...SimpleRemoteSlsbInvokerInterceptorTests.java | 3 +-- .../jdbc/core/AbstractRowMapperTests.java | 3 +-- .../core/simple/TableMetaDataContextTests.java | 17 ++++++++++++++++- .../portlet/bind/PortletRequestUtilsTests.java | 4 +--- .../support/ServletContextSupportTests.java | 1 - 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java index 77aad8e9ff1..0c1c50c9c52 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -24,8 +24,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import java.lang.reflect.Method; - import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.logging.Log; import org.junit.Test; diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java index 6efc651d272..96501f2c14f 100644 --- a/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -24,8 +24,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import java.lang.reflect.Method; - import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.logging.Log; import org.junit.Test; diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java index cab03e38239..2480f64fac2 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java @@ -47,8 +47,6 @@ import org.springframework.core.io.UrlResource; import org.springframework.tests.Assume; import org.springframework.tests.TestGroup; -import org.springframework.tests.Assume; -import org.springframework.tests.TestGroup; import org.springframework.tests.sample.beans.GenericBean; import org.springframework.tests.sample.beans.GenericIntegerBean; import org.springframework.tests.sample.beans.GenericSetOfIntegerBean; diff --git a/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java b/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java index 9e5bd8911a5..7e7694767c6 100644 --- a/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java @@ -24,8 +24,6 @@ import org.junit.Test; import org.springframework.tests.Assume; import org.springframework.tests.TestGroup; -import org.springframework.tests.Assume; -import org.springframework.tests.TestGroup; import org.springframework.tests.sample.beans.TestBean; import static org.junit.Assert.*; diff --git a/spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java b/spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java index 8779f9ed5ed..b581a05f032 100644 --- a/spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java +++ b/spring-beans/src/test/java/org/springframework/tests/beans/CollectingReaderEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -29,7 +29,6 @@ import org.springframework.beans.factory.parsing.ComponentDefinition; import org.springframework.beans.factory.parsing.DefaultsDefinition; import org.springframework.beans.factory.parsing.ImportDefinition; import org.springframework.beans.factory.parsing.ReaderEventListener; -import org.springframework.core.CollectionFactory; /** * @author Rob Harrop diff --git a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java index c0fa18c2c33..0c03c57c69d 100644 --- a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -18,7 +18,6 @@ package org.springframework.ejb.access; import static org.junit.Assert.*; import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java index aeffd6f6bb7..98016c61134 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -26,7 +26,6 @@ import java.math.BigDecimal; import java.sql.Connection; import java.sql.ResultSet; import java.sql.ResultSetMetaData; -import java.sql.SQLException; import java.sql.Statement; import java.sql.Timestamp; diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java index a6d22145b91..34572961a80 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + package org.springframework.jdbc.core.simple; import static org.junit.Assert.*; @@ -9,7 +25,6 @@ import static org.mockito.Mockito.verify; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; -import java.sql.SQLException; import java.sql.Types; import java.util.ArrayList; import java.util.Date; diff --git a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java index 8092d835b32..9c3e7b045de 100644 --- a/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java +++ b/spring-webmvc-portlet/src/test/java/org/springframework/web/portlet/bind/PortletRequestUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -16,8 +16,6 @@ package org.springframework.web.portlet.bind; -import junit.framework.TestCase; - import org.junit.Test; import org.springframework.tests.Assume; import org.springframework.tests.TestGroup; diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java b/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java index 07823327e66..77bc44cca56 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/context/support/ServletContextSupportTests.java @@ -41,7 +41,6 @@ import org.springframework.beans.factory.support.ManagedList; import org.springframework.beans.factory.support.ManagedMap; import org.springframework.beans.factory.support.ManagedSet; import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.io.Resource; import org.springframework.mock.web.test.MockServletContext; From 15e9fe638c631c8c75d3499a083c103ddef594a8 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 4 Jan 2013 11:38:58 +0100 Subject: [PATCH 2/6] Remove duplicate test resources The files deleted in this commit existed in identical form in two places within a given module; typically in src/test/java and src/test/resources. The version within src/test/resources has been favored in all cases. This change was prompted by associated Eclipse warnings, which have now been quelled. Issue: SPR-9431 --- .../jdbc/support/custom-error-codes.xml | 24 ------------ .../jdbc/support/test-error-codes.xml | 14 ------- .../jdbc/support/wildcard-error-codes.xml | 38 ------------------- .../orm/hibernate3/filterDefinitions.xml | 30 --------------- .../orm/hibernate3/typeDefinitions.xml | 32 ---------------- .../springframework/orm/jdo/test.properties | 1 - .../web/context/WEB-INF/empty-servlet.xml | 12 ------ .../web/context/WEB-INF/sessionContext.xml | 16 -------- .../web/servlet/complexviews.properties | 3 -- 9 files changed, 170 deletions(-) delete mode 100644 spring-jdbc/src/test/java/org/springframework/jdbc/support/custom-error-codes.xml delete mode 100644 spring-jdbc/src/test/java/org/springframework/jdbc/support/test-error-codes.xml delete mode 100644 spring-jdbc/src/test/java/org/springframework/jdbc/support/wildcard-error-codes.xml delete mode 100644 spring-orm/src/test/java/org/springframework/orm/hibernate3/filterDefinitions.xml delete mode 100644 spring-orm/src/test/java/org/springframework/orm/hibernate3/typeDefinitions.xml delete mode 100644 spring-orm/src/test/java/org/springframework/orm/jdo/test.properties delete mode 100644 spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/empty-servlet.xml delete mode 100644 spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml delete mode 100644 spring-webmvc/src/test/java/org/springframework/web/servlet/complexviews.properties diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/custom-error-codes.xml b/spring-jdbc/src/test/java/org/springframework/jdbc/support/custom-error-codes.xml deleted file mode 100644 index a2aa1898320..00000000000 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/custom-error-codes.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - 1,2 - 1,1400,1722 - - - - 999 - - org.springframework.jdbc.support.CustomErrorCodeException - - - - - - - diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/test-error-codes.xml b/spring-jdbc/src/test/java/org/springframework/jdbc/support/test-error-codes.xml deleted file mode 100644 index dd3fc33004b..00000000000 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/test-error-codes.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - 1,2 - 1,1400,1722 - - - diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/wildcard-error-codes.xml b/spring-jdbc/src/test/java/org/springframework/jdbc/support/wildcard-error-codes.xml deleted file mode 100644 index b44c0a9c1b8..00000000000 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/wildcard-error-codes.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - 1,2,942 - 1,1400,1722 - - - - *DB0 - -204,1,2 - 3,4 - - - - DB1* - -204,1,2 - 3,4 - - - - *DB2* - -204,1,2 - 3,4 - - - - *DB3* - -204,1,2 - 3,4 - - - diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/filterDefinitions.xml b/spring-orm/src/test/java/org/springframework/orm/hibernate3/filterDefinitions.xml deleted file mode 100644 index 96b19990ac4..00000000000 --- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/filterDefinitions.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - string - long - - - - - - - - integer - - - - - - - - diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/typeDefinitions.xml b/spring-orm/src/test/java/org/springframework/orm/hibernate3/typeDefinitions.xml deleted file mode 100644 index bd12f319b7f..00000000000 --- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/typeDefinitions.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - value1 - othervalue - - - - - - - - - myvalue - - - - - - - - diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/test.properties b/spring-orm/src/test/java/org/springframework/orm/jdo/test.properties deleted file mode 100644 index cd4acea9278..00000000000 --- a/spring-orm/src/test/java/org/springframework/orm/jdo/test.properties +++ /dev/null @@ -1 +0,0 @@ -myKey=myValue diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/empty-servlet.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/empty-servlet.xml deleted file mode 100644 index b49584e11dd..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/empty-servlet.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml b/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml deleted file mode 100644 index eb7bf0f6eae..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/context/WEB-INF/sessionContext.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/complexviews.properties b/spring-webmvc/src/test/java/org/springframework/web/servlet/complexviews.properties deleted file mode 100644 index 6917be21627..00000000000 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/complexviews.properties +++ /dev/null @@ -1,3 +0,0 @@ -form.(class)=org.springframework.web.servlet.view.InternalResourceView -form.requestContextAttribute=rc -form.url=myform.jsp From 662a02b952126c726fe0db16179a6b4595cc08b9 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 4 Jan 2013 11:41:49 +0100 Subject: [PATCH 3/6] Fix several miscellaneous compiler/Eclipse warnings - Suppress an (intentional) AspectJ warning - Remove unused imports - Suppress a [hiding] warning - Fix a generics warning related to extension of final types Issue: SPR-9431 --- .../aop/aspectj/autoproxy/CodeStyleAspect.aj | 5 ++++- .../AnnotationProcessorPerformanceTests.java | 1 - .../BeanMethodPolymorphismTests.java | 18 +++++++++++++++++- .../ScheduledExecutorFactoryBeanTests.java | 1 - .../core/BridgeMethodResolverTests.java | 4 ++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj b/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj index 0758d3a403a..77da43176ab 100644 --- a/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj +++ b/spring-aspects/src/test/java/org/springframework/aop/aspectj/autoproxy/CodeStyleAspect.aj @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -16,6 +16,8 @@ package org.springframework.aop.aspectj.autoproxy; +import org.aspectj.lang.annotation.SuppressAjWarnings; + /** * @author Adrian Colyer */ @@ -25,6 +27,7 @@ public aspect CodeStyleAspect { pointcut somePC() : call(* someMethod()); + @SuppressAjWarnings("adviceDidNotMatch") before() : somePC() { System.out.println("match"); } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java index 0a9cfdf655f..578748f4fd2 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/AnnotationProcessorPerformanceTests.java @@ -17,7 +17,6 @@ package org.springframework.context.annotation; import static org.junit.Assert.*; -import static org.junit.Assume.assumeFalse; import javax.annotation.Resource; diff --git a/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java b/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java index 4797aae61be..655324d1c7d 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + package org.springframework.context.annotation; import static org.hamcrest.CoreMatchers.equalTo; @@ -31,7 +47,7 @@ public class BeanMethodPolymorphismTests { @Test public void beanMethodOverloadingWithoutInheritance() { - @SuppressWarnings("unused") + @SuppressWarnings({ "unused", "hiding" }) @Configuration class Config { @Bean String aString() { return "na"; } @Bean String aString(Integer dependency) { return "na"; } diff --git a/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java index 4f5b69735ec..095f930c610 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java @@ -28,7 +28,6 @@ import org.springframework.tests.TestGroup; import static org.junit.Assert.*; import static org.mockito.BDDMockito.*; -import static org.mockito.Mockito.*; /** * @author Rick Evans diff --git a/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java b/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java index b4c32171cfa..c013f3d3db5 100644 --- a/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * 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. @@ -1048,7 +1048,7 @@ public class BridgeMethodResolverTests { } - public class GenericSqlMapIntegerDao extends GenericSqlMapDao { + public class GenericSqlMapIntegerDao extends GenericSqlMapDao { @Override public void saveOrUpdate(T t) { From 42729014b67e8d63e70420f3aa4c058f00b07b45 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 4 Jan 2013 11:56:26 +0100 Subject: [PATCH 4/6] Move namespace tests to root integration module Prior to this change, spring-beans contained its own META-INF containing spring.handlers and spring.schemas files in src/main/resources; it also had files of the same name within src/test/resources/META-INF, causing 'duplicate resource' warnings and confusion in general. This commit moves the com.foo test package, it's associated namespace parsing tests and test versions of META-INF files to the root project and it's src/test integration testing folder. Issue: SPR-9431 --- {spring-beans/src => src}/test/java/com/foo/Component.java | 0 .../test/java/com/foo/ComponentBeanDefinitionParser.java | 0 .../test/java/com/foo/ComponentBeanDefinitionParserTests.java | 2 +- .../src => src}/test/java/com/foo/ComponentFactoryBean.java | 0 .../test/java/com/foo/ComponentNamespaceHandler.java | 0 .../src => src}/test/resources/META-INF/spring.handlers | 0 .../src => src}/test/resources/META-INF/spring.schemas | 0 .../src => src}/test/resources/com/foo/component-config.xml | 0 {spring-beans/src => src}/test/resources/com/foo/component.xsd | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename {spring-beans/src => src}/test/java/com/foo/Component.java (100%) rename {spring-beans/src => src}/test/java/com/foo/ComponentBeanDefinitionParser.java (100%) rename spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java => src/test/java/com/foo/ComponentBeanDefinitionParserTests.java (97%) rename {spring-beans/src => src}/test/java/com/foo/ComponentFactoryBean.java (100%) rename {spring-beans/src => src}/test/java/com/foo/ComponentNamespaceHandler.java (100%) rename {spring-beans/src => src}/test/resources/META-INF/spring.handlers (100%) rename {spring-beans/src => src}/test/resources/META-INF/spring.schemas (100%) rename {spring-beans/src => src}/test/resources/com/foo/component-config.xml (100%) rename {spring-beans/src => src}/test/resources/com/foo/component.xsd (100%) diff --git a/spring-beans/src/test/java/com/foo/Component.java b/src/test/java/com/foo/Component.java similarity index 100% rename from spring-beans/src/test/java/com/foo/Component.java rename to src/test/java/com/foo/Component.java diff --git a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java b/src/test/java/com/foo/ComponentBeanDefinitionParser.java similarity index 100% rename from spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java rename to src/test/java/com/foo/ComponentBeanDefinitionParser.java diff --git a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java b/src/test/java/com/foo/ComponentBeanDefinitionParserTests.java similarity index 97% rename from spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java rename to src/test/java/com/foo/ComponentBeanDefinitionParserTests.java index 97e77c5740f..b28d1d41603 100644 --- a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java +++ b/src/test/java/com/foo/ComponentBeanDefinitionParserTests.java @@ -30,7 +30,7 @@ import org.springframework.core.io.ClassPathResource; /** * @author Costin Leau */ -public class ComponentBeanDefinitionParserTest { +public class ComponentBeanDefinitionParserTests { private static DefaultListableBeanFactory bf; diff --git a/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java b/src/test/java/com/foo/ComponentFactoryBean.java similarity index 100% rename from spring-beans/src/test/java/com/foo/ComponentFactoryBean.java rename to src/test/java/com/foo/ComponentFactoryBean.java diff --git a/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java b/src/test/java/com/foo/ComponentNamespaceHandler.java similarity index 100% rename from spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java rename to src/test/java/com/foo/ComponentNamespaceHandler.java diff --git a/spring-beans/src/test/resources/META-INF/spring.handlers b/src/test/resources/META-INF/spring.handlers similarity index 100% rename from spring-beans/src/test/resources/META-INF/spring.handlers rename to src/test/resources/META-INF/spring.handlers diff --git a/spring-beans/src/test/resources/META-INF/spring.schemas b/src/test/resources/META-INF/spring.schemas similarity index 100% rename from spring-beans/src/test/resources/META-INF/spring.schemas rename to src/test/resources/META-INF/spring.schemas diff --git a/spring-beans/src/test/resources/com/foo/component-config.xml b/src/test/resources/com/foo/component-config.xml similarity index 100% rename from spring-beans/src/test/resources/com/foo/component-config.xml rename to src/test/resources/com/foo/component-config.xml diff --git a/spring-beans/src/test/resources/com/foo/component.xsd b/src/test/resources/com/foo/component.xsd similarity index 100% rename from spring-beans/src/test/resources/com/foo/component.xsd rename to src/test/resources/com/foo/component.xsd From 676231644ddd38d14826dd961b20672f6ea1bda8 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 4 Jan 2013 11:57:22 +0100 Subject: [PATCH 5/6] Update Apache license headers for moved files Issue: SPR-9431 --- src/test/java/com/foo/Component.java | 16 ++++++++++++++++ .../com/foo/ComponentBeanDefinitionParser.java | 16 ++++++++++++++++ .../foo/ComponentBeanDefinitionParserTests.java | 1 + src/test/java/com/foo/ComponentFactoryBean.java | 16 ++++++++++++++++ .../java/com/foo/ComponentNamespaceHandler.java | 16 ++++++++++++++++ 5 files changed, 65 insertions(+) diff --git a/src/test/java/com/foo/Component.java b/src/test/java/com/foo/Component.java index 5c5d61ec81c..759954c41db 100644 --- a/src/test/java/com/foo/Component.java +++ b/src/test/java/com/foo/Component.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.foo; import java.util.ArrayList; diff --git a/src/test/java/com/foo/ComponentBeanDefinitionParser.java b/src/test/java/com/foo/ComponentBeanDefinitionParser.java index 94dd439bfb0..9fb2213c2bb 100644 --- a/src/test/java/com/foo/ComponentBeanDefinitionParser.java +++ b/src/test/java/com/foo/ComponentBeanDefinitionParser.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.foo; import java.util.List; diff --git a/src/test/java/com/foo/ComponentBeanDefinitionParserTests.java b/src/test/java/com/foo/ComponentBeanDefinitionParserTests.java index b28d1d41603..4a036f6c27f 100644 --- a/src/test/java/com/foo/ComponentBeanDefinitionParserTests.java +++ b/src/test/java/com/foo/ComponentBeanDefinitionParserTests.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.foo; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/src/test/java/com/foo/ComponentFactoryBean.java b/src/test/java/com/foo/ComponentFactoryBean.java index ac47c4efea9..2b126d4f4e5 100644 --- a/src/test/java/com/foo/ComponentFactoryBean.java +++ b/src/test/java/com/foo/ComponentFactoryBean.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.foo; import java.util.List; diff --git a/src/test/java/com/foo/ComponentNamespaceHandler.java b/src/test/java/com/foo/ComponentNamespaceHandler.java index b29eeca0614..b1a830c83b7 100644 --- a/src/test/java/com/foo/ComponentNamespaceHandler.java +++ b/src/test/java/com/foo/ComponentNamespaceHandler.java @@ -1,3 +1,19 @@ +/* + * 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. + */ + package com.foo; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; From cf68cc5f0b2650bb1cd34064d7e43747f79285a4 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 4 Jan 2013 12:08:58 +0100 Subject: [PATCH 6/6] Eliminate AJ @Async warning in test case Prior to this commit, ClassWithAsyncAnnotation#return5 forced an unsuppressable warning in Eclipse, making it virtually impossible to get to a zero-warnings state in the codebase. The 'solution' here is simply to comment out the method and it's associated test case. The 'declare warnings' functionality around @Async is well-understood and has long been stable. Also, the entire AnnotationAsyncExecutionAspectTests class has been added to TestGroup#PERFORMANCE (SPR-9984), as opposed to just asyncMethodGetsRoutedAsynchronously as it was previously, the rationale being that all tests are actually timing dependent. Issue: SPR-9431, SPR-9984 --- .../aspectj/AnnotationAsyncExecutionAspectTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java index b95ee6b8078..d82367ddb07 100644 --- a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java +++ b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java @@ -49,14 +49,14 @@ public class AnnotationAsyncExecutionAspectTests { @Before public void setUp() { + Assume.group(TestGroup.PERFORMANCE); + executor = new CountingExecutor(); AnnotationAsyncExecutionAspect.aspectOf().setExecutor(executor); } @Test public void asyncMethodGetsRoutedAsynchronously() { - Assume.group(TestGroup.PERFORMANCE); - ClassWithoutAsyncAnnotation obj = new ClassWithoutAsyncAnnotation(); obj.incrementAsync(); executor.waitForCompletion(); @@ -107,6 +107,7 @@ public class AnnotationAsyncExecutionAspectTests { assertEquals(1, executor.submitCompleteCounter); } + /* @Test public void methodReturningNonVoidNonFutureInAsyncClassGetsRoutedSynchronously() { ClassWithAsyncAnnotation obj = new ClassWithAsyncAnnotation(); @@ -115,6 +116,7 @@ public class AnnotationAsyncExecutionAspectTests { assertEquals(0, executor.submitStartCounter); assertEquals(0, executor.submitCompleteCounter); } + */ @Test public void qualifiedAsyncMethodsAreRoutedToCorrectExecutor() throws InterruptedException, ExecutionException { @@ -198,9 +200,11 @@ public class AnnotationAsyncExecutionAspectTests { // Manually check that there is a warning from the 'declare warning' statement in // AnnotationAsyncExecutionAspect + /* public int return5() { return 5; } + */ public Future incrementReturningAFuture() { counter++;