You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2012/10/11 23:06:56 UTC

svn commit: r1397310 - in /airavata/trunk/modules/registry/airavata-jpa-registry: pom.xml src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java src/test/resources/repository.properties

Author: chathuri
Date: Thu Oct 11 21:06:56 2012
New Revision: 1397310

URL: http://svn.apache.org/viewvc?rev=1397310&view=rev
Log:
start derby in the in memory mode for tests

Modified:
    airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml
    airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/repository.properties

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml?rev=1397310&r1=1397309&r2=1397310&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/pom.xml Thu Oct 11 21:06:56 2012
@@ -73,21 +73,25 @@
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
             <version>${derby.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbyclient</artifactId>
             <version>${derby.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbynet</artifactId>
             <version>${derby.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbytools</artifactId>
             <version>${derby.version}</version>
+            <scope>test</scope>
         </dependency>
         <!--dependency>
             <groupId>org.apache.airavata</groupId>

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java?rev=1397310&r1=1397309&r2=1397310&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java Thu Oct 11 21:06:56 2012
@@ -91,7 +91,8 @@ public class Initialize {
 
 
         if (Utils.getDBType().equals("derby")) {
-            startDerbyInServerMode();
+//            startDerbyInServerMode();
+            startDerbyInEmbeddedMode();
         }
 
 
@@ -255,4 +256,15 @@ public class Initialize {
         }
 
     }
+
+    private void startDerbyInEmbeddedMode(){
+        try {
+            Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+            DriverManager.getConnection("jdbc:derby:memory:unit-testing-jpa;create=true").close();
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (SQLException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+    }
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/repository.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/repository.properties?rev=1397310&r1=1397309&r2=1397310&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/repository.properties (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/repository.properties Thu Oct 11 21:06:56 2012
@@ -88,6 +88,9 @@ registry.jdbc.password=airavata
 #registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
 
 #for derby
-registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-registry.jdbc.url=jdbc:derby://localhost:20000/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+#registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+#registry.jdbc.url=jdbc:derby://localhost:20000/persistent_data;create=true;user=airavata;password=airavata
+registry.jdbc.url=jdbc:derby:memory:unit-testing;create=true;user=airavata;password=airavata
+