Browse Source

Replace EasyMock with Mockito

Issue: SPR-10126
pull/246/merge
Phillip Webb 13 years ago
parent
commit
05765d7520
  1. 8
      build.gradle
  2. 8
      spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
  3. 11
      spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java
  4. 13
      spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java
  5. 11
      spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java
  6. 11
      spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java
  7. 6
      spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java
  8. 12
      spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java
  9. 26
      spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
  10. 6
      spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
  11. 12
      spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
  12. 10
      spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
  13. 10
      spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
  14. 5
      spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java
  15. 20
      spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
  16. 9
      spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java
  17. 10
      spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java
  18. 7
      spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java
  19. 11
      spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java
  20. 9
      spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java
  21. 12
      spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java
  22. 8
      spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java
  23. 9
      spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java
  24. 10
      spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java
  25. 12
      spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java
  26. 10
      spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java
  27. 10
      spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
  28. 11
      spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java
  29. 9
      spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
  30. 11
      spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java
  31. 9
      spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java
  32. 10
      spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java
  33. 7
      spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java
  34. 7
      spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java
  35. 5
      spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java
  36. 7
      spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java
  37. 4
      spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java
  38. 12
      spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java
  39. 10
      spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java
  40. 8
      spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java
  41. 13
      spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java
  42. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java
  43. 13
      spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
  44. 27
      spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
  45. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/core/RowMapperTests.java
  46. 8
      spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java
  47. 7
      spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
  48. 12
      spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterQueryTests.java
  49. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/CallMetaDataContextTests.java
  50. 15
      spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java
  51. 8
      spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertTests.java
  52. 14
      spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java
  53. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java
  54. 10
      spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java
  55. 8
      spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcDaoSupportTests.java
  56. 11
      spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java
  57. 14
      spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java
  58. 18
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceJtaTransactionTests.java
  59. 11
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java
  60. 12
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTest.java
  61. 8
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DriverManagerDataSourceTests.java
  62. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapterTests.java
  63. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/DatabasePopulatorTests.java
  64. 11
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookupTests.java
  65. 12
      spring-jdbc/src/test/java/org/springframework/jdbc/object/BatchSqlUpdateTests.java
  66. 10
      spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericSqlQueryTests.java
  67. 10
      spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericStoredProcedureTests.java
  68. 18
      spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
  69. 10
      spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java
  70. 16
      spring-jdbc/src/test/java/org/springframework/jdbc/object/StoredProcedureTests.java
  71. 11
      spring-jdbc/src/test/java/org/springframework/jdbc/support/DataFieldMaxValueIncrementerTests.java
  72. 7
      spring-jdbc/src/test/java/org/springframework/jdbc/support/DefaultLobHandlerTests.java
  73. 9
      spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java
  74. 16
      spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
  75. 10
      spring-jdbc/src/test/java/org/springframework/jdbc/support/rowset/ResultSetWrappingRowSetTests.java
  76. 11
      spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java
  77. 11
      spring-jms/src/test/java/org/springframework/jms/connection/JmsTransactionManagerTests.java
  78. 11
      spring-jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java
  79. 12
      spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java
  80. 13
      spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java
  81. 6
      spring-jms/src/test/java/org/springframework/jms/core/support/JmsGatewaySupportTests.java
  82. 12
      spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java
  83. 10
      spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102Tests.java
  84. 15
      spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapterTests.java
  85. 5
      spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java
  86. 9
      spring-jms/src/test/java/org/springframework/jms/remoting/JmsInvokerTests.java
  87. 12
      spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverter102Tests.java
  88. 11
      spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverterTests.java
  89. 10
      spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJackson2MessageConverterTests.java
  90. 10
      spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java
  91. 10
      spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java
  92. 5
      spring-jms/src/test/java/org/springframework/jms/support/destination/DynamicDestinationResolverTests.java
  93. 7
      spring-jms/src/test/java/org/springframework/jms/support/destination/JmsDestinationAccessorTests.java
  94. 10
      spring-jms/src/test/java/org/springframework/jms/support/destination/JndiDestinationResolverTests.java
  95. 15
      spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateInterceptorTests.java
  96. 17
      spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateJtaTransactionTests.java
  97. 17
      spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java
  98. 10
      spring-orm/src/test/java/org/springframework/orm/hibernate3/LocalSessionFactoryBeanTests.java
  99. 6
      spring-orm/src/test/java/org/springframework/orm/hibernate3/support/HibernateDaoSupportTests.java
  100. 8
      spring-orm/src/test/java/org/springframework/orm/hibernate3/support/LobTypeTests.java
  101. Some files were not shown because too many files have changed in this diff Show More

8
build.gradle

