harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479418 [15/43] - in /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common: javax/swing/ javax/swing/border/ javax/swing/colorchooser/ javax/swing/event/ javax/swing/filechooser/ javax/swing/plaf/ javax/swing/plaf/basic/ j...
Date Sun, 26 Nov 2006 20:15:55 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableModelTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/DefaultTableModelTest.java Sun Nov 26 12:15:43 2006
@@ -14,7 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Anton Avtamonov
  * @version $Revision$
@@ -23,9 +22,9 @@
 
 import java.util.Arrays;
 import java.util.Vector;
-
 import javax.swing.event.TableModelEvent;
 
+@SuppressWarnings("unchecked")
 public class DefaultTableModelTest extends BasicSwingTableTestCase {
     private DefaultTableModel model;
 
@@ -33,10 +32,12 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         model = new DefaultTableModel();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         model = null;
     }
@@ -46,97 +47,95 @@
         assertNotNull(model.columnIdentifiers);
         assertEquals(0, model.dataVector.size());
         assertEquals(0, model.columnIdentifiers.size());
-
         model = new DefaultTableModel(3, 4);
         assertEquals(4, model.columnIdentifiers.size());
         assertNull(model.columnIdentifiers.get(0));
         assertNull(model.columnIdentifiers.get(3));
-
         assertEquals(3, model.dataVector.size());
         assertTrue(model.dataVector.get(0) instanceof Vector);
         assertTrue(model.dataVector.get(2) instanceof Vector);
-        assertEquals(4, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(2)).size());
-        assertNull(((Vector)model.dataVector.get(0)).get(0));
-        assertNull(((Vector)model.dataVector.get(2)).get(3));
-
-        model = new DefaultTableModel(new Object[] {"col1", "col2", "col3"}, 4);
+        assertEquals(4, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(2)).size());
+        assertNull(((Vector) model.dataVector.get(0)).get(0));
+        assertNull(((Vector) model.dataVector.get(2)).get(3));
+        model = new DefaultTableModel(new Object[] { "col1", "col2", "col3" }, 4);
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals("col2", model.columnIdentifiers.get(1));
         assertEquals(4, model.dataVector.size());
-
-        Vector columnNames = new Vector(Arrays.asList(new Object[] {"col1", "col2", "col3"}));
+        Vector columnNames = new Vector(Arrays.asList(new Object[] { "col1", "col2", "col3" }));
         model = new DefaultTableModel(columnNames, 4);
         assertTrue(columnNames == model.columnIdentifiers);
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals("col2", model.columnIdentifiers.get(1));
         assertEquals(4, model.dataVector.size());
-
         Vector dataVector = new Vector();
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"data11", "data12", "data13"})));
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"data21", "data22", "data23"})));
-        model = new DefaultTableModel(dataVector, new Vector(Arrays.asList(new Object[] {"col1", "col2", "col3"})));
+        dataVector
+                .add(new Vector(Arrays.asList(new Object[] { "data11", "data12", "data13" })));
+        dataVector
+                .add(new Vector(Arrays.asList(new Object[] { "data21", "data22", "data23" })));
+        model = new DefaultTableModel(dataVector, new Vector(Arrays.asList(new Object[] {
+                "col1", "col2", "col3" })));
         assertTrue(dataVector == model.dataVector);
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals(2, model.dataVector.size());
-
-        model = new DefaultTableModel(null, new Vector(Arrays.asList(new Object[] {"col1", "col2", "col3"})));
+        model = new DefaultTableModel(null, new Vector(Arrays.asList(new Object[] { "col1",
+                "col2", "col3" })));
         assertNotNull(model.dataVector);
         assertEquals(0, model.dataVector.size());
-
         model = new DefaultTableModel(dataVector, null);
         assertNotNull(model.columnIdentifiers);
         assertEquals(0, model.columnIdentifiers.size());
         assertEquals(2, model.dataVector.size());
-        assertEquals(0, ((Vector)model.dataVector.get(0)).size());
-
-        model = new DefaultTableModel(new Object[][] {{"data11", "data12", "data13"}, {"data21", "data22", "data23"}}, new Object[] {"col1", "col2", "col3"});
+        assertEquals(0, ((Vector) model.dataVector.get(0)).size());
+        model = new DefaultTableModel(new Object[][] { { "data11", "data12", "data13" },
+                { "data21", "data22", "data23" } }, new Object[] { "col1", "col2", "col3" });
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals(2, model.dataVector.size());
-
     }
 
     public void testGetSetDataVector() throws Exception {
         Vector dataVector = new Vector();
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"data11", "data12", "data13"})));
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"data21", "data22", "data23"})));
-        model = new DefaultTableModel(dataVector, new Vector(Arrays.asList(new Object[] {"col1", "col2", "col3"})));
+        dataVector
+                .add(new Vector(Arrays.asList(new Object[] { "data11", "data12", "data13" })));
+        dataVector
+                .add(new Vector(Arrays.asList(new Object[] { "data21", "data22", "data23" })));
+        model = new DefaultTableModel(dataVector, new Vector(Arrays.asList(new Object[] {
+                "col1", "col2", "col3" })));
         assertTrue(dataVector == model.getDataVector());
