1   /*
2    *
3    * The DbUnit Database Testing Framework
4    * Copyright (C)2002-2004, DbUnit.org
5    *
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 2.1 of the License, or (at your option) any later version.
10   *
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this library; if not, write to the Free Software
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   *
20   */
21  
22  package org.dbunit.assertion;
23  
24  import java.io.FileReader;
25  import java.io.StringReader;
26  import java.math.BigDecimal;
27  
28  import junit.framework.ComparisonFailure;
29  import junit.framework.TestCase;
30  
31  import org.dbunit.DatabaseEnvironment;
32  import org.dbunit.database.IDatabaseConnection;
33  import org.dbunit.dataset.Column;
34  import org.dbunit.dataset.CompositeDataSet;
35  import org.dbunit.dataset.CompositeTable;
36  import org.dbunit.dataset.DataSetException;
37  import org.dbunit.dataset.DataSetUtils;
38  import org.dbunit.dataset.DefaultDataSet;
39  import org.dbunit.dataset.DefaultTable;
40  import org.dbunit.dataset.FilteredDataSet;
41  import org.dbunit.dataset.IDataSet;
42  import org.dbunit.dataset.ITable;
43  import org.dbunit.dataset.ITableMetaData;
44  import org.dbunit.dataset.datatype.DataType;
45  import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
46  import org.dbunit.dataset.xml.XmlDataSet;
47  import org.dbunit.operation.DatabaseOperation;
48  import org.dbunit.testutil.TestUtils;
49  
50  /**
51   * @author Manuel Laflamme
52   * @version $Revision: 1162 $
53   * @since Mar 22, 2002
54   */
55  public class DbUnitAssertIT extends TestCase
56  {
57      public static final String FILE_PATH = "xml/assertionTest.xml";
58      
59      private DbUnitAssert assertion = new DbUnitAssert();
60      
61      
62      public DbUnitAssertIT(String s)
63      {
64          super(s);
65      }
66  
67      private IDataSet getDataSet() throws Exception
68      {
69          return new FlatXmlDataSetBuilder().build(TestUtils.getFileReader(FILE_PATH));
70      }
71  
72      ////////////////////////////////////////////////////////////////////////////
73      // Test methods
74  
75      public void testAssertTablesEquals() throws Exception
76      {
77          IDataSet dataSet = getDataSet();
78          assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
79                  dataSet.getTable("TEST_TABLE_WITH_SAME_VALUE"), 
80                  new Column[] {new Column("COLUMN0", DataType.VARCHAR)} );
81      }
82      
83      public void testAssertTablesEmtpyEquals() throws Exception
84      {
85        IDataSet empty1 = new XmlDataSet(TestUtils.getFileReader("xml/assertionTest-empty1.xml"));
86        IDataSet empty2 = new FlatXmlDataSetBuilder().build(TestUtils.getFileReader("xml/assertionTest-empty2.xml"));
87        assertion.assertEquals(empty1, empty2);
88      }
89      
90  
91  	public void testAssertTablesEqualsColumnNamesCaseInsensitive() throws Exception
92      {
93          IDataSet dataSet = getDataSet();
94          assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
95                  dataSet.getTable("TEST_TABLE_WITH_LOWER_COLUMN_NAMES"));
96      }
97  
98      public void testAssertTablesAndNamesNotEquals() throws Exception
99      {
100         IDataSet dataSet = getDataSet();
101         assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
102                 dataSet.getTable("TEST_TABLE_WITH_DIFFERENT_NAME"));
103     }
104 
105     public void testAssertTablesAndColumnCountNotEquals() throws Exception
106     {
107         IDataSet dataSet = getDataSet();
108 
109         try
110         {
111             assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
112                     dataSet.getTable("TEST_TABLE_WITH_3_COLUMNS"));
113             throw new IllegalStateException("Should throw an AssertionFailedError");
114         }
115         catch (ComparisonFailure expected)
116         {
117             assertEquals("[COLUMN0, COLUMN1, COLUMN2, COLUMN3]", expected.getExpected());
118             assertEquals("[COLUMN0, COLUMN1, COLUMN2]", expected.getActual());
119             String expectedMsg = "column count (table=TEST_TABLE, expectedColCount=4, actualColCount=3) expected:<...N0, COLUMN1, COLUMN2[, COLUMN3]]> but was:<...N0, COLUMN1, COLUMN2[]]>";
120             assertEquals(expectedMsg, expected.getMessage());
121         }
122     }
123 
124     public void testAssertTablesAndColumnSequenceNotEquals() throws Exception
125     {
126         IDataSet dataSet = getDataSet();
127 
128         assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
129                 dataSet.getTable("TEST_TABLE_WITH_DIFFERENT_COLUMN_SEQUENCE"));
130     }
131 
132     public void testAssertTablesAndColumnNamesNotEquals() throws Exception
133     {
134         IDataSet dataSet = getDataSet();
135 
136         try
137         {
138             assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
139                     dataSet.getTable("TEST_TABLE_WITH_DIFFERENT_COLUMN_NAMES"));
140             throw new IllegalStateException("Should throw an AssertionFailedError");
141         }
142         catch (ComparisonFailure expected)
143         {
144             assertEquals("[COLUMN0, COLUMN1, COLUMN2, COLUMN3]", expected.getExpected());
145             assertEquals("[COLUMN4, COLUMN5, COLUMN6, COLUMN7]", expected.getActual());
146             String expectedMsg = "column mismatch (table=TEST_TABLE) expected:<[COLUMN[0, COLUMN1, COLUMN2, COLUMN3]]> but was:<[COLUMN[4, COLUMN5, COLUMN6, COLUMN7]]>";
147             assertEquals(expectedMsg, expected.getMessage());
148         }
149     }
150 
151     public void testAssertTablesAndRowCountNotEquals() throws Exception
152     {
153         IDataSet dataSet = getDataSet();
154 
155         try
156         {
157             assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
158                     dataSet.getTable("TEST_TABLE_WITH_ONE_ROW"));
159             throw new IllegalStateException("Should throw an AssertionFailedError");
160         }
161         catch (ComparisonFailure expected)
162         {
163             assertEquals("2", expected.getExpected());
164             assertEquals("1", expected.getActual());
165             String expectedMsg = "row count (table=TEST_TABLE) expected:<[2]> but was:<[1]>";
166             assertEquals(expectedMsg, expected.getMessage());
167         }
168     }
169 
170     public void testAssertTablesAndValuesNotEquals() throws Exception
171     {
172         IDataSet dataSet = getDataSet();
173 
174         try
175         {
176             assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
177                     dataSet.getTable("TEST_TABLE_WITH_WRONG_VALUE"));
178             throw new IllegalStateException("Should throw an AssertionFailedError");
179         }
180         catch (ComparisonFailure expected)
181         {
182             assertEquals("row 1 col 2", expected.getExpected());
183             assertEquals("wrong value", expected.getActual());
184             String expectedMsg = "value (table=TEST_TABLE, row=1, col=COLUMN2) expected:<[row 1 col 2]> but was:<[wrong value]>";
185             assertEquals(expectedMsg, expected.getMessage());
186         }
187     }
188 
189     public void testAssertTablesWithColFilterAndValuesNotEqualExcluded() throws Exception
190     {
191         IDataSet dataSet = getDataSet();
192         
193         // Column2 has the wrong value, so exclude -> test should run successfully
194         String[] allColumnsThatAreNotEqual = new String[] {"COLUMN2"};
195         assertion.assertEqualsIgnoreCols(dataSet.getTable("TEST_TABLE"),
196                 dataSet.getTable("TEST_TABLE_WITH_WRONG_VALUE"),
197                 allColumnsThatAreNotEqual );
198     }
199 
200     public void testAssertTablesWithColFilterAndValuesNotEqualNotExcluded() throws Exception
201     {
202         IDataSet dataSet = getDataSet();
203         
204         // Column0 has correct value. Column2 has the wrong value but is not filtered.
205         // -> test should fail
206         String[] filteredColumns = new String[] {"COLUMN0"};
207         try {
208             assertion.assertEqualsIgnoreCols(dataSet.getTable("TEST_TABLE"),
209 	                dataSet.getTable("TEST_TABLE_WITH_WRONG_VALUE"),
210 	                filteredColumns );
211             throw new IllegalStateException("Should throw an AssertionFailedError");
212         }
213         catch (ComparisonFailure expected)
214         {
215             assertEquals("row 1 col 2", expected.getExpected());
216             assertEquals("wrong value", expected.getActual());
217         	String expectedMsg = "value (table=TEST_TABLE, row=1, col=COLUMN2) expected:<[row 1 col 2]> but was:<[wrong value]>";
218         	assertEquals(expectedMsg, expected.getMessage());
219         }
220     }
221 
222     public void testAssertTablesAndValuesNotEquals_AdditionalColumnInfo() throws Exception
223     {
224         IDataSet dataSet = getDataSet();
225 
226         try
227         {
228         	Column[] additionalColInfo = new Column[]{
229         			new Column("COLUMN0", DataType.VARCHAR)
230         	};
231         	assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
232                     dataSet.getTable("TEST_TABLE_WITH_WRONG_VALUE"),
233                     additionalColInfo);
234             throw   new IllegalStateException("Should throw an AssertionFailedError");
235         }
236         catch (ComparisonFailure expected)
237         {
238         	String expectedMsg = "junit.framework.ComparisonFailure: value (table=TEST_TABLE, row=1, col=COLUMN2, " +
239         			"Additional row info: ('COLUMN0': expected=<row 1 col 0>, actual=<row 1 col 0>)) " +
240         			"expected:<[row 1 col 2]> but was:<[wrong value]>";
241         	String actualMsg = expected.toString();
242         	assertEquals("row 1 col 2", expected.getExpected());
243         	assertEquals("wrong value", expected.getActual());
244         	assertEquals("Exception message did not match the expected one.", expectedMsg, actualMsg);
245         }
246     }
247 
248     
249     public void testAssertTablesEqualsAndIncompatibleDataType() throws Exception
250     {
251         String tableName = "TABLE_NAME";
252 
253         // Setup actual table
254         Column[] actualColumns = new Column[] {
255             new Column("BOOLEAN", DataType.BOOLEAN),
256         };
257         Object[] actualRow = new Object[] {
258             Boolean.TRUE,
259         };
260         DefaultTable actualTable = new DefaultTable(tableName,
261                 actualColumns);
262         actualTable.addRow(actualRow);
263 
264         // Setup expected table
265         Column[] expectedColumns = new Column[] {
266             new Column("BOOLEAN", DataType.VARCHAR),
267         };
268         Object[] expectedRow = new Object[] {
269             "1",
270         };
271         DefaultTable expectedTable = new DefaultTable(tableName,
272                 expectedColumns);
273         expectedTable.addRow(expectedRow);
274 
275 
276         try
277         {
278             assertion.assertEquals(expectedTable, actualTable);
279         }
280         catch (ComparisonFailure expected)
281         {
282             assertEquals("VARCHAR", expected.getExpected());
283             assertEquals("BOOLEAN", expected.getActual());
284             String expectedMsg = "Incompatible data types: (table=TABLE_NAME, col=BOOLEAN) expected:<[VARCHAR]> but was:<[BOOLEAN]>";
285             assertEquals(expectedMsg, expected.getMessage());
286         }
287     }
288 
289     public void testAssertTablesByQueryWithColFilterAndValuesNotEqualExcluded() throws Exception
290     {
291         DatabaseEnvironment env = DatabaseEnvironment.getInstance();
292         IDatabaseConnection connection = env.getConnection();
293 
294         IDataSet dataSet = env.getInitDataSet();
295     	ITable expectedTable = dataSet.getTable("TEST_TABLE");
296 
297 		ITable table = dataSet.getTable("TEST_TABLE");
298 		ITable filteredTable = new ModifyingTable(table, "COLUMN2");
299         DatabaseOperation.CLEAN_INSERT.execute(connection, new DefaultDataSet(filteredTable));
300 
301     	// Ignore COLUMN2 which has been modified by the "ModifyingTable" above and hence does not match.
302         // When we ignore this column, the assertion should work without failure
303         String[] ignoreCols = new String[] {"COLUMN2"};
304         assertion.assertEqualsByQuery(expectedTable, connection, "TEST_TABLE", "select * from TEST_TABLE order by 1", ignoreCols);
305     }
306     
307     public void testAssertTablesByQueryWithColFilterAndValuesNotEqualNotExcluded() throws Exception
308     {
309         DatabaseEnvironment env = DatabaseEnvironment.getInstance();
310         IDatabaseConnection connection = env.getConnection();
311 
312         IDataSet dataSet = env.getInitDataSet();
313     	ITable expectedTable = dataSet.getTable("TEST_TABLE");
314 
315 		ITable table = dataSet.getTable("TEST_TABLE");
316 		ITable filteredTable = new ModifyingTable(table, "COLUMN2");
317         DatabaseOperation.CLEAN_INSERT.execute(connection, new DefaultDataSet(filteredTable));
318 
319     	// Ignore COLUMN1 which has NOT been modified by the "ModifyingTable". The modified COLUMN2 does
320         // not match and is not ignored. So the assertion should fail.
321         String[] ignoreCols = new String[] {"COLUMN1"};
322         try {
323             assertion.assertEqualsByQuery(expectedTable, connection, "TEST_TABLE", "select * from TEST_TABLE order by 1", ignoreCols);
324         	fail("The assertion should not work");
325         }
326         catch (ComparisonFailure expected)
327         {
328             assertEquals("row 0 col 2", expected.getExpected());
329             assertEquals("row 0 col 2 (modified COLUMN2)", expected.getActual());
330         	String expectedMsg = "value (table=TEST_TABLE, row=0, col=COLUMN2) expected:<row 0 col 2[]> but was:<row 0 col 2[ (modified COLUMN2)]>";
331         	assertEquals(expectedMsg, expected.getMessage());
332         }
333     }
334 
335     
336     
337     public void testAssertTablesEqualsAndCompatibleDataType() throws Exception
338     {
339         String tableName = "TABLE_NAME";
340         java.sql.Timestamp now = new java.sql.Timestamp(
341                 System.currentTimeMillis());
342 
343         // Setup actual table
344         Column[] actualColumns = new Column[] {
345             new Column("BOOLEAN", DataType.BOOLEAN),
346             new Column("TIMESTAMP", DataType.TIMESTAMP),
347             new Column("STRING", DataType.CHAR),
348             new Column("NUMERIC", DataType.NUMERIC),
349         };
350         Object[] actualRow = new Object[] {
351             Boolean.TRUE,
352             now,
353             "0",
354             new BigDecimal("123.4"),
355         };
356         DefaultTable actualTable = new DefaultTable(tableName,
357                 actualColumns);
358         actualTable.addRow(actualRow);
359 
360 
361         // Setup expected table
362         Column[] expectedColumns = new Column[] {
363             new Column("BOOLEAN", DataType.UNKNOWN),
364             new Column("TIMESTAMP", DataType.UNKNOWN),
365             new Column("STRING", DataType.UNKNOWN),
366             new Column("NUMERIC", DataType.UNKNOWN),
367         };
368         Object[] expectedRow = new Object[] {
369             "1",
370             new Long(now.getTime()),
371             new Integer("0"),
372             "123.4000",
373         };
374         DefaultTable expectedTable = new DefaultTable(tableName,
375                 expectedColumns);
376         expectedTable.addRow(expectedRow);
377 
378         assertion.assertEquals(expectedTable, actualTable);
379     }
380 
381     public void testAssertDataSetsEquals() throws Exception
382     {
383         IDataSet dataSet1 = getDataSet();
384 
385         // change table names order
386         String[] names = DataSetUtils.getReverseTableNames(dataSet1);
387         IDataSet dataSet2 = new FilteredDataSet(names, dataSet1);
388 
389         assertTrue("assert not same", dataSet1 != dataSet2);
390         assertion.assertEquals(dataSet1, dataSet2);
391     }
392 
393     public void testAssertDataSetsEqualsTableNamesCaseInsensitive() throws Exception
394     {
395         IDataSet dataSet1 = getDataSet();
396 
397         // change table names case
398         String[] names = dataSet1.getTableNames();
399         for (int i = 0; i < names.length; i++)
400         {
401             names[i] = names[i].toLowerCase();
402         }
403         IDataSet dataSet2 = new FilteredDataSet(names, dataSet1);
404 
405         assertTrue("assert not same", dataSet1 != dataSet2);
406         assertion.assertEquals(dataSet1, dataSet2);
407     }
408 
409     public void testAssertDataSetsAndTableCountNotEquals() throws Exception
410     {
411         IDataSet dataSet1 = getDataSet();
412 
413         // only one table
414         String[] names = new String[]{dataSet1.getTableNames()[0]};
415         IDataSet dataSet2 = new FilteredDataSet(names, dataSet1);
416 
417         assertTrue("assert not same", dataSet1 != dataSet2);
418 
419         try
420         {
421             assertion.assertEquals(dataSet1, dataSet2);
422             throw new IllegalStateException("Should throw an AssertionFailedError");
423         }
424         catch (ComparisonFailure expected)
425         {
426             assertEquals("9", expected.getExpected());
427             assertEquals("1", expected.getActual());
428             assertEquals("table count expected:<[9]> but was:<[1]>", expected.getMessage());
429         }
430     }
431 
432 
433     public void testAssertDataSetsAndTableNamesNotEquals() throws Exception
434     {
435         IDataSet dataSet1 = getDataSet();
436 
437         // reverse table names
438         String[] names = dataSet1.getTableNames();
439         ITable[] tables = new ITable[names.length];
440         for (int i = 0; i < names.length; i++)
441         {
442             String reversedName = new StringBuffer(names[i]).reverse().toString();
443             tables[i] = new CompositeTable(reversedName,
444                     dataSet1.getTable(names[i]));
445         }
446         IDataSet dataSet2 = new DefaultDataSet(tables);
447 
448         assertTrue("assert not same", dataSet1 != dataSet2);
449         assertEquals("table count", dataSet1.getTableNames().length,
450                 dataSet2.getTableNames().length);
451 
452         try
453         {
454             assertion.assertEquals(dataSet1, dataSet2);
455             throw new IllegalStateException("Should throw an AssertionFailedError");
456         }
457         catch (ComparisonFailure expected)
458         {
459         }
460     }
461 
462     public void testAssertDataSetsAndTablesNotEquals() throws Exception
463     {
464         IDataSet dataSet1 = getDataSet();
465 
466         // different row counts (double)
467         IDataSet dataSet2 = new CompositeDataSet(dataSet1, dataSet1);
468 
469         assertTrue("assert not same", dataSet1 != dataSet2);
470         assertEquals("table count", dataSet1.getTableNames().length,
471                 dataSet2.getTableNames().length);
472 
473         try
474         {
475             assertion.assertEquals(dataSet1, dataSet2);
476             throw new IllegalStateException("Should throw an AssertionFailedError");
477         }
478         catch (ComparisonFailure expected)
479         {
480             assertEquals("2", expected.getExpected());
481             assertEquals("4", expected.getActual());
482             assertEquals("row count (table=TEST_TABLE) expected:<[2]> but was:<[4]>", expected.getMessage());
483         }
484     }
485     
486     public void testAssertDataSetsWithFailureHandler() throws Exception
487     {
488         DiffCollectingFailureHandler fh = new DiffCollectingFailureHandler();
489         
490         String xml1 = 
491             "<dataset>\n"+
492             "<TEST_TABLE COLUMN0='row 0 col 0' COLUMN1='row 0 col 1'/>\n" +
493             "</dataset>\n";
494         IDataSet dataSet1 = new FlatXmlDataSetBuilder().build(new StringReader(xml1));
495         String xml2 = 
496             "<dataset>\n"+
497             "<TEST_TABLE COLUMN0='row 0 col somthing' COLUMN1='row 0 col something mysterious'/>\n" +
498             "</dataset>\n";
499         IDataSet dataSet2 = new FlatXmlDataSetBuilder().build(new StringReader(xml2));
500 
501         // Invoke the assertion
502         assertion.assertEquals(dataSet1, dataSet2, fh);
503         // We expect that no failure was thrown even if the dataSets were not equal.
504         // This is because our custom failureHandler
505         assertEquals(2, fh.getDiffList().size());
506     }
507 
508     
509     
510     public void testGetComparisonDataType_ExpectedTypeUnknown()
511     {
512     	Column expectedColumn = new Column("COL1", DataType.UNKNOWN);
513     	Column actualColumn = new Column("COL1", DataType.VARCHAR);
514     	DataType dataType = new DbUnitAssert.ComparisonColumn("BLABLA_TABLE_NOT_NEEDED_HERE", expectedColumn, actualColumn, assertion.getDefaultFailureHandler()).getDataType();
515     	assertEquals(DataType.VARCHAR, dataType);
516     }
517     
518     public void testGetComparisonDataType_ActualTypeUnknown()
519     {
520     	Column expectedColumn = new Column("COL1", DataType.VARCHAR);
521     	Column actualColumn = new Column("COL1", DataType.UNKNOWN);
522     	DataType dataType = new DbUnitAssert.ComparisonColumn("BLABLA_TABLE_NOT_NEEDED_HERE", expectedColumn, actualColumn, assertion.getDefaultFailureHandler()).getDataType();
523     	assertEquals(DataType.VARCHAR, dataType);
524     }
525 
526     public void testGetComparisonDataType_BothTypesSetIncompatible()
527     {
528     	Column expectedColumn = new Column("COL1", DataType.VARCHAR);
529     	Column actualColumn = new Column("COL1", DataType.NUMERIC);
530     	try {
531     	    new DbUnitAssert.ComparisonColumn("BLABLA_TABLE_NOT_NEEDED_HERE", expectedColumn, actualColumn, assertion.getDefaultFailureHandler()).getDataType();
532     		fail("Incompatible datatypes should not work");
533     	}
534     	catch(ComparisonFailure expected){
535     		assertEquals("VARCHAR", expected.getExpected());
536     		assertEquals("NUMERIC", expected.getActual());
537     		String expectedMsg = "Incompatible data types: (table=BLABLA_TABLE_NOT_NEEDED_HERE, col=COL1) expected:<[VARCHAR]> but was:<[NUMERIC]>";
538     		assertEquals(expectedMsg, expected.getMessage());
539     	}
540     }
541 
542     public void testGetComparisonDataType_BothTypesSetToSame()
543     {
544     	Column expectedColumn = new Column("COL1", DataType.VARCHAR);
545     	Column actualColumn = new Column("COL1", DataType.VARCHAR);
546     	DataType dataType = new DbUnitAssert.ComparisonColumn("BLABLA_TABLE_NOT_NEEDED_HERE", expectedColumn, actualColumn, assertion.getDefaultFailureHandler()).getDataType();
547     	assertEquals(DataType.VARCHAR, dataType);
548     }
549 
550     public void testGetComparisonDataType_BothTypesUnknown()
551     {
552     	Column expectedColumn = new Column("COL1", DataType.UNKNOWN);
553     	Column actualColumn = new Column("COL1", DataType.UNKNOWN);
554     	DataType dataType = new DbUnitAssert.ComparisonColumn("BLABLA_TABLE_NOT_NEEDED_HERE", expectedColumn, actualColumn, assertion.getDefaultFailureHandler()).getDataType();
555     	assertEquals(DataType.UNKNOWN, dataType);
556     }
557 
558     
559     
560     /**
561      * Test utility that modifies all values for a specific column arbitrarily
562      */
563     protected static class ModifyingTable implements ITable
564     {
565     	private ITable _wrappedTable;
566     	private String _columnToModify;
567     	
568     	public ModifyingTable(ITable originalTable, String columnToModify)
569     	{
570     		this._wrappedTable = originalTable;
571     		this._columnToModify = columnToModify;
572     	}
573 
574 		public int getRowCount() {
575 			return this._wrappedTable.getRowCount();
576 		}
577 
578 		public ITableMetaData getTableMetaData() {
579 			return this._wrappedTable.getTableMetaData();
580 		}
581 
582 		public Object getValue(int row, String column) throws DataSetException {
583 			Object originalValue = _wrappedTable.getValue(row, column);
584 
585 			// Modify the value if column name matches
586 			if(column.equalsIgnoreCase(this._columnToModify)) {
587 				return String.valueOf(originalValue) + " (modified "+_columnToModify +")";
588 			}
589 			return originalValue;
590 		}
591     	
592     	
593     }
594 
595 }
596 
597 
598 
599 
600