1 21 package org.dbunit.dataset; 22 23 import com.mockobjects.Verifiable; 24 25 import java.util.ArrayList ; 26 import java.util.Iterator ; 27 import java.util.List ; 28 29 34 public class MockDataSet extends AbstractDataSet implements Verifiable 35 { 36 private final List _tableList = new ArrayList (); 37 38 public void addTable(ITable table) 39 { 40 _tableList.add(table); 41 } 42 43 public void addEmptyTable(String tableName) 44 { 45 _tableList.add(new DefaultTable(tableName)); 46 } 47 48 51 protected ITableIterator createIterator(boolean reversed) 52 throws DataSetException 53 { 54 ITable[] tables = (ITable[])_tableList.toArray(new ITable[0]); 55 return new DefaultTableIterator(tables, reversed); 56 } 57 58 61 public void verify() 62 { 63 for (Iterator it = _tableList.iterator(); it.hasNext();) 64 { 65 ITable table = (ITable)it.next(); 66 if (table instanceof Verifiable) 67 { 68 ((Verifiable)table).verify(); 69 } 70 } 71 } 72 } 73 | Popular Tags |