db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r1237258 - /db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java
Date Sun, 29 Jan 2012 12:17:27 GMT
Author: andyj
Date: Sun Jan 29 12:17:26 2012
New Revision: 1237258

URL: http://svn.apache.org/viewvc?rev=1237258&view=rev
Log:
Improve console output for schema installation to be clearer and not adding newlines

Modified:
    db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java

Modified: db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java?rev=1237258&r1=1237257&r2=1237258&view=diff
==============================================================================
--- db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java (original)
+++ db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java Sun Jan 29
12:17:26 2012
@@ -129,28 +129,31 @@ public class InstallSchema extends Abstr
 
             // Create database
             for (String idtype : idtypes) {
-
                 for (String mapping : mappings) {
-
                     System.setProperty("ij.outfile", logsDirectory + File.separator
                             + "database" + File.separator + db + "_" + idtype
                             + "_" + mapping + ".txt");
 
-                    System.out.println("*> Installing schema" + mapping
-                                + ".sql for " + db + " " + idtype);
+                    System.out.print("*> Installing schema" + mapping
+                                + ".sql for " + db + " " + idtype + " ... ");
 
                     String[] args = {sqlDirectory + File.separator + db
                         + File.separator + idtype + File.separator
                         + "schema" + mapping + ".sql"};
                     System.setProperty("derby.system.home", dbDirName);
 
+                    boolean success = true;
                     try {
                         org.apache.derby.tools.ij.main(args);
                     } catch (IOException ioex) {
+                    	success = false;
+                    	System.out.println("FAILED!");
                         throw new MojoExecutionException(
                                 "*> Failed to execute ij: " +
                                 ioex.getLocalizedMessage());
                     } catch (Exception ex) {
+                    	success = false;
+                    	System.out.println("FAILED!");
                         ex.printStackTrace();
                         System.out.println("*> Classpath is ");
                         new Utilities().printClasspath();
@@ -165,13 +168,13 @@ public class InstallSchema extends Abstr
                         System.out.println("*> java.security.policy is \n    "
                                 + System.getProperty("java.security.policy"));
                     } finally {
-                        System.out.println("*> Installation of schema" + mapping
-                                + ".sql for " + db + " " + idtype
-                                + " is complete. See diagnostic output in "
-                                + dbLogsDir + ".");
+                    	if (success) {
+                    		System.out.println("done");
+                    	}
                     }
                 }
             }
+            System.out.println("*> See diagnostic output in " + dbLogsDir + ".");
         }
     }
 }



Mime
View raw message