/** Accuracy Test of the <code>DefaultTagTableModel(DefaultTagEditor)</code> constructor. */ public void testconstructor_Simple() { tagTable = new DefaultTagTableModel(parent); // creat a new instance. assertNotNull("Constructor should work well.", tagTable); // get the first col name to check the constructor. assertEquals( "The col name expected to be equal", DEFAULT_COLUMN_NAMES[0], tagTable.getColumnName(0)); // get the second col name to check the constructor. assertEquals( "The col name expected to be equal", DEFAULT_COLUMN_NAMES[1], tagTable.getColumnName(1)); }
/** * Accuracy Test of the <code>DefaultTagTableModel(DefaultTagEditor, String[], String, String) * </code> constructor. */ public void testconstructor_Complex() { String[] cols = new String[] {"tag", "value"}; tagTable = new DefaultTagTableModel(parent, cols, null, null); // creat a new instance. assertNotNull("Constructor should work well.", tagTable); // get the first col name to check the constructor. assertEquals("The col name expected to be equal", cols[0], tagTable.getColumnName(0)); // get the second col name to check the constructor. assertEquals("The col name expected to be equal", cols[1], tagTable.getColumnName(1)); }
/** Accuracy Test of the <code>getColumnName(int)</code> method. */ public void testgetColumnName() { // get the first col name to check the method. assertEquals( "The col name expected to be equal", DEFAULT_COLUMN_NAMES[0], tagTable.getColumnName(0)); // get the second col name to check the method. assertEquals( "The col name expected to be equal", DEFAULT_COLUMN_NAMES[1], tagTable.getColumnName(1)); // get the out range col name to check the method. assertNull("The col name expected to be null", tagTable.getColumnName(3)); // creat a new col names. String[] cols = new String[] {"new tag", "new value"}; tagTable = new DefaultTagTableModel(parent, cols, null, null); // get the first col name to check the constructor. assertEquals("The col name expected to be equal", cols[0], tagTable.getColumnName(0)); // get the second col name to check the constructor. assertEquals("The col name expected to be equal", cols[1], tagTable.getColumnName(1)); // get the out range col name to check the method. assertNull("The col name expected to be null", tagTable.getColumnName(-1)); }