Merge branch 'SPR-9431' into cleanup-3.2.x

* SPR-9431:
  Eliminate AJ @Async warning in test case
  Update Apache license headers for moved files
  Move namespace tests to root integration module
  Fix several miscellaneous compiler/Eclipse warnings
  Remove duplicate test resources
  Fix warnings due to unused import statements
This commit is contained in:
Chris Beams
2013-01-04 12:22:14 +01:00
36 changed files with 154 additions and 237 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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");
}

View File

@@ -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<Integer> incrementReturningAFuture() {
counter++;

View File

@@ -1,26 +0,0 @@
package com.foo;
import java.util.ArrayList;
import java.util.List;
public class Component {
private String name;
private List<Component> components = new ArrayList<Component>();
// mmm, there is no setter method for the 'components'
public void addComponent(Component component) {
this.components.add(component);
}
public List<Component> getComponents() {
return components;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -1,11 +0,0 @@
package com.foo;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
public class ComponentNamespaceHandler extends NamespaceHandlerSupport {
@Override
public void init() {
registerBeanDefinitionParser("component",
new ComponentBeanDefinitionParser());
}
}

View File

@@ -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;

View File

@@ -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.*;

View File

@@ -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

View File

@@ -17,7 +17,6 @@
package org.springframework.context.annotation;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeFalse;
import javax.annotation.Resource;

View File

@@ -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"; }

View File

@@ -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;

View File

@@ -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

View File

@@ -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<T extends Integer> extends GenericSqlMapDao<T> {
public class GenericSqlMapIntegerDao<T extends Number> extends GenericSqlMapDao<T> {
@Override
public void saveOrUpdate(T t) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!--
Whacky error codes for testing
-->
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="badSqlGrammarCodes"><value>1,2</value></property>
<property name="dataIntegrityViolationCodes"><value>1,1400,1722</value></property>
<property name="customTranslations">
<list>
<bean class="org.springframework.jdbc.support.CustomSQLErrorCodesTranslation">
<property name="errorCodes"><value>999</value></property>
<property name="exceptionClass">
<value>org.springframework.jdbc.support.CustomErrorCodeException</value>
</property>
</bean>
</list>
</property>
</bean>
</beans>

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!--
Whacky error codes for testing
-->
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="badSqlGrammarCodes"><value>1,2</value></property>
<property name="dataIntegrityViolationCodes"><value>1,1400,1722</value></property>
</bean>
</beans>

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!--
Whacky error codes for testing
-->
<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="badSqlGrammarCodes"><value>1,2,942</value></property>
<property name="dataIntegrityViolationCodes"><value>1,1400,1722</value></property>
</bean>
<bean id="DB0" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="databaseProductName"><value>*DB0</value></property>
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
</bean>
<bean id="DB1" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="databaseProductName"><value>DB1*</value></property>
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
</bean>
<bean id="DB2" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="databaseProductName"><value>*DB2*</value></property>
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
</bean>
<bean id="DB3" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="databaseProductName"><value>*DB3*</value></property>
<property name="badSqlGrammarCodes"><value>-204,1,2</value></property>
<property name="dataIntegrityViolationCodes"><value>3,4</value></property>
</bean>
</beans>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBeanTests$FilterTestLocalSessionFactoryBean">
<property name="filterDefinitions">
<list>
<bean class="org.springframework.orm.hibernate3.FilterDefinitionFactoryBean">
<property name="filterName" value="filter1"/>
<property name="parameterTypes">
<props>
<prop key="param1">string</prop>
<prop key="otherParam">long</prop>
</props>
</property>
<property name="defaultFilterCondition" value="someCondition"/>
</bean>
<bean id="filter2" class="org.springframework.orm.hibernate3.FilterDefinitionFactoryBean">
<property name="parameterTypes">
<props>
<prop key="myParam">integer</prop>
</props>
</property>
</bean>
</list>
</property>
</bean>
</beans>

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBeanTests$TypeTestLocalSessionFactoryBean">
<property name="typeDefinitions">
<list>
<bean class="org.springframework.orm.hibernate3.TypeDefinitionBean">
<property name="typeName" value="type1"/>
<property name="typeClass" value="mypackage.MyTypeClass"/>
<property name="parameters">
<props>
<prop key="param1">value1</prop>
<prop key="otherParam">othervalue</prop>
</props>
</property>
</bean>
<bean id="type2" class="org.springframework.orm.hibernate3.TypeDefinitionBean">
<property name="typeName" value="type2"/>
<property name="typeClass" value="mypackage.MyOtherTypeClass"/>
<property name="parameters">
<props>
<prop key="myParam">myvalue</prop>
</props>
</property>
</bean>
</list>
</property>
</bean>
</beans>

View File

@@ -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;

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
<bean id="servletContextAwareBean" class="org.springframework.web.context.ServletContextAwareBean"/>
<bean id="servletConfigAwareBean" class="org.springframework.web.context.ServletConfigAwareBean"/>
</beans>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="dummy"/>
<property name="age" value="-1"/>
</bean>
<bean id="rodProto" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name" value="dummy"/>
<property name="age" value="-1"/>
</bean>
</beans>

View File

@@ -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;

View File

@@ -1,3 +0,0 @@
form.(class)=org.springframework.web.servlet.view.InternalResourceView
form.requestContextAttribute=rc
form.url=myform.jsp

View File

@@ -0,0 +1,42 @@
/*
* 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;
import java.util.List;
public class Component {
private String name;
private List<Component> components = new ArrayList<Component>();
// mmm, there is no setter method for the 'components'
public void addComponent(Component component) {
this.components.add(component);
}
public List<Component> getComponents() {
return components;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -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;

View File

@@ -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;
@@ -30,7 +31,7 @@ import org.springframework.core.io.ClassPathResource;
/**
* @author Costin Leau
*/
public class ComponentBeanDefinitionParserTest {
public class ComponentBeanDefinitionParserTests {
private static DefaultListableBeanFactory bf;

View File

@@ -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;

View File

@@ -0,0 +1,27 @@
/*
* 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;
public class ComponentNamespaceHandler extends NamespaceHandlerSupport {
@Override
public void init() {
registerBeanDefinitionParser("component",
new ComponentBeanDefinitionParser());
}
}