1 7 8 package org.jdesktop.dataset; 9 10 import junit.framework.*; 11 12 13 17 public class DataRelationTableTest extends TestCase { 18 19 private DataSet ds; 20 private DataRelation relation; 21 private DataTable parentTable; 22 private DataTable childTable; 23 24 public DataRelationTableTest(String testName) { 25 super(testName); 26 } 27 28 31 protected void setUp() throws Exception { 32 ds = new DataSet(); 33 relation = ds.createRelation(); 34 35 parentTable = ds.createTable(); 36 DataColumn parentColumn = parentTable.createColumn(); 37 parentColumn.setName("pid"); 38 relation.setParentColumn(parentColumn); 39 parentTable.appendRow().setValue("pid", 100); 40 parentTable.appendRow().setValue("pid", 101); 41 parentTable.appendRow().setValue("pid", 102); 42 parentTable.createSelector().setName("parentSelector"); 43 44 childTable = ds.createTable(); 45 DataColumn childColumn = childTable.createColumn(); 46 childColumn.setName("cid"); 47 childColumn = childTable.createColumn(); 48 childColumn.setName("pid"); 49 relation.setChildColumn(childColumn); 50 DataRow row = childTable.appendRow(); 51 row.setValue("cid", 200); 52 row.setValue("pid", 100); 53 row = childTable.appendRow(); 54 row.setValue("cid", 201); 55 row.setValue("pid", 101); 56 row = childTable.appendRow(); 57 row.setValue("cid", 202); 58 row.setValue("pid", 101); 59 row = childTable.appendRow(); 60 row.setValue("cid", 203); 61 row.setValue("pid", 100); 62 row = childTable.appendRow(); 63 row.setValue("cid", 204); 64 row.setValue("pid", 100); 65 row = childTable.appendRow(); 66 row.setValue("cid", 205); 67 row.setValue("pid", 102); 68 } 69 70 protected void tearDown() throws Exception { 71 } 72 73 public static Test suite() { 74 TestSuite suite = new TestSuite(DataRelationTableTest.class); 75 76 return suite; 77 } 78 79 82 public void testGetRelation() { 83 System.out.println("testGetRelation"); 84 85 } 88 89 92 public void testGetSelector() { 93 System.out.println("testGetSelector"); 94 95 } 98 99 102 public void testSetDataProvider() { 103 System.out.println("testSetDataProvider"); 104 105 } 108 109 112 public void testSave() { 113 System.out.println("testSave"); 114 115 } 118 119 122 public void testAppendRow() { 123 System.out.println("testAppendRow"); 124 125 } 128 129 132 public void testRefresh() { 133 System.out.println("testRefresh"); 134 135 } 138 139 }
| Popular Tags
|