Polishing

This commit is contained in:
Juergen Hoeller
2016-07-26 17:15:15 +02:00
parent 7b564b72a1
commit e03dea1d64
193 changed files with 324 additions and 323 deletions

View File

@@ -42,7 +42,7 @@ import static org.junit.Assert.*;
* @author Chris Beams
* @since 19.05.2003
*/
public final class BeanUtilsTests {
public class BeanUtilsTests {
@Test
public void testInstantiateClass() {

View File

@@ -31,7 +31,7 @@ import static org.junit.Assert.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class BeanWrapperEnumTests {
public class BeanWrapperEnumTests {
@Test
public void testCustomEnum() {

View File

@@ -36,7 +36,7 @@ import static org.junit.Assert.*;
* @author Chris Beams
* @since 08.03.2004
*/
public final class ConcurrentBeanWrapperTests {
public class ConcurrentBeanWrapperTests {
private final Log logger = LogFactory.getLog(getClass());

View File

@@ -26,7 +26,7 @@ import static org.junit.Assert.*;
* @author Rod Johnson
* @author Chris Beams
*/
public final class MutablePropertyValuesTests extends AbstractPropertyValuesTests {
public class MutablePropertyValuesTests extends AbstractPropertyValuesTests {
@Test
public void testValid() throws Exception {

View File

@@ -26,7 +26,7 @@ import static org.junit.Assert.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class PropertyAccessorUtilsTests {
public class PropertyAccessorUtilsTests {
@Test
public void testCanonicalPropertyName() {

View File

@@ -43,7 +43,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Chris Beams
* @since 04.07.2003
*/
public final class BeanFactoryUtilsTests {
public class BeanFactoryUtilsTests {
private static final Class<?> CLASS = BeanFactoryUtilsTests.class;
private static final Resource ROOT_CONTEXT = qualifiedResource(CLASS, "root.xml");

View File

@@ -48,7 +48,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Chris Beams
* @since 10.03.2004
*/
public final class ConcurrentBeanFactoryTests {
public class ConcurrentBeanFactoryTests {
private static final Log logger = LogFactory.getLog(ConcurrentBeanFactoryTests.class);
private static final Resource CONTEXT = qualifiedResource(ConcurrentBeanFactoryTests.class, "context.xml");

View File

@@ -26,7 +26,7 @@ import static org.junit.Assert.*;
* @author Rick Evans
* @author Chris Beams
*/
public final class AnnotationBeanWiringInfoResolverTests {
public class AnnotationBeanWiringInfoResolverTests {
@Test
public void testResolveWiringInfo() throws Exception {

View File

@@ -36,7 +36,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class CustomAutowireConfigurerTests {
public class CustomAutowireConfigurerTests {
private static final Resource CONTEXT = qualifiedResource(CustomAutowireConfigurerTests.class, "context.xml");

View File

@@ -39,7 +39,7 @@ import static org.junit.Assert.*;
* @author Chris Beams
* @since 2.0
*/
public final class RequiredAnnotationBeanPostProcessorTests {
public class RequiredAnnotationBeanPostProcessorTests {
@Test
public void testWithRequiredPropertyOmitted() {

View File

@@ -42,7 +42,7 @@ import static org.junit.Assert.*;
* @author Chris Beams
* @since 31.07.2004
*/
public final class CustomEditorConfigurerTests {
public class CustomEditorConfigurerTests {
@Test
public void testCustomEditorConfigurerWithPropertyEditorRegistrar() throws ParseException {

View File

@@ -34,7 +34,7 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class CustomScopeConfigurerTests {
public class CustomScopeConfigurerTests {
private static final String FOO_SCOPE = "fooScope";
private ConfigurableListableBeanFactory factory;
@@ -81,7 +81,7 @@ public final class CustomScopeConfigurerTests {
assertTrue(factory.getRegisteredScope(FOO_SCOPE) instanceof NoOpScope);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testWhereScopeMapHasNullScopeValueInEntrySet() throws Exception {
Map<String, Object> scopes = new HashMap<>();
scopes.put(FOO_SCOPE, null);
@@ -90,7 +90,7 @@ public final class CustomScopeConfigurerTests {
figurer.postProcessBeanFactory(factory);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testWhereScopeMapHasNonScopeInstanceInEntrySet() throws Exception {
Map<String, Object> scopes = new HashMap<>();
scopes.put(FOO_SCOPE, this); // <-- not a valid value...
@@ -100,7 +100,7 @@ public final class CustomScopeConfigurerTests {
}
@SuppressWarnings("unchecked")
@Test(expected=ClassCastException.class)
@Test(expected = ClassCastException.class)
public void testWhereScopeMapHasNonStringTypedScopeNameInKeySet() throws Exception {
Map scopes = new HashMap();
scopes.put(this, new NoOpScope()); // <-- not a valid value (the key)...

View File

@@ -35,7 +35,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Chris Beams
* @since 31.07.2004
*/
public final class FieldRetrievingFactoryBeanTests {
public class FieldRetrievingFactoryBeanTests {
private static final Resource CONTEXT =
qualifiedResource(FieldRetrievingFactoryBeanTests.class, "context.xml");

View File

@@ -32,7 +32,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Chris Beams
* @since 01.11.2003
*/
public final class PropertiesFactoryBeanTests {
public class PropertiesFactoryBeanTests {
private static final Class<?> CLASS = PropertiesFactoryBeanTests.class;
private static final Resource TEST_PROPS = qualifiedResource(CLASS, "test.properties");

View File

@@ -38,7 +38,7 @@ import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;
* @author Rick Evans
* @author Chris Beams
*/
public final class ServiceLocatorFactoryBeanTests {
public class ServiceLocatorFactoryBeanTests {
private DefaultListableBeanFactory bf;
@@ -237,12 +237,12 @@ public final class ServiceLocatorFactoryBeanTests {
assertTrue(testBean4 instanceof ExtendedTestService);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testNoServiceLocatorInterfaceSupplied() throws Exception {
new ServiceLocatorFactoryBean().afterPropertiesSet();
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testWhenServiceLocatorInterfaceIsNotAnInterfaceType() throws Exception {
ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean();
factory.setServiceLocatorInterface(getClass());
@@ -250,14 +250,14 @@ public final class ServiceLocatorFactoryBeanTests {
// should throw, bad (non-interface-type) serviceLocator interface supplied
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testWhenServiceLocatorExceptionClassToExceptionTypeWithOnlyNoArgCtor() throws Exception {
ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean();
factory.setServiceLocatorExceptionClass(ExceptionClassWithOnlyZeroArgCtor.class);
// should throw, bad (invalid-Exception-type) serviceLocatorException class supplied
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
@SuppressWarnings("unchecked")
public void testWhenServiceLocatorExceptionClassIsNotAnExceptionSubclass() throws Exception {
ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean();
@@ -265,7 +265,7 @@ public final class ServiceLocatorFactoryBeanTests {
// should throw, bad (non-Exception-type) serviceLocatorException class supplied
}
@Test(expected=UnsupportedOperationException.class)
@Test(expected = UnsupportedOperationException.class)
public void testWhenServiceLocatorMethodCalledWithTooManyParameters() throws Exception {
ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean();
factory.setServiceLocatorInterface(ServiceLocatorInterfaceWithExtraNonCompliantMethod.class);

View File

@@ -38,7 +38,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class SimpleScopeTests {
public class SimpleScopeTests {
private static final Resource CONTEXT = qualifiedResource(SimpleScopeTests.class, "context.xml");

View File

@@ -24,9 +24,9 @@ import org.junit.Test;
* @author Rick Evans
* @author Chris Beams
*/
public final class ConstructorArgumentEntryTests {
public class ConstructorArgumentEntryTests {
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorBailsOnNegativeCtorIndexArgument() {
new ConstructorArgumentEntry(-1);
}

View File

@@ -35,7 +35,7 @@ import static org.springframework.tests.TestResourceUtils.*;
* @author Chris Beams
* @since 2.0
*/
public final class CustomProblemReporterTests {
public class CustomProblemReporterTests {
private static final Resource CONTEXT = qualifiedResource(CustomProblemReporterTests.class, "context.xml");

View File

@@ -28,9 +28,9 @@ import static org.mockito.BDDMockito.*;
* @author Juergen Hoeller
* @author Chris Beams
*/
public final class FailFastProblemReporterTests {
public class FailFastProblemReporterTests {
@Test(expected=BeanDefinitionParsingException.class)
@Test(expected = BeanDefinitionParsingException.class)
public void testError() throws Exception {
FailFastProblemReporter reporter = new FailFastProblemReporter();
reporter.error(new Problem("VGER", new Location(new DescriptiveResource("here")),

View File

@@ -24,7 +24,7 @@ import static org.junit.Assert.*;
* @author Rick Evans
* @author Chris Beams
*/
public final class NullSourceExtractorTests {
public class NullSourceExtractorTests {
@Test
public void testPassThroughContract() throws Exception {

View File

@@ -26,7 +26,7 @@ import static org.junit.Assert.*;
* @author Rick Evans
* @author Chris Beams
*/
public final class PassThroughSourceExtractorTests {
public class PassThroughSourceExtractorTests {
@Test
public void testPassThroughContract() throws Exception {

View File

@@ -24,19 +24,19 @@ import org.junit.Test;
* @author Rick Evans
* @author Chris Beams
*/
public final class PropertyEntryTests {
public class PropertyEntryTests {
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorBailsOnNullPropertyNameArgument() throws Exception {
new PropertyEntry(null);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorBailsOnEmptyPropertyNameArgument() throws Exception {
new PropertyEntry("");
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorBailsOnWhitespacedPropertyNameArgument() throws Exception {
new PropertyEntry("\t ");
}

View File

@@ -26,7 +26,7 @@ import static org.junit.Assert.*;
* @author Rick Evans
* @author Sam Brannen
*/
public final class BeanWiringInfoTests {
public class BeanWiringInfoTests {
@Test(expected = IllegalArgumentException.class)
public void ctorWithNullBeanName() throws Exception {

View File

@@ -25,7 +25,7 @@ import static org.junit.Assert.*;
*
* @author Rick Evans
*/
public final class ClassNameBeanWiringInfoResolverTests {
public class ClassNameBeanWiringInfoResolverTests {
@Test(expected = IllegalArgumentException.class)
public void resolveWiringInfoWithNullBeanInstance() throws Exception {

View File

@@ -26,19 +26,19 @@ import org.xml.sax.InputSource;
* @author Rick Evans
* @author Chris Beams
*/
public final class DelegatingEntityResolverTests {
public class DelegatingEntityResolverTests {
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorWhereDtdEntityResolverIsNull() throws Exception {
new DelegatingEntityResolver(null, new NoOpEntityResolver());
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorWhereSchemaEntityResolverIsNull() throws Exception {
new DelegatingEntityResolver(new NoOpEntityResolver(), null);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorWhereEntityResolversAreBothNull() throws Exception {
new DelegatingEntityResolver(null, null);
}

View File

@@ -61,7 +61,7 @@ public class ProfileXmlBeanDefinitionTests {
private static final String TARGET_BEAN = "foo";
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testProfileValidation() {
beanFactoryFor(PROD_ELIGIBLE_XML, NULL_ACTIVE);
}

View File

@@ -77,7 +77,7 @@ public class DefaultNamespaceHandlerResolverTests {
new DefaultNamespaceHandlerResolver(null);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorWithNullClassLoaderArgumentAndNullMappingLocationArgument() throws Exception {
new DefaultNamespaceHandlerResolver(null, null);
}

View File

@@ -27,7 +27,7 @@ import static org.junit.Assert.*;
*
* @author Rick Evans
*/
public final class ByteArrayPropertyEditorTests {
public class ByteArrayPropertyEditorTests {
private final PropertyEditor byteEditor = new ByteArrayPropertyEditor();

View File

@@ -27,7 +27,7 @@ import static org.junit.Assert.*;
*
* @author Rick Evans
*/
public final class CharArrayPropertyEditorTests {
public class CharArrayPropertyEditorTests {
private final PropertyEditor charEditor = new CharArrayPropertyEditor();

View File

@@ -30,20 +30,20 @@ import static org.junit.Assert.*;
* @author Rick Evans
* @author Chris Beams
*/
public final class CustomCollectionEditorTests {
public class CustomCollectionEditorTests {
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testCtorWithNullCollectionType() throws Exception {
new CustomCollectionEditor(null);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
@SuppressWarnings("unchecked")
public void testCtorWithNonCollectionType() throws Exception {
new CustomCollectionEditor((Class) String.class);
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testWithCollectionTypeThatDoesNotExposeAPublicNoArgCtor() throws Exception {
CustomCollectionEditor editor = new CustomCollectionEditor(CollectionTypeWithNoNoArgCtor.class);
editor.setValue("1");