FYI: new checks for javax.swing.table.TableColumn

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FYI: new checks for javax.swing.table.TableColumn

Dave Gilbert-4
I committed this patch:

2005-07-25  David Gilbert  <[hidden email]>

    * gnu/testlet/javax/swing/table/TableColumn/constructors.java
    (testConstructor2): added check for negative width,
    (testConstructor3): added check for negative width.
    * gnu/testlet/javax/swing/table/TableColumn/setHeaderValue.java:
    (test): check null argument.
    * gnu/testlet/javax/swing/table/TableColumn/setIdentifier.java:
    (test): check null argument.
    * gnu/testlet/javax/swing/table/TableColumn/setMinWidth.java:
    (test): wrap at 80 columns.

Regards,

Dave Gilbert



Index: gnu/testlet/javax/swing/table/TableColumn/constructors.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/table/TableColumn/constructors.java,v
retrieving revision 1.1
diff -u -r1.1 constructors.java
--- gnu/testlet/javax/swing/table/TableColumn/constructors.java 9 Jan 2005 23:06:43 -0000 1.1
+++ gnu/testlet/javax/swing/table/TableColumn/constructors.java 25 Jul 2005 08:35:32 -0000
@@ -74,6 +74,9 @@
     harness.check(c1.getCellEditor(), null);
     harness.check(c1.getHeaderValue(), null);
     harness.check(c1.getResizable(), true);
+    
+    TableColumn c2 = new TableColumn(-1);
+    harness.check(c2.getModelIndex(), -1);
   }
   
   private void testConstructor3(TestHarness harness)
@@ -88,6 +91,10 @@
     harness.check(c1.getCellEditor(), null);
     harness.check(c1.getHeaderValue(), null);
     harness.check(c1.getResizable(), true);
+    
+    // negative width
+    TableColumn c2 = new TableColumn(1, -1);
+    harness.check(c2.getWidth(), -1);
   }
   
   private void testConstructor4(TestHarness harness)  
Index: gnu/testlet/javax/swing/table/TableColumn/setHeaderValue.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/table/TableColumn/setHeaderValue.java,v
retrieving revision 1.1
diff -u -r1.1 setHeaderValue.java
--- gnu/testlet/javax/swing/table/TableColumn/setHeaderValue.java 9 Jan 2005 23:06:43 -0000 1.1
+++ gnu/testlet/javax/swing/table/TableColumn/setHeaderValue.java 25 Jul 2005 08:35:32 -0000
@@ -47,9 +47,12 @@
     harness.check(c.getHeaderValue(), new Integer(99));
     
     // O'Reilly's "Java Swing" (first edition) lists this as a "bound" property
-   c.addPropertyChangeListener(this);
-   c.setHeaderValue("Value");
-   harness.check(this.event != null);
+    c.addPropertyChangeListener(this);
+    c.setHeaderValue("Value");
+    harness.check(this.event != null);
+    
+    c.setHeaderValue(null);
+    harness.check(c.getHeaderValue(), null);
   }
   
   public void propertyChange(PropertyChangeEvent e)
Index: gnu/testlet/javax/swing/table/TableColumn/setIdentifier.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/table/TableColumn/setIdentifier.java,v
retrieving revision 1.1
diff -u -r1.1 setIdentifier.java
--- gnu/testlet/javax/swing/table/TableColumn/setIdentifier.java 9 Jan 2005 23:06:43 -0000 1.1
+++ gnu/testlet/javax/swing/table/TableColumn/setIdentifier.java 25 Jul 2005 08:35:32 -0000
@@ -40,6 +40,9 @@
     TableColumn c = new TableColumn();
     c.setIdentifier(new Integer(99));
     harness.check(c.getIdentifier(), new Integer(99));
+    
+    c.setIdentifier(null);
+    harness.check(c.getIdentifier(), null);
   }
 
 }
Index: gnu/testlet/javax/swing/table/TableColumn/setMinWidth.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/table/TableColumn/setMinWidth.java,v
retrieving revision 1.1
diff -u -r1.1 setMinWidth.java
--- gnu/testlet/javax/swing/table/TableColumn/setMinWidth.java 9 Jan 2005 23:06:43 -0000 1.1
+++ gnu/testlet/javax/swing/table/TableColumn/setMinWidth.java 25 Jul 2005 08:35:32 -0000
@@ -41,8 +41,8 @@
     c.setMinWidth(11);
     harness.check(c.getMinWidth(), 11);
     
-    // spec says that current and preferred width will be updated if they are less than
-    // the min width
+    // spec says that current and preferred width will be updated if they are
+    // less than the min width
     harness.check(c.getWidth(), 75);
     harness.check(c.getPreferredWidth(), 75);
     c.setMinWidth(88);