Revision: 4006
Author: [email protected]
Date: Wed Dec 1 09:18:52 2010
Log: This fixes some tests testing some of the copy constructors of
playpencomponents.
http://code.google.com/p/power-architect/source/detail?r=4006
Modified:
/trunk/regress/ca/sqlpower/architect/swingui/TestPlayPenComponent.java
/trunk/regress/ca/sqlpower/architect/swingui/TestRelationship.java
=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/TestPlayPenComponent.java
Fri Apr 9 08:41:23 2010
+++ /trunk/regress/ca/sqlpower/architect/swingui/TestPlayPenComponent.java
Wed Dec 1 09:18:52 2010
@@ -113,7 +113,9 @@
copyIgnoreProperties.add("fontRenderContext");
copyIgnoreProperties.add("height");
copyIgnoreProperties.add("insets");
+ copyIgnoreProperties.add("lengths");
copyIgnoreProperties.add("location");
+ copyIgnoreProperties.add("locationOnScreen");
copyIgnoreProperties.add("magicEnabled");
copyIgnoreProperties.add("opaque");
copyIgnoreProperties.add("parent");
@@ -139,7 +141,6 @@
// copy and original should point to same business object
copySameInstanceIgnoreProperties.add("model");
-
// First pass: set all settable properties, because testing the
duplication of
// an object with all its properties at their defaults
is not a
@@ -199,6 +200,8 @@
return false;
} else if (property.getPropertyType() == Integer.class ||
property.getPropertyType() == Integer.TYPE) {
return false;
+ } else if (property.getPropertyType() == Double.class ||
property.getPropertyType() == Double.TYPE) {
+ return false;
} else if (property.getPropertyType() == Color.class) {
return false;
} else if (property.getPropertyType() == Font.class) {
@@ -254,7 +257,13 @@
} else {
newVal = new Integer(((Integer) oldVal).intValue() + 1);
}
- } else if (property.getPropertyType() == Color.class) {
+ } else if (property.getPropertyType() == Double.class ||
property.getPropertyType() == Double.TYPE) {
+ if(oldVal == null) {
+ newVal = new Double(0);
+ } else {
+ newVal = new Double(((Double) oldVal).doubleValue() + 1);
+ }
+ } else if (property.getPropertyType() == Color.class) {
if (oldVal == null) {
newVal = new Color(0xFAC157);
} else {
=======================================
--- /trunk/regress/ca/sqlpower/architect/swingui/TestRelationship.java Wed
Mar 17 14:29:59 2010
+++ /trunk/regress/ca/sqlpower/architect/swingui/TestRelationship.java Wed
Dec 1 09:18:52 2010
@@ -196,4 +196,11 @@
public ArchitectNewValueMaker createNewValueMaker(SPObject root,
DataSourceCollection<SPDataSource> dsCollection) {
return new ArchitectNewValueMaker(root, dsCollection);
}
-}
+ @Override
+ public void testCopyConstructor() throws Exception {
+ // For relationships, since they are positioned by the tables they
connect and not
+ // just positioned with respect to the play pen, we need to ingore
specifically this.
+ copyIgnoreProperties.add("topLeftCorner");
+ super.testCopyConstructor();
+ }
+}