Author: kentam
Date: Fri Oct  8 16:14:08 2004
New Revision: 54129

Modified:
   
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/database/SQLStatementTest.java
Log:
Fixed a problem in a database control test case where a database is being 
created in the wrong location and test data is not cleaned up properly during 
teardown.




Modified: 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/database/SQLStatementTest.java
==============================================================================
--- 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/database/SQLStatementTest.java
        (original)
+++ 
incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/database/SQLStatementTest.java
        Fri Oct  8 16:14:08 2004
@@ -42,8 +42,8 @@
        }
 
        protected void tearDown() {
+               dropTable();
                try { this.con.close(); } catch (Throwable t) {}
-        dropTable();
        }
 
 
@@ -199,7 +199,7 @@
         Connection con = null;
         try {
             Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
-            con = DriverManager.getConnection("jdbc:derby:test;create=true");
+            con = 
DriverManager.getConnection("jdbc:derby:build/databaseControlTestDB;create=true");
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -208,7 +208,6 @@
     }
 
     private void createTable() {
-        //Test data
         String sql = "CREATE TABLE EMPLOYEE ( ID INT PRIMARY KEY NOT NULL, " +
                    "FNAME VARCHAR(20), LNAME VARCHAR(20), TITLE VARCHAR(15))";
 
@@ -225,7 +224,6 @@
     }
 
     private void dropTable() {
-        //Test data
         String sql = "DROP TABLE EMPLOYEE";
         PreparedStatement ps = null;
         try {

Reply via email to