Polishing
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)...
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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")),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 ");
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user