-
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
         dataVector = new Vector();
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-        model.setDataVector(dataVector, new Vector(Arrays.asList(new Object[] {"col1", "col2"})));
+        dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        dataVector.add(new Vector(Arrays
+                .asList(new Object[] { "value21", "value22", "value23" })));
+        dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
+        model.setDataVector(dataVector, new Vector(Arrays
+                .asList(new Object[] { "col1", "col2" })));
         assertTrue(dataVector == model.getDataVector());
         assertTrue(dataVector == model.dataVector);
         assertEquals(2, model.columnIdentifiers.size());
-        assertEquals(2, ((Vector)model.getDataVector().get(0)).size());
-        assertEquals(2, ((Vector)model.getDataVector().get(1)).size());
-        assertEquals(2, ((Vector)model.getDataVector().get(2)).size());
-        assertEquals("value22", ((Vector)model.getDataVector().get(1)).get(1));
-        assertNull(((Vector)model.getDataVector().get(2)).get(1));
+        assertEquals(2, ((Vector) model.getDataVector().get(0)).size());
+        assertEquals(2, ((Vector) model.getDataVector().get(1)).size());
+        assertEquals(2, ((Vector) model.getDataVector().get(2)).size());
+        assertEquals("value22", ((Vector) model.getDataVector().get(1)).get(1));
+        assertNull(((Vector) model.getDataVector().get(2)).get(1));
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
         model.addTableModelListener(listener);
-        Object[][] dataArray = new Object[][] {new Object[] {"value11", "value12"},
-                                        new Object[] {"value21", "value22", "value23"},
-                                        new Object[] {"value31"}};
-        model.setDataVector(dataArray, new Object[] {"col1", "col2"});
+        Object[][] dataArray = new Object[][] { new Object[] { "value11", "value12" },
+                new Object[] { "value21", "value22", "value23" }, new Object[] { "value31" } };
+        model.setDataVector(dataArray, new Object[] { "col1", "col2" });
         assertEquals(2, model.columnIdentifiers.size());
-        assertEquals(2, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-        assertEquals("value22", ((Vector)model.dataVector.get(1)).get(1));
-        assertNull(((Vector)model.dataVector.get(2)).get(1));
+        assertEquals(2, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
+        assertEquals("value22", ((Vector) model.dataVector.get(1)).get(1));
+        assertNull(((Vector) model.dataVector.get(2)).get(1));
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
@@ -148,7 +147,6 @@
     public void testNewDataAvailable() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
         TableModelEvent event = new TableModelEvent(model);
         model.newDataAvailable(event);
         assertTrue(listener.eventOccured());
@@ -158,18 +156,19 @@
     public void testNewRowsAdded() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-        TableModelEvent event = new TableModelEvent(model, 1, 2, TableModelEvent.HEADER_ROW, TableModelEvent.DELETE);
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
+        TableModelEvent event = new TableModelEvent(model, 1, 2, TableModelEvent.HEADER_ROW,
+                TableModelEvent.DELETE);
         model.newRowsAdded(event);
         assertEquals(2, model.columnIdentifiers.size());
-        assertEquals(2, ((Vector)model.getDataVector().get(0)).size());
-        assertEquals(2, ((Vector)model.getDataVector().get(1)).size());
-        assertEquals(2, ((Vector)model.getDataVector().get(2)).size());
+        assertEquals(2, ((Vector) model.getDataVector().get(0)).size());
+        assertEquals(2, ((Vector) model.getDataVector().get(1)).size());
+        assertEquals(2, ((Vector) model.getDataVector().get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(event, listener.getEvent());
     }
@@ -177,7 +176,6 @@
     public void testRowsRemoved() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
         TableModelEvent event = new TableModelEvent(model);
         model.rowsRemoved(event);
         assertTrue(listener.eventOccured());
@@ -186,17 +184,15 @@
 
     public void testSetNumRowsSetGetRowCount() throws Exception {
         assertEquals(0, model.getRowCount());
-
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         assertEquals(3, model.getRowCount());
-
         listener.reset();
         model.setRowCount(5);
         assertEquals(5, model.getDataVector().size());
@@ -207,17 +203,15 @@
         assertEquals(4, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.INSERT, listener.getEvent().getType());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(4)).size());
-
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(4)).size());
         listener.reset();
         model.setRowCount(5);
         assertEquals(5, model.getDataVector().size());
         assertFalse(listener.eventOccured());
         listener.reset();
