summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-11-17 23:32:33 -0500
committerJames Moger <james.moger@gitblit.com>2015-04-10 09:16:11 -0400
commitf897fc7d25c757fc0607ce010c1e8c50ce127131 (patch)
treef74234da6163dac1fc2253ab90f0328cfd9e0ea2 /src
parent96be41b6f1100fc9b3eaf19006f5469ce31ca934 (diff)
downloadiciql-f897fc7d25c757fc0607ce010c1e8c50ce127131.tar.gz
iciql-f897fc7d25c757fc0607ce010c1e8c50ce127131.zip
Added Derby tcp test
Diffstat (limited to 'src')
-rw-r--r--src/test/java/com/iciql/test/IciqlSuite.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/test/java/com/iciql/test/IciqlSuite.java b/src/test/java/com/iciql/test/IciqlSuite.java
index e3e0663..6ec61df 100644
--- a/src/test/java/com/iciql/test/IciqlSuite.java
+++ b/src/test/java/com/iciql/test/IciqlSuite.java
@@ -33,6 +33,7 @@ import org.apache.commons.dbcp.DriverManagerConnectionFactory;
import org.apache.commons.dbcp.PoolableConnectionFactory;
import org.apache.commons.dbcp.PoolingDataSource;
import org.apache.commons.pool.impl.GenericObjectPool;
+import org.apache.derby.drda.NetworkServerControl;
import org.hsqldb.persist.HsqlProperties;
import org.junit.Assert;
import org.junit.runner.JUnitCore;
@@ -110,6 +111,7 @@ public class IciqlSuite {
new TestDb("HSQL", "tcp", "jdbc:hsqldb:hsql://localhost/iciql"),
new TestDb("Derby", "memory", "jdbc:derby:memory:iciql;create=true"),
new TestDb("Derby", "file", "jdbc:derby:directory:testdbs/derby/iciql;create=true"),
+ new TestDb("Derby", "tcp", "jdbc:derby://localhost:1527/testdbs/derby/iciql;create=true", "sa", "sa"),
new TestDb("MySQL", "tcp", "jdbc:mysql://localhost:3306/iciql", "sa", "sa"),
new TestDb("PostgreSQL", "tcp", "jdbc:postgresql://localhost:5432/iciql", "sa", "sa"),
new TestDb("SQLite", "memory", "jdbc:sqlite:file:iciql?mode=memory&cache=shared"),
@@ -318,9 +320,10 @@ public class IciqlSuite {
deleteRecursively(baseFolder);
new File(baseFolder, "/sqlite").mkdirs();
- // Start the HSQL and H2 servers in-process
+ // Start the HSQL, H2, and Derby servers in-process
org.hsqldb.Server hsql = startHSQL();
org.h2.tools.Server h2 = startH2();
+ NetworkServerControl derby = startDerby();
// Statement logging
final FileWriter statementWriter;
@@ -482,6 +485,7 @@ public class IciqlSuite {
}
hsql.stop();
h2.stop();
+ derby.shutdown();
System.exit(0);
}
@@ -563,6 +567,18 @@ public class IciqlSuite {
}
/**
+ * Start the Derby tcp server.
+ *
+ * @return an Derby server instance
+ * @throws Exception
+ */
+ private static NetworkServerControl startDerby() throws Exception {
+ NetworkServerControl serverControl = new NetworkServerControl();
+ serverControl.start(null);
+ return serverControl;
+ }
+
+ /**
* Represents a test database url.
*/
private static class TestDb implements Comparable<TestDb> {