db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r691583 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/optimizer/RunOptimizerTest.java
Date Wed, 03 Sep 2008 11:58:30 GMT
Author: kahatlen
Date: Wed Sep  3 04:58:30 2008
New Revision: 691583

URL: http://svn.apache.org/viewvc?rev=691583&view=rev
Log:
DERBY-3845: Problems running org.apache.derbyTesting.system.optimizer.RunOptimizerTest

Make sure the database is initialized also when -mode is specified on
the command line.

Patch contributed by Ole Solberg <Ole.Solberg@Sun.COM>.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/optimizer/RunOptimizerTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/optimizer/RunOptimizerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/optimizer/RunOptimizerTest.java?rev=691583&r1=691582&r2=691583&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/optimizer/RunOptimizerTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/optimizer/RunOptimizerTest.java
Wed Sep  3 04:58:30 2008
@@ -63,13 +63,13 @@
 					driverClass=StaticValues.embedClass;
 					jdbcurl=StaticValues.embedURL;
 				}
-			}else{
+			}
 
-				File dir = new File("testdb");
-				if((!dir.exists())){
-					reset=true;
-				}
+			File dir = new File("testdb");
+			if((!dir.exists())){
+				reset=true; // If nonexisting must always .init and .createObjects
 			}
+
 			System.out.println("Running test with url "+jdbcurl);
 			if(args.length>0){
 				for(int i=0;i<args.length;i++){
@@ -87,20 +87,21 @@
 				}
 			
 			Class.forName(driverClass);
-			if (reset) {
-				if (verbose)
-					System.out.println("Initializing...");
+			if (reset) { // Must also be done if db nonexisting
+                System.out.println("Initializing db ...");
 				conn = DriverManager.getConnection(jdbcurl);
 				TestViews.init();
 				DataUtils.dropObjects(conn,verbose);
 				DataUtils.createObjects(conn,verbose);
 			}else{
+                System.out.println("Use existing db ...");
 				conn = DriverManager.getConnection(jdbcurl);
 			}
 			DataUtils.insertData(conn,verbose);
 			QueryList.init(conn);
 			if (verbose)
 				System.out.println(" List of query scenarios to run: "+QueryList.getQList().size());
+            System.out.println("Starting tests ...");
 			for(int i=0;i<QueryList.getQList().size();i++){
 				if (verbose)
 					System.out.println("\n______________________________________________________________________\n");



Mime
View raw message