-
         model.setNumRows(1);
         assertEquals(1, model.getDataVector().size());
         assertEquals(1, model.getRowCount());
@@ -232,83 +226,75 @@
     public void testAddRow() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         listener.reset();
-        model.addRow((Vector)null);
+        model.addRow((Vector) null);
         assertEquals(4, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(3)).size());
-        assertNull(((Vector)model.dataVector.get(3)).get(0));
-        assertNull(((Vector)model.dataVector.get(3)).get(1));
-
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(3)).size());
+        assertNull(((Vector) model.dataVector.get(3)).get(0));
+        assertNull(((Vector) model.dataVector.get(3)).get(1));
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(3, listener.getEvent().getFirstRow());
         assertEquals(3, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.INSERT, listener.getEvent().getType());
-
-
         listener.reset();
-        model.addRow(new Object[] {"a"});
+        model.addRow(new Object[] { "a" });
         assertEquals(5, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(4)).size());
-        assertEquals("a", ((Vector)model.dataVector.get(4)).get(0));
-        assertNull(((Vector)model.dataVector.get(4)).get(1));
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(4)).size());
+        assertEquals("a", ((Vector) model.dataVector.get(4)).get(0));
+        assertNull(((Vector) model.dataVector.get(4)).get(1));
     }
 
     public void testInsertRow() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         listener.reset();
-        model.insertRow(1, (Vector)null);
+        model.insertRow(1, (Vector) null);
         assertEquals(4, model.getDataVector().size());
-        assertEquals(2, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(3)).size());
-        assertNull(((Vector)model.dataVector.get(1)).get(0));
-        assertNull(((Vector)model.dataVector.get(1)).get(1));
-
+        assertEquals(2, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(3)).size());
+        assertNull(((Vector) model.dataVector.get(1)).get(0));
+        assertNull(((Vector) model.dataVector.get(1)).get(1));
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(1, listener.getEvent().getFirstRow());
         assertEquals(1, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.INSERT, listener.getEvent().getType());
-
-
         listener.reset();
-        model.insertRow(0, new Object[] {"a", "b", "c"});
+        model.insertRow(0, new Object[] { "a", "b", "c" });
         assertEquals(5, model.getDataVector().size());
-        assertEquals(2, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(4)).size());
-        assertEquals("a", ((Vector)model.dataVector.get(0)).get(0));
-        assertEquals("b", ((Vector)model.dataVector.get(0)).get(1));
-
+        assertEquals(2, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(4)).size());
+        assertEquals("a", ((Vector) model.dataVector.get(0)).get(0));
+        assertEquals("b", ((Vector) model.dataVector.get(0)).get(1));
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
-                model.insertRow(6, new Object[] {"a", "b", "c"});
+                model.insertRow(6, new Object[] { "a", "b", "c" });
             }
         });
     }
@@ -316,115 +302,106 @@
     public void testMoveRow() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31", "value32", "value33"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value41", "value42", "value43", "value44"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value51", "value52", "value53", "value54", "value55"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31", "value32",
