harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [19/28] - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/
Date Sun, 26 Nov 2006 00:04:16 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTableTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTableTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTableTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTableTest.java Sat Nov 25 16:04:10 2006
@@ -26,7 +26,6 @@
 import java.awt.Rectangle;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-
 import javax.swing.plaf.TableUI;
 import javax.swing.plaf.basic.BasicTableUI;
 import javax.swing.table.DefaultTableCellRenderer;
@@ -38,6 +37,7 @@
 import javax.swing.table.TableColumn;
 import javax.swing.table.TableColumnModel;
 
+@SuppressWarnings("serial")
 public class JTableTest extends BasicSwingTestCase {
     private JTable table;
 
@@ -45,12 +45,14 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         table = new JTable();
         propertyChangeController = new PropertyChangeController();
         table.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         table = null;
     }
@@ -62,30 +64,25 @@
         assertSame(JTableHeader.class, table.tableHeader.getClass());
         assertEquals(3, table.defaultEditorsByColumnClass.size());
         assertEquals(8, table.defaultRenderersByColumnClass.size());
-
         DefaultTableModel model = new DefaultTableModel();
         table = new JTable(model);
         assertSame(model, table.dataModel);
         assertSame(DefaultTableColumnModel.class, table.columnModel.getClass());
         assertSame(DefaultListSelectionModel.class, table.selectionModel.getClass());
-
         DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
         table = new JTable(model, columnModel);
         assertSame(model, table.dataModel);
         assertSame(columnModel, table.columnModel);
         assertSame(DefaultListSelectionModel.class, table.selectionModel.getClass());
-
         DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
         table = new JTable(model, columnModel, selectionModel);
         assertSame(model, table.dataModel);
         assertSame(columnModel, table.columnModel);
         assertSame(selectionModel, table.selectionModel);
-
         table = new JTable(null, columnModel, null);
         assertSame(DefaultTableModel.class, table.dataModel.getClass());
         assertSame(columnModel, table.columnModel);
         assertSame(DefaultListSelectionModel.class, table.selectionModel.getClass());
-
         table = new JTable(3, 4);
         assertSame(DefaultTableModel.class, table.dataModel.getClass());
         assertSame(DefaultTableColumnModel.class, table.columnModel.getClass());
@@ -98,6 +95,7 @@
     public void testAddNotify() throws Exception {
         final Marker marker = new Marker();
         new JTable() {
+            @Override
             protected void configureEnclosingScrollPane() {
                 marker.setOccurred();
             }
@@ -108,6 +106,7 @@
     public void testRemoveNotify() throws Exception {
         final Marker marker = new Marker();
         new JTable() {
+            @Override
             protected void unconfigureEnclosingScrollPane() {
                 marker.setOccurred();
             }
@@ -119,11 +118,9 @@
         JScrollPane pane = new JScrollPane();
         pane.setViewportView(table);
         assertNull(pane.getColumnHeader());
-
         table.addNotify();
         assertNotNull(pane.getColumnHeader());
         assertSame(table.getTableHeader(), pane.getColumnHeader().getView());
-
         table.removeNotify();
         assertNull(pane.getColumnHeader().getView());
     }
@@ -133,7 +130,6 @@
         assertEquals(table.tableHeader, table.getTableHeader());
         assertEquals(table, table.getTableHeader().getTable());
         assertEquals(table.getColumnModel(), table.getTableHeader().getColumnModel());
-
         JTableHeader oldValue = table.getTableHeader();
         JTableHeader header = new JTableHeader();
         table.setTableHeader(header);
@@ -142,7 +138,6 @@
         assertNull(oldValue.getTable());
         assertNotSame(table.getColumnModel(), table.getTableHeader().getColumnModel());
         assertTrue(propertyChangeController.isChanged("tableHeader"));
-
         table.setTableHeader(null);
         assertNull(table.getTableHeader());
     }
@@ -150,12 +145,10 @@
     public void testGetSetRowHeight() throws Exception {
         assertEquals(16, table.rowHeight);
         assertEquals(16, table.getRowHeight());
-
         table.setRowHeight(30);
         assertEquals(30, table.getRowHeight());
         assertEquals(30, table.getRowHeight(10));
         assertTrue(propertyChangeController.isChanged("rowHeight"));
-
         propertyChangeController.reset();
         table.setRowHeight(10, 50);
         assertEquals(30, table.getRowHeight());
@@ -165,7 +158,6 @@
             assertEquals(0, table.getRowHeight(10));
         }
         assertFalse(propertyChangeController.isChanged("rowHeight"));
-
         table = new JTable(3, 4);
         table.setRowHeight(2, 50);
         assertEquals(16, table.getRowHeight());
@@ -176,14 +168,12 @@
         } else {
             assertEquals(0, table.getRowHeight(10));
         }
-
         table.setRowHeight(20, 50);
         if (isHarmony()) {
             assertEquals(16, table.getRowHeight(20));
         } else {
             assertEquals(0, table.getRowHeight(20));
         }
-
         table.setRowHeight(3, 25);
         if (isHarmony()) {
             assertEquals(16, table.getRowHeight(3));
@@ -191,19 +181,19 @@
             assertEquals(0, table.getRowHeight(3));
         }
         table.setRowHeight(40);
-        ((DefaultTableModel)table.getModel()).addRow(new Object[] {"3", "3"});
+        ((DefaultTableModel) table.getModel()).addRow(new Object[] { "3", "3" });
         assertEquals(40, table.getRowHeight(3));
         table.setRowHeight(3, 25);
         assertEquals(25, table.getRowHeight(3));
-        ((DefaultTableModel)table.getModel()).removeRow(3);
-        ((DefaultTableModel)table.getModel()).addRow(new Object[] {"3", "3"});
+        ((DefaultTableModel) table.getModel()).removeRow(3);
+        ((DefaultTableModel) table.getModel()).addRow(new Object[] { "3", "3" });
         if (isHarmony()) {
             assertEquals(25, table.getRowHeight(3));
         } else {
             assertEquals(40, table.getRowHeight(3));
         }
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setRowHeight(0);
             }
