01: /*
02: * RowDataTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.storage;
13:
14: import junit.framework.TestCase;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class RowDataTest extends TestCase {
21:
22: public RowDataTest(String testName) {
23: super (testName);
24: }
25:
26: public void testChangeValues() {
27: RowData row = new RowData(2);
28: assertTrue(row.isNew());
29:
30: row.setValue(0, "123");
31: row.setValue(1, new Integer(42));
32: row.resetStatus();
33: assertFalse(row.isModified());
34:
35: Object value = row.getValue(0);
36: assertEquals(value, "123");
37: value = row.getValue(1);
38: assertEquals(value, new Integer(42));
39:
40: row.setValue(0, null);
41: value = row.getValue(0);
42: assertNull(value);
43: assertEquals("123", row.getOriginalValue(0));
44: assertTrue(row.isModified());
45:
46: row.resetStatus();
47: row.setValue(0, "456");
48: value = row.getValue(0);
49: assertEquals(value, "456");
50: assertNull(row.getOriginalValue(0));
51: assertTrue(row.isColumnModified(0));
52: }
53: }
|