1 21 package org.dbunit.database; 22 23 import com.mockobjects.ExpectationCounter; 24 import com.mockobjects.Verifiable; 25 import org.dbunit.dataset.Column; 26 import org.dbunit.dataset.DataSetException; 27 import org.dbunit.dataset.DefaultTableMetaData; 28 import org.dbunit.dataset.ITableMetaData; 29 30 35 public class MockResultSetTable implements IResultSetTable, Verifiable 36 { 37 private final ExpectationCounter _closeCalls = 38 new ExpectationCounter("MockResultSetTable.close"); 39 private ITableMetaData _metaData; 40 41 public void setupTableMetaData(String tableName) 42 { 43 _metaData = new DefaultTableMetaData(tableName, new Column[0]); 44 } 45 46 public void setExpectedCloseCalls(int callsCount) 47 { 48 _closeCalls.setExpected(callsCount); 49 } 50 51 54 public void verify() 55 { 56 _closeCalls.verify(); 57 } 58 59 62 public Object getValue(int row, String column) throws DataSetException 63 { 64 return null; 65 } 66 67 public int getRowCount() 68 { 69 return 0; 70 } 71 72 public ITableMetaData getTableMetaData() 73 { 74 return _metaData; 75 } 76 77 public void close() throws DataSetException 78 { 79 _closeCalls.inc(); 80 } 81 } 82 | Popular Tags |