You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by an...@apache.org on 2012/01/29 13:17:27 UTC

svn commit: r1237258 - /db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java

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 + ".");
         }
     }
 }