|
From: <pe...@us...> - 2004-01-02 23:19:06
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/sql/entities
In directory sc8-pr-cvs1:/tmp/cvs-serv16562/src/test/org/neuclear/commons/sql/entities
Modified Files:
TableDefinitionTest.java
Log Message:
Added StatementFactory pattern and refactored the ledger to use it.
Index: TableDefinitionTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/sql/entities/TableDefinitionTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TableDefinitionTest.java 31 Dec 2003 00:39:29 -0000 1.4
--- TableDefinitionTest.java 2 Jan 2004 23:19:03 -0000 1.5
***************
*** 5,8 ****
--- 5,10 ----
import org.neuclear.commons.sql.DefaultConnectionSource;
import org.neuclear.commons.sql.TestCaseConnectionSource;
+ import org.neuclear.commons.sql.statements.StatementFactory;
+ import org.neuclear.commons.sql.statements.SimpleStatementFactory;
import org.neuclear.commons.sql.entities.drivers.DDLDriver;
import org.neuclear.commons.NeuClearException;
***************
*** 35,38 ****
--- 37,43 ----
$Id$
$Log$
+ Revision 1.5 2004/01/02 23:19:03 pelle
+ Added StatementFactory pattern and refactored the ledger to use it.
+
Revision 1.4 2003/12/31 00:39:29 pelle
Added Drivers for handling different Database dialects in the entity model.
***************
*** 116,124 ****
public void testCreateTableStructure() throws SQLException, IOException, NamingException, NeuClearException {
! final Connection con = new TestCaseConnectionSource().getConnection();
try {
! PreparedStatement stmt=con.prepareStatement("drop testtransaction");
stmt.execute();
! stmt=con.prepareStatement("drop testaccounts");
stmt.execute();
} catch (Exception e) {
--- 121,129 ----
public void testCreateTableStructure() throws SQLException, IOException, NamingException, NeuClearException {
! final StatementFactory fact = new SimpleStatementFactory(new TestCaseConnectionSource());
try {
! PreparedStatement stmt=fact.prepareStatement("drop testtransaction");
stmt.execute();
! stmt=fact.prepareStatement("drop testaccounts");
stmt.execute();
} catch (Exception e) {
***************
*** 133,137 ****
table.addMoney();
table.addComment();
! table.create(con,driver);
/* Entity entity=table.insertEntity(con,new Object[] {
"created",TimeTools.now(),
--- 138,142 ----
table.addMoney();
table.addComment();
! table.create(fact,driver);
/* Entity entity=table.insertEntity(con,new Object[] {
"created",TimeTools.now(),
***************
*** 147,152 ****
assertNotNull(entity);
*/
- con.commit();
- con.close();
}
--- 152,155 ----
|