diff --git a/org.springframework.beans/.classpath b/org.springframework.beans/.classpath index 4636741915..29117f917c 100644 --- a/org.springframework.beans/.classpath +++ b/org.springframework.beans/.classpath @@ -11,7 +11,6 @@ - diff --git a/org.springframework.beans/ivy.xml b/org.springframework.beans/ivy.xml index f3c41e0271..d26d757c53 100644 --- a/org.springframework.beans/ivy.xml +++ b/org.springframework.beans/ivy.xml @@ -26,7 +26,6 @@ - diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BeanUtilsTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/BeanUtilsTests.java index c682d03a71..8089c82996 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/BeanUtilsTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/BeanUtilsTests.java @@ -30,6 +30,8 @@ import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceEditor; +import test.beans.DerivedTestBean; + /** * Unit tests for {@link BeanUtils}. * diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java index 75a063658a..43182fe69a 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperEnumTests.java @@ -20,6 +20,9 @@ import static org.junit.Assert.*; import org.junit.Test; +import test.beans.CustomEnum; +import test.beans.GenericBean; + /** * @author Juergen Hoeller * @author Chris Beams diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java index 4091e87313..cbbdef1a34 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java @@ -38,6 +38,8 @@ import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; +import test.beans.GenericBean; + /** * @author Juergen Hoeller * @author Chris Beams diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java index 74d7b4eaa3..cd3e4c181d 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperTests.java @@ -16,6 +16,8 @@ package org.springframework.beans; +import static org.junit.Assert.*; + import java.beans.PropertyEditorSupport; import java.math.BigDecimal; import java.math.BigInteger; @@ -34,11 +36,11 @@ import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; -import junit.framework.TestCase; import org.apache.commons.logging.LogFactory; -import org.hibernate.FlushMode; - +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowire; import org.springframework.beans.propertyeditors.CustomNumberEditor; import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; import org.springframework.beans.propertyeditors.StringTrimmerEditor; @@ -46,14 +48,18 @@ import org.springframework.beans.support.DerivedFromProtectedBaseBean; import org.springframework.util.StopWatch; import org.springframework.util.StringUtils; +import test.beans.BooleanTestBean; + /** * @author Rod Johnson * @author Juergen Hoeller * @author Alef Arendsen * @author Arjen Poutsma + * @author Chris Beams */ -public class BeanWrapperTests extends TestCase { +public final class BeanWrapperTests { + @Test public void testIsReadablePropertyNotReadable() { NoRead nr = new NoRead(); BeanWrapper bw = new BeanWrapperImpl(nr); @@ -63,12 +69,14 @@ public class BeanWrapperTests extends TestCase { /** * Shouldn't throw an exception: should just return false */ + @Test public void testIsReadablePropertyNoSuchProperty() { NoRead nr = new NoRead(); BeanWrapper bw = new BeanWrapperImpl(nr); assertFalse(bw.isReadableProperty("xxxxx")); } + @Test public void testIsReadablePropertyNull() { NoRead nr = new NoRead(); BeanWrapper bw = new BeanWrapperImpl(nr); @@ -81,6 +89,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testIsWritablePropertyNull() { NoRead nr = new NoRead(); BeanWrapper bw = new BeanWrapperImpl(nr); @@ -93,6 +102,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testReadableAndWritableForIndexedProperties() { BeanWrapper bw = new BeanWrapperImpl(IndexedTestBean.class); @@ -137,6 +147,7 @@ public class BeanWrapperTests extends TestCase { assertFalse(bw.isWritableProperty("array[key1]")); } + @Test public void testTypeDeterminationForIndexedProperty() { BeanWrapper bw = new BeanWrapperImpl(IndexedTestBean.class); assertEquals(null, bw.getPropertyType("map[key0]")); @@ -150,6 +161,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(String.class, bw.getPropertyType("map[key0]")); } + @Test public void testGetterThrowsException() { GetterBean gb = new GetterBean(); BeanWrapper bw = new BeanWrapperImpl(gb); @@ -157,6 +169,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("Set name to tom", gb.getName().equals("tom")); } + @Test public void testEmptyPropertyValuesSet() { TestBean t = new TestBean(); int age = 50; @@ -177,6 +190,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testAllValid() { TestBean t = new TestBean(); String newName = "tony"; @@ -199,6 +213,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testBeanWrapperUpdates() { TestBean t = new TestBean(); int newAge = 33; @@ -215,6 +230,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testValidNullUpdate() { TestBean t = new TestBean(); t.setName("Frank"); // we need to change it back @@ -229,6 +245,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("spouse is now null", t.getSpouse() == null); } + @Test public void testIgnoringIndexedProperty() { MutablePropertyValues values = new MutablePropertyValues(); values.addPropertyValue("toBeIgnored[0]", new Integer(42)); @@ -236,6 +253,7 @@ public class BeanWrapperTests extends TestCase { bw.setPropertyValues(values, true); } + @Test public void testConvertPrimitiveToString() { MutablePropertyValues values = new MutablePropertyValues(); values.addPropertyValue("name", new Integer(42)); @@ -245,6 +263,7 @@ public class BeanWrapperTests extends TestCase { assertEquals("42", tb.getName()); } + @Test public void testConvertClassToString() { MutablePropertyValues values = new MutablePropertyValues(); values.addPropertyValue("name", Integer.class); @@ -259,6 +278,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(Integer.class.toString(), tb.getName()); } + @Test public void testBooleanObject() { BooleanTestBean tb = new BooleanTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -273,6 +293,7 @@ public class BeanWrapperTests extends TestCase { } + @Test public void testNumberObjects() { NumberTestBean tb = new NumberTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -306,6 +327,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("Correct bigDecimal value", new BigDecimal("4.0").equals(tb.getBigDecimal())); } + @Test public void testNumberCoercion() { NumberTestBean tb = new NumberTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -339,18 +361,19 @@ public class BeanWrapperTests extends TestCase { assertTrue("Correct bigDecimal value", new BigDecimal("4.0").equals(tb.getBigDecimal())); } + @Test public void testEnumByFieldName() { EnumTester et = new EnumTester(); BeanWrapper bw = new BeanWrapperImpl(et); - bw.setPropertyValue("flushMode", "MANUAL"); - assertEquals(FlushMode.MANUAL, et.getFlushMode()); + bw.setPropertyValue("autowire", "BY_NAME"); + assertEquals(Autowire.BY_NAME, et.getAutowire()); - bw.setPropertyValue("flushMode", " AUTO "); - assertEquals(FlushMode.AUTO, et.getFlushMode()); + bw.setPropertyValue("autowire", " BY_TYPE "); + assertEquals(Autowire.BY_TYPE, et.getAutowire()); try { - bw.setPropertyValue("flushMode", "EVER"); + bw.setPropertyValue("autowire", "NHERITED"); fail("Should have thrown TypeMismatchException"); } catch (TypeMismatchException ex) { @@ -358,6 +381,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testPropertiesProperty() throws Exception { PropsTester pt = new PropsTester(); BeanWrapper bw = new BeanWrapperImpl(pt); @@ -375,6 +399,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("Freedom==slavery", freedomVal.equals("slavery")); } + @Test public void testStringArrayProperty() throws Exception { PropsTester pt = new PropsTester(); BeanWrapper bw = new BeanWrapperImpl(pt); @@ -384,7 +409,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("foo") && pt.stringArray[1].equals("fi") && pt.stringArray[2].equals("fi") && pt.stringArray[3].equals("fum")); - List list = new ArrayList(); + List list = new ArrayList(); list.add("foo"); list.add("fi"); list.add("fi"); @@ -394,13 +419,13 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("foo") && pt.stringArray[1].equals("fi") && pt.stringArray[2].equals("fi") && pt.stringArray[3].equals("fum")); - Set set = new HashSet(); + Set set = new HashSet(); set.add("foo"); set.add("fi"); set.add("fum"); bw.setPropertyValue("stringArray", set); assertTrue("stringArray length = 3", pt.stringArray.length == 3); - List result = Arrays.asList(pt.stringArray); + List result = Arrays.asList(pt.stringArray); assertTrue("correct values", result.contains("foo") && result.contains("fi") && result.contains("fum")); bw.setPropertyValue("stringArray", "one"); @@ -411,6 +436,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("stringArray is null", pt.stringArray == null); } + @Test public void testStringArrayPropertyWithCustomStringEditor() throws Exception { PropsTester pt = new PropsTester(); BeanWrapper bw = new BeanWrapperImpl(pt); @@ -425,7 +451,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("foo") && pt.stringArray[1].equals("fi") && pt.stringArray[2].equals("fi") && pt.stringArray[3].equals("fum")); - List list = new ArrayList(); + List list = new ArrayList(); list.add("4foo"); list.add("7fi"); list.add("6fi"); @@ -435,13 +461,13 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("foo") && pt.stringArray[1].equals("fi") && pt.stringArray[2].equals("fi") && pt.stringArray[3].equals("fum")); - Set set = new HashSet(); + Set set = new HashSet(); set.add("4foo"); set.add("7fi"); set.add("6fum"); bw.setPropertyValue("stringArray", set); assertTrue("stringArray length = 3", pt.stringArray.length == 3); - List result = Arrays.asList(pt.stringArray); + List result = Arrays.asList(pt.stringArray); assertTrue("correct values", result.contains("foo") && result.contains("fi") && result.contains("fum")); bw.setPropertyValue("stringArray", "8one"); @@ -449,6 +475,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("one")); } + @Test public void testStringArrayPropertyWithStringSplitting() throws Exception { PropsTester pt = new PropsTester(); BeanWrapperImpl bw = new BeanWrapperImpl(pt); @@ -458,6 +485,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("a1") && pt.stringArray[1].equals("b2")); } + @Test public void testStringArrayPropertyWithCustomStringDelimiter() throws Exception { PropsTester pt = new PropsTester(); BeanWrapper bw = new BeanWrapperImpl(pt); @@ -467,6 +495,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.stringArray[0].equals("a1") && pt.stringArray[1].equals("b2")); } + @Test public void testStringPropertyWithCustomEditor() throws Exception { TestBean tb = new TestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -488,6 +517,7 @@ public class BeanWrapperTests extends TestCase { assertEquals("", tb.getName()); } + @Test public void testIntArrayProperty() { PropsTester pt = new PropsTester(); BeanWrapper bw = new BeanWrapperImpl(pt); @@ -502,7 +532,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.intArray[0] == 4 && pt.intArray[1] == 5 && pt.intArray[2] == 2 && pt.intArray[3] == 3); - List list = new ArrayList(); + List list = new ArrayList(); list.add(new Integer(4)); list.add("5"); list.add(new Integer(2)); @@ -512,13 +542,13 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.intArray[0] == 4 && pt.intArray[1] == 5 && pt.intArray[2] == 2 && pt.intArray[3] == 3); - Set set = new HashSet(); + Set set = new HashSet(); set.add("4"); set.add(new Integer(5)); set.add("3"); bw.setPropertyValue("intArray", set); assertTrue("intArray length = 3", pt.intArray.length == 3); - List result = new ArrayList(); + List result = new ArrayList(); result.add(new Integer(pt.intArray[0])); result.add(new Integer(pt.intArray[1])); result.add(new Integer(pt.intArray[2])); @@ -542,6 +572,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.intArray[0] == 1); } + @Test public void testIntArrayPropertyWithCustomEditor() { PropsTester pt = new PropsTester(); BeanWrapper bw = new BeanWrapperImpl(pt); @@ -574,6 +605,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.intArray[0] == 1); } + @Test public void testIntArrayPropertyWithStringSplitting() throws Exception { PropsTester pt = new PropsTester(); BeanWrapperImpl bw = new BeanWrapperImpl(pt); @@ -583,6 +615,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("correct values", pt.intArray[0] == 4 && pt.intArray[1] == 5); } + @Test public void testIndividualAllValid() { TestBean t = new TestBean(); String newName = "tony"; @@ -602,6 +635,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void test2Invalid() { TestBean t = new TestBean(); String newName = "tony"; @@ -625,6 +659,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testPossibleMatches() { TestBean tb = new TestBean(); try { @@ -639,6 +674,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testTypeMismatch() { TestBean t = new TestBean(); try { @@ -651,6 +687,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testEmptyValueForPrimitiveProperty() { TestBean t = new TestBean(); try { @@ -666,6 +703,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testSetPropertyValuesIgnoresInvalidNestedOnRequest() { ITestBean rod = new TestBean(); MutablePropertyValues pvs = new MutablePropertyValues(); @@ -685,6 +723,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testGetNestedProperty() { ITestBean rod = new TestBean("rod", 31); ITestBean kerry = new TestBean("kerry", 35); @@ -699,6 +738,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("spousesSpouse = initial point", rod == spousesSpouse); } + @Test public void testGetNestedPropertyNullValue() throws Exception { ITestBean rod = new TestBean("rod", 31); ITestBean kerry = new TestBean("kerry", 35); @@ -716,6 +756,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testSetNestedProperty() throws Exception { ITestBean rod = new TestBean("rod", 31); ITestBean kerry = new TestBean("kerry", 0); @@ -735,6 +776,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(rod, bw.getPropertyValue("spouse.spouse")); } + @Test public void testSetNestedPropertyNullValue() throws Exception { ITestBean rod = new TestBean("rod", 31); BeanWrapper bw = new BeanWrapperImpl(rod); @@ -749,6 +791,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testSetNestedPropertyPolymorphic() throws Exception { ITestBean rod = new TestBean("rod", 31); ITestBean kerry = new Employee(); @@ -770,6 +813,7 @@ public class BeanWrapperTests extends TestCase { "Lewisham".equals(kbw.getPropertyValue("spouse.spouse.spouse.spouse.company"))); } + @Test public void testNullObject() { try { new BeanWrapperImpl((Object) null); @@ -780,6 +824,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testNestedProperties() { String doctorCompany = ""; String lawyerCompany = "Dr. Sueem"; @@ -791,6 +836,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(lawyerCompany, tb.getLawyer().getCompany()); } + @Test public void testIndexedProperties() { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -853,6 +899,7 @@ public class BeanWrapperTests extends TestCase { assertEquals("nameB", bw.getPropertyValue("map[key4][1].name")); } + @Test public void testIndexedPropertiesWithDirectAccess() { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -911,6 +958,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(tb5, bw.getPropertyValue("map['key9']")); } + @Test public void testMapAccessWithTypeConversion() { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -943,6 +991,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testMapAccessWithUnmodifiableMap() { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -955,7 +1004,7 @@ public class BeanWrapperTests extends TestCase { } }); - Map inputMap = new HashMap(); + Map inputMap = new HashMap(); inputMap.put(new Integer(1), "rod"); inputMap.put(new Integer(2), "rob"); MutablePropertyValues pvs = new MutablePropertyValues(); @@ -965,6 +1014,7 @@ public class BeanWrapperTests extends TestCase { assertEquals("rob", ((TestBean) bean.getMap().get(new Integer(2))).getName()); } + @Test public void testMapAccessWithCustomUnmodifiableMap() { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -977,7 +1027,7 @@ public class BeanWrapperTests extends TestCase { } }); - Map inputMap = new HashMap(); + Map inputMap = new HashMap(); inputMap.put(new Integer(1), "rod"); inputMap.put(new Integer(2), "rob"); MutablePropertyValues pvs = new MutablePropertyValues(); @@ -987,6 +1037,8 @@ public class BeanWrapperTests extends TestCase { assertEquals("rob", ((TestBean) bean.getMap().get(new Integer(2))).getName()); } + @SuppressWarnings("unchecked") // must work with raw map in this test + @Test public void testRawMapAccessWithNoEditorRegistered() { IndexedTestBean bean = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -1001,6 +1053,7 @@ public class BeanWrapperTests extends TestCase { assertFalse(readOnlyMap.isAccessed()); } + @Test public void testPrimitiveArray() { PrimitiveArrayBean tb = new PrimitiveArrayBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -1010,6 +1063,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(2, tb.getArray()[1]); } + @Test public void testLargeMatchingPrimitiveArray() { if (LogFactory.getLog(BeanWrapperTests.class).isTraceEnabled()) { // Skip this test: Trace logging blows the time limit. @@ -1065,6 +1119,7 @@ public class BeanWrapperTests extends TestCase { assertTrue("Took too long", sw.getLastTaskTimeMillis() > time1); } + @Test public void testLargeMatchingPrimitiveArrayWithSpecificEditor() { PrimitiveArrayBean tb = new PrimitiveArrayBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -1082,6 +1137,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(1, tb.getArray()[1]); } + @Test public void testLargeMatchingPrimitiveArrayWithIndexSpecificEditor() { PrimitiveArrayBean tb = new PrimitiveArrayBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -1099,6 +1155,7 @@ public class BeanWrapperTests extends TestCase { assertEquals(1, tb.getArray()[1]); } + @Test public void testPropertiesInProtectedBaseBean() { DerivedFromProtectedBaseBean bean = new DerivedFromProtectedBaseBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -1107,6 +1164,7 @@ public class BeanWrapperTests extends TestCase { assertEquals("someValue", bean.getSomeProperty()); } + @Test public void testErrorMessageOfNestedProperty() { ITestBean parent = new TestBean(); ITestBean child = new DifferentTestBean(); @@ -1121,19 +1179,20 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testMatchingCollections() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Collection coll = new HashSet(); + Collection coll = new HashSet(); coll.add("coll1"); bw.setPropertyValue("collection", coll); - Set set = new HashSet(); + Set set = new HashSet(); set.add("set1"); bw.setPropertyValue("set", set); - SortedSet sortedSet = new TreeSet(); + SortedSet sortedSet = new TreeSet(); sortedSet.add("sortedSet1"); bw.setPropertyValue("sortedSet", sortedSet); - List list = new LinkedList(); + List list = new LinkedList(); list.add("list1"); bw.setPropertyValue("list", list); assertSame(coll, tb.getCollection()); @@ -1142,19 +1201,21 @@ public class BeanWrapperTests extends TestCase { assertSame(list, tb.getList()); } + @SuppressWarnings("unchecked") // list cannot be properly parameterized as it breaks other tests + @Test public void testNonMatchingCollections() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Collection coll = new ArrayList(); + Collection coll = new ArrayList(); coll.add("coll1"); bw.setPropertyValue("collection", coll); - List set = new LinkedList(); + List set = new LinkedList(); set.add("set1"); bw.setPropertyValue("set", set); - List sortedSet = new ArrayList(); + List sortedSet = new ArrayList(); sortedSet.add("sortedSet1"); bw.setPropertyValue("sortedSet", sortedSet); - Set list = new HashSet(); + Set list = new HashSet(); list.add("list1"); bw.setPropertyValue("list", list); assertEquals(1, tb.getCollection().size()); @@ -1167,19 +1228,21 @@ public class BeanWrapperTests extends TestCase { assertTrue(tb.getList().containsAll(list)); } + @SuppressWarnings("unchecked") // list cannot be properly parameterized as it breaks other tests + @Test public void testCollectionsWithArrayValues() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Collection coll = new HashSet(); + Collection coll = new HashSet(); coll.add("coll1"); bw.setPropertyValue("collection", coll.toArray()); - List set = new LinkedList(); + List set = new LinkedList(); set.add("set1"); bw.setPropertyValue("set", set.toArray()); - List sortedSet = new ArrayList(); + List sortedSet = new ArrayList(); sortedSet.add("sortedSet1"); bw.setPropertyValue("sortedSet", sortedSet.toArray()); - Set list = new HashSet(); + Set list = new HashSet(); list.add("list1"); bw.setPropertyValue("list", list.toArray()); assertEquals(1, tb.getCollection().size()); @@ -1192,19 +1255,21 @@ public class BeanWrapperTests extends TestCase { assertTrue(tb.getList().containsAll(list)); } + @SuppressWarnings("unchecked") // list cannot be properly parameterized as it breaks other tests + @Test public void testCollectionsWithIntArrayValues() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Collection coll = new HashSet(); + Collection coll = new HashSet(); coll.add(new Integer(0)); bw.setPropertyValue("collection", new int[] {0}); - List set = new LinkedList(); + List set = new LinkedList(); set.add(new Integer(1)); bw.setPropertyValue("set", new int[] {1}); - List sortedSet = new ArrayList(); + List sortedSet = new ArrayList(); sortedSet.add(new Integer(2)); bw.setPropertyValue("sortedSet", new int[] {2}); - Set list = new HashSet(); + Set list = new HashSet(); list.add(new Integer(3)); bw.setPropertyValue("list", new int[] {3}); assertEquals(1, tb.getCollection().size()); @@ -1217,19 +1282,21 @@ public class BeanWrapperTests extends TestCase { assertTrue(tb.getList().containsAll(list)); } + @SuppressWarnings("unchecked") // list cannot be properly parameterized as it breaks other tests + @Test public void testCollectionsWithIntegerValues() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Collection coll = new HashSet(); + Collection coll = new HashSet(); coll.add(new Integer(0)); bw.setPropertyValue("collection", new Integer(0)); - List set = new LinkedList(); + List set = new LinkedList(); set.add(new Integer(1)); bw.setPropertyValue("set", new Integer(1)); - List sortedSet = new ArrayList(); + List sortedSet = new ArrayList(); sortedSet.add(new Integer(2)); bw.setPropertyValue("sortedSet", new Integer(2)); - Set list = new HashSet(); + Set list = new HashSet(); list.add(new Integer(3)); bw.setPropertyValue("list", new Integer(3)); assertEquals(1, tb.getCollection().size()); @@ -1242,16 +1309,18 @@ public class BeanWrapperTests extends TestCase { assertTrue(tb.getList().containsAll(list)); } + @SuppressWarnings("unchecked") // list cannot be properly parameterized as it breaks other tests + @Test public void testCollectionsWithStringValues() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - List set = new LinkedList(); + List set = new LinkedList(); set.add("set1"); bw.setPropertyValue("set", "set1"); - List sortedSet = new ArrayList(); + List sortedSet = new ArrayList(); sortedSet.add("sortedSet1"); bw.setPropertyValue("sortedSet", "sortedSet1"); - Set list = new HashSet(); + Set list = new HashSet(); list.add("list1"); bw.setPropertyValue("list", "list1"); assertEquals(1, tb.getSet().size()); @@ -1262,6 +1331,7 @@ public class BeanWrapperTests extends TestCase { assertTrue(tb.getList().containsAll(list)); } + @Test public void testCollectionsWithStringValuesAndCustomEditor() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); @@ -1282,26 +1352,28 @@ public class BeanWrapperTests extends TestCase { assertTrue(tb.getList().contains("list1")); } + @Test public void testMatchingMaps() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Map map = new HashMap(); + Map map = new HashMap(); map.put("key", "value"); bw.setPropertyValue("map", map); - SortedMap sortedMap = new TreeMap(); + SortedMap sortedMap = new TreeMap(); map.put("sortedKey", "sortedValue"); bw.setPropertyValue("sortedMap", sortedMap); assertSame(map, tb.getMap()); assertSame(sortedMap, tb.getSortedMap()); } + @Test public void testNonMatchingMaps() { IndexedTestBean tb = new IndexedTestBean(); BeanWrapper bw = new BeanWrapperImpl(tb); - Map map = new TreeMap(); + Map map = new TreeMap(); map.put("key", "value"); bw.setPropertyValue("map", map); - Map sortedMap = new HashMap(); + Map sortedMap = new TreeMap(); sortedMap.put("sortedKey", "sortedValue"); bw.setPropertyValue("sortedMap", sortedMap); assertEquals(1, tb.getMap().size()); @@ -1310,6 +1382,7 @@ public class BeanWrapperTests extends TestCase { assertEquals("sortedValue", tb.getSortedMap().get("sortedKey")); } + @Test public void testSetNumberProperties() { NumberPropertyBean bean = new NumberPropertyBean(); BeanWrapper bw = new BeanWrapperImpl(bean); @@ -1359,6 +1432,7 @@ public class BeanWrapperTests extends TestCase { } + @Test public void testAlternativesForTypo() { IntelliBean ib = new IntelliBean(); BeanWrapper bw = new BeanWrapperImpl(ib); @@ -1371,6 +1445,7 @@ public class BeanWrapperTests extends TestCase { } } + @Test public void testAlternativesForTypos() { IntelliBean ib = new IntelliBean(); BeanWrapper bw = new BeanWrapperImpl(ib); @@ -1398,14 +1473,14 @@ public class BeanWrapperTests extends TestCase { private static class EnumTester { - private FlushMode flushMode; + private Autowire autowire; - public void setFlushMode(FlushMode flushMode) { - this.flushMode = flushMode; + public void setAutowire(Autowire autowire) { + this.autowire = autowire; } - public FlushMode getFlushMode() { - return flushMode; + public Autowire getAutowire() { + return autowire; } } @@ -1608,8 +1683,29 @@ public class BeanWrapperTests extends TestCase { public void setMyStringss(String string) {} } + private static class Employee extends TestBean { - public static class ReadOnlyMap extends HashMap { + private String co; + + /** + * Constructor for Employee. + */ + public Employee() { + super(); + } + + public String getCompany() { + return co; + } + + public void setCompany(String co) { + this.co = co; + } + + } + + @SuppressWarnings("serial") + public static class ReadOnlyMap extends HashMap { private boolean frozen = false; @@ -1619,7 +1715,7 @@ public class BeanWrapperTests extends TestCase { this.frozen = true; } - public ReadOnlyMap(Map map) { + public ReadOnlyMap(Map map) { super(map); this.frozen = true; } @@ -1633,12 +1729,12 @@ public class BeanWrapperTests extends TestCase { } } - public Set entrySet() { + public Set> entrySet() { this.accessed = true; return super.entrySet(); } - public Set keySet() { + public Set keySet() { this.accessed = true; return super.keySet(); } diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java index 09db3bb2ce..514d2b2984 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/CachedIntrospectionResultsTests.java @@ -16,15 +16,18 @@ package org.springframework.beans; -import junit.framework.TestCase; +import static org.junit.Assert.*; +import org.junit.Test; import org.springframework.core.OverridingClassLoader; /** * @author Juergen Hoeller + * @author Chris Beams */ -public class CachedIntrospectionResultsTests extends TestCase { +public final class CachedIntrospectionResultsTests { + @Test public void testAcceptClassLoader() throws Exception { BeanWrapper bw = new BeanWrapperImpl(TestBean.class); assertTrue(bw.isWritableProperty("name")); @@ -32,7 +35,7 @@ public class CachedIntrospectionResultsTests extends TestCase { assertTrue(CachedIntrospectionResults.classCache.containsKey(TestBean.class)); ClassLoader child = new OverridingClassLoader(getClass().getClassLoader()); - Class tbClass = child.loadClass("org.springframework.beans.TestBean"); + Class tbClass = child.loadClass("org.springframework.beans.TestBean"); assertFalse(CachedIntrospectionResults.classCache.containsKey(tbClass)); CachedIntrospectionResults.acceptClassLoader(child); bw = new BeanWrapperImpl(tbClass); diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java index 028f79e46c..e27ccaccce 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java @@ -16,6 +16,8 @@ package org.springframework.beans; +import static org.junit.Assert.*; + import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Collections; @@ -24,29 +26,32 @@ import java.util.Iterator; import java.util.Properties; import java.util.Set; -import junit.framework.TestCase; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.junit.Test; /** * @author Guillaume Poirier * @author Juergen Hoeller + * @author Chris Beams * @since 08.03.2004 */ -public class ConcurrentBeanWrapperTests extends TestCase { +public final class ConcurrentBeanWrapperTests { private final Log logger = LogFactory.getLog(getClass()); - private Set set = Collections.synchronizedSet(new HashSet()); + private Set set = Collections.synchronizedSet(new HashSet()); private Throwable ex = null; + @Test public void testSingleThread() { for (int i = 0; i < 100; i++) { performSet(); } } - + + @Test public void testConcurrent() { for (int i = 0; i < 10; i++) { TestRun run = new TestRun(this); @@ -79,7 +84,7 @@ public class ConcurrentBeanWrapperTests extends TestCase { assertTrue("The System properties must not be empty", p.size() != 0); - for (Iterator i = p.entrySet().iterator(); i.hasNext();) { + for (Iterator i = p.entrySet().iterator(); i.hasNext();) { i.next(); if (Math.random() > 0.9) { i.remove(); diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/Employee.java b/org.springframework.beans/src/test/java/org/springframework/beans/Employee.java deleted file mode 100644 index 767134094c..0000000000 --- a/org.springframework.beans/src/test/java/org/springframework/beans/Employee.java +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * Copyright 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.beans; - -public class Employee extends TestBean { - - private String co; - - /** - * Constructor for Employee. - */ - public Employee() { - super(); - } - - public String getCompany() { - return co; - } - - public void setCompany(String co) { - this.co = co; - } - -} \ No newline at end of file diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/GenericIntegerBean.java b/org.springframework.beans/src/test/java/org/springframework/beans/GenericIntegerBean.java index 5970af0fc5..76f294eed3 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/GenericIntegerBean.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/GenericIntegerBean.java @@ -16,6 +16,8 @@ package org.springframework.beans; +import test.beans.GenericBean; + /** * @author Juergen Hoeller */ diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/GenericSetOfIntegerBean.java b/org.springframework.beans/src/test/java/org/springframework/beans/GenericSetOfIntegerBean.java index 54e18c3a17..7c3ff5688c 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/GenericSetOfIntegerBean.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/GenericSetOfIntegerBean.java @@ -18,6 +18,8 @@ package org.springframework.beans; import java.util.Set; +import test.beans.GenericBean; + /** * @author Juergen Hoeller */ diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/IndexedTestBean.java b/org.springframework.beans/src/test/java/org/springframework/beans/IndexedTestBean.java index ddb091770e..9185a486c6 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/IndexedTestBean.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/IndexedTestBean.java @@ -34,13 +34,13 @@ public class IndexedTestBean { private TestBean[] array; - private Collection collection; + private Collection collection; private List list; - private Set set; + private Set set; - private SortedSet sortedSet; + private SortedSet sortedSet; private Map map; @@ -69,13 +69,13 @@ public class IndexedTestBean { TestBean tbX = new TestBean("nameX", 0); TestBean tbY = new TestBean("nameY", 0); this.array = new TestBean[] {tb0, tb1}; - this.list = new ArrayList(); + this.list = new ArrayList(); this.list.add(tb2); this.list.add(tb3); - this.set = new TreeSet(); + this.set = new TreeSet(); this.set.add(tb6); this.set.add(tb7); - this.map = new HashMap(); + this.map = new HashMap(); this.map.put("key1", tb4); this.map.put("key2", tb5); this.map.put("key.3", tb5); @@ -94,11 +94,11 @@ public class IndexedTestBean { this.array = array; } - public Collection getCollection() { + public Collection getCollection() { return collection; } - public void setCollection(Collection collection) { + public void setCollection(Collection collection) { this.collection = collection; } @@ -110,19 +110,19 @@ public class IndexedTestBean { this.list = list; } - public Set getSet() { + public Set getSet() { return set; } - public void setSet(Set set) { + public void setSet(Set set) { this.set = set; } - public SortedSet getSortedSet() { + public SortedSet getSortedSet() { return sortedSet; } - public void setSortedSet(SortedSet sortedSet) { + public void setSortedSet(SortedSet sortedSet) { this.sortedSet = sortedSet; } diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/PropertyAccessorUtilsTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/PropertyAccessorUtilsTests.java index 7c48383080..be5e858903 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/PropertyAccessorUtilsTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/PropertyAccessorUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2008 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,19 @@ package org.springframework.beans; +import static org.junit.Assert.*; + import java.util.Arrays; -import junit.framework.TestCase; +import org.junit.Test; /** * @author Juergen Hoeller + * @author Chris Beams */ -public class PropertyAccessorUtilsTests extends TestCase { +public final class PropertyAccessorUtilsTests { + @Test public void testCanonicalPropertyName() { assertEquals("map", PropertyAccessorUtils.canonicalPropertyName("map")); assertEquals("map[key1]", PropertyAccessorUtils.canonicalPropertyName("map[key1]")); @@ -37,6 +41,7 @@ public class PropertyAccessorUtilsTests extends TestCase { assertEquals("map[key1].name", PropertyAccessorUtils.canonicalPropertyName("map[\"key1\"].name")); } + @Test public void testCanonicalPropertyNames() { String[] original = new String[] {"map", "map[key1]", "map['key1']", "map[\"key1\"]", "map[key1][key2]", diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java index 52eeefc62e..7049fa2f2e 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java @@ -39,7 +39,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Test; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; import org.springframework.beans.ITestBean; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.NestedTestBean; @@ -73,6 +72,8 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import org.springframework.util.StopWatch; +import test.beans.DerivedTestBean; + import common.beans.core.SideEffectBean; /** diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java index 0b960a36ea..aa72ee42da 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java @@ -21,10 +21,11 @@ import java.util.Arrays; import junit.framework.TestCase; import org.springframework.beans.BeansException; -import org.springframework.beans.DerivedTestBean; import org.springframework.beans.TestBean; import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry; +import test.beans.DerivedTestBean; + /** * @author Juergen Hoeller * @since 04.07.2006 diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java index edeea8881b..494aaa5ee4 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java @@ -31,7 +31,6 @@ import java.util.Map; import java.util.Set; import org.junit.Test; -import org.springframework.beans.GenericBean; import org.springframework.beans.GenericIntegerBean; import org.springframework.beans.GenericSetOfIntegerBean; import org.springframework.beans.PropertyEditorRegistrar; @@ -41,6 +40,8 @@ import org.springframework.beans.propertyeditors.CustomNumberEditor; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.UrlResource; +import test.beans.GenericBean; + /** * @author Juergen Hoeller * @author Chris Beams diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml b/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml index a2c2585b78..63614f687c 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml +++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/support/genericBeanTests.xml @@ -3,7 +3,7 @@ - + diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java index ef0f5664e7..19394f52a3 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java @@ -42,7 +42,6 @@ import org.junit.Test; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeansException; -import org.springframework.beans.BooleanTestBean; import org.springframework.beans.ITestBean; import org.springframework.beans.IndexedTestBean; import org.springframework.beans.MutablePropertyValues; @@ -50,6 +49,8 @@ import org.springframework.beans.NumberTestBean; import org.springframework.beans.PropertyValue; import org.springframework.beans.TestBean; +import test.beans.BooleanTestBean; + /** * Unit tests for the various PropertyEditors in Spring. * diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BooleanTestBean.java b/org.springframework.beans/src/test/java/test/beans/BooleanTestBean.java similarity index 90% rename from org.springframework.beans/src/test/java/org/springframework/beans/BooleanTestBean.java rename to org.springframework.beans/src/test/java/test/beans/BooleanTestBean.java index 19231819cb..37a022b661 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/BooleanTestBean.java +++ b/org.springframework.beans/src/test/java/test/beans/BooleanTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2008 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. @@ -14,10 +14,11 @@ * limitations under the License. */ -package org.springframework.beans; +package test.beans; /** * @author Juergen Hoeller + * @author Chris Beams * @since 10.06.2003 */ public class BooleanTestBean { diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/CustomEnum.java b/org.springframework.beans/src/test/java/test/beans/CustomEnum.java similarity index 95% rename from org.springframework.beans/src/test/java/org/springframework/beans/CustomEnum.java rename to org.springframework.beans/src/test/java/test/beans/CustomEnum.java index 1e43492191..d7404bc678 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/CustomEnum.java +++ b/org.springframework.beans/src/test/java/test/beans/CustomEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package test.beans; /** * @author Juergen Hoeller diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/DerivedTestBean.java b/org.springframework.beans/src/test/java/test/beans/DerivedTestBean.java similarity index 96% rename from org.springframework.beans/src/test/java/org/springframework/beans/DerivedTestBean.java rename to org.springframework.beans/src/test/java/test/beans/DerivedTestBean.java index 2bb41a9d5b..918a91e6bd 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/DerivedTestBean.java +++ b/org.springframework.beans/src/test/java/test/beans/DerivedTestBean.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package org.springframework.beans; +package test.beans; import java.io.Serializable; +import org.springframework.beans.TestBean; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.DisposableBean; diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/GenericBean.java b/org.springframework.beans/src/test/java/test/beans/GenericBean.java similarity index 99% rename from org.springframework.beans/src/test/java/org/springframework/beans/GenericBean.java rename to org.springframework.beans/src/test/java/test/beans/GenericBean.java index c4b85fa1f6..f6e13e9052 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/GenericBean.java +++ b/org.springframework.beans/src/test/java/test/beans/GenericBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.beans; +package test.beans; import java.util.ArrayList; import java.util.Collection; diff --git a/org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/shortcutTests.xml b/org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/shortcutTests.xml index 2d5762942f..71c3e46318 100644 --- a/org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/shortcutTests.xml +++ b/org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/shortcutTests.xml @@ -22,6 +22,6 @@ - +