@@ -213,12 +203,10 @@
     public void testGetSetRowMargin() throws Exception {
         assertEquals(1, table.getRowMargin());
         assertEquals(1, table.getIntercellSpacing().height);
-
         table.setRowMargin(10);
         assertEquals(10, table.getRowMargin());
         assertEquals(10, table.getIntercellSpacing().height);
         assertTrue(propertyChangeController.isChanged("rowMargin"));
-
         table.setRowMargin(-5);
         assertEquals(-5, table.getRowMargin());
         assertEquals(-5, table.getIntercellSpacing().height);
@@ -227,13 +215,10 @@
     public void testGetSetIntercellSpacing() throws Exception {
         assertEquals(new Dimension(1, 1), table.getIntercellSpacing());
         assertNotSame(table.getIntercellSpacing(), table.getIntercellSpacing());
-
         table.setRowMargin(10);
         assertEquals(new Dimension(1, 10), table.getIntercellSpacing());
-
         table.getColumnModel().setColumnMargin(5);
         assertEquals(new Dimension(5, 10), table.getIntercellSpacing());
-
         propertyChangeController.reset();
         Dimension spacing = new Dimension(3, 4);
         table.setIntercellSpacing(spacing);
@@ -246,7 +231,6 @@
 
     public void testGetSetGridColor() throws Exception {
         assertEquals(UIManager.getColor("Table.gridColor"), table.getGridColor());
-
         table.setGridColor(Color.RED);
         assertEquals(Color.RED, table.getGridColor());
         assertTrue(propertyChangeController.isChanged("gridColor"));
@@ -255,13 +239,11 @@
     public void testSetShowGrid() throws Exception {
         assertTrue(table.getShowHorizontalLines());
         assertTrue(table.getShowVerticalLines());
-
         table.setShowGrid(false);
         assertFalse(table.getShowHorizontalLines());
         assertFalse(table.getShowVerticalLines());
         assertTrue(propertyChangeController.isChanged("showHorizontalLines"));
         assertTrue(propertyChangeController.isChanged("showVerticalLines"));
-
         table.setShowGrid(true);
         assertTrue(table.getShowHorizontalLines());
         assertTrue(table.getShowVerticalLines());
@@ -269,33 +251,27 @@
 
     public void testGetSetShowHorizontalLines() throws Exception {
         assertTrue(table.getShowHorizontalLines());
-
         table.setShowHorizontalLines(false);
         assertFalse(table.getShowHorizontalLines());
         assertTrue(propertyChangeController.isChanged("showHorizontalLines"));
-
         table.setShowHorizontalLines(true);
         assertTrue(table.getShowHorizontalLines());
     }
 
     public void testGetSetShowVerticalLines() throws Exception {
         assertTrue(table.getShowVerticalLines());
-
         table.setShowVerticalLines(false);
         assertFalse(table.getShowVerticalLines());
         assertTrue(propertyChangeController.isChanged("showVerticalLines"));
-
         table.setShowVerticalLines(true);
         assertTrue(table.getShowVerticalLines());
     }
 
     public void testGetSetAutoResizeMode() throws Exception {
         assertEquals(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS, table.getAutoResizeMode());
-
         table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
         assertEquals(JTable.AUTO_RESIZE_ALL_COLUMNS, table.getAutoResizeMode());
         assertTrue(propertyChangeController.isChanged("autoResizeMode"));
-
         propertyChangeController.reset();
         table.setAutoResizeMode(20);
         assertEquals(JTable.AUTO_RESIZE_ALL_COLUMNS, table.getAutoResizeMode());
@@ -304,20 +280,16 @@
 
     public void testGetSetAutoCreateColumnsFromModel() throws Exception {
         assertTrue(table.getAutoCreateColumnsFromModel());
-
         table.setAutoCreateColumnsFromModel(false);
         assertFalse(table.getAutoCreateColumnsFromModel());
         assertTrue(propertyChangeController.isChanged("autoCreateColumnsFromModel"));
-
-        DefaultTableModel model = (DefaultTableModel)table.getModel();
+        DefaultTableModel model = (DefaultTableModel) table.getModel();
         model.addColumn("column1");
         assertEquals(0, table.getColumnModel().getColumnCount());
-
         table.setAutoCreateColumnsFromModel(true);
         assertEquals(1, table.getColumnModel().getColumnCount());
         model.addColumn("column2");
         assertEquals(2, table.getColumnModel().getColumnCount());
-
         table.setAutoCreateColumnsFromModel(false);
         model.addColumn("column3");
         assertEquals(2, table.getColumnModel().getColumnCount());
@@ -326,23 +298,19 @@
     public void testCreateDefaultColumnsFromModel() throws Exception {
         TableColumnModel columnModel = table.getColumnModel();
         assertEquals(0, columnModel.getColumnCount());
-
         TableColumn modelColumn1 = new TableColumn();
         modelColumn1.setIdentifier("modelColumn1");
         columnModel.addColumn(modelColumn1);
         assertEquals(1, columnModel.getColumnCount());
-
         table.setAutoCreateColumnsFromModel(false);
-        DefaultTableModel model = (DefaultTableModel)table.getModel();
+        DefaultTableModel model = (DefaultTableModel) table.getModel();
         model.addColumn("column1");
         model.addColumn("column2");
         assertEquals(1, columnModel.getColumnCount());
-
         table.createDefaultColumnsFromModel();
         assertEquals(2, columnModel.getColumnCount());
         assertEquals("column1", columnModel.getColumn(0).getIdentifier());
         assertEquals("column2", columnModel.getColumn(1).getIdentifier());
-
         model.addColumn("column3");
         model.addColumn("column4");
         assertEquals(2, columnModel.getColumnCount());
@@ -352,23 +320,19 @@
 
     public void testGetSetDefaultRenderer() throws Exception {
         assertEquals(8, table.defaultRenderersByColumnClass.size());
-
         assertNotNull(table.getDefaultRenderer(String.class));
-        assertSame(table.defaultRenderersByColumnClass.get(Object.class), table.getDefaultRenderer(String.class));
-
+        assertSame(table.defaultRenderersByColumnClass.get(Object.class), table
+                .getDefaultRenderer(String.class));
         DefaultTableCellRenderer stringRenderer = new DefaultTableCellRenderer();
         table.setDefaultRenderer(String.class, stringRenderer);
         DefaultTableCellRenderer objectRenderer = new DefaultTableCellRenderer();
         table.setDefaultRenderer(Object.class, objectRenderer);
         assertEquals(9, table.defaultRenderersByColumnClass.size());
-
         assertSame(stringRenderer, table.getDefaultRenderer(String.class));
         assertSame(objectRenderer, table.getDefaultRenderer(JTable.class));
-
         table.setDefaultRenderer(Object.class, null);
         assertEquals(8, table.defaultRenderersByColumnClass.size());
         assertNull(table.getDefaultRenderer(JTable.class));
-
         DefaultTableCellRenderer actionRenderer = new DefaultTableCellRenderer();
         table.setDefaultRenderer(Action.class, actionRenderer);
         assertSame(actionRenderer, table.getDefaultRenderer(Action.class));
@@ -377,46 +341,43 @@
 
     public void testGetSetDefaultEditor() throws Exception {
         assertEquals(3, table.defaultEditorsByColumnClass.size());
-
         assertNotNull(table.getDefaultEditor(String.class));
-        assertSame(table.defaultEditorsByColumnClass.get(Object.class), table.getDefaultEditor(String.class));
-
+        assertSame(table.defaultEditorsByColumnClass.get(Object.class), table
+                .getDefaultEditor(String.class));
         DefaultCellEditor componentEditor = new DefaultCellEditor(new JTextField());
         table.setDefaultEditor(JComponent.class, componentEditor);
         DefaultCellEditor booleanEditor = new DefaultCellEditor(new JCheckBox());
         table.setDefaultEditor(Boolean.class, booleanEditor);
         assertEquals(4, table.defaultEditorsByColumnClass.size());
-
         assertSame(componentEditor, table.getDefaultEditor(JTable.class));
         assertSame(booleanEditor, table.getDefaultEditor(Boolean.class));
-
         table.setDefaultEditor(Boolean.class, null);
         assertEquals(3, table.defaultEditorsByColumnClass.size());
-
         assertNotNull(table.getDefaultEditor(Boolean.class));
         assertNotNull(table.getDefaultEditor(Math.class));
     }
 
     public void testGetSetDragEnabled() throws Exception {
         assertFalse(table.getDragEnabled());
-
         table.setDragEnabled(true);
         assertTrue(table.getDragEnabled());
     }
 
     public void testSetSelectionMode() throws Exception {
-        assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, table.getSelectionModel().getSelectionMode());
-        assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, table.getColumnModel().getSelectionModel().getSelectionMode());
-
+        assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, table.getSelectionModel()
+                .getSelectionMode());
+        assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, table.getColumnModel()
+                .getSelectionModel().getSelectionMode());
         table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-        assertEquals(ListSelectionModel.SINGLE_SELECTION, table.getSelectionModel().getSelectionMode());
-        assertEquals(ListSelectionModel.SINGLE_SELECTION, table.getColumnModel().getSelectionModel().getSelectionMode());
+        assertEquals(ListSelectionModel.SINGLE_SELECTION, table.getSelectionModel()
+                .getSelectionMode());
+        assertEquals(ListSelectionModel.SINGLE_SELECTION, table.getColumnModel()
+                .getSelectionModel().getSelectionMode());
         assertFalse(propertyChangeController.isChanged());
     }
 
     public void testGetSetRowSelectionAllowed() throws Exception {
         assertTrue(table.getRowSelectionAllowed());
-
         table.setRowSelectionAllowed(false);
         assertFalse(table.getRowSelectionAllowed());
         assertTrue(propertyChangeController.isChanged("rowSelectionAllowed"));
@@ -425,7 +386,6 @@
     public void testGetSetColumnSelectionAllowed() throws Exception {
         assertFalse(table.getColumnSelectionAllowed());
         assertFalse(table.getColumnModel().getColumnSelectionAllowed());
-
         table.setColumnSelectionAllowed(true);
         assertTrue(table.getColumnSelectionAllowed());
         assertTrue(table.getColumnModel().getColumnSelectionAllowed());
@@ -435,14 +395,12 @@
     public void testGetSetCellSelectionEnabled() throws Exception {
         assertFalse(table.getCellSelectionEnabled());
         assertFalse(table.cellSelectionEnabled);
-
         table.setCellSelectionEnabled(false);
         assertFalse(table.cellSelectionEnabled);
         assertFalse(table.getCellSelectionEnabled());
         assertFalse(table.getRowSelectionAllowed());
         assertFalse(table.getColumnSelectionAllowed());
         assertFalse(propertyChangeController.isChanged("cellSelectionEnabled"));
-
         propertyChangeController.reset();
         table.setCellSelectionEnabled(true);
         assertTrue(table.cellSelectionEnabled);
@@ -450,7 +408,6 @@
         assertTrue(table.getRowSelectionAllowed());
         assertTrue(table.getColumnSelectionAllowed());
         assertTrue(propertyChangeController.isChanged("cellSelectionEnabled"));
-
         table.setRowSelectionAllowed(false);
         assertFalse(table.getCellSelectionEnabled());
         assertTrue(table.cellSelectionEnabled);
@@ -460,15 +417,12 @@
         table = new JTable(3, 4);
         assertEquals(0, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
-
         table.selectAll();
         assertEquals(3, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(4, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
-
         table.clearSelection();
         assertEquals(0, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
-
         table.setCellSelectionEnabled(false);
         table.selectAll();
         assertEquals(3, getSelectedIndices(table.getSelectionModel()).length);
@@ -478,24 +432,23 @@
     public void testSetRowSelectionInterval() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, getSelectedIndices(table.getSelectionModel()).length);
-
         table.setRowSelectionInterval(1, 2);
         assertEquals(2, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(1, getSelectedIndices(table.getSelectionModel())[0]);
         assertEquals(2, getSelectedIndices(table.getSelectionModel())[1]);
-
         table.clearSelection();
         table.setRowSelectionAllowed(false);
         table.setRowSelectionInterval(1, 1);
         assertEquals(1, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(1, getSelectedIndices(table.getSelectionModel())[0]);
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setRowSelectionInterval(0, 3);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setRowSelectionInterval(-1, 1);
             }
@@ -505,24 +458,23 @@
     public void testSetColumnSelectionInterval() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
-
         table.setColumnSelectionInterval(1, 2);
         assertEquals(2, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
         assertEquals(1, getSelectedIndices(table.getColumnModel().getSelectionModel())[0]);
         assertEquals(2, getSelectedIndices(table.getColumnModel().getSelectionModel())[1]);
-
         table.clearSelection();
         table.setColumnSelectionAllowed(false);
         table.setColumnSelectionInterval(1, 1);
         assertEquals(1, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
         assertEquals(1, getSelectedIndices(table.getColumnModel().getSelectionModel())[0]);
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setColumnSelectionInterval(0, 4);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setColumnSelectionInterval(-1, 1);
             }
@@ -532,36 +484,36 @@
     public void testAddRemoveRowSelectionInterval() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, getSelectedIndices(table.getSelectionModel()).length);
-
         table.addRowSelectionInterval(0, 0);
         assertEquals(1, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getSelectionModel())[0]);
-
         table.addRowSelectionInterval(2, 2);
         assertEquals(2, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getSelectionModel())[0]);
         assertEquals(2, getSelectedIndices(table.getSelectionModel())[1]);
-
         table.removeRowSelectionInterval(2, 1);
         assertEquals(1, getSelectedIndices(table.getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getSelectionModel())[0]);
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.addRowSelectionInterval(4, 4);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.addRowSelectionInterval(-1, 1);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.removeRowSelectionInterval(-1, 1);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.removeRowSelectionInterval(4, 4);
             }
@@ -571,42 +523,41 @@
     public void testAddRemoveColumnSelectionInterval() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
-
         table.addColumnSelectionInterval(0, 0);
         assertEquals(1, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel())[0]);
-
         table.addColumnSelectionInterval(2, 3);
         assertEquals(3, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel())[0]);
         assertEquals(2, getSelectedIndices(table.getColumnModel().getSelectionModel())[1]);
         assertEquals(3, getSelectedIndices(table.getColumnModel().getSelectionModel())[2]);
-
         table.removeColumnSelectionInterval(3, 3);
         assertEquals(2, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel())[0]);
         assertEquals(2, getSelectedIndices(table.getColumnModel().getSelectionModel())[1]);
-
         table.removeColumnSelectionInterval(1, 2);
         assertEquals(1, getSelectedIndices(table.getColumnModel().getSelectionModel()).length);
         assertEquals(0, getSelectedIndices(table.getColumnModel().getSelectionModel())[0]);
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.addColumnSelectionInterval(4, 4);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.addColumnSelectionInterval(-1, 1);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.removeColumnSelectionInterval(4, 4);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.removeColumnSelectionInterval(-1, 1);
             }
@@ -616,10 +567,8 @@
     public void testGetSelectedRow() throws Exception {
         table = new JTable(3, 4);
         assertEquals(-1, table.getSelectedRow());
-
         table.setRowSelectionInterval(1, 1);
         assertEquals(1, table.getSelectedRow());
-
         table.addRowSelectionInterval(2, 2);
         assertEquals(1, table.getSelectedRow());
     }
@@ -627,10 +576,8 @@
     public void testGetSelectedColumn() throws Exception {
         table = new JTable(3, 4);
         assertEquals(-1, table.getSelectedColumn());
-
         table.setColumnSelectionInterval(1, 1);
         assertEquals(1, table.getSelectedColumn());
-
         table.addColumnSelectionInterval(2, 3);
         assertEquals(1, table.getSelectedColumn());
     }
@@ -638,11 +585,9 @@
     public void testGetSelectedRows() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, table.getSelectedRows().length);
-
         table.setRowSelectionInterval(1, 1);
         assertEquals(1, table.getSelectedRows().length);
         assertEquals(1, table.getSelectedRows()[0]);
-
         table.addRowSelectionInterval(2, 2);
         assertEquals(2, table.getSelectedRows().length);
         assertEquals(1, table.getSelectedRows()[0]);
@@ -652,12 +597,10 @@
     public void testGetSelectedColumns() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, table.getSelectedColumns().length);
-
         table.setColumnSelectionInterval(0, 1);
         assertEquals(2, table.getSelectedColumns().length);
         assertEquals(0, table.getSelectedColumns()[0]);
         assertEquals(1, table.getSelectedColumns()[1]);
-
         table.addColumnSelectionInterval(3, 3);
         assertEquals(3, table.getSelectedColumns().length);
         assertEquals(0, table.getSelectedColumns()[0]);
@@ -668,10 +611,8 @@
     public void testGetSelectedRowCount() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, table.getSelectedRowCount());
-
         table.setRowSelectionInterval(1, 1);
         assertEquals(1, table.getSelectedRowCount());
-
         table.addRowSelectionInterval(2, 2);
         assertEquals(2, table.getSelectedRowCount());
     }