+                "value33" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value41", "value42",
+                "value43", "value44" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value51", "value52",
+                "value53", "value54", "value55" })));
         listener.reset();
         model.moveRow(0, 1, 1);
         assertEquals(5, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(5, ((Vector)model.dataVector.get(4)).size());
-
+        assertEquals(3, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(5, ((Vector) model.dataVector.get(4)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(0, listener.getEvent().getFirstRow());
         assertEquals(2, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
-
         listener.reset();
         model.moveRow(1, 1, 2);
         assertEquals(5, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(5, ((Vector)model.dataVector.get(4)).size());
-
+        assertEquals(3, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(5, ((Vector) model.dataVector.get(4)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(1, listener.getEvent().getFirstRow());
         assertEquals(2, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
-
         listener.reset();
         model.moveRow(2, 2, 0);
         assertEquals(5, model.getDataVector().size());
-        assertEquals(1, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(5, ((Vector)model.dataVector.get(4)).size());
-
+        assertEquals(1, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(5, ((Vector) model.dataVector.get(4)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(0, listener.getEvent().getFirstRow());
         assertEquals(2, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
-
         listener.reset();
         model.moveRow(0, 3, 1);
         assertEquals(5, model.getDataVector().size());
-        assertEquals(5, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(4)).size());
-
+        assertEquals(5, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(4)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(0, listener.getEvent().getFirstRow());
         assertEquals(4, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
         model.moveRow(2, 4, 1);
         assertEquals(5, model.getDataVector().size());
-        assertEquals(5, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(3)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(4)).size());
-
+        assertEquals(5, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(3)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(4)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(1, listener.getEvent().getFirstRow());
         assertEquals(4, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
-
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.moveRow(-1, 2, 0);
             }
         });
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.moveRow(0, 3, 2);
             }
         });
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.moveRow(1, 2, 4);
             }
         });
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.moveRow(1, 7, 0);
             }
@@ -434,32 +411,31 @@
     public void testRemoveRow() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         listener.reset();
         model.removeRow(1);
         assertEquals(2, model.getDataVector().size());
-        assertEquals(2, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(1)).size());
-
+        assertEquals(2, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(1)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(1, listener.getEvent().getFirstRow());
         assertEquals(1, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.DELETE, listener.getEvent().getType());
-
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.removeRow(-1);
             }
         });
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.removeRow(3);
             }
@@ -469,66 +445,59 @@
     public void testSetColumnIdentifiers() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         listener.reset();
-        model.setColumnIdentifiers(new Vector(Arrays.asList(new Object[] {"col1", "col2"})));
+        model.setColumnIdentifiers(new Vector(Arrays.asList(new Object[] { "col1", "col2" })));
         assertEquals(2, model.columnIdentifiers.size());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(2, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(2, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
-        model.setColumnIdentifiers(new Vector(Arrays.asList(new Object[] {"col1", "col2", "col3"})));
+        model.setColumnIdentifiers(new Vector(Arrays.asList(new Object[] { "col1", "col2",
+                "col3" })));
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(3, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
-        model.setColumnIdentifiers(new Object[] {"col1"});
+        model.setColumnIdentifiers(new Object[] { "col1" });
         assertEquals(1, model.columnIdentifiers.size());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(1, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(1, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
-        model.setColumnIdentifiers(new Object[] {"col1"});
+        model.setColumnIdentifiers(new Object[] { "col1" });
         assertEquals(1, model.columnIdentifiers.size());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(1, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(1, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
@@ -539,57 +508,50 @@
 
     public void testGetSetColumnCount() throws Exception {
         assertEquals(0, model.getColumnCount());
-
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         listener.reset();
         model.setColumnCount(2);
         assertEquals(2, model.columnIdentifiers.size());
         assertEquals(2, model.getColumnCount());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(2, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(2, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(2, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(2, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
         model.setColumnCount(3);
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals(3, model.getColumnCount());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(3, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
         listener.reset();
         model.setColumnCount(1);
         assertEquals(1, model.columnIdentifiers.size());
         assertEquals(1, model.getColumnCount());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(1, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(1, ((Vector)model.dataVector.get(2)).size());
-
+        assertEquals(1, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(1, ((Vector) model.dataVector.get(2)).size());
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
@@ -601,40 +563,36 @@
     public void testAddColumn() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         listener.reset();
-        model.addColumn(null, new Object[] {"val13", "val23"});
+        model.addColumn(null, new Object[] { "val13", "val23" });
         assertEquals(3, model.columnIdentifiers.size());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(3, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(3, ((Vector)model.dataVector.get(2)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(3, ((Vector) model.dataVector.get(2)).size());
         assertNull(model.columnIdentifiers.get(2));
-        assertEquals("val13", ((Vector)model.dataVector.get(0)).get(2));
-        assertEquals("val23", ((Vector)model.dataVector.get(1)).get(2));
-        assertNull(((Vector)model.dataVector.get(2)).get(2));
-
+        assertEquals("val13", ((Vector) model.dataVector.get(0)).get(2));
+        assertEquals("val23", ((Vector) model.dataVector.get(1)).get(2));
+        assertNull(((Vector) model.dataVector.get(2)).get(2));
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getFirstRow());
         assertEquals(TableModelEvent.HEADER_ROW, listener.getEvent().getLastRow());
         assertEquals(TableModelEvent.ALL_COLUMNS, listener.getEvent().getColumn());
         assertEquals(TableModelEvent.UPDATE, listener.getEvent().getType());
-
-
         listener.reset();
         model.addColumn("col4");
         assertEquals(4, model.columnIdentifiers.size());
         assertEquals(3, model.getDataVector().size());
-        assertEquals(4, ((Vector)model.dataVector.get(0)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(1)).size());
-        assertEquals(4, ((Vector)model.dataVector.get(2)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(0)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(1)).size());
+        assertEquals(4, ((Vector) model.dataVector.get(2)).size());
         assertEquals("col4", model.columnIdentifiers.get(3));
         assertTrue(listener.eventOccured());
     }
@@ -642,19 +600,17 @@
     public void testGetColumnName() throws Exception {
         assertEquals("A", model.getColumnName(0));
         assertEquals("B", model.getColumnName(1));
-
         model.setColumnCount(2);
         assertEquals("A", model.getColumnName(0));
         assertEquals("B", model.getColumnName(1));
-
-        model.setColumnIdentifiers(new Object[] {"col1", null, "col3", new Integer(4)});
+        model.setColumnIdentifiers(new Object[] { "col1", null, "col3", new Integer(4) });
         assertEquals("col1", model.getColumnName(0));
         assertEquals("B", model.getColumnName(1));
         assertEquals("col3", model.getColumnName(2));
         assertEquals("4", model.getColumnName(3));
         assertEquals("E", model.getColumnName(4));
-
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.getColumnName(-1);
             }
@@ -668,30 +624,29 @@
     public void testGetSetValueAt() throws Exception {
         TestTableModelListener listener = new TestTableModelListener();
         model.addTableModelListener(listener);
-
-        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] {"col1", "col2"}));
+        model.columnIdentifiers = new Vector(Arrays.asList(new Object[] { "col1", "col2" }));
         model.dataVector = new Vector();
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value11", "value12"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value21", "value22", "value23"})));
-        model.dataVector.add(new Vector(Arrays.asList(new Object[] {"value31"})));
-
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value11", "value12" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value21", "value22",
+                "value23" })));
+        model.dataVector.add(new Vector(Arrays.asList(new Object[] { "value31" })));
         assertEquals("value22", model.getValueAt(1, 1));
         assertEquals("value31", model.getValueAt(2, 0));
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.getValueAt(2, 1);
             }
         });
         testExceptionalCase(new ArrayIndexOutOfBoundsExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setValueAt("value32", 2, 1);
             }
         });
-
         listener.reset();
         model.setValueAt(new Integer(3), 1, 0);
         assertEquals(new Integer(3), model.getValueAt(1, 0));
-
         assertTrue(listener.eventOccured());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(1, listener.getEvent().getFirstRow());
@@ -701,14 +656,15 @@
     }
 
     public void testConvertToVector() throws Exception {
-        Object[] array = new Object[] {"1", new Integer(6), new String[] {"31", "32"}};
+        Object[] array = new Object[] { "1", new Integer(6), new String[] { "31", "32" } };
         assertEquals(new Vector(Arrays.asList(array)), DefaultTableModel.convertToVector(array));
-
-        Object[][] arrayOfArray = new Object[][] {new Object[] {"1"}, new Object[] {new Integer(6), new Character('c')}, new String[] {"31", "32"}};
+        Object[][] arrayOfArray = new Object[][] { new Object[] { "1" },
+                new Object[] { new Integer(6), new Character('c') },
+                new String[] { "31", "32" } };
         Vector expected = new Vector();
-        expected.add(Arrays.asList(new Object[] {"1"}));
-        expected.add(Arrays.asList(new Object[] {new Integer(6), new Character('c')}));
-        expected.add(Arrays.asList(new String[] {"31", "32"}));
+        expected.add(Arrays.asList(new Object[] { "1" }));
+        expected.add(Arrays.asList(new Object[] { new Integer(6), new Character('c') }));
+        expected.add(Arrays.asList(new String[] { "31", "32" }));
         assertEquals(expected, DefaultTableModel.convertToVector(arrayOfArray));
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/JTableHeaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/JTableHeaderTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/JTableHeaderTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/JTableHeaderTest.java Sun Nov 26 12:15:43 2006
@@ -24,7 +24,6 @@
 import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
 import java.util.Arrays;
-
 import javax.swing.BasicSwingTestCase;
 import javax.swing.JTable;
 import javax.swing.plaf.TableHeaderUI;
@@ -38,23 +37,22 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         header = new JTableHeader();
-
         propertyChangeController = new PropertyChangeController();
         header.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         header = null;
     }
 
     public void testJTableHeader() throws Exception {
         assertTrue(header.columnModel instanceof DefaultTableColumnModel);
-
         header = new JTableHeader(null);
         assertTrue(header.columnModel instanceof DefaultTableColumnModel);
-
         TableColumnModel cm = new DefaultTableColumnModel();
         header = new JTableHeader(cm);
         assertSame(cm, header.columnModel);
@@ -63,7 +61,6 @@
     public void testGetSetTable() throws Exception {
         assertNull(header.table);
         assertNull(header.getTable());
-
         JTable table = new JTable();
         header.setTable(table);
         assertSame(table, header.getTable());
@@ -86,7 +83,6 @@
 
     public void testGetSetDraggedColumn() throws Exception {
         assertNull(header.getDraggedColumn());
-
         TableColumn column = new TableColumn();
         header.setDraggedColumn(column);
         assertEquals(column, header.getDraggedColumn());
@@ -95,10 +91,8 @@
 
     public void testGetSetDraggedDistance() throws Exception {
         assertEquals(0, header.getDraggedDistance());
-
         header.setDraggedDistance(10);
         assertEquals(10, header.getDraggedDistance());
-
         header.setDraggedDistance(-10);
         assertEquals(-10, header.getDraggedDistance());
         assertFalse(propertyChangeController.isChanged());
@@ -106,7 +100,6 @@
 
     public void testGetSetResizingColumn() throws Exception {
         assertNull(header.getResizingColumn());
-
         TableColumn column = new TableColumn();
         header.setResizingColumn(column);
         assertEquals(column, header.getResizingColumn());
@@ -115,7 +108,6 @@
 
     public void testGetSetUpdateTableInRealTime() throws Exception {
         assertTrue(header.getUpdateTableInRealTime());
-
         header.setUpdateTableInRealTime(false);
         assertFalse(header.getUpdateTableInRealTime());
         assertFalse(propertyChangeController.isChanged());
@@ -124,19 +116,16 @@
     public void testGetSetDefaultRenderer() throws Exception {
         assertTrue(header.getDefaultRenderer() instanceof DefaultTableCellRenderer);
         assertTrue(header.getDefaultRenderer() instanceof UIResource);
-
         TableCellRenderer renderer = new DefaultTableCellRenderer();
         header.setDefaultRenderer(renderer);
         assertSame(renderer, header.getDefaultRenderer());
         assertFalse(propertyChangeController.isChanged());
-
         header.setDefaultRenderer(null);
         assertNull(header.getDefaultRenderer());
     }
 
     public void testColumnAtPoint() throws Exception {
         assertEquals(-1, header.columnAtPoint(new Point(10, 10)));
-
         header.columnModel.addColumn(new TableColumn(0, 20));
         header.columnModel.addColumn(new TableColumn(0, 30));
         assertEquals(0, header.columnAtPoint(new Point(10, 1000)));
@@ -146,50 +135,46 @@
 
     public void testGetHeaderRect() throws Exception {
         assertEquals(new Rectangle(), header.getHeaderRect(10));
-
         header.columnModel.addColumn(new TableColumn(0, 20));
         assertEquals(new Rectangle(0, 0, 20, 0), header.getHeaderRect(0));
         assertEquals(new Rectangle(), header.getHeaderRect(1));
-
         header.columnModel.addColumn(new TableColumn(0, 30));
         assertEquals(new Rectangle(0, 0, 20, 0), header.getHeaderRect(0));
         assertEquals(new Rectangle(20, 0, 30, 0), header.getHeaderRect(1));
         assertEquals(new Rectangle(), header.getHeaderRect(2));
-
         assertNotSame(header.getHeaderRect(2), header.getHeaderRect(2));
-
         header.setBounds(10, 10, 100, 30);
         assertEquals(new Rectangle(0, 0, 20, 30), header.getHeaderRect(0));
     }
 
     public void testGetToolTipText() throws Exception {
         assertNull(header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 0, 0, false)));
-
-        ((DefaultTableCellRenderer)header.getDefaultRenderer()).setToolTipText("tooltip");
+        ((DefaultTableCellRenderer) header.getDefaultRenderer()).setToolTipText("tooltip");
         assertNull(header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 0, 0, false)));
-
         header.columnModel.addColumn(new TableColumn(0, 20));
-        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 100, 0, false)));
+        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 100,
+                0, false)));
         assertNull(header.getToolTipText(new MouseEvent(header, 0, 0, 0, 25, 0, 0, false)));
-
         header.columnModel.addColumn(new TableColumn(0, 20));
-        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 100, 0, false)));
-        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 25, 100, 0, false)));
-
-        DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)header.columnModel.getColumn(0).createDefaultHeaderRenderer();
+        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 100,
+                0, false)));
+        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 25, 100,
+                0, false)));
+        DefaultTableCellRenderer renderer = (DefaultTableCellRenderer) header.columnModel
+                .getColumn(0).createDefaultHeaderRenderer();
         renderer.setToolTipText("column tooltip");
         header.columnModel.getColumn(0).setHeaderRenderer(renderer);
-        assertEquals("column tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0, 100, 0, false)));
-        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 25, 100, 0, false)));
+        assertEquals("column tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 0,
+                100, 0, false)));
+        assertEquals("tooltip", header.getToolTipText(new MouseEvent(header, 0, 0, 0, 25, 100,
+                0, false)));
     }
 
     public void testGetSetUpdateUI() throws Exception {
         assertNotNull(header.getUI());
-
         TableHeaderUI ui = new BasicTableHeaderUI();
         header.setUI(ui);
         assertSame(ui, header.getUI());
-
         header.updateUI();
         assertNotNull(header.getUI());
         assertNotSame(ui, header.getUI());
@@ -197,15 +182,16 @@
 
     public void testGetSetColumnModel() throws Exception {
         assertTrue(header.getColumnModel() instanceof DefaultTableColumnModel);
-        assertTrue(Arrays.asList(((DefaultTableColumnModel)header.getColumnModel()).getColumnModelListeners()).contains(header));
-
+        assertTrue(Arrays.asList(
+                ((DefaultTableColumnModel) header.getColumnModel()).getColumnModelListeners())
+                .contains(header));
         DefaultTableColumnModel model = new DefaultTableColumnModel();
         header.setColumnModel(model);
         assertSame(model, header.getColumnModel());
         assertTrue(Arrays.asList(model.getColumnModelListeners()).contains(header));
         assertTrue(propertyChangeController.isChanged("columnModel"));
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 header.setColumnModel(null);
             }
@@ -232,7 +218,6 @@
         assertNull(header.getDraggedColumn());
         assertEquals(0, header.getDraggedDistance());
         assertNull(header.getTable());
-
         header.setReorderingAllowed(false);
         header.setResizingAllowed(false);
         header.setUpdateTableInRealTime(false);
@@ -241,7 +226,6 @@
         header.setDraggedColumn(new TableColumn());
         header.setDraggedDistance(10);
         header.setTable(new JTable());
-
         header.initializeLocalVars();
         assertTrue(header.getReorderingAllowed());
         assertTrue(header.getResizingAllowed());

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/TableColumnTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/TableColumnTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/TableColumnTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/table/TableColumnTest.java Sun Nov 26 12:15:43 2006
@@ -14,7 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Anton Avtamonov
  * @version $Revision$
@@ -23,12 +22,9 @@
 
 import java.awt.Component;
 import java.awt.Dimension;
-
 import javax.swing.BasicSwingTestCase;
-import javax.swing.BorderFactory;
 import javax.swing.DefaultCellEditor;
 import javax.swing.JCheckBox;
-import javax.swing.UIManager;
 
 public class TableColumnTest extends BasicSwingTestCase {
     private TableColumn column;
@@ -37,17 +33,20 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         column = new TableColumn();
         propertyChangeController = new PropertyChangeController();
         column.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         column = null;
         propertyChangeController = null;
     }
 
+    @SuppressWarnings("deprecation")
     public void testTableColumn() throws Exception {
         assertEquals(0, column.modelIndex);
         assertEquals(75, column.width);
@@ -60,15 +59,12 @@
         assertNull(column.headerValue);
         assertNull(column.headerRenderer);
         assertNull(column.identifier);
-
         column = new TableColumn(10);
         assertEquals(10, column.modelIndex);
-
         column = new TableColumn(10, 20);
         assertEquals(10, column.modelIndex);
         assertEquals(20, column.width);
         assertEquals(20, column.getPreferredWidth());
-
         TableCellRenderer renderer = new DefaultTableCellRenderer();
         TableCellEditor editor = new DefaultCellEditor(new JCheckBox());
         column = new TableColumn(10, 20, renderer, editor);
@@ -91,7 +87,6 @@
         column.setHeaderValue("Header");
         assertEquals("Header", column.getIdentifier());
         assertNull(column.identifier);
-
         propertyChangeController.reset();
         column.setIdentifier("Any");
         assertEquals("Any", column.getIdentifier());
@@ -134,14 +129,11 @@
         column.setWidth(20);
         assertEquals(20, column.getWidth());
         assertTrue(propertyChangeController.isChanged("width"));
-
         column.setMaxWidth(100);
         column.setWidth(10);
         assertEquals(15, column.getWidth());
-
         column.setWidth(150);
         assertEquals(100, column.getWidth());
-
         assertEquals(75, column.getPreferredWidth());
     }
 
@@ -150,14 +142,11 @@
         column.setPreferredWidth(50);
         assertEquals(50, column.getPreferredWidth());
         assertTrue(propertyChangeController.isChanged("preferredWidth"));
-
         column.setMaxWidth(100);
         column.setPreferredWidth(10);
         assertEquals(15, column.getPreferredWidth());
-
         column.setPreferredWidth(150);
         assertEquals(100, column.getPreferredWidth());
-
         assertEquals(75, column.getWidth());
     }
 
