import net.jaekl.cfb.db.Table;
import net.jaekl.cfb.db.TableMock;
import net.jaekl.cfb.db.TypeMismatchException;
+import net.jaekl.cfb.util.Util;
public class DbDriverMock extends DbDriver {
- private HashMap<String, TableMock> m_tables;
+ private ArrayList<ConnectionMock> m_cons;
private HashMap<String, SequenceMock> m_sequences;
+ private HashMap<String, TableMock> m_tables;
public DbDriverMock() {
super();
- m_tables = new HashMap<String, TableMock>();
+ m_cons = new ArrayList<ConnectionMock>();
m_sequences = new HashMap<String, SequenceMock>();
+ m_tables = new HashMap<String, TableMock>();
}
@Override
public Connection connect(String host, int port, String dbName, String user, String pass)
throws SQLException
{
- return null;
+ ConnectionMock con = new ConnectionMock();
+ m_cons.add(con);
+ return con;
}
@Override
if (condition.getColumn().equals(col)) {
switch(condition.getOperation()) {
case EQUAL:
- return (condition.getValue().equals(row.getValue(idx)));
+ return Util.objsAreEqual(condition.getValue(), row.getValue(idx));
case GREATER_THAN:
return (aLessThanB(condition.getValue(), row.getValue(idx)));
case LESS_THAN: