]> source.dussan.org Git - iciql.git/commitdiff
Added Derby tcp test
authorJames Moger <james.moger@gitblit.com>
Tue, 18 Nov 2014 04:32:33 +0000 (23:32 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 10 Apr 2015 13:16:11 +0000 (09:16 -0400)
.classpath
build.moxie
src/test/java/com/iciql/test/IciqlSuite.java

index df99f7a69c14c1d0b28e1b3d102d52eed233552f..eb2a9780fd93c46a3f2a8adaba4d4ef65048eb65 100644 (file)
@@ -6,6 +6,8 @@
        <classpathentry kind="lib" path="ext/h2-1.4.186.jar" sourcepath="ext/src/h2-1.4.186.jar" />
        <classpathentry kind="lib" path="ext/hsqldb-2.3.2.jar" sourcepath="ext/src/hsqldb-2.3.2.jar" />
        <classpathentry kind="lib" path="ext/derby-10.11.1.1.jar" />
+       <classpathentry kind="lib" path="ext/derbyclient-10.11.1.1.jar" />
+       <classpathentry kind="lib" path="ext/derbynet-10.11.1.1.jar" />
        <classpathentry kind="lib" path="ext/mysql-connector-java-5.1.33.jar" />
        <classpathentry kind="lib" path="ext/postgresql-9.4-1201-jdbc41.jar" sourcepath="ext/src/postgresql-9.4-1201-jdbc41.jar" />
        <classpathentry kind="lib" path="ext/sqlite-jdbc-3.8.7.jar" sourcepath="ext/src/sqlite-jdbc-3.8.7.jar" />
index f17ef1506eef95f5590df6aff5e1dda3392af0ea..b31da16d524267a0af6c43884945c7f45c4f8bad 100644 (file)
@@ -95,6 +95,8 @@ dependencies:
 - provided 'com.h2database:h2:${h2.version}'
 - provided 'org.hsqldb:hsqldb:${hsqldb.version}'
 - provided 'org.apache.derby:derby:${derby.version}'
+- provided 'org.apache.derby:derbyclient:${derby.version}'
+- provided 'org.apache.derby:derbynet:${derby.version}'
 - provided 'mysql:mysql-connector-java:5.1.33'
 - provided 'org.postgresql:postgresql:9.4-1201-jdbc41'
 - provided 'org.xerial:sqlite-jdbc:${sqlite.version}'
index e3e0663fa925bb212e8b2709e9e0df5ce87b5725..6ec61dfd47e65af1a364c13ead1d6973d25ad682 100644 (file)
@@ -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);
        }
 
@@ -562,6 +566,18 @@ public class IciqlSuite {
                return server;
        }
 
+       /**
+        * 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.
         */