@ -13,7 +13,6 @@ configure(allprojects) { project -> @@ -13,7 +13,6 @@ configure(allprojects) { project ->
version = qualifyVersionIfNecessary(version)
ext.aspectjVersion = "1.7.2"
ext.easymockVersion = "2.5.2"
ext.hsqldbVersion = "1.8.0.10"
ext.junitVersion = "4.11"
ext.slf4jVersion = "1.6.1"
@ -69,13 +68,6 @@ configure(allprojects) { project -> @@ -69,13 +68,6 @@ configure(allprojects) { project ->
testCompile("junit:junit:${junitVersion}")
testCompile("org.hamcrest:hamcrest-all:1.3")
testCompile("org.mockito:mockito-core:1.9.5")
if (project.name in ["spring",
"spring-orm-hibernate4", "spring-oxm", "spring-struts",
"spring-test", "spring-test-mvc", "spring-tx", "spring-web",
"spring-webmvc", "spring-webmvc-portlet", "spring-webmvc-tiles3"]) {
testCompile("org.easymock:easymock:${easymockVersion}")
testCompile "org.easymock:easymockclassextension:${easymockVersion}"
}
}
ext.javadocLinks = [

8
spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java

@ -16,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.aop.framework.adapter;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Method;
@ -33,6 +28,9 @@ import org.junit.Test; @@ -33,6 +28,9 @@ import org.junit.Test;
import org.springframework.aop.ThrowsAdvice;
import org.springframework.tests.aop.advice.MethodCounter;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson

11
spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java

@ -16,18 +16,13 @@ @@ -16,18 +16,13 @@
package org.springframework.aop.interceptor;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rob Harrop
* @author Rick Evans

13
spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java

@ -1,5 +1,5 @@ @@ -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,18 +16,13 @@ @@ -16,18 +16,13 @@
package org.springframework.aop.interceptor;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the {@link DebugInterceptor} class.
*

11
spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java

@ -1,5 +1,5 @@ @@ -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,16 +16,13 @@ @@ -16,16 +16,13 @@
package org.springframework.aop.interceptor;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rob Harrop
* @author Rick Evans

11
spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java

@ -16,18 +16,13 @@ @@ -16,18 +16,13 @@
package org.springframework.aop.interceptor;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the {@link SimpleTraceInterceptor} class.
*

6
spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,11 @@ @@ -16,11 +16,11 @@
package org.springframework.aop.scope;
import static org.mockito.Mockito.mock;
import org.junit.Test;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the {@link DefaultScopedObject} class.
*

12
spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.aop.support;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
@ -41,6 +33,10 @@ import org.springframework.tests.sample.beans.SerializablePerson; @@ -41,6 +33,10 @@ import org.springframework.tests.sample.beans.SerializablePerson;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Chris Beams

26
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java

@ -16,24 +16,6 @@ @@ -16,24 +16,6 @@
package org.springframework.beans.factory;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import java.io.Closeable;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
@ -104,6 +86,10 @@ import org.springframework.tests.sample.beans.factory.DummyFactory; @@ -104,6 +86,10 @@ import org.springframework.tests.sample.beans.factory.DummyFactory;
import org.springframework.util.StopWatch;
import org.springframework.util.StringValueResolver;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests properties population and autowire behavior.
*
@ -2261,8 +2247,8 @@ public class DefaultListableBeanFactoryTests { @@ -2261,8 +2247,8 @@ public class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
bf.registerBeanDefinition("abs", BeanDefinitionBuilder
.rootBeanDefinition(TestBean.class).setAbstract(true).getBeanDefinition());
assertThat(bf.containsBean("abs"), is(true));
assertThat(bf.containsBean("bogus"), is(false));
assertThat(bf.containsBean("abs"), equalTo(true));
assertThat(bf.containsBean("bogus"), equalTo(false));
}
@Test

6
spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.beans.factory.config;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import java.util.HashMap;
import java.util.Map;
@ -26,6 +23,9 @@ import org.junit.Before; @@ -26,6 +23,9 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for {@link CustomScopeConfigurer}.
*

12
spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.beans.factory.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
import java.util.Date;
import javax.inject.Provider;
@ -38,6 +30,10 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; @@ -38,6 +30,10 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.Resource;
import org.springframework.util.SerializationTestUtils;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.springframework.tests.TestResourceUtils.*;
/**
* @author Colin Sampaleanu
* @author Juergen Hoeller

10
spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java

@ -1,5 +1,5 @@ @@ -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,10 +16,6 @@ @@ -16,10 +16,6 @@
package org.springframework.beans.factory.config;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.genericBeanDefinition;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@ -30,6 +26,10 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory; @@ -30,6 +26,10 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.NestedCheckedException;
import org.springframework.core.NestedRuntimeException;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;
/**
* Unit tests for {@link ServiceLocatorFactoryBean}.
*

10
spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java

@ -1,5 +1,5 @@ @@ -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,15 +16,13 @@ @@ -16,15 +16,13 @@
package org.springframework.beans.factory.parsing;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.apache.commons.logging.Log;
import org.junit.Test;
import org.springframework.core.io.DescriptiveResource;
import static org.mockito.Matchers.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Juergen Hoeller

5
spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.beans.factory.wiring;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import junit.framework.TestCase;
import org.springframework.beans.factory.BeanFactory;
@ -26,6 +23,8 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; @@ -26,6 +23,8 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.tests.sample.beans.TestBean;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans

20
spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java

@ -16,15 +16,6 @@ @@ -16,15 +16,6 @@
package org.springframework.scheduling.quartz;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
@ -52,19 +43,22 @@ import org.quartz.Trigger; @@ -52,19 +43,22 @@ import org.quartz.Trigger;
import org.quartz.TriggerListener;
import org.quartz.impl.SchedulerRepository;
import org.quartz.spi.JobFactory;
import org.springframework.tests.context.TestMethodInvokingTask;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.support.StaticListableBeanFactory;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.io.FileSystemResourceLoader;
import org.springframework.core.task.TaskExecutor;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.tests.context.TestMethodInvokingTask;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller

9
spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java

@ -16,18 +16,17 @@ @@ -16,18 +16,17 @@
package org.springframework.aop.aspectj;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.

10
spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java

@ -16,19 +16,17 @@ @@ -16,19 +16,17 @@
package org.springframework.aop.aspectj;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect.AfterReturningAdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.

7
spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java

@ -16,14 +16,13 @@ @@ -16,14 +16,13 @@
package org.springframework.aop.aspectj;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AfterThrowingAdviceBindingTestAspect.AfterThrowingAdviceBindingCollaborator;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.

11
spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java

@ -16,20 +16,19 @@ @@ -16,20 +16,19 @@
package org.springframework.aop.aspectj;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AroundAdviceBindingTestAspect.AroundAdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.

9
spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java

@ -16,18 +16,17 @@ @@ -16,18 +16,17 @@
package org.springframework.aop.aspectj;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.

12
spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java

@ -1,5 +1,5 @@ @@ -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,19 +16,15 @@ @@ -16,19 +16,15 @@
package org.springframework.aop.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.lang.reflect.Method;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Chris Beams

8
spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java

@ -16,21 +16,19 @@ @@ -16,21 +16,19 @@
package org.springframework.aop.framework;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
import org.springframework.aop.support.AopUtils;
import org.springframework.tests.sample.beans.IOther;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @since 13.03.2003
* @author Rod Johnson

9
spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java

@ -1,5 +1,5 @@ @@ -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,13 +16,12 @@ @@ -16,13 +16,12 @@
package org.springframework.context.access;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit test for {@link ContextBeanFactoryReference}
*

10
spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.context.annotation;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import java.lang.instrument.ClassFileTransformer;
import org.junit.Test;
@ -28,6 +23,9 @@ import org.springframework.context.annotation.EnableLoadTimeWeaving.AspectJWeavi @@ -28,6 +23,9 @@ import org.springframework.context.annotation.EnableLoadTimeWeaving.AspectJWeavi
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.instrument.classloading.LoadTimeWeaver;
import static org.mockito.Matchers.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for @EnableLoadTimeWeaving
*

12
spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java

@ -20,16 +20,8 @@ import java.util.HashSet; @@ -20,16 +20,8 @@ import java.util.HashSet;
import java.util.Set;
import org.aopalliance.intercept.MethodInvocation;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationContext;
@ -39,6 +31,10 @@ import org.springframework.context.BeanThatBroadcasts; @@ -39,6 +31,10 @@ import org.springframework.context.BeanThatBroadcasts;
import org.springframework.context.BeanThatListens;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit and integration tests for the ApplicationContext event support.

10
spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java

@ -16,21 +16,21 @@ @@ -16,21 +16,21 @@
package org.springframework.context.event;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.beans.BeansException;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.TestListener;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Dmitriy Kopylenko

10
spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.ejb.access;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
import javax.ejb.EJBLocalObject;
@ -31,6 +26,9 @@ import org.junit.Test; @@ -31,6 +26,9 @@ import org.junit.Test;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.jndi.JndiTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller

11
spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java

@ -1,5 +1,5 @@ @@ -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,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.ejb.access;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import java.lang.reflect.Proxy;
import javax.ejb.CreateException;
@ -32,6 +26,9 @@ import javax.naming.NamingException; @@ -32,6 +26,9 @@ import javax.naming.NamingException;
import org.junit.Test;
import org.springframework.jndi.JndiTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller

9
spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java

@ -16,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.ejb.access;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.rmi.ConnectException;
import java.rmi.RemoteException;
@ -36,6 +30,9 @@ import org.springframework.aop.framework.ProxyFactory; @@ -36,6 +30,9 @@ import org.springframework.aop.framework.ProxyFactory;
import org.springframework.jndi.JndiTemplate;
import org.springframework.remoting.RemoteAccessException;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller

11
spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java

@ -1,5 +1,5 @@ @@ -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,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.ejb.access;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import java.lang.reflect.Proxy;
import java.rmi.RemoteException;
@ -34,6 +28,9 @@ import org.junit.Test; @@ -34,6 +28,9 @@ import org.junit.Test;
import org.springframework.jndi.JndiTemplate;
import org.springframework.remoting.RemoteAccessException;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller

9
spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java

@ -16,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jndi;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import javax.naming.Context;
import javax.naming.NamingException;
@ -31,6 +25,9 @@ import org.springframework.tests.sample.beans.DerivedTestBean; @@ -31,6 +25,9 @@ import org.springframework.tests.sample.beans.DerivedTestBean;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller

10
spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java

@ -1,5 +1,5 @@ @@ -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,16 +16,14 @@ @@ -16,16 +16,14 @@
package org.springframework.jndi;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import javax.naming.Context;
import javax.naming.NameNotFoundException;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Juergen Hoeller

7
spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.scripting.bsh;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.util.Arrays;
import java.util.Collection;
@ -26,7 +23,6 @@ import junit.framework.TestCase; @@ -26,7 +23,6 @@ import junit.framework.TestCase;
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.target.dynamic.Refreshable;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@ -38,6 +34,9 @@ import org.springframework.scripting.ScriptCompilationException; @@ -38,6 +34,9 @@ import org.springframework.scripting.ScriptCompilationException;
import org.springframework.scripting.ScriptSource;
import org.springframework.scripting.TestBeanAwareMessenger;
import org.springframework.scripting.support.ScriptFactoryPostProcessor;
import org.springframework.tests.sample.beans.TestBean;
import static org.mockito.BDDMockito.*;
/**
* @author Rob Harrop

7
spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java

@ -16,16 +16,16 @@ @@ -16,16 +16,16 @@
package org.springframework.scripting.groovy;
import groovy.lang.DelegatingMetaClass;
import groovy.lang.GroovyObject;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Map;
import groovy.lang.DelegatingMetaClass;
import groovy.lang.GroovyObject;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.target.dynamic.Refreshable;
import org.springframework.beans.factory.BeanCreationException;
@ -52,7 +52,6 @@ import org.springframework.util.ObjectUtils; @@ -52,7 +52,6 @@ import org.springframework.util.ObjectUtils;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.mockito.Mockito.mock;
/**
* @author Rob Harrop

5
spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,12 @@ @@ -16,11 +16,12 @@
package org.springframework.scripting.support;
import static org.mockito.Mockito.mock;
import junit.framework.TestCase;
import org.springframework.beans.factory.BeanFactory;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
*/

7
spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java

@ -1,5 +1,5 @@ @@ -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,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.scripting.support;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -27,6 +24,8 @@ import junit.framework.TestCase; @@ -27,6 +24,8 @@ import junit.framework.TestCase;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Juergen Hoeller

4
spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java

@ -16,11 +16,8 @@ @@ -16,11 +16,8 @@
package org.springframework.scripting.support;
import static org.mockito.Mockito.mock;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
@ -34,6 +31,7 @@ import org.springframework.tests.Assume; @@ -34,6 +31,7 @@ import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans

12
spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.util;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@ -36,6 +28,10 @@ import org.junit.Before; @@ -36,6 +28,10 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.InOrder;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for {@link StreamUtils}.
*

10
spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java

@ -1,5 +1,5 @@ @@ -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,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.util.xml;
import static org.mockito.BDDMockito.willAnswer;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import java.io.InputStream;
import javax.xml.stream.XMLInputFactory;
@ -44,6 +38,8 @@ import org.xml.sax.ext.LexicalHandler; @@ -44,6 +38,8 @@ import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.XMLReaderFactory;
import static org.mockito.BDDMockito.*;
public abstract class AbstractStaxXMLReaderTestCase {
protected static XMLInputFactory inputFactory;

8
spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,9 @@ @@ -16,11 +16,9 @@
package org.springframework.util.xml;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.InputStream;
import java.io.StringReader;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
@ -29,6 +27,8 @@ import org.xml.sax.ContentHandler; @@ -29,6 +27,8 @@ import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.helpers.AttributesImpl;
import static org.mockito.BDDMockito.*;
public class StaxEventXMLReaderTests extends AbstractStaxXMLReaderTestCase {
public static final String CONTENT = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";

13
spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java

@ -1,5 +1,5 @@ @@ -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,23 +18,22 @@ package org.springframework.util.xml; @@ -18,23 +18,22 @@ package org.springframework.util.xml;
import java.io.InputStream;
import java.io.StringReader;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import static org.junit.Assert.*;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import static org.junit.Assert.*;
import static org.mockito.Matchers.*;
import static org.mockito.BDDMockito.*;
public class StaxStreamXMLReaderTests extends AbstractStaxXMLReaderTestCase {
public static final String CONTENT = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";

9
spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java

@ -16,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jdbc.core;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
@ -35,6 +29,9 @@ import org.springframework.jdbc.core.test.SpacePerson; @@ -35,6 +29,9 @@ import org.springframework.jdbc.core.test.SpacePerson;
import org.springframework.jdbc.datasource.SingleConnectionDataSource;
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Mock object based abstract class for RowMapper tests.
* Initializes mock objects and verifies results.

13
spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java

@ -1,5 +1,5 @@ @@ -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,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jdbc.core;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Connection;
@ -43,6 +35,9 @@ import org.junit.Test; @@ -43,6 +35,9 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

27
spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java

@ -1,5 +1,5 @@ @@ -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,26 +16,6 @@ @@ -16,26 +16,6 @@
package org.springframework.jdbc.core;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.sameInstance;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.springframework.tests.Matchers.exceptionCause;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@ -71,6 +51,11 @@ import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor; @@ -71,6 +51,11 @@ import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor;
import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter;
import org.springframework.util.LinkedCaseInsensitiveMap;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.springframework.tests.Matchers.*;
/**
* Mock object based tests for JdbcTemplate.
*

9
spring-jdbc/src/test/java/org/springframework/jdbc/core/RowMapperTests.java

@ -16,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.jdbc.core;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -34,9 +29,11 @@ import junit.framework.TestCase; @@ -34,9 +29,11 @@ import junit.framework.TestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.jdbc.datasource.SingleConnectionDataSource;
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
import org.springframework.tests.sample.beans.TestBean;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller

8
spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java

@ -1,5 +1,5 @@ @@ -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,10 +16,6 @@ @@ -16,10 +16,6 @@
package org.springframework.jdbc.core;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@ -30,6 +26,8 @@ import java.util.GregorianCalendar; @@ -30,6 +26,8 @@ import java.util.GregorianCalendar;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 31.08.2004

7
spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java

@ -27,13 +27,13 @@ import java.util.HashMap; @@ -27,13 +27,13 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.Customer;
import org.springframework.jdbc.core.JdbcOperations;
@ -46,11 +46,6 @@ import org.springframework.jdbc.core.SqlParameterValue; @@ -46,11 +46,6 @@ import org.springframework.jdbc.core.SqlParameterValue;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
/**
* @author Rick Evans

12
spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterQueryTests.java

@ -1,5 +1,5 @@ @@ -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,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jdbc.core.namedparam;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -42,6 +35,9 @@ import org.junit.Before; @@ -42,6 +35,9 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.jdbc.core.RowMapper;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Thomas Risberg
* @author Phillip Webb

9
spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/CallMetaDataContextTests.java

@ -1,11 +1,5 @@ @@ -1,11 +1,5 @@
package org.springframework.jdbc.core.simple;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Types;
@ -24,6 +18,9 @@ import org.springframework.jdbc.core.SqlParameter; @@ -24,6 +18,9 @@ import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.core.metadata.CallMetaDataContext;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Mock object based tests for CallMetaDataContext.
*

15
spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java

@ -1,5 +1,5 @@ @@ -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,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jdbc.core.simple;
import static org.hamcrest.Matchers.sameInstance;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.springframework.tests.Matchers.exceptionCause;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@ -43,6 +35,11 @@ import org.springframework.jdbc.core.SqlOutParameter; @@ -43,6 +35,11 @@ import org.springframework.jdbc.core.SqlOutParameter;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.springframework.tests.Matchers.*;
/**
* Mock object based tests for SimpleJdbcCall.
*

8
spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertTests.java

@ -1,5 +1,5 @@ @@ -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,10 +16,6 @@ @@ -16,10 +16,6 @@
package org.springframework.jdbc.core.simple;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@ -34,6 +30,8 @@ import org.junit.Test; @@ -34,6 +30,8 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import static org.mockito.BDDMockito.*;
/**
* Mock object based tests for SimpleJdbcInsert.
*

14
spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java

@ -1,5 +1,5 @@ @@ -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,15 +16,6 @@ @@ -16,15 +16,6 @@
package org.springframework.jdbc.core.simple;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@ -48,6 +39,9 @@ import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; @@ -48,6 +39,9 @@ import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
* @author Rob Harrop

9
spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java

@ -16,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jdbc.core.simple;
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.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@ -38,6 +32,9 @@ import org.springframework.jdbc.core.SqlParameterValue; @@ -38,6 +32,9 @@ import org.springframework.jdbc.core.SqlParameterValue;
import org.springframework.jdbc.core.metadata.TableMetaDataContext;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Mock object based tests for TableMetaDataContext.
*

10
spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java

@ -16,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.jdbc.core.support;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
@ -28,8 +23,11 @@ import java.sql.Statement; @@ -28,8 +23,11 @@ import java.sql.Statement;
import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson

8
spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcDaoSupportTests.java

@ -1,5 +1,5 @@ @@ -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,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.jdbc.core.support;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
import java.util.List;
@ -27,6 +24,9 @@ import javax.sql.DataSource; @@ -27,6 +24,9 @@ import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 30.07.2003

11
spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java

@ -1,5 +1,5 @@ @@ -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,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jdbc.core.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -36,6 +30,9 @@ import org.springframework.jdbc.LobRetrievalFailureException; @@ -36,6 +30,9 @@ import org.springframework.jdbc.LobRetrievalFailureException;
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Alef Arendsen
*/

14
spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -15,14 +15,6 @@ @@ -15,14 +15,6 @@
*/
package org.springframework.jdbc.core.support;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
@ -40,6 +32,10 @@ import org.mockito.MockitoAnnotations; @@ -40,6 +32,10 @@ import org.mockito.MockitoAnnotations;
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Test cases for the sql lob value:
*

18
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceJtaTransactionTests.java

@ -1,5 +1,5 @@ @@ -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,19 +16,6 @@ @@ -16,19 +16,6 @@
package org.springframework.jdbc.datasource;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
@ -59,6 +46,9 @@ import org.springframework.transaction.support.TransactionSynchronization; @@ -59,6 +46,9 @@ import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 17.10.2005

11
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jdbc.datasource;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@ -55,6 +47,9 @@ import org.springframework.transaction.support.TransactionSynchronization; @@ -55,6 +47,9 @@ import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 04.07.2003

12
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTest.java

@ -1,5 +1,5 @@ @@ -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,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jdbc.datasource;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.sql.Connection;
@ -31,6 +25,10 @@ import javax.sql.DataSource; @@ -31,6 +25,10 @@ import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for {@link DelegatingDataSource}.
*

8
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DriverManagerDataSourceTests.java

@ -1,5 +1,5 @@ @@ -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,14 +16,14 @@ @@ -16,14 +16,14 @@
package org.springframework.jdbc.datasource;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import java.sql.Connection;
import java.util.Properties;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
*/

9
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapterTests.java

@ -1,5 +1,5 @@ @@ -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,10 +16,6 @@ @@ -16,10 +16,6 @@
package org.springframework.jdbc.datasource;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.sql.Connection;
import java.sql.SQLException;
@ -27,6 +23,9 @@ import javax.sql.DataSource; @@ -27,6 +23,9 @@ import javax.sql.DataSource;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 28.05.2004

9
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/DatabasePopulatorTests.java

@ -1,5 +1,5 @@ @@ -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,10 +16,6 @@ @@ -16,10 +16,6 @@
package org.springframework.jdbc.datasource.init;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.SQLException;
@ -32,6 +28,9 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; @@ -32,6 +28,9 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Dave Syer
* @author Sam Brannen

11
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookupTests.java

@ -1,5 +1,5 @@ @@ -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,18 +16,15 @@ @@ -16,18 +16,15 @@
package org.springframework.jdbc.datasource.lookup;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanNotOfRequiredTypeException;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Juergen Hoeller

12
spring-jdbc/src/test/java/org/springframework/jdbc/object/BatchSqlUpdateTests.java

@ -1,5 +1,5 @@ @@ -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. You may obtain a copy of
@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jdbc.object;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@ -33,6 +26,9 @@ import javax.sql.DataSource; @@ -33,6 +26,9 @@ import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.jdbc.core.SqlParameter;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 22.02.2005

10
spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericSqlQueryTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -17,11 +17,6 @@ @@ -17,11 +17,6 @@
package org.springframework.jdbc.object;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -43,6 +38,9 @@ import org.springframework.core.io.ClassPathResource; @@ -43,6 +38,9 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.Customer;
import org.springframework.jdbc.datasource.TestDataSourceWrapper;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Thomas Risberg
*/

10
spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericStoredProcedureTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.jdbc.object;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Types;
@ -37,6 +32,9 @@ import org.springframework.core.io.ClassPathResource; @@ -37,6 +32,9 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.TestDataSourceWrapper;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Thomas Risberg
*/

18
spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java

@ -1,5 +1,5 @@ @@ -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,18 +16,6 @@ @@ -16,18 +16,6 @@
package org.springframework.jdbc.object;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -51,6 +39,10 @@ import org.springframework.dao.InvalidDataAccessApiUsageException; @@ -51,6 +39,10 @@ import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.jdbc.Customer;
import org.springframework.jdbc.core.SqlParameter;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Trevor Cook
* @author Thomas Risberg

10
spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.jdbc.object;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -42,6 +37,9 @@ import org.springframework.jdbc.core.SqlParameter; @@ -42,6 +37,9 @@ import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Trevor Cook
* @author Thomas Risberg

16
spring-jdbc/src/test/java/org/springframework/jdbc/object/StoredProcedureTests.java

@ -1,5 +1,5 @@ @@ -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,17 +16,6 @@ @@ -16,17 +16,6 @@
package org.springframework.jdbc.object;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.startsWith;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.Connection;
@ -62,6 +51,9 @@ import org.springframework.jdbc.support.SQLExceptionTranslator; @@ -62,6 +51,9 @@ import org.springframework.jdbc.support.SQLExceptionTranslator;
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Thomas Risberg
* @author Trevor Cook

11
spring-jdbc/src/test/java/org/springframework/jdbc/support/DataFieldMaxValueIncrementerTests.java

@ -1,5 +1,5 @@ @@ -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,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jdbc.support;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -35,6 +29,9 @@ import org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer; @@ -35,6 +29,9 @@ import org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer;
import org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer;
import org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 27.02.2004

7
spring-jdbc/src/test/java/org/springframework/jdbc/support/DefaultLobHandlerTests.java

@ -1,5 +1,5 @@ @@ -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,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.jdbc.support;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@ -33,6 +30,8 @@ import org.springframework.jdbc.support.lob.DefaultLobHandler; @@ -33,6 +30,8 @@ import org.springframework.jdbc.support.lob.DefaultLobHandler;
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 17.12.2003

9
spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java

@ -1,5 +1,5 @@ @@ -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,10 +16,6 @@ @@ -16,10 +16,6 @@
package org.springframework.jdbc.support;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@ -32,6 +28,9 @@ import org.junit.Test; @@ -32,6 +28,9 @@ import org.junit.Test;
import org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor;
import org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Andre Biryukov
* @author Juergen Hoeller

16
spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java

@ -1,5 +1,5 @@ @@ -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,16 +16,6 @@ @@ -16,16 +16,6 @@
package org.springframework.jdbc.support;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
@ -37,6 +27,10 @@ import org.junit.Test; @@ -37,6 +27,10 @@ import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Tests for SQLErrorCodes loading.
*

10
spring-jdbc/src/test/java/org/springframework/jdbc/support/rowset/ResultSetWrappingRowSetTests.java

@ -1,5 +1,5 @@ @@ -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,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.jdbc.support.rowset;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigDecimal;
@ -34,6 +29,9 @@ import org.junit.Before; @@ -34,6 +29,9 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.jdbc.InvalidResultSetAccessException;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Thomas Risberg
*/

11
spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jms.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@ -53,6 +45,9 @@ import org.springframework.jms.listener.endpoint.JmsMessageEndpointManager; @@ -53,6 +45,9 @@ import org.springframework.jms.listener.endpoint.JmsMessageEndpointManager;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.ErrorHandler;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Mark Fisher
* @author Juergen Hoeller

11
spring-jms/src/test/java/org/springframework/jms/connection/JmsTransactionManagerTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jms.connection;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
@ -53,6 +45,9 @@ import org.springframework.transaction.support.TransactionCallbackWithoutResult; @@ -53,6 +45,9 @@ import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 26.07.2004

11
spring-jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jms.connection;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.ExceptionListener;
@ -38,6 +30,9 @@ import javax.jms.TopicSession; @@ -38,6 +30,9 @@ import javax.jms.TopicSession;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @since 26.07.2004

12
spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java

@ -16,15 +16,6 @@ @@ -16,15 +16,6 @@
package org.springframework.jms.core;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
@ -67,6 +58,9 @@ import org.springframework.jms.support.converter.SimpleMessageConverter; @@ -67,6 +58,9 @@ import org.springframework.jms.support.converter.SimpleMessageConverter;
import org.springframework.jms.support.destination.JndiDestinationResolver;
import org.springframework.jndi.JndiTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the JmsTemplate implemented using JMS 1.0.2.
*

13
spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java

@ -16,16 +16,6 @@ @@ -16,16 +16,6 @@
package org.springframework.jms.core;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
@ -68,6 +58,9 @@ import org.springframework.jndi.JndiTemplate; @@ -68,6 +58,9 @@ import org.springframework.jndi.JndiTemplate;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the JmsTemplate implemented using JMS 1.1.
*

6
spring-jms/src/test/java/org/springframework/jms/core/support/JmsGatewaySupportTests.java

@ -15,9 +15,6 @@ @@ -15,9 +15,6 @@
*/
package org.springframework.jms.core.support;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
import java.util.List;
@ -26,6 +23,9 @@ import javax.jms.ConnectionFactory; @@ -26,6 +23,9 @@ import javax.jms.ConnectionFactory;
import org.junit.Test;
import org.springframework.jms.core.JmsTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Mark Pollack
* @since 24.9.2004

12
spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java

@ -16,15 +16,6 @@ @@ -16,15 +16,6 @@
package org.springframework.jms.listener;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.HashSet;
import javax.jms.Connection;
@ -43,6 +34,9 @@ import org.springframework.core.task.TaskExecutor; @@ -43,6 +34,9 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.jms.StubQueue;
import org.springframework.util.ErrorHandler;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Juergen Hoeller

10
spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102Tests.java

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jms.listener.adapter;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import javax.jms.BytesMessage;
@ -42,6 +35,9 @@ import org.mockito.invocation.InvocationOnMock; @@ -42,6 +35,9 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.jms.support.converter.SimpleMessageConverter102;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the {@link MessageListenerAdapter102} class.
*

15
spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapterTests.java

@ -16,18 +16,6 @@ @@ -16,18 +16,6 @@
package org.springframework.jms.listener.adapter;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.io.Serializable;
@ -50,6 +38,9 @@ import org.mockito.stubbing.Answer; @@ -50,6 +38,9 @@ import org.mockito.stubbing.Answer;
import org.springframework.jms.support.converter.MessageConversionException;
import org.springframework.jms.support.converter.SimpleMessageConverter;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Juergen Hoeller

5
spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.jms.listener.endpoint;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import javax.jms.Destination;
import javax.jms.Session;
@ -28,6 +25,8 @@ import org.springframework.jca.StubResourceAdapter; @@ -28,6 +25,8 @@ import org.springframework.jca.StubResourceAdapter;
import org.springframework.jms.StubQueue;
import org.springframework.jms.support.destination.DestinationResolver;
import static org.mockito.BDDMockito.*;
/**
* @author Agim Emruli
* @author Juergen Hoeller

9
spring-jms/src/test/java/org/springframework/jms/remoting/JmsInvokerTests.java

@ -16,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jms.remoting;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Enumeration;
@ -44,6 +38,9 @@ import org.springframework.jms.support.converter.SimpleMessageConverter; @@ -44,6 +38,9 @@ import org.springframework.jms.support.converter.SimpleMessageConverter;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
*/

12
spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverter102Tests.java

@ -16,12 +16,6 @@ @@ -16,12 +16,6 @@
package org.springframework.jms.support;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import java.io.ByteArrayInputStream;
import java.util.Random;
@ -35,6 +29,10 @@ import org.mockito.invocation.InvocationOnMock; @@ -35,6 +29,10 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.jms.support.converter.SimpleMessageConverter102;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the {@link SimpleMessageConverter102} class.
*
@ -53,7 +51,7 @@ public final class SimpleMessageConverter102Tests { @@ -53,7 +51,7 @@ public final class SimpleMessageConverter102Tests {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(content);
given(session.createBytesMessage()).willReturn(message);
given(message.readBytes(any(byte[].class))).willAnswer(new Answer<Integer>() {
given(message.readBytes((byte[]) anyObject())).willAnswer(new Answer<Integer>() {
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
return byteArrayInputStream.read((byte[])invocation.getArguments()[0]);

11
spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverterTests.java

@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
package org.springframework.jms.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.HashMap;
@ -43,6 +35,9 @@ import org.mockito.stubbing.Answer; @@ -43,6 +35,9 @@ import org.mockito.stubbing.Answer;
import org.springframework.jms.support.converter.MessageConversionException;
import org.springframework.jms.support.converter.SimpleMessageConverter;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* Unit tests for the {@link SimpleMessageConverter} class.
*

10
spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJackson2MessageConverterTests.java

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jms.support.converter;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.Date;
@ -38,6 +31,9 @@ import org.junit.Test; @@ -38,6 +31,9 @@ import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Arjen Poutsma
* @author Dave Syer

10
spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jms.support.converter;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.HashMap;
@ -37,6 +30,9 @@ import org.junit.Test; @@ -37,6 +30,9 @@ import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Arjen Poutsma
* @author Dave Syer

10
spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jms.support.converter;
import static org.junit.Assert.assertEquals;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import javax.jms.BytesMessage;
import javax.jms.Session;
import javax.jms.TextMessage;
@ -34,6 +27,9 @@ import org.junit.Test; @@ -34,6 +27,9 @@ import org.junit.Test;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Arjen Poutsma
*/

5
spring-jms/src/test/java/org/springframework/jms/support/destination/DynamicDestinationResolverTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.jms.support.destination;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Queue;
@ -32,6 +29,8 @@ import junit.framework.TestCase; @@ -32,6 +29,8 @@ import junit.framework.TestCase;
import org.springframework.jms.StubQueue;
import org.springframework.jms.StubTopic;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
*/

7
spring-jms/src/test/java/org/springframework/jms/support/destination/JmsDestinationAccessorTests.java

@ -16,14 +16,13 @@ @@ -16,14 +16,13 @@
package org.springframework.jms.support.destination;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import javax.jms.ConnectionFactory;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Chris Beams

10
spring-jms/src/test/java/org/springframework/jms/support/destination/JndiDestinationResolverTests.java

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.jms.support.destination;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import javax.jms.Destination;
import javax.jms.Session;
import javax.naming.NamingException;
@ -30,6 +23,9 @@ import javax.naming.NamingException; @@ -30,6 +23,9 @@ import javax.naming.NamingException;
import org.junit.Test;
import org.springframework.jms.StubTopic;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
* @author Chris Beams

15
spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateInterceptorTests.java

@ -16,18 +16,6 @@ @@ -16,18 +16,6 @@
package org.springframework.orm.hibernate3;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.sql.SQLException;
import org.aopalliance.intercept.MethodInvocation;
@ -46,6 +34,9 @@ import org.springframework.beans.factory.BeanFactory; @@ -46,6 +34,9 @@ import org.springframework.beans.factory.BeanFactory;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

17
spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateJtaTransactionTests.java

@ -16,20 +16,6 @@ @@ -16,20 +16,6 @@
package org.springframework.orm.hibernate3;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.ArrayList;
import java.util.List;
@ -62,6 +48,9 @@ import org.springframework.transaction.support.TransactionCallbackWithoutResult; @@ -62,6 +48,9 @@ import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

17
spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java

@ -16,20 +16,6 @@ @@ -16,20 +16,6 @@
package org.springframework.orm.hibernate3;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
@ -79,6 +65,9 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException; @@ -79,6 +65,9 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

10
spring-orm/src/test/java/org/springframework/orm/hibernate3/LocalSessionFactoryBeanTests.java

@ -16,13 +16,6 @@ @@ -16,13 +16,6 @@
package org.springframework.orm.hibernate3;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@ -63,6 +56,9 @@ import org.springframework.core.io.FileSystemResource; @@ -63,6 +56,9 @@ import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

6
spring-orm/src/test/java/org/springframework/orm/hibernate3/support/HibernateDaoSupportTests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.orm.hibernate3.support;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
import java.util.List;
@ -26,6 +23,9 @@ import org.hibernate.SessionFactory; @@ -26,6 +23,9 @@ import org.hibernate.SessionFactory;
import org.junit.Test;
import org.springframework.orm.hibernate3.HibernateTemplate;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

8
spring-orm/src/test/java/org/springframework/orm/hibernate3/support/LobTypeTests.java

@ -16,11 +16,6 @@ @@ -16,11 +16,6 @@
package org.springframework.orm.hibernate3.support;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
@ -48,6 +43,9 @@ import org.springframework.tests.transaction.MockJtaTransaction; @@ -48,6 +43,9 @@ import org.springframework.tests.transaction.MockJtaTransaction;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
* @author Phillip Webb

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save