From 76032b43bf2d29a68c19cd19561fc7290cfaef49 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Wed, 29 Oct 2008 12:49:51 +0000 Subject: [PATCH] Moved tests over from testsuite to beans git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@183 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../beans/propertyeditors/BeanInfoTests.java | 0 .../ByteArrayPropertyEditorTests.java | 0 .../CharArrayPropertyEditorTests.java | 0 .../beans/MutablePropertyValuesTests.java | 97 ------------------- 4 files changed, 97 deletions(-) rename {org.springframework.testsuite => org.springframework.beans}/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java (100%) rename {org.springframework.testsuite => org.springframework.beans}/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java (100%) rename {org.springframework.testsuite => org.springframework.beans}/src/test/java/org/springframework/beans/propertyeditors/CharArrayPropertyEditorTests.java (100%) delete mode 100644 org.springframework.testsuite/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java rename to org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/BeanInfoTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java rename to org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/ByteArrayPropertyEditorTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/beans/propertyeditors/CharArrayPropertyEditorTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/CharArrayPropertyEditorTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/beans/propertyeditors/CharArrayPropertyEditorTests.java rename to org.springframework.beans/src/test/java/org/springframework/beans/propertyeditors/CharArrayPropertyEditorTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java b/org.springframework.testsuite/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java deleted file mode 100644 index c6fa04227a4..00000000000 --- a/org.springframework.testsuite/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java +++ /dev/null @@ -1,97 +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; - -/** - * Tests for MutablePropertyValues. - * - * @author Rod Johnson - */ -public class MutablePropertyValuesTests extends AbstractPropertyValuesTests { - - public void testValid() throws Exception { - MutablePropertyValues pvs = new MutablePropertyValues(); - pvs.addPropertyValue(new PropertyValue("forname", "Tony")); - pvs.addPropertyValue(new PropertyValue("surname", "Blair")); - pvs.addPropertyValue(new PropertyValue("age", "50")); - doTestTony(pvs); - - MutablePropertyValues deepCopy = new MutablePropertyValues(pvs); - doTestTony(deepCopy); - deepCopy.setPropertyValueAt(new PropertyValue("name", "Gordon"), 0); - doTestTony(pvs); - assertEquals("Gordon", deepCopy.getPropertyValue("name").getValue()); - } - - public void addOrOverride() throws Exception { - MutablePropertyValues pvs = new MutablePropertyValues(); - pvs.addPropertyValue(new PropertyValue("forname", "Tony")); - pvs.addPropertyValue(new PropertyValue("surname", "Blair")); - pvs.addPropertyValue(new PropertyValue("age", "50")); - doTestTony(pvs); - PropertyValue addedPv = new PropertyValue("rod", "Rod"); - pvs.addPropertyValue(addedPv); - assertTrue(pvs.getPropertyValue("rod").equals(addedPv)); - PropertyValue changedPv = new PropertyValue("forname", "Greg"); - pvs.addPropertyValue(changedPv); - assertTrue(pvs.getPropertyValue("forename").equals(changedPv)); - } - - public void testChangesOnEquals() throws Exception { - MutablePropertyValues pvs = new MutablePropertyValues(); - pvs.addPropertyValue(new PropertyValue("forname", "Tony")); - pvs.addPropertyValue(new PropertyValue("surname", "Blair")); - pvs.addPropertyValue(new PropertyValue("age", "50")); - MutablePropertyValues pvs2 = pvs; - PropertyValues changes = pvs2.changesSince(pvs); - assertTrue("changes are empty", changes.getPropertyValues().length == 0); - } - - public void testChangeOfOneField() throws Exception { - MutablePropertyValues pvs = new MutablePropertyValues(); - pvs.addPropertyValue(new PropertyValue("forname", "Tony")); - pvs.addPropertyValue(new PropertyValue("surname", "Blair")); - pvs.addPropertyValue(new PropertyValue("age", "50")); - - MutablePropertyValues pvs2 = new MutablePropertyValues(pvs); - PropertyValues changes = pvs2.changesSince(pvs); - assertTrue("changes are empty, not of length " + changes.getPropertyValues().length, - changes.getPropertyValues().length == 0); - - pvs2.addPropertyValue(new PropertyValue("forname", "Gordon")); - changes = pvs2.changesSince(pvs); - assertEquals("1 change", 1, changes.getPropertyValues().length); - PropertyValue fn = changes.getPropertyValue("forname"); - assertTrue("change is forname", fn != null); - assertTrue("new value is gordon", fn.getValue().equals("Gordon")); - - MutablePropertyValues pvs3 = new MutablePropertyValues(pvs); - changes = pvs3.changesSince(pvs); - assertTrue("changes are empty, not of length " + changes.getPropertyValues().length, - changes.getPropertyValues().length == 0); - - // add new - pvs3.addPropertyValue(new PropertyValue("foo", "bar")); - pvs3.addPropertyValue(new PropertyValue("fi", "fum")); - changes = pvs3.changesSince(pvs); - assertTrue("2 change", changes.getPropertyValues().length == 2); - fn = changes.getPropertyValue("foo"); - assertTrue("change in foo", fn != null); - assertTrue("new value is bar", fn.getValue().equals("bar")); - } - -}