@@ -166,11 +155,9 @@
         column.setMinWidth(50);
         assertEquals(50, column.getMinWidth());
         assertTrue(propertyChangeController.isChanged("minWidth"));
-
         column.setMinWidth(100);
         assertEquals(100, column.getWidth());
         assertEquals(100, column.getPreferredWidth());
-
         column.setMinWidth(10);
         assertEquals(100, column.getWidth());
         assertEquals(100, column.getPreferredWidth());
@@ -181,11 +168,9 @@
         column.setMaxWidth(100);
         assertEquals(100, column.getMaxWidth());
         assertTrue(propertyChangeController.isChanged("maxWidth"));
-
         column.setMaxWidth(50);
         assertEquals(50, column.getWidth());
         assertEquals(50, column.getPreferredWidth());
-
         column.setMinWidth(100);
         assertEquals(100, column.getMinWidth());
         assertEquals(50, column.getWidth());
@@ -205,19 +190,17 @@
         assertEquals(75, column.getWidth());
         assertEquals(75, column.getPreferredWidth());
         assertEquals(Integer.MAX_VALUE, column.getMaxWidth());
-
-        DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)column.createDefaultHeaderRenderer();
+        DefaultTableCellRenderer renderer = (DefaultTableCellRenderer) column
+                .createDefaultHeaderRenderer();
         renderer.setMaximumSize(new Dimension(600, 200));
         renderer.setPreferredSize(new Dimension(400, 100));
         renderer.setMinimumSize(new Dimension(200, 50));
         column.setHeaderRenderer(renderer);
