db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r1237397 - in /db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck: Help.java RunTCK.java
Date Sun, 29 Jan 2012 18:03:21 GMT
Author: andyj
Date: Sun Jan 29 18:03:20 2012
New Revision: 1237397

URL: http://svn.apache.org/viewvc?rev=1237397&view=rev
Log:
JDO-647 Save test log for RI against each test rather than a large file for all. Update console
output to make cleaner and report success/fail

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

Modified: db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Help.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Help.java?rev=1237397&r1=1237396&r2=1237397&view=diff
==============================================================================
--- db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Help.java (original)
+++ db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Help.java Sun Jan 29 18:03:20
2012
@@ -55,6 +55,8 @@ public class Help extends AbstractMojo{
         msg.append("  Default value is \"applicationidentity datastoreidentity\"\n");
         msg.append("* project.lib.iut.directory\n");
         msg.append("  Location of implementation jar files. Default: ${basedir}/../lib/iut\n");
+        msg.append("* jdo.tck.impl.logfile\n");
+        msg.append("  Location of implementation log file. Default: ${basedir}/datanucleus.txt\n");
         msg.append("* jdo.tck.doInstallSchema\n");
         msg.append("  Setting this parameter to false will bypass schema installation.\n");
         msg.append("* jdo.tck.doEnhance\n");

Modified: db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java?rev=1237397&r1=1237396&r2=1237397&view=diff
==============================================================================
--- db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java (original)
+++ db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java Sun Jan 29 18:03:20
2012
@@ -41,7 +41,6 @@ import org.apache.maven.plugin.MojoFailu
  * @goal runtck
  *
  * @phase integration-test
- *
  */
 public class RunTCK extends AbstractTCKMojo {
 
@@ -52,6 +51,7 @@ public class RunTCK extends AbstractTCKM
      * @required
      */
     private boolean doRunTCK;
+
     /**
      * To run the RunTCK plugin goal in verbose mode.
      * @parameter expression="${jdo.tck.runTCKVerbose}"
@@ -59,6 +59,7 @@ public class RunTCK extends AbstractTCKM
      * @required
      */
     private boolean runtckVerbose;
+
     /**
      * Run the TCK in a debugger.
      * @parameter expression="${jdo.tck.debugTCK}"
@@ -66,6 +67,7 @@ public class RunTCK extends AbstractTCKM
      * @required
      */
     private boolean debugTCK;
+
     /**
      * Implementation to be tested (jdori or iut).
      * Any value other than "jdori" will test an appropriately configured IUT
@@ -74,6 +76,7 @@ public class RunTCK extends AbstractTCKM
      * @required
      */
     private String impl;
+
     /**
      * Location of third party libraries such as JNDI.
      * @parameter expression="${project.lib.ext.directory}"
@@ -81,6 +84,15 @@ public class RunTCK extends AbstractTCKM
      * @required
      */
     private String extLibsDirectory;
+
+    /**
+     * Location of implementation log file.
+     * @parameter expression="${jdo.tck.impl.logfile}"
+     *      default-value="${user.dir}/datanucleus.txt"
+     * @required
+     */
+    private String implLogFile;
+
     /**
      * Location of jar files for implementation under test.
      * @parameter expression="${project.lib.iut.directory}"
@@ -96,6 +108,7 @@ public class RunTCK extends AbstractTCKM
      * @optional
      */
     private String pmfProperties;
+
     /**
      * Name of file in src/conf containing property jdo.tck.exclude,
      *   whose value is a list of files to be excluded from testing.
@@ -148,6 +161,7 @@ public class RunTCK extends AbstractTCKM
      * @optional
      */
     private String debugDirectives;
+
     /**
      * Class used to run a batch of tests.
      * @parameter expression="${jdo.tck.testrunnerclass}"
@@ -155,6 +169,7 @@ public class RunTCK extends AbstractTCKM
      * @required
      */
     private String testRunnerClass;
+
     /**
      * Class used to output test result and configuration information.
      * @parameter expression="${jdo.tck.resultprinterclass}"
@@ -217,10 +232,11 @@ public class RunTCK extends AbstractTCKM
 
         PropertyUtils.string2Set(dblist, dbs);
         PropertyUtils.string2Set(identitytypes, idtypes);
-        System.out.println("*>TCK to be run for implementation " + impl
-                + " on \n configurations: "
-                + cfgs.toString() + "\n  databases: " + dbs.toString()
-                + "\n  identity types: " + identitytypes.toString());
+        System.out.println("*>TCK to be run for implementation '" + impl +
+                "' on \n" +
+                " configurations: " + cfgs.toString() + "\n" +
+                " databases: " + dbs.toString() + "\n" +
+                " identitytypes: " + identitytypes.toString());
 
         // Properties required for test execution
         System.out.println("cleanupaftertest is " + cleanupaftertest);
@@ -358,7 +374,6 @@ public class RunTCK extends AbstractTCKM
                     }
                     List<String> classesList = Arrays.asList(classes.split(" "));
 
-
                     propsString.add("-Djdo.tck.schemaname=" + idtype + mapping);
                     propsString.add("-Djdo.tck.cfg=" + cfg);
 
@@ -397,18 +412,48 @@ public class RunTCK extends AbstractTCKM
                     command.add(testRunnerClass);
                     command.addAll(classesList);
 
-                    // invoke class runner
-                    System.out.println("*> Starting configuration=" + cfg
-                            + " with database=" + db + " identitytype=" + idtype
-                            + " mapping=" + mapping + " on the " + impl + ".");
+                    if (runonce.equals("true") && alreadyran) {
+                        continue;
+                    }
+
                     if (debugTCK) {
                         System.out.println("Using debug arguments: \n"
                                 + debugDirectives);
                     }
-                    if (runonce.equals("true") && alreadyran) {
-                        continue;
-                    }
+
+                    // invoke class runner
+                    System.out.print("*> Running tests for " + cfg +
+                    		" with " + idtype +
+                    		" on '" + db + "'" +
+                            " mapping=" + mapping + " ... ");
                     result = (new Utilities()).invokeTest(command);
+                    if (result.getExitValue() == 0) {
+                    	System.out.println("success");
+                    } else {
+                    	System.out.println("FAIL");
+                    }
+
+                    // TODO This is only for the RI right now, but could be made to work
for UIT
+                    if ("jdori".equals(impl)) {
+                    	// Move log to per-test location
+                    	String idname = "dsid";
+                        if (idtype.trim().equals("applicationidentity")) {
+                            idname = "app";
+                        }
+                    	String configName = cfg;
+                    	if (cfg.indexOf('.') > 0) {
+                    		configName = configName.substring(0, cfg.indexOf('.'));
+                    	}
+                    	String testLogFilename = thisLogDir +
+                    	    idname + "-" + configName + "-datanucleus.txt";
+                    	try {
+                        	File logFile = new File(implLogFile);
+							FileUtils.moveFile(logFile, new File(testLogFilename));
+						} catch (Exception e) {
+							System.out.println(">> Error moving implementation log file " +
+									e.getMessage());
+						}
+                    }
 
                     if (runtckVerbose) {
                         System.out.println("\nCommand line is: \n" + command.toString());



Mime
View raw message