You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2005/05/20 15:42:40 UTC

svn commit: r171116 - /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java

Author: djd
Date: Fri May 20 06:42:38 2005
New Revision: 171116

URL: http://svn.apache.org/viewcvs?rev=171116&view=rev
Log:
Add check in the test harness to remove ij.database and ij.protocol
from the <testname>_app.properties file created if ij.dataSource is
set in the system property set. This allows the tests to be run obtaining
the connection from a DataSource specified in the system properties.
Required for testing under J2ME environments where no Driver/DriverManager exists.

Modified:
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?rev=171116&r1=171115&r2=171116&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java Fri May 20 06:42:38 2005
@@ -1374,7 +1374,18 @@
 				System.out.println("console.encoding:" + conEnc + 
 								   " file.encoding:" + fileEnc +
 							   " derby.ui.codeset: " + ap.getProperty("derby.ui.codeset"));
-
+			
+			// If the initial connection is being specified as a DataSource
+			// on the command line using -Dij.dataSource=<dsclassname>
+			// then remove the ij.database property that comes from any
+			// default_app or other properties file. This is because the
+			// ij.database will override the ij.dataSource property.
+			if (System.getProperty("ij.dataSource") != null)
+			{
+				ap.remove("ij.database");
+				ap.remove("ij.protocol");
+			}
+		
 //System.out.println("appPropFile: " + appPropFile.getPath());
             bos = new BufferedOutputStream(new FileOutputStream(appPropFile));
             ap.save(bos, "App Properties");