@@ -679,10 +620,8 @@
     public void testGetSelectedColumnCount() throws Exception {
         table = new JTable(3, 4);
         assertEquals(0, table.getSelectedColumnCount());
-
         table.setColumnSelectionInterval(0, 1);
         assertEquals(2, table.getSelectedColumnCount());
-
         table.addColumnSelectionInterval(3, 3);
         assertEquals(3, table.getSelectedColumnCount());
     }
@@ -692,12 +631,10 @@
         assertFalse(table.isRowSelected(0));
         assertFalse(table.isRowSelected(1));
         assertFalse(table.isRowSelected(2));
-
         table.addRowSelectionInterval(0, 1);
         assertTrue(table.isRowSelected(0));
         assertTrue(table.isRowSelected(1));
         assertFalse(table.isRowSelected(2));
-
         assertFalse(table.isRowSelected(-1));
         assertFalse(table.isRowSelected(4));
     }
@@ -708,14 +645,12 @@
         assertFalse(table.isColumnSelected(1));
         assertFalse(table.isColumnSelected(2));
         assertFalse(table.isColumnSelected(3));
-
         table.addColumnSelectionInterval(0, 1);
         table.addColumnSelectionInterval(3, 3);
         assertTrue(table.isColumnSelected(0));
         assertTrue(table.isColumnSelected(1));
         assertFalse(table.isColumnSelected(2));
         assertTrue(table.isColumnSelected(3));
-
         assertFalse(table.isColumnSelected(-1));
         assertFalse(table.isColumnSelected(5));
     }
@@ -724,7 +659,6 @@
         table = new JTable(3, 4);
         assertTrue(table.getRowSelectionAllowed());
         assertFalse(table.getColumnSelectionAllowed());
-
         assertFalse(table.isCellSelected(0, 0));
         assertFalse(table.isCellSelected(0, 1));
         assertFalse(table.isCellSelected(0, 2));
@@ -737,7 +671,6 @@
         assertFalse(table.isCellSelected(2, 1));
         assertFalse(table.isCellSelected(2, 2));
         assertFalse(table.isCellSelected(2, 3));
-
         table.addRowSelectionInterval(0, 0);
         table.addRowSelectionInterval(2, 2);
         assertTrue(table.isCellSelected(0, 0));
@@ -752,7 +685,6 @@
         assertTrue(table.isCellSelected(2, 1));
         assertTrue(table.isCellSelected(2, 2));
         assertTrue(table.isCellSelected(2, 3));
-
         table.setCellSelectionEnabled(true);
         assertFalse(table.isCellSelected(0, 0));
         assertFalse(table.isCellSelected(0, 1));
@@ -766,7 +698,6 @@
         assertFalse(table.isCellSelected(2, 1));
         assertFalse(table.isCellSelected(2, 2));
         assertFalse(table.isCellSelected(2, 3));
-
         table.addColumnSelectionInterval(1, 1);
         table.addColumnSelectionInterval(3, 3);
         assertFalse(table.isCellSelected(0, 0));
@@ -781,7 +712,6 @@
         assertTrue(table.isCellSelected(2, 1));
         assertFalse(table.isCellSelected(2, 2));
         assertTrue(table.isCellSelected(2, 3));
-
         table.setCellSelectionEnabled(false);
         assertFalse(table.isCellSelected(0, 0));
         assertFalse(table.isCellSelected(0, 1));
@@ -795,7 +725,6 @@
         assertFalse(table.isCellSelected(2, 1));
         assertFalse(table.isCellSelected(2, 2));
         assertFalse(table.isCellSelected(2, 3));
-
         table.setColumnSelectionAllowed(true);
         table.setRowSelectionAllowed(false);
         assertFalse(table.isCellSelected(0, 0));
@@ -810,7 +739,6 @@
         assertTrue(table.isCellSelected(2, 1));
         assertFalse(table.isCellSelected(2, 2));
         assertTrue(table.isCellSelected(2, 3));
-
         table.setColumnSelectionAllowed(false);
         table.setRowSelectionAllowed(true);
         assertTrue(table.isCellSelected(0, 0));
@@ -825,7 +753,6 @@
         assertTrue(table.isCellSelected(2, 1));
         assertTrue(table.isCellSelected(2, 2));
         assertTrue(table.isCellSelected(2, 3));
-
         table.setCellSelectionEnabled(true);
         assertFalse(table.isCellSelected(-1, 0));
         assertFalse(table.isCellSelected(0, -1));
@@ -836,13 +763,11 @@
     public void testChangeSelection() throws Exception {
         table = new JTable(3, 4);
         table.setCellSelectionEnabled(true);
-
         table.changeSelection(1, 1, true, false);
         assertTrue(table.isCellSelected(1, 1));
         assertFalse(table.isCellSelected(1, 2));
         assertFalse(table.isCellSelected(2, 1));
         assertFalse(table.isCellSelected(2, 2));
-
         table.changeSelection(2, 2, true, false);
         assertTrue(table.isCellSelected(1, 1));
         assertTrue(table.isCellSelected(1, 2));
@@ -852,7 +777,6 @@
         assertEquals(2, table.getColumnModel().getSelectionModel().getAnchorSelectionIndex());
         assertEquals(2, table.getSelectionModel().getLeadSelectionIndex());
         assertEquals(2, table.getColumnModel().getSelectionModel().getLeadSelectionIndex());
-
         table.changeSelection(2, 3, true, true);
         assertTrue(table.isCellSelected(1, 1));
         assertTrue(table.isCellSelected(1, 2));
@@ -863,7 +787,6 @@
         assertEquals(2, table.getColumnModel().getSelectionModel().getLeadSelectionIndex());
         assertEquals(2, table.getSelectionModel().getAnchorSelectionIndex());
         assertEquals(3, table.getColumnModel().getSelectionModel().getAnchorSelectionIndex());
-
         table.changeSelection(0, 3, false, true);
         assertFalse(table.isCellSelected(1, 1));
         assertFalse(table.isCellSelected(1, 2));
@@ -876,16 +799,13 @@
         assertFalse(table.isCellSelected(0, 4));
         assertFalse(table.isCellSelected(1, 4));
         assertFalse(table.isCellSelected(2, 4));
-
         table.changeSelection(1, 2, false, true);
         assertFalse(table.isCellSelected(1, 1));
         assertTrue(table.isCellSelected(1, 2));
-
         table.changeSelection(1, 1, true, false);
         assertTrue(table.isCellSelected(1, 1));
         table.changeSelection(1, 1, true, false);
         assertFalse(table.isCellSelected(1, 1));
-
         table.changeSelection(2, 3, false, false);
         assertTrue(table.isCellSelected(2, 3));
         assertEquals(1, table.getSelectedRowCount());
@@ -893,12 +813,12 @@
     }
 
     public void testGetSetSelectionForegroundBackground() throws Exception {
-        assertEquals(UIManager.getColor("Table.selectionForeground"), table.getSelectionForeground());
-        assertEquals(UIManager.getColor("Table.selectionBackground"), table.getSelectionBackground());
-
+        assertEquals(UIManager.getColor("Table.selectionForeground"), table
+                .getSelectionForeground());
+        assertEquals(UIManager.getColor("Table.selectionBackground"), table
+                .getSelectionBackground());
         table.setSelectionForeground(Color.BLUE);
         assertTrue(propertyChangeController.isChanged("selectionForeground"));
-
         propertyChangeController.reset();
         table.setSelectionBackground(Color.RED);
         assertTrue(propertyChangeController.isChanged("selectionBackground"));
@@ -912,16 +832,16 @@
         assertNotNull(table.getColumn("B"));
         assertNotNull(table.getColumn("C"));
         assertNotNull(table.getColumn("D"));
-
         table.getColumn("C").setIdentifier("ANY");
         assertNotNull(table.getColumn("ANY"));
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 assertNull(table.getColumn("C"));
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 assertNull(table.getColumn("E"));
             }
