01: /*
02: * RowDataListTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2007, 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: * @author Thomas Kellerer
18: */
19: public class RowDataListTest extends TestCase {
20: public RowDataListTest(String testName) {
21: super (testName);
22: }
23:
24: public void testAdd() {
25: try {
26: RowDataList list = new RowDataList();
27: list.reset();
28:
29: // Make sure add() still works properly after calling reset()
30: RowData row = new RowData(2);
31: row.setValue(0, "Test");
32: row.setValue(1, new Integer(42));
33: list.add(row);
34: RowData r = list.get(0);
35: assertNotNull(r);
36: assertEquals(r.getValue(0), "Test");
37: assertEquals(r.getValue(1), new Integer(42));
38: } catch (Throwable th) {
39: th.printStackTrace();
40: fail(th.getMessage());
41: }
42: }
43:
44: }
|