You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mt...@apache.org on 2011/01/24 21:43:57 UTC

svn commit: r1062964 - in /openjpa/trunk: openjpa-persistence-jdbc/pom.xml openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java pom.xml

Author: mtylenda
Date: Mon Jan 24 20:43:57 2011
New Revision: 1062964

URL: http://svn.apache.org/viewvc?rev=1062964&view=rev
Log:
OPENJPA-1876: Tests speed-up - do not shut Derby down at the end of each test.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/pom.xml
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java
    openjpa/trunk/pom.xml

Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=1062964&r1=1062963&r2=1062964&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Mon Jan 24 20:43:57 2011
@@ -86,6 +86,7 @@
                 <connection.url>jdbc:hsqldb:mem:openjpa20-hsqldb-database</connection.url>
                 <connection.username>sa</connection.username>
                 <connection.password />
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -111,6 +112,7 @@
                 <connection.url>${openjpa.mysql.url}</connection.url>
                 <connection.username>${openjpa.mysql.username}</connection.username>
                 <connection.password>${openjpa.mysql.password}</connection.password>
+                <jdbc.DBDictionary />
                 <!-- DBCP overrides for MySQL testing -->
                 <dbcp.maxIdle>0</dbcp.maxIdle>
                 <dbcp.minIdle>0</dbcp.minIdle>
@@ -139,6 +141,7 @@
                 <connection.url>${openjpa.postgresql.url}</connection.url>
                 <connection.username>${openjpa.postgresql.username}</connection.username>
                 <connection.password>${openjpa.postgresql.password}</connection.password>
+                <jdbc.DBDictionary />
                 <!-- DBCP overrides -->
                 <dbcp.maxIdle>0</dbcp.maxIdle>
                 <dbcp.minIdle>0</dbcp.minIdle>
@@ -199,6 +202,7 @@
                 <connection.url>${openjpa.mssql.url}</connection.url>
                 <connection.username>${openjpa.mssql.username}</connection.username>
                 <connection.password>${openjpa.mssql.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
             <repositories>
                 <repository>
@@ -240,6 +244,7 @@
                 <connection.url>${openjpa.sqlserver.url}</connection.url>
                 <connection.username>${openjpa.sqlserver.username}</connection.username>
                 <connection.password>${openjpa.sqlserver.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -266,6 +271,7 @@
                 <connection.url>${openjpa.sybase.url}</connection.url>
                 <connection.username>${openjpa.sybase.username}</connection.username>
                 <connection.password>${openjpa.sybase.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -286,6 +292,7 @@
                 <connection.url>${openjpa.sybase.url}</connection.url>
                 <connection.username>${openjpa.sybase.username}</connection.username>
                 <connection.password>${openjpa.sybase.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -312,6 +319,7 @@
                 <connection.url>${openjpa.ingres.url}</connection.url>
                 <connection.username>${openjpa.ingres.username}</connection.username>
                 <connection.password>${openjpa.ingres.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -346,6 +354,7 @@
                 <connection.url>${openjpa.custom.url}</connection.url>
                 <connection.username>${openjpa.custom.username}</connection.username>
                 <connection.password>${openjpa.custom.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -393,6 +402,7 @@
                 <connection.url>${openjpa.custom.url}</connection.url>
                 <connection.username>${openjpa.custom.username}</connection.username>
                 <connection.password>${openjpa.custom.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
 
@@ -465,6 +475,7 @@
                 <connection.url>${openjpa.db2.url}</connection.url>
                 <connection.username>${openjpa.db2.username}</connection.username>
                 <connection.password>${openjpa.db2.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
             <repositories>
                 <repository>
@@ -597,6 +608,7 @@
                 <connection.url>${openjpa.ids.url}</connection.url>
                 <connection.username>${openjpa.ids.username}</connection.username>
                 <connection.password>${openjpa.ids.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
             <repositories>
                 <repository>
@@ -664,6 +676,7 @@
                 <connection.url>${openjpa.oracle.url}</connection.url>
                 <connection.username>${openjpa.oracle.username}</connection.username>
                 <connection.password>${openjpa.oracle.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
             <repositories>
                 <repository>
@@ -708,6 +721,7 @@
                 <connection.url>${openjpa.soliddb.url}</connection.url>
                 <connection.username>${openjpa.soliddb.username}</connection.username>
                 <connection.password>${openjpa.soliddb.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
             <repositories>
                 <repository>

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java?rev=1062964&r1=1062963&r2=1062964&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/TestDynamicSchemas.java Mon Jan 24 20:43:57 2011
@@ -177,6 +177,21 @@ public class TestDynamicSchemas extends 
     }
 
 
+    /**
+     * Derby tests run with a DerbyDictionary-specific property, so clear it out here.
+     * Otherwise, all tests except testDerbyDynamicSchema will fail.
+     */
+    @Override
+    protected OpenJPAEntityManagerFactorySPI createEMF(Object... props) {
+        int propsLength = props.length;
+        Object[] newProps = new Object[propsLength + 2];
+        System.arraycopy(props, 0, newProps, 0, propsLength);
+        newProps[propsLength] = "openjpa.jdbc.DBDictionary";
+        newProps[propsLength + 1] = "";
+        return super.createEMF(newProps);
+    }
+
+
     private void validateTableName(OpenJPAEntityManagerFactorySPI emf) {
         JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
         DBDictionary dict = conf.getDBDictionaryInstance();

Modified: openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=1062964&r1=1062963&r2=1062964&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Mon Jan 24 20:43:57 2011
@@ -367,6 +367,8 @@
                 <connection.url>jdbc:derby:target/database/openjpa-derby-database;create=true</connection.url>
                 <connection.username />
                 <connection.password />
+                <!-- Tests are much faster without shutting derby down at the end of each test. -->
+                <jdbc.DBDictionary>ShutdownOnClose=false</jdbc.DBDictionary>
             </properties>
         </profile>
 
@@ -395,6 +397,8 @@
                 <connection.url>jdbc:derby:memory:openjpa-derby-inmem-database;create=true</connection.url>
                 <connection.username />
                 <connection.password />
+                <!-- Tests are much faster without shutting derby down at the end of each test. -->
+                <jdbc.DBDictionary>ShutdownOnClose=false</jdbc.DBDictionary>
             </properties>
         </profile>
 
@@ -437,6 +441,7 @@
                 <connection.url>${openjpa.derbynet.url}</connection.url>
                 <connection.username>${openjpa.derbynet.username}</connection.username>
                 <connection.password>${openjpa.derbynet.password}</connection.password>
+                <jdbc.DBDictionary />
             </properties>
         </profile>
     </profiles>
@@ -649,6 +654,10 @@
                             <value>${connection.password}</value>
                         </property>
                         <property>
+                            <name>openjpa.jdbc.DBDictionary</name>
+                            <value>${jdbc.DBDictionary}</value>
+                        </property>
+                        <property>
                             <name>derby.stream.error.file</name>
                             <value>target/derby.log</value>
                         </property>