@@ -930,19 +850,16 @@
 
     public void testConvertColumnIndexToModel() throws Exception {
         assertEquals(-5, table.convertColumnIndexToModel(-5));
-
         table = new JTable(3, 4);
         assertEquals(0, table.convertColumnIndexToModel(0));
         assertEquals(1, table.convertColumnIndexToModel(1));
         assertEquals(2, table.convertColumnIndexToModel(2));
         assertEquals(3, table.convertColumnIndexToModel(3));
-
         table.moveColumn(0, 2);
         assertEquals(1, table.convertColumnIndexToModel(0));
         assertEquals(2, table.convertColumnIndexToModel(1));
         assertEquals(0, table.convertColumnIndexToModel(2));
         assertEquals(3, table.convertColumnIndexToModel(3));
-
         table.getColumnModel().getColumn(0).setModelIndex(-5);
         table.getColumnModel().getColumn(1).setModelIndex(-5);
         table.getColumnModel().getColumn(2).setModelIndex(-5);
@@ -951,8 +868,8 @@
         assertEquals(-5, table.convertColumnIndexToModel(1));
         assertEquals(-5, table.convertColumnIndexToModel(2));
         assertEquals(-5, table.convertColumnIndexToModel(3));
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.convertColumnIndexToModel(100);
             }
@@ -962,19 +879,16 @@
     public void testConvertColumnIndexToView() throws Exception {
         assertEquals(-5, table.convertColumnIndexToView(-5));
         assertEquals(-1, table.convertColumnIndexToView(10));
-
         table = new JTable(3, 4);
         assertEquals(0, table.convertColumnIndexToView(0));
         assertEquals(1, table.convertColumnIndexToView(1));
         assertEquals(2, table.convertColumnIndexToView(2));
         assertEquals(3, table.convertColumnIndexToView(3));
-
         table.moveColumn(0, 2);
         assertEquals(2, table.convertColumnIndexToView(0));
         assertEquals(0, table.convertColumnIndexToView(1));
         assertEquals(1, table.convertColumnIndexToView(2));
         assertEquals(3, table.convertColumnIndexToView(3));
-
         table.getColumnModel().getColumn(0).setModelIndex(-5);
         table.getColumnModel().getColumn(1).setModelIndex(-5);
         table.getColumnModel().getColumn(2).setModelIndex(-5);
@@ -987,11 +901,10 @@
 
     public void testGetRowCount() throws Exception {
         assertEquals(0, table.getRowCount());
-
         table = new JTable(3, 4);
         assertEquals(3, table.getRowCount());
-
         table = new JTable(new DefaultTableModel() {
+            @Override
             public int getRowCount() {
                 return 10;
             }
@@ -1001,11 +914,10 @@
 
     public void testGetColumnCount() throws Exception {
         assertEquals(0, table.getColumnCount());
-
         table = new JTable(3, 4);
         assertEquals(4, table.getColumnCount());
-
         table = new JTable(new DefaultTableModel() {
+            @Override
             public int getColumnCount() {
                 return 10;
             }
@@ -1019,19 +931,19 @@
         assertEquals("B", table.getColumnName(1));
         assertEquals("C", table.getColumnName(2));
         assertEquals("D", table.getColumnName(3));
-
         table.moveColumn(0, 2);
         assertEquals("B", table.getColumnName(0));
         assertEquals("C", table.getColumnName(1));
         assertEquals("A", table.getColumnName(2));
         assertEquals("D", table.getColumnName(3));
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.getColumnName(-1);
             }
         });
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.getColumnName(100);
             }
@@ -1040,7 +952,8 @@
 
     public void testGetColumnClass() throws Exception {
         table = new JTable(new DefaultTableModel(3, 4) {
-            public Class getColumnClass(final int columnIndex) {
+            @Override
+            public Class<?> getColumnClass(final int columnIndex) {
                 return columnIndex < 2 ? Object.class : String.class;
             }
         });
@@ -1048,16 +961,14 @@
         assertEquals(Object.class, table.getColumnClass(1));
         assertEquals(String.class, table.getColumnClass(2));
         assertEquals(String.class, table.getColumnClass(3));
-
         table.moveColumn(0, 2);
         assertEquals(Object.class, table.getColumnClass(0));
         assertEquals(String.class, table.getColumnClass(1));
         assertEquals(Object.class, table.getColumnClass(2));
         assertEquals(String.class, table.getColumnClass(3));
-
         assertEquals(Object.class, table.getColumnClass(-1));
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.getColumnName(100);
             }
@@ -1070,7 +981,6 @@
         assertNull(table.getValueAt(0, 1));
         assertNull(table.getValueAt(0, 2));
         assertNull(table.getValueAt(0, 3));
-
         table.setValueAt("a", 0, 0);
         table.setValueAt("b", 0, 1);
         table.setValueAt("c", 0, 2);
@@ -1079,19 +989,18 @@
         assertEquals("b", table.getValueAt(0, 1));
         assertEquals("c", table.getValueAt(0, 2));
         assertEquals("d", table.getValueAt(0, 3));
-
         table.moveColumn(0, 2);
         assertEquals("b", table.getValueAt(0, 0));
         assertEquals("c", table.getValueAt(0, 1));
         assertEquals("a", table.getValueAt(0, 2));
         assertEquals("d", table.getValueAt(0, 3));
-
         table.setValueAt("another a", 0, 2);
         assertEquals("another a", table.getValueAt(0, 2));
     }
 
     public void testIsCellEditable() throws Exception {
         table = new JTable(new DefaultTableModel(3, 4) {
+            @Override
             public boolean isCellEditable(final int row, final int column) {
                 return column < 2;
             }
@@ -1100,16 +1009,14 @@
         assertTrue(table.isCellEditable(0, 1));
         assertFalse(table.isCellEditable(0, 2));
         assertFalse(table.isCellEditable(0, 3));
-
         table.moveColumn(0, 2);
         assertTrue(table.isCellEditable(0, 0));
         assertFalse(table.isCellEditable(0, 1));
         assertTrue(table.isCellEditable(0, 2));
         assertFalse(table.isCellEditable(0, 3));
-
         assertTrue(table.isCellEditable(100, -1));
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.isCellEditable(0, 100);
             }
@@ -1118,7 +1025,6 @@
 
     public void testAddColumn() throws Exception {
         assertEquals(0, table.getColumnCount());
-
         TableColumn column1 = new TableColumn(0);
         column1.setIdentifier("column1");
         table.addColumn(column1);
@@ -1126,19 +1032,16 @@
         assertEquals(0, table.getModel().getColumnCount());
         assertSame(column1, table.getColumn("column1"));
         assertEquals(0, table.getColumnModel().getColumnIndex("column1"));
-
         TableColumn column2 = new TableColumn(1);
         table.addColumn(column2);
         assertEquals(2, table.getColumnCount());
         assertSame(column2, table.getColumn("B"));
         assertEquals(1, table.getColumnModel().getColumnIndex("B"));
-
         TableColumn column3 = new TableColumn(20);
         table.addColumn(column3);
         assertEquals(3, table.getColumnCount());
         assertSame(column3, table.getColumn("U"));
         assertEquals(2, table.getColumnModel().getColumnIndex("U"));
-
         TableColumn column31 = new TableColumn(20);
         table.addColumn(column31);
         assertEquals(4, table.getColumnCount());
@@ -1147,13 +1050,11 @@
         assertEquals(2, table.getColumnModel().getColumnIndex("U"));
         assertEquals("U", table.getColumnModel().getColumn(2).getIdentifier());
         assertEquals("U", table.getColumnModel().getColumn(3).getIdentifier());
-
         TableColumn column5 = new TableColumn();
         column5.setIdentifier("column1");
         assertNull(column5.getHeaderValue());
         table.addColumn(column5);
         assertEquals("A", column5.getHeaderValue());
-
         TableColumn column6 = new TableColumn();
         column6.setIdentifier("column1");
         column6.setHeaderValue("header value");
@@ -1163,23 +1064,19 @@
 
     public void testRemoveColumn() throws Exception {
         assertEquals(0, table.getColumnCount());
-
         TableColumn column1 = new TableColumn(0);
         column1.setIdentifier("column1");
         table.addColumn(column1);
         assertEquals(1, table.getColumnCount());
         assertSame(column1, table.getColumn("column1"));
         assertEquals(0, table.getColumnModel().getColumnIndex("column1"));
-
         TableColumn column2 = new TableColumn(1);
         table.addColumn(column2);
         assertEquals(2, table.getColumnCount());
         assertSame(column2, table.getColumn("B"));
         assertEquals(1, table.getColumnModel().getColumnIndex("B"));
-
         table.removeColumn(column1);
         assertEquals(1, table.getColumnCount());
-
         table.removeColumn(new TableColumn(1));
         assertEquals(1, table.getColumnCount());
     }
@@ -1188,11 +1085,9 @@
         TableColumn column1 = new TableColumn(0);
         table.addColumn(column1);
         assertEquals(0, table.getColumnModel().getColumnIndex("A"));
-
         TableColumn column2 = new TableColumn(1);
         table.addColumn(column2);
         assertEquals(1, table.getColumnModel().getColumnIndex("B"));
-
         table.moveColumn(0, 1);
         assertEquals(0, table.getColumnModel().getColumnIndex("B"));
         assertEquals(1, table.getColumnModel().getColumnIndex("A"));
@@ -1201,15 +1096,12 @@
     public void testColumnAtPoint() throws Exception {
         assertEquals(-1, table.columnAtPoint(new Point(10, 10)));
         assertEquals(-1, table.columnAtPoint(new Point(-10, 10)));
-
         table.addColumn(new TableColumn(0, 20));
         table.addColumn(new TableColumn(1, 30));
-
         assertEquals(0, table.columnAtPoint(new Point(10, 100)));
         assertEquals(0, table.columnAtPoint(new Point(19, 100)));
         assertEquals(1, table.columnAtPoint(new Point(20, 100)));
         assertEquals(1, table.columnAtPoint(new Point(49, 100)));
-
         table.moveColumn(0, 1);
         assertEquals(0, table.columnAtPoint(new Point(10, 100)));
         assertEquals(0, table.columnAtPoint(new Point(29, 100)));
@@ -1220,19 +1112,15 @@
     public void testRowAtPoint() throws Exception {
         assertEquals(-1, table.rowAtPoint(new Point(10, 10)));
         assertEquals(-1, table.rowAtPoint(new Point(10, -10)));
-
         table = new JTable(3, 4);
         table.setRowHeight(10);
-
         table.setRowHeight(1, 30);
-
         assertEquals(0, table.rowAtPoint(new Point(1000, 0)));
         assertEquals(0, table.rowAtPoint(new Point(1000, 9)));
         assertEquals(1, table.rowAtPoint(new Point(1000, 10)));
         assertEquals(1, table.rowAtPoint(new Point(1000, 39)));
         assertEquals(2, table.rowAtPoint(new Point(1000, 40)));
         assertEquals(2, table.rowAtPoint(new Point(1000, 49)));
-
         if (isHarmony()) {
             assertEquals(-1, table.rowAtPoint(new Point(10, -100)));
         } else {
@@ -1246,25 +1134,18 @@
         assertEquals(new Rectangle(), table.getCellRect(0, 0, false));
         assertEquals(new Rectangle(), table.getCellRect(10, 10, true));
         assertEquals(new Rectangle(), table.getCellRect(-10, -10, true));
-
         table = new JTable(3, 4);
         table.setIntercellSpacing(new Dimension(12, 10));
-
         assertEquals(new Rectangle(0, 0, 75, 16), table.getCellRect(0, 0, true));
         assertEquals(new Rectangle(6, 5, 63, 6), table.getCellRect(0, 0, false));
-
         assertEquals(new Rectangle(75, 16, 75, 16), table.getCellRect(1, 1, true));
         assertEquals(new Rectangle(81, 21, 63, 6), table.getCellRect(1, 1, false));
-
         assertEquals(new Rectangle(225, 32, 75, 16), table.getCellRect(2, 3, true));
         assertEquals(new Rectangle(231, 37, 63, 6), table.getCellRect(2, 3, false));
-
-
         assertEquals(new Rectangle(0, 32, 0, 16), table.getCellRect(2, 4, true));
         assertEquals(new Rectangle(0, 32, 0, 16), table.getCellRect(2, 4, false));
         assertEquals(new Rectangle(0, 32, 0, 16), table.getCellRect(2, -1, true));
         assertEquals(new Rectangle(0, 32, 0, 16), table.getCellRect(2, -1, false));
-
         assertEquals(new Rectangle(225, 0, 75, 0), table.getCellRect(3, 3, true));
         assertEquals(new Rectangle(225, 0, 75, 0), table.getCellRect(3, 3, false));
         assertEquals(new Rectangle(225, 0, 75, 0), table.getCellRect(-1, 3, true));
@@ -1272,33 +1153,38 @@
     }
 
     public void testGetToolTipText() throws Exception {
-        assertNull(table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 0, 0, 0, false)));
-
+        assertNull(table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0,
+                0, 0, 0, false)));
         table = new JTable(3, 4) {
+            @Override
             public TableCellRenderer getCellRenderer(final int row, final int column) {
-                DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)getDefaultRenderer(Object.class);
+                DefaultTableCellRenderer renderer = (DefaultTableCellRenderer) getDefaultRenderer(Object.class);
                 renderer.setToolTipText("[" + row + ", " + column + "]");
-
                 return renderer;
             }
         };
-        assertNull(table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, -10, -10, 0, false)));
-        assertNull(table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 800, 20, 0, false)));
-
-        assertEquals("[0, 0]", table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 0, 0, 0, false)));
-        assertEquals("[0, 0]", table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 30, 10, 0, false)));
-        assertEquals("[1, 0]", table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 30, 20, 0, false)));
-        assertEquals("[1, 1]", table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 80, 20, 0, false)));
+        assertNull(table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0,
+                -10, -10, 0, false)));
+        assertNull(table.getToolTipText(new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0,
+                800, 20, 0, false)));
+        assertEquals("[0, 0]", table.getToolTipText(new MouseEvent(table,
+                MouseEvent.MOUSE_ENTERED, 0, 0, 0, 0, 0, false)));
+        assertEquals("[0, 0]", table.getToolTipText(new MouseEvent(table,
+                MouseEvent.MOUSE_ENTERED, 0, 0, 30, 10, 0, false)));
+        assertEquals("[1, 0]", table.getToolTipText(new MouseEvent(table,
+                MouseEvent.MOUSE_ENTERED, 0, 0, 30, 20, 0, false)));
+        assertEquals("[1, 1]", table.getToolTipText(new MouseEvent(table,
+                MouseEvent.MOUSE_ENTERED, 0, 0, 80, 20, 0, false)));
     }
 
     public void testGetSetSurrendersFocusOnKeystroke() throws Exception {
         assertFalse(table.getSurrendersFocusOnKeystroke());
-
         table.setSurrendersFocusOnKeystroke(true);
         assertTrue(table.getSurrendersFocusOnKeystroke());
         assertFalse(propertyChangeController.isChanged());
     }
 