-
         column.sizeWidthToFit();
         assertEquals(200, column.getMinWidth());
         assertEquals(400, column.getWidth());
         assertEquals(400, column.getPreferredWidth());
         assertEquals(600, column.getMaxWidth());
-
         column.setHeaderRenderer(column.createDefaultHeaderRenderer());
         column.sizeWidthToFit();
         // specifics of our JLabel's size calculation processing: we calculate component size including
@@ -235,46 +218,43 @@
             assertEquals(0, column.getPreferredWidth());
             assertEquals(0, column.getMaxWidth());
         }
-
         column.setHeaderValue("Any");
         column.sizeWidthToFit();
-        Component defaultRenderingComponent = column.createDefaultHeaderRenderer().getTableCellRendererComponent(null, "Any", false, false, 0, 0);
+        Component defaultRenderingComponent = column.createDefaultHeaderRenderer()
+                .getTableCellRendererComponent(null, "Any", false, false, 0, 0);
         assertEquals(defaultRenderingComponent.getMinimumSize().width, column.getMinWidth());
         assertEquals(defaultRenderingComponent.getPreferredSize().width, column.getWidth());
-        assertEquals(defaultRenderingComponent.getPreferredSize().width, column.getPreferredWidth());
+        assertEquals(defaultRenderingComponent.getPreferredSize().width, column
+                .getPreferredWidth());
         assertEquals(defaultRenderingComponent.getMaximumSize().width, column.getMaxWidth());