+    @SuppressWarnings("deprecation")
     public void testEditCellAt() throws Exception {
         assertFalse(table.editCellAt(0, 0));
         assertFalse(table.isEditing());
@@ -1306,30 +1192,27 @@
         assertEquals(-1, table.getEditingColumn());
         assertNull(table.getCellEditor());
         assertNull(table.getEditorComponent());
-
         table = new JTable(3, 4);
-
         assertTrue(table.editCellAt(0, 0));
         assertTrue(table.isEditing());
         assertNotNull(table.getEditorComponent());
         assertEquals(0, table.getEditingRow());
         assertEquals(0, table.getEditingColumn());
-
         assertTrue(table.editCellAt(1, 2, new KeyEvent(table, KeyEvent.KEY_PRESSED, 0, 0, 0)));
         assertTrue(table.isEditing());
         assertNotNull(table.getEditorComponent());
         assertEquals(1, table.getEditingRow());
         assertEquals(2, table.getEditingColumn());
         assertNotNull(table.getCellEditor());
-
-        assertFalse(table.editCellAt(0, 0, new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0, 0, 0, 0, 0, false)));
+        assertFalse(table.editCellAt(0, 0, new MouseEvent(table, MouseEvent.MOUSE_ENTERED, 0,
+                0, 0, 0, 0, false)));
         assertFalse(table.isEditing());
         assertEquals(-1, table.getEditingRow());
         assertEquals(-1, table.getEditingColumn());
         assertNull(table.getCellEditor());
         assertNull(table.getEditorComponent());
-
         table = new JTable(new DefaultTableModel() {
+            @Override
             public boolean isCellEditable(final int row, final int column) {
                 return false;
             }
@@ -1340,14 +1223,12 @@
 
     public void testIsEditing() throws Exception {
         assertFalse(table.isEditing());
-
         table.cellEditor = new DefaultCellEditor(new JCheckBox());
         assertTrue(table.isEditing());
     }
 
     public void testGetEditingComponent() throws Exception {
         assertNull(table.getEditorComponent());
-
         table.editorComp = new JLabel();
         assertEquals(table.editorComp, table.getEditorComponent());
     }
@@ -1355,12 +1236,10 @@
     public void testGetSetEditingRowColumn() throws Exception {
         assertEquals(-1, table.getEditingRow());
         assertEquals(-1, table.getEditingColumn());
-
         table.editingRow = 25;
         table.editingColumn = -5;
         assertEquals(25, table.getEditingRow());
         assertEquals(-5, table.getEditingColumn());
-
         table.setEditingRow(15);
         assertEquals(15, table.getEditingRow());
         assertFalse(propertyChangeController.isChanged());
@@ -1368,11 +1247,9 @@
 
     public void testGetSetUpdateUI() throws Exception {
         assertTrue(table.getUI() instanceof BasicTableUI);
-
         TableUI ui = new BasicTableUI();
         table.setUI(ui);
         assertSame(ui, table.getUI());
-
         table.updateUI();
         assertNotSame(ui, table.getUI());
     }
@@ -1382,23 +1259,21 @@
     }
 
     public void testGetSetModel() throws Exception {
-        DefaultTableModel oldModel = (DefaultTableModel)table.getModel();
+        DefaultTableModel oldModel = (DefaultTableModel) table.getModel();
         assertNotNull(oldModel);
         assertEquals(1, oldModel.getTableModelListeners().length);
         assertEquals(table, oldModel.getTableModelListeners()[0]);
-
         DefaultTableModel model = new DefaultTableModel(3, 4);
         table.setModel(model);
         assertEquals(0, oldModel.getTableModelListeners().length);
         assertEquals(1, model.getTableModelListeners().length);
         assertEquals(4, table.getColumnModel().getColumnCount());
         assertTrue(propertyChangeController.isChanged("model"));
-
         table.setAutoCreateColumnsFromModel(false);
         table.setModel(new DefaultTableModel(1, 2));
         assertEquals(4, table.getColumnModel().getColumnCount());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setModel(null);
             }
@@ -1407,21 +1282,19 @@
 
     public void testGetSetColumnModel() throws Exception {
         table = new JTable(3, 4);
-
-        DefaultTableColumnModel oldModel = (DefaultTableColumnModel)table.getColumnModel();
+        DefaultTableColumnModel oldModel = (DefaultTableColumnModel) table.getColumnModel();
         assertNotNull(oldModel);
         assertEquals(2, oldModel.getColumnModelListeners().length);
         assertEquals(table.getTableHeader(), oldModel.getColumnModelListeners()[0]);
         assertEquals(table, oldModel.getColumnModelListeners()[1]);
-
         DefaultTableColumnModel model = new DefaultTableColumnModel();
         table.setColumnModel(model);
         assertEquals(0, oldModel.getColumnModelListeners().length);
         assertEquals(2, model.getColumnModelListeners().length);
         assertEquals(0, table.getColumnModel().getColumnCount());
         assertFalse(propertyChangeController.isChanged());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setColumnModel(null);
             }
@@ -1429,18 +1302,18 @@
     }
 
     public void testGetSetSelectionModel() throws Exception {
-        DefaultListSelectionModel oldModel = (DefaultListSelectionModel)table.getSelectionModel();
+        DefaultListSelectionModel oldModel = (DefaultListSelectionModel) table
+                .getSelectionModel();
         assertNotNull(oldModel);
         assertEquals(1, oldModel.getListSelectionListeners().length);
         assertEquals(table, oldModel.getListSelectionListeners()[0]);
-
         DefaultListSelectionModel model = new DefaultListSelectionModel();
         table.setSelectionModel(model);
         assertEquals(0, oldModel.getListSelectionListeners().length);
         assertEquals(1, model.getListSelectionListeners().length);
         assertTrue(propertyChangeController.isChanged("selectionModel"));
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.setSelectionModel(null);
             }
@@ -1449,16 +1322,14 @@
 
     public void testEditingCanceled() throws Exception {
         table = new JTable(3, 4);
-
         table.editCellAt(0, 0);
         assertTrue(table.isEditing());
         assertNotNull(table.getCellEditor());
         assertNotNull(table.getEditorComponent());
         assertEquals(0, table.getEditingRow());
         assertEquals(0, table.getEditingColumn());
-
-        table.setCellEditor(new DefaultCellEditor((JTextField)table.getEditorComponent()));
-        ((JTextField)table.getEditorComponent()).setText("new value");
+        table.setCellEditor(new DefaultCellEditor((JTextField) table.getEditorComponent()));
+        ((JTextField) table.getEditorComponent()).setText("new value");
         table.editingCanceled(null);
         assertFalse(table.isEditing());
         assertNull(table.getValueAt(0, 0));
@@ -1466,16 +1337,14 @@
 
     public void testEditingStoppped() throws Exception {
         table = new JTable(3, 4);
-
         table.editCellAt(0, 0);
         assertTrue(table.isEditing());
         assertNotNull(table.getCellEditor());
         assertNotNull(table.getEditorComponent());
         assertEquals(0, table.getEditingRow());
         assertEquals(0, table.getEditingColumn());
-
-        table.setCellEditor(new DefaultCellEditor((JTextField)table.getEditorComponent()));
-        ((JTextField)table.getEditorComponent()).setText("new value");
+        table.setCellEditor(new DefaultCellEditor((JTextField) table.getEditorComponent()));
+        ((JTextField) table.getEditorComponent()).setText("new value");
         table.editingStopped(null);
         assertFalse(table.isEditing());
         assertEquals("new value", table.getValueAt(0, 0));
@@ -1483,16 +1352,12 @@
 
     public void testGetSetPreferredScrollableViewportSize() throws Exception {
         assertEquals(new Dimension(450, 400), table.getPreferredScrollableViewportSize());
-
         table = new JTable(3, 4);
         assertEquals(new Dimension(450, 400), table.getPreferredScrollableViewportSize());
-
         table = new JTable(300, 400);
         assertEquals(new Dimension(450, 400), table.getPreferredScrollableViewportSize());
-
         table.setBorder(BorderFactory.createLineBorder(Color.RED, 20));
         assertEquals(new Dimension(450, 400), table.getPreferredScrollableViewportSize());
-
         Dimension size = new Dimension(200, 300);
         table.setPreferredScrollableViewportSize(size);
         assertSame(size, table.getPreferredScrollableViewportSize());
@@ -1501,17 +1366,14 @@
 
     //TODO
     public void testGetScrollableUnitIncrement() throws Exception {
-
     }
 
     //TODO
     public void testGetScrollableBlockIncrement() throws Exception {
-
     }
 
     public void testGetScrollableTracksViewportWidth() throws Exception {
         assertTrue(table.getScrollableTracksViewportWidth());
-
         table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         assertFalse(table.getScrollableTracksViewportWidth());
     }
@@ -1522,7 +1384,6 @@
 
     public void testCreateDefaultRenderers() throws Exception {
         assertEquals(8, table.defaultRenderersByColumnClass.size());
-
         table.defaultRenderersByColumnClass = null;
         table.createDefaultRenderers();
         assertEquals(8, table.defaultRenderersByColumnClass.size());
@@ -1530,7 +1391,6 @@
 
     public void testCreateDefaultEditors() throws Exception {
         assertEquals(3, table.defaultEditorsByColumnClass.size());
-
         table.defaultEditorsByColumnClass = null;
         table.createDefaultEditors();
         assertEquals(3, table.defaultEditorsByColumnClass.size());
@@ -1547,7 +1407,6 @@
         table.rowSelectionAllowed = false;
         table.defaultEditorsByColumnClass = null;
         table.defaultRenderersByColumnClass = null;
-
         table.initializeLocalVars();
         assertEquals(1, table.rowMargin);
         assertNotNull(table.tableHeader);
@@ -1572,7 +1431,8 @@
     }
 
     public void testCreateDefaultSelectionModel() throws Exception {
-        assertSame(DefaultListSelectionModel.class, table.createDefaultSelectionModel().getClass());
+        assertSame(DefaultListSelectionModel.class, table.createDefaultSelectionModel()
+                .getClass());
         assertNotSame(table.createDefaultSelectionModel(), table.createDefaultSelectionModel());
     }
 
@@ -1583,7 +1443,6 @@
 
     public void testGetSetCellEditor() throws Exception {
         assertNull(table.getCellEditor());
-
         TableCellEditor editor = new DefaultCellEditor(new JTextField());
         table.setCellEditor(editor);
         assertSame(editor, table.getCellEditor());
@@ -1591,21 +1450,19 @@
 
     public void testGetCellRenderer() throws Exception {
         table = new JTable(3, 4);
-        assertEquals(table.defaultRenderersByColumnClass.get(Object.class), table.getCellRenderer(0, 0));
-
+        assertEquals(table.defaultRenderersByColumnClass.get(Object.class), table
+                .getCellRenderer(0, 0));
         TableCellRenderer renderer = new DefaultTableCellRenderer();
         table.getColumnModel().getColumn(0).setCellRenderer(renderer);
         assertEquals(renderer, table.getCellRenderer(0, 0));
         assertEquals(renderer, table.getCellRenderer(1, 0));
         assertEquals(renderer, table.getCellRenderer(2, 0));
-
         table.moveColumn(0, 2);
         assertEquals(renderer, table.getCellRenderer(0, 2));
         assertEquals(renderer, table.getCellRenderer(1, 2));
         assertEquals(renderer, table.getCellRenderer(2, 2));
-
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.getCellRenderer(100, 100);
             }
@@ -1614,12 +1471,10 @@
 
     public void testPrepareRenderer() throws Exception {
         table = new JTable(3, 4);
-
         DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
         assertSame(renderer, table.prepareRenderer(renderer, 0, 0));
         assertEquals(table.getBackground(), renderer.getBackground());
         assertEquals(table.getForeground(), renderer.getForeground());
-
         table.getSelectionModel().setSelectionInterval(0, 0);
         table.prepareRenderer(renderer, 0, 0);
         assertEquals(table.getSelectionBackground(), renderer.getBackground());
@@ -1628,7 +1483,6 @@
 
     public void testPrepareEditor() throws Exception {
         table = new JTable(3, 4);
-
         JTextField editorComponent = new JTextField();
         DefaultCellEditor editor = new DefaultCellEditor(editorComponent);
         table.setCellEditor(editor);
@@ -1640,21 +1494,19 @@
 
     public void testGetCellEditor() throws Exception {
         table = new JTable(3, 4);
-        assertEquals(table.defaultEditorsByColumnClass.get(Object.class), table.getCellEditor(0, 0));
-
+        assertEquals(table.defaultEditorsByColumnClass.get(Object.class), table.getCellEditor(
+                0, 0));
         TableCellEditor editor = new DefaultCellEditor(new JTextField());
         table.getColumnModel().getColumn(0).setCellEditor(editor);
         assertEquals(editor, table.getCellEditor(0, 0));
         assertEquals(editor, table.getCellEditor(1, 0));
         assertEquals(editor, table.getCellEditor(2, 0));
-
         table.moveColumn(0, 2);
         assertEquals(editor, table.getCellEditor(0, 2));
         assertEquals(editor, table.getCellEditor(1, 2));
         assertEquals(editor, table.getCellEditor(2, 2));
-
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 table.getCellEditor(100, 100);
             }
@@ -1664,15 +1516,12 @@
     public void testRemoveEditor() throws Exception {
         table.removeEditor();
         int childrenCount = table.getComponentCount();
-
-
         table.setCellEditor(new DefaultCellEditor(new JTextField()));
         table.editorComp = new JTextField();
         table.add(table.editorComp);
         table.setEditingColumn(10);
         table.setEditingRow(10);
         assertEquals(childrenCount + 1, table.getComponentCount());
-
         table.removeEditor();
         assertNull(table.getCellEditor());
         assertNull(table.getEditorComponent());
@@ -1681,7 +1530,6 @@
         assertEquals(-1, table.getEditingRow());
     }
 
-
     private int[] getSelectedIndices(final ListSelectionModel selModel) {
         int count = 0;
         for (int i = selModel.getMinSelectionIndex(); i <= selModel.getMaxSelectionIndex(); i++) {
@@ -1689,7 +1537,6 @@
                 count++;
             }
         }
-
         int[] result = new int[count];
         count = 0;
         for (int i = selModel.getMinSelectionIndex(); i <= selModel.getMaxSelectionIndex(); i++) {
@@ -1697,7 +1544,6 @@
                 result[count++] = i;
             }
         }
-
         return result;
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaRTest.java Sat Nov 25 16:04:10 2006
@@ -21,25 +21,23 @@
 package javax.swing;
 
 import java.awt.Dimension;
-
 import junit.framework.TestCase;
 
 public class JTextAreaRTest extends TestCase {
-
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
-
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
 
     public void testGetPrefferedSize() {
         JTextArea textArea = new JTextArea();
-        Dimension d = new Dimension(100,100);
+        Dimension d = new Dimension(100, 100);
         textArea.setPreferredSize(d);
         assertEquals(d, textArea.getPreferredSize());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaTest.java Sat Nov 25 16:04:10 2006
@@ -25,16 +25,14 @@
 import java.awt.Font;
 import java.awt.FontMetrics;
 import java.awt.GridLayout;
-
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 /*
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-*/
-
+ import java.io.FileInputStream;
+ import java.io.FileOutputStream;
+ import java.io.ObjectInputStream;
+ import java.io.ObjectOutputStream;
+ */
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleState;
 import javax.accessibility.AccessibleStateSet;
@@ -61,13 +59,11 @@
             + " Edison cap, \tEdison effect\n"
             + "Edison screw, Edison screw cap, Edison screw \n"
             + "holder, Edison screw lampholder, Edison screw " + "plug\n"
-            + "Edison screw terminal, Edison storage battery"
-            + "Edison storage \t\tcell";
+            + "Edison screw terminal, Edison storage battery" + "Edison storage \t\tcell";
 
-    String bidiContent = sLTR + sRTL + sRTL + " \t" + sLTR + sRTL + sLTR + "\n"
-            + sRTL + "." + sLTR + sRTL + "\t" + sRTL + "\n" + sLTR + sLTR
-            + sRTL + sRTL + sRTL + sLTR + sLTR + sLTR + sRTL + sLTR + sRTL
-            + sLTR;
+    String bidiContent = sLTR + sRTL + sRTL + " \t" + sLTR + sRTL + sLTR + "\n" + sRTL + "."
+            + sLTR + sRTL + "\t" + sRTL + "\n" + sLTR + sLTR + sRTL + sRTL + sRTL + sLTR + sLTR
+            + sLTR + sRTL + sLTR + sRTL + sLTR;
 
     String str1 = "jazz band";
 
@@ -114,9 +110,9 @@
         }
         assertTrue(cond);
         assertEquals(count, k);
-
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         listener = new SimplePropertyChangeListener();
@@ -136,6 +132,7 @@
         jf.pack();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         jf.dispose();
         super.tearDown();
@@ -143,18 +140,14 @@
 
     public void testGetScrollableTracksViewportWidth() throws Exception {
         assertFalse(jta.getScrollableTracksViewportWidth());
-
         jta.setLineWrap(true);
         assertTrue(jta.getScrollableTracksViewportWidth());
-
     }
 
     public void testJTextAreaDocumentStringintint() {
-
         Document doc = new PlainDocument();
         try {
             doc.insertString(0, str2, null);
-
             ExtJTextArea ta = new ExtJTextArea(doc, str1, 3, 8);
             assertEquals(str1, ta.getText());
             assertEquals(doc, ta.getDocument());
@@ -162,16 +155,11 @@
             assertEquals(8, ta.getColumns());
             assertFalse(ta.getLineWrap());
             assertFalse(ta.getWrapStyleWord());
-
             doc = new PlainDocument();
-
             doc.insertString(0, str2, null);
-
             ta = new ExtJTextArea(doc, null, 5, 6);
             assertEquals(str2, ta.getText());
-
             ta = new ExtJTextArea(doc, "", 5, 6);
-
             assertEquals("", ta.getText());
             try {
                 ta = new ExtJTextArea(doc, str1, -1, 4);
@@ -240,7 +228,6 @@
         }
         assertTrue(bWasException);
         assertEquals("columns: -3", message);
-
     }
 
     public void testJTextAreaString() {
@@ -255,7 +242,6 @@
 
     public void testJTextAreaintint() {
         ExtJTextArea ta = new ExtJTextArea(5, 6);
-
         assertEquals("", ta.getText());
         assertTrue(ta.getDocument() instanceof PlainDocument);
         assertEquals(5, ta.getRows());
@@ -326,19 +312,16 @@
         jta.replaceRange("", 5, 10);
         tmp = replaceRange(tmp, "", 5, 10);
         assertEquals(tmp, jta.getText());
-
         try {
             jta.replaceRange(str2, -1, 5);
         } catch (IllegalArgumentException e) {
             bWasException = true;
             message = e.getMessage();
         }
-
         assertTrue(bWasException);
         assertEquals("Invalid remove", message);
         bWasException = false;
         message = null;
-
         try {
             jta.replaceRange(str2, 1, tmp.length() + 1);
         } catch (IllegalArgumentException e) {
@@ -349,7 +332,6 @@
         assertEquals("Invalid remove", message);
         bWasException = false;
         message = null;
-
         try {
             jta.replaceRange(str2, 10, 5);
         } catch (IllegalArgumentException e) {
@@ -358,7 +340,6 @@
         }
         assertTrue(bWasException);
         assertEquals("end before start", message);
-
         jta.replaceRange(str2, 7, 14);
         tmp = replaceRange(tmp, str2, 7, 14);
         assertEquals(tmp, jta.getText());
@@ -368,7 +349,6 @@
         jta.replaceRange("", 5, 12);
         tmp = replaceRange(tmp, "", 5, 12);
         assertEquals(tmp, jta.getText());
-
     }
 
     String insertString(final String s1, final String s2, final int index) {
@@ -412,7 +392,6 @@
         }
         assertFalse(bWasException);
         assertNull(message);
-
         jta.insert(str2, 7);
         tmp = insertString(tmp, str2, 7);
         assertEquals(tmp, jta.getText());
@@ -420,7 +399,6 @@
         assertEquals(tmp, jta.getText());
         jta.insert("", 7);
         assertEquals(tmp, jta.getText());
-
     }
 
     public void testAppend() throws Exception {
@@ -439,37 +417,35 @@
         assertEquals(tmp, jta.getText());
         jta.append("");
         assertEquals(tmp, jta.getText());
-
     }
+
     // Implementation dependent
     /*
-    public void testParamString() {
-        String str = "," + jta.getX() + "," + jta.getY() + ","
-                + jta.getSize().width + "x" + jta.getSize().height + ","
-                + "layout=" + jta.getLayout() + ",";
-        str = str.replaceFirst("@[^,}]*", "");
-        str +=
-        "alignmentX=" + "null"+ "," + //1.4.2
-        "alignmentY=" + "null"+ "," + //1.4.2
-        //"alignmentX=" + "0.0" + "," + //1.5.0
-        //        "alignmentY=" + "0.0" + "," + //1.5.0
-                "border=" + jta.getBorder() + "," + "flags=296" + ","
-                + "maximumSize=,minimumSize=,preferredSize=," + "caretColor="
-                + jta.getCaretColor() + "," + "disabledTextColor="
-                + jta.getDisabledTextColor() + "," + "editable="
-                + jta.isEditable() + "," + "margin=" + jta.getMargin() + ","
-                + "selectedTextColor=" + jta.getSelectedTextColor() + ","
-                + "selectionColor=" + jta.getSelectionColor() + ","
-                + "columns=" + jta.getColumns() + "," + "columnWidth="
-                + jta.getColumnWidth() + "," + "rows=" + jta.getRows() + ","
-                + "rowHeight=" + jta.getRowHeight() + "," + "word="
-                + jta.getWrapStyleWord() + "," + "wrap=" + jta.getLineWrap();
-        assertEquals(changeString(str), changeString(jta.paramString()));
-    } */
-
+     public void testParamString() {
+     String str = "," + jta.getX() + "," + jta.getY() + ","
+     + jta.getSize().width + "x" + jta.getSize().height + ","
+     + "layout=" + jta.getLayout() + ",";
+     str = str.replaceFirst("@[^,}]*", "");
+     str +=
+     "alignmentX=" + "null"+ "," + //1.4.2
+     "alignmentY=" + "null"+ "," + //1.4.2
+     //"alignmentX=" + "0.0" + "," + //1.5.0
+     //        "alignmentY=" + "0.0" + "," + //1.5.0
+     "border=" + jta.getBorder() + "," + "flags=296" + ","
+     + "maximumSize=,minimumSize=,preferredSize=," + "caretColor="
+     + jta.getCaretColor() + "," + "disabledTextColor="
+     + jta.getDisabledTextColor() + "," + "editable="
+     + jta.isEditable() + "," + "margin=" + jta.getMargin() + ","
+     + "selectedTextColor=" + jta.getSelectedTextColor() + ","
+     + "selectionColor=" + jta.getSelectionColor() + ","
+     + "columns=" + jta.getColumns() + "," + "columnWidth="
+     + jta.getColumnWidth() + "," + "rows=" + jta.getRows() + ","
+     + "rowHeight=" + jta.getRowHeight() + "," + "word="
+     + jta.getWrapStyleWord() + "," + "wrap=" + jta.getLineWrap();
+     assertEquals(changeString(str), changeString(jta.paramString()));
+     } */
     String changeString(final String s) {
-        return s.replaceFirst("layout[^,]*,", "")
-                .replaceFirst("flag[^,]*,", "");
+        return s.replaceFirst("layout[^,]*,", "").replaceFirst("flag[^,]*,", "");
     }
 
     public void testGetUIClassID() {
@@ -478,7 +454,6 @@
     }
 
     public void testGetScrollableUnitIncrement() throws Exception {
-
         assertEquals(jta.getColumnWidth(), jta.getScrollableUnitIncrement(null,
                 SwingConstants.HORIZONTAL, -1));
         assertEquals(jta.getColumnWidth(), jta.getScrollableUnitIncrement(null,
@@ -491,7 +466,6 @@
                 SwingConstants.VERTICAL, 0));
         assertEquals(jta.getRowHeight(), jta.getScrollableUnitIncrement(null,
                 SwingConstants.VERTICAL, 1));
-
         try {
             jta.getScrollableUnitIncrement(null, 3, 1);
         } catch (IllegalArgumentException e) {
@@ -500,7 +474,6 @@
         }
         assertTrue(bWasException);
         assertEquals("Invalid orientation: 3", message);
-
         Font newFont = new java.awt.Font("SimSun", 0, 12);
         jta.setFont(newFont);
         assertEquals(jta.getColumnWidth(), jta.getScrollableUnitIncrement(null,
@@ -515,27 +488,21 @@
                 SwingConstants.VERTICAL, 0));
         assertEquals(jta.getRowHeight(), jta.getScrollableUnitIncrement(null,
                 SwingConstants.VERTICAL, 1));
-
     }
 
     public void testSetFont() throws Exception {
-
         Font oldFont = jta.getFont();
         FontMetrics fm = jta.getFontMetrics(oldFont);
         assertEquals(fm.getHeight(), jta.getRowHeight());
         assertEquals(fm.charWidth('m'), jta.getColumnWidth());
-
         jta.wasCallRevalidate = false;
         Font newFont = new java.awt.Font("SimSun", 0, 12);
         jta.setFont(newFont);
         assertTrue(jta.wasCallRevalidate);
-        assertEqualsPropertyChangeEvent("font", oldFont, newFont,
-                listener.event);
-
+        assertEqualsPropertyChangeEvent("font", oldFont, newFont, listener.event);
         fm = jta.getFontMetrics(newFont);
         assertEquals(fm.getHeight(), jta.getRowHeight());
         assertEquals(fm.charWidth('m'), jta.getColumnWidth());
-
     }
 
     Dimension getPrefferedSize(final JTextArea jta) {
@@ -545,61 +512,43 @@
         Dimension dim2 = jta.getUI().getPreferredSize(jta);
         int width2 = dim2.width;
         int height2 = dim2.height;
-        return new Dimension(Math.max(width1, width2), Math.max(height1,
-                height2));
-
+        return new Dimension(Math.max(width1, width2), Math.max(height1, height2));
     }
 
     public void testGetPreferredSize() throws Exception {
-
-        assertEquals(jta.getPreferredSize(), jta
-                .getPreferredScrollableViewportSize());
-
+        assertEquals(jta.getPreferredSize(), jta.getPreferredScrollableViewportSize());
         jta.setColumns(5);
         jta.setRows(2);
         assertEquals(getPrefferedSize(jta), jta.getPreferredSize());
-
         jta.setColumns(500);
         jta.setRows(1);
         assertEquals(getPrefferedSize(jta), jta.getPreferredSize());
-
         jta.setColumns(1);
         jta.setRows(500);
         assertEquals(getPrefferedSize(jta), jta.getPreferredSize());
-
         jta.setColumns(500);
         jta.setRows(200);
         assertEquals(getPrefferedSize(jta), jta.getPreferredSize());
-
     }
 
     public void testGetPreferredScrollableViewportSize() throws Exception {
-
-        assertEquals(jta.getPreferredSize(), jta
-                .getPreferredScrollableViewportSize());
-
+        assertEquals(jta.getPreferredSize(), jta.getPreferredScrollableViewportSize());
         jta.setColumns(5);
         jta.setRows(2);
-        Dimension dim = new Dimension(5 * jta.getColumnWidth(), 2 * jta
-                .getRowHeight());
+        Dimension dim = new Dimension(5 * jta.getColumnWidth(), 2 * jta.getRowHeight());
         assertEquals(dim, jta.getPreferredScrollableViewportSize());
         jta.setColumns(500);
         jta.setRows(200);
-        dim = new Dimension(500 * jta.getColumnWidth(), 200 * jta
-                .getRowHeight());
+        dim = new Dimension(500 * jta.getColumnWidth(), 200 * jta.getRowHeight());
         assertEquals(dim, jta.getPreferredScrollableViewportSize());
-
         jta.setColumns(0);
         jta.setRows(200);
-        assertEquals(new Dimension(jta.getPreferredSize().width, 200 * jta
-                .getRowHeight()), jta.getPreferredScrollableViewportSize());
-
+        assertEquals(new Dimension(jta.getPreferredSize().width, 200 * jta.getRowHeight()), jta
+                .getPreferredScrollableViewportSize());
         jta.setColumns(1);
         jta.setRows(0);
-        assertEquals(new Dimension(1 * jta.getColumnWidth(), jta
-                .getPreferredSize().height), jta
-                .getPreferredScrollableViewportSize());
-
+        assertEquals(new Dimension(1 * jta.getColumnWidth(), jta.getPreferredSize().height),
+                jta.getPreferredScrollableViewportSize());
     }
 
     public void testGetLineStartEndOffset() {
@@ -610,17 +559,16 @@
         for (int j = 0; j < count; j++) {
             Element currentElement = root.getElement(j);
             try {
-                assertEquals(currentElement.getStartOffset(), jta
-                        .getLineStartOffset(j));
+                assertEquals(currentElement.getStartOffset(), jta.getLineStartOffset(j));
                 int end = currentElement.getEndOffset();
-                if (j == count - 1)
+                if (j == count - 1) {
                     end--;
+                }
                 assertEquals(end, jta.getLineEndOffset(j));
             } catch (BadLocationException e) {
             }
         }
         doc.readUnlock();
-
         try {
             jta.getLineStartOffset(count);
         } catch (BadLocationException e) {
@@ -651,7 +599,6 @@
         assertEquals("Negative line", message);
         bWasException = false;
         message = null;
-
         try {
             jta.getLineEndOffset(count);
         } catch (BadLocationException e) {
@@ -680,7 +627,6 @@
         }
         assertTrue(bWasException);
         assertEquals("Negative line", message);
-
     }
 
     public void testGetLineOfOffset() {
@@ -695,7 +641,6 @@
             }
         }
         doc.readUnlock();
-
         try {
             jta.getLineOfOffset(length + 1);
         } catch (BadLocationException e) {
@@ -706,7 +651,6 @@
         assertEquals("Can't translate offset to line", message);
         bWasException = false;
         message = null;
-
         try {
             jta.getLineOfOffset(5000);
         } catch (BadLocationException e) {
@@ -717,7 +661,6 @@
         assertEquals("Can't translate offset to line", message);
         bWasException = false;
         message = null;
-
         try {
             jta.getLineOfOffset(-1);
         } catch (BadLocationException e) {
@@ -728,84 +671,71 @@
         assertEquals("Can't translate offset to line", message);
         bWasException = false;
         message = null;
-
     }
 
     public void testSerialization() throws Exception {
         /*
-        jt.setRows(6);
-        jt.setColumns(8);
-        jt.setLineWrap(true);
-        jt.setWrapStyleWord(true);
-        jt.setFont(new java.awt.Font("SimSun", 0, 12));
-
-        JTextArea jta1 = new JTextArea();
-        FileOutputStream fo = new FileOutputStream("tmp");
-        ObjectOutputStream so = new ObjectOutputStream(fo);
-        so.writeObject(jt);
-        so.flush();
-        so.close();
-        FileInputStream fi = new FileInputStream("tmp");
-        ObjectInputStream si = new ObjectInputStream(fi);
-        jta1 = (JTextArea) si.readObject();
-        si.close();
-
-        assertTrue(jta1.getLineWrap());
-        assertTrue(jta1.getWrapStyleWord());
-        assertEquals(bidiContent, jta1.getText());
-        assertEquals(6, jta1.getRows());
-        assertEquals(8, jta1.getColumns());
-        assertEquals(new java.awt.Font("SimSun", 0, 12), jta1.getFont());
-        */
+         jt.setRows(6);
+         jt.setColumns(8);
+         jt.setLineWrap(true);
+         jt.setWrapStyleWord(true);
+         jt.setFont(new java.awt.Font("SimSun", 0, 12));
+
+         JTextArea jta1 = new JTextArea();
+         FileOutputStream fo = new FileOutputStream("tmp");
+         ObjectOutputStream so = new ObjectOutputStream(fo);
+         so.writeObject(jt);
+         so.flush();
+         so.close();
+         FileInputStream fi = new FileInputStream("tmp");
+         ObjectInputStream si = new ObjectInputStream(fi);
+         jta1 = (JTextArea) si.readObject();
+         si.close();
+
+         assertTrue(jta1.getLineWrap());
+         assertTrue(jta1.getWrapStyleWord());
+         assertEquals(bidiContent, jta1.getText());
+         assertEquals(6, jta1.getRows());
+         assertEquals(8, jta1.getColumns());
+         assertEquals(new java.awt.Font("SimSun", 0, 12), jta1.getFont());
+         */
     }
 
-
     public void testSetGetWrapStyleWord() throws Exception {
         assertFalse(jta.getWrapStyleWord());
-
         jta.setWrapStyleWord(true);
         assertTrue(jta.getWrapStyleWord());
-        assertEqualsPropertyChangeEvent("wrapStyleWord", Boolean.FALSE,
-                Boolean.TRUE, listener.event);
-
+        assertEqualsPropertyChangeEvent("wrapStyleWord", Boolean.FALSE, Boolean.TRUE,
+                listener.event);
     }
 
     public void testSetGetLineWrap() throws Exception {
         assertFalse(jta.getLineWrap());
-
         jta.setLineWrap(true);
         assertTrue(jta.getLineWrap());
-        assertEqualsPropertyChangeEvent("lineWrap", Boolean.FALSE,
-                Boolean.TRUE, listener.event);
-
+        assertEqualsPropertyChangeEvent("lineWrap", Boolean.FALSE, Boolean.TRUE, listener.event);
     }
 
     public void testSetGetTabSize() throws Exception {
         assertEquals(8, jta.getTabSize());
         assertEquals(new Integer(8), jta.getDocument().getProperty("tabSize"));
-
         jta.setTabSize(5);
         assertEquals(5, jta.getTabSize());
         assertEquals(new Integer(5), jta.getDocument().getProperty("tabSize"));
-        assertEquals(new Integer(5), (Integer) jta.getDocument().getProperty(
-                "tabSize"));
-        assertEqualsPropertyChangeEvent("tabSize", new Integer(8), new Integer(
-                5), listener.event);
+        assertEquals(new Integer(5), jta.getDocument().getProperty("tabSize"));
+        assertEqualsPropertyChangeEvent("tabSize", new Integer(8), new Integer(5),
+                listener.event);
         jta.setTabSize(-2);
         assertEquals(new Integer(-2), jta.getDocument().getProperty("tabSize"));
-
         assertEquals(-2, jta.getTabSize());
-
     }
 
     public void testSetGetRows() throws Exception {
         assertEquals(0, jta.getRows());
-
         jta.wasCallInvalidate = false;
         jta.setRows(6);
         assertEquals(6, jta.getRows());
         assertTrue(jta.wasCallInvalidate);
-
         try {
             jta.setRows(-1);
         } catch (IllegalArgumentException e) {
@@ -819,25 +749,20 @@
     public void testGetLineCount() {
         AbstractDocument doc_jta = (AbstractDocument) jta.getDocument();
         doc_jta.readLock();
-        assertEquals(jta.getLineCount(), doc_jta.getDefaultRootElement()
-                .getElementCount());
+        assertEquals(jta.getLineCount(), doc_jta.getDefaultRootElement().getElementCount());
         doc_jta.readUnlock();
-
         doc_jta = (AbstractDocument) bidiJta.getDocument();
         doc_jta.readLock();
-        assertEquals(bidiJta.getLineCount(), doc_jta.getDefaultRootElement()
-                .getElementCount());
+        assertEquals(bidiJta.getLineCount(), doc_jta.getDefaultRootElement().getElementCount());
         doc_jta.readUnlock();
     }
 
     public void testSetGetColumns() throws Exception {
         assertEquals(0, jta.getColumns());
-
         jta.wasCallInvalidate = false;
         jta.setColumns(6);
         assertEquals(6, jta.getColumns());
         assertTrue(jta.wasCallInvalidate);
-
         try {
             jta.setColumns(-1);
         } catch (IllegalArgumentException e) {
@@ -846,6 +771,5 @@
         }
         assertTrue(bWasException);
         assertEquals("columns less than zero.", message);
-
     }
 }



Mime
View raw message