-
         column.setHeaderRenderer(column.createDefaultHeaderRenderer());
         column.setHeaderValue(null);
-        defaultRenderingComponent = column.createDefaultHeaderRenderer().getTableCellRendererComponent(null, "Any", false, false, 0, 0);
+        defaultRenderingComponent = column.createDefaultHeaderRenderer()
+                .getTableCellRendererComponent(null, "Any", false, false, 0, 0);
         assertEquals(defaultRenderingComponent.getMinimumSize().width, column.getMinWidth());
         assertEquals(defaultRenderingComponent.getPreferredSize().width, column.getWidth());
-        assertEquals(defaultRenderingComponent.getPreferredSize().width, column.getPreferredWidth());
+        assertEquals(defaultRenderingComponent.getPreferredSize().width, column
+                .getPreferredWidth());
         assertEquals(defaultRenderingComponent.getMaximumSize().width, column.getMaxWidth());
     }
 
+    @SuppressWarnings("deprecation")
     public void testEnableDisableResizedPosting() throws Exception {
         assertEquals(0, column.resizedPostingDisableCount);
         column.disableResizedPosting();
         assertEquals(1, column.resizedPostingDisableCount);
         assertFalse(propertyChangeController.isChanged());
-
         column.disableResizedPosting();
         assertEquals(2, column.resizedPostingDisableCount);
-
         column.disableResizedPosting();
         assertEquals(3, column.resizedPostingDisableCount);
-
         column.enableResizedPosting();
         assertEquals(2, column.resizedPostingDisableCount);
         assertFalse(propertyChangeController.isChanged());
-
         column.enableResizedPosting();
         assertEquals(1, column.resizedPostingDisableCount);
-
         column.enableResizedPosting();
         assertEquals(0, column.resizedPostingDisableCount);
-
         column.enableResizedPosting();
         assertEquals(-1, column.resizedPostingDisableCount);
     }
@@ -282,13 +262,13 @@
     public void testAddRemoveGetPropertyChangeListener() throws Exception {
         assertEquals(1, column.getPropertyChangeListeners().length);
         assertEquals(propertyChangeController, column.getPropertyChangeListeners()[0]);
-
         column.removePropertyChangeListener(propertyChangeController);
         assertEquals(0, column.getPropertyChangeListeners().length);
     }
 
     public void testCreateDefaultHeaderRenderer() throws Exception {
         assertTrue(column.createDefaultHeaderRenderer() instanceof DefaultTableCellRenderer);
-        assertNotSame(column.createDefaultHeaderRenderer(), column.createDefaultHeaderRenderer());
+        assertNotSame(column.createDefaultHeaderRenderer(), column
+                .createDefaultHeaderRenderer());
     }
 }



Mime
View raw message