db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r1237213 - in /db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck: AbstractTCKMojo.java Enhance.java InstallSchema.java PropertyUtils.java RunTCK.java
Date Sun, 29 Jan 2012 08:47:26 GMT
Author: andyj
Date: Sun Jan 29 08:47:25 2012
New Revision: 1237213

URL: http://svn.apache.org/viewvc?rev=1237213&view=rev
Log:
JDO-647 Read configurations from src/conf/configurations.list when not user defined just like
in Maven1. 
Also add abstract superclass providing some common things rather than duping.
Fix duplicated installation of "schema.sql"

Added:
    db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/AbstractTCKMojo.java
Modified:
    db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
    db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java
    db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
    db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java

Added: db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/AbstractTCKMojo.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/AbstractTCKMojo.java?rev=1237213&view=auto
==============================================================================
--- db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/AbstractTCKMojo.java (added)
+++ db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/AbstractTCKMojo.java Sun Jan
29 08:47:25 2012
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2006-2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jdo.exectck;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Properties;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Abstract Mojo to be extended for the actual goals of this maven plugin.
+ */
+public abstract class AbstractTCKMojo extends AbstractMojo {
+
+	/**
+     * Location of TCK generated output.
+     * @parameter expression="${project.build.directory}"
+     *      default-value="${basedir}/target"
+     * @required
+     */
+    protected String buildDirectory;
+
+    /**
+     * Location of the logs directory.
+     * @parameter expression="${project.log.directory}"
+     *      default-value="${project.build.directory}/logs"
+     * @required
+     */
+    protected File logsDirectory;
+
+    /**
+     * Location of the configuration directory.
+     * @parameter expression="${project.conf.directory}"
+     *      default-value="${basedir}/src/conf"
+     * @required
+     */
+    protected String confDirectory;
+
+    /**
+     * Location of the configuration directory.
+     * @parameter expression="${project.sql.directory}"
+     *      default-value="${basedir}/src/sql"
+     * @required
+     */
+    protected String sqlDirectory;
+
+    /**
+     * List of configuration files, each describing a test configuration.
+     * Note: Collection can only be configured in pom.xml. Using multi-valued
+     *       type because long String cannot be broken across lines in pom.xml.
+     * @parameter
+     * @optional
+     */
+    protected Collection<String> cfgs;
+
+    /**
+     * List of configuration files, each describing a test configuration.
+     * Allows command line override of configured cfgs value.
+     * @parameter expression="${jdo.tck.cfglist}"
+     * @optional
+     */
+    protected String cfgList;
+
+    /**
+     * List of databases to run tests under.
+     * Currently only derby is supported.
+     * @parameter expression="${jdo.tck.dblist}"
+     *      default-value="derby"
+     * @required
+     */
+    protected String dblist;
+
+    protected Collection<String> dbs = new HashSet<String>();
+
+    /**
+     * List of identity types to be tested.
+     * @parameter expression="${jdo.tck.identitytypes}"
+     *      default-value="applicationidentity datastoreidentity"
+     * @required
+     */
+    protected String identitytypes;
+
+    protected Collection<String> idtypes = new HashSet<String>();
+
+    /**
+     * Convenience method to set the cfgList from the file
+     * "src/conf/configurations.list".
+     * @throws MojoExecutionException If the file could not be found/opened
+     */
+    protected void setCfgListFromFile() throws MojoExecutionException {
+        try {
+            Properties defaultProps = new Properties();
+            FileInputStream in = new FileInputStream(confDirectory + File.separator +
+                "configurations.list");
+            defaultProps.load(in);
+            in.close();
+            cfgList = defaultProps.getProperty("jdo.tck.cfglist");
+        }
+        catch (Exception e) {
+            // Error finding configurations.list
+            throw new MojoExecutionException("No configuration specified and could not "
+
+                "find 'src/conf/configurations.list'");
+		}
+    }
+}

Modified: db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java?rev=1237213&r1=1237212&r2=1237213&view=diff
==============================================================================
--- db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java (original)
+++ db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java Sun Jan 29 08:47:25
2012
@@ -14,6 +14,7 @@ import java.io.IOException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 import javax.jdo.JDOEnhancer;
@@ -25,7 +26,6 @@ import javax.jdo.JDOHelper;
  * @goal enhance
  *
  * @phase integration-test
- *
  */
 public class Enhance extends AbstractMojo {
 
@@ -78,6 +78,7 @@ public class Enhance extends AbstractMoj
      * @required
      */
     private String iutLibsDirectory;
+
     /**
      * List of identity types to be tested.
      * @parameter expression="${jdo.tck.identitytypes}"
@@ -85,7 +86,7 @@ public class Enhance extends AbstractMoj
      * @required
      */
     private String identitytypes;
-    private HashSet<String> idtypes;
+    private Collection<String> idtypes;
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
@@ -95,7 +96,7 @@ public class Enhance extends AbstractMoj
             return;
         }
 
-        idtypes = new HashSet();
+        idtypes = new HashSet<String>();
         PropertyUtils.string2Set(identitytypes, idtypes);
 
         // Create directory for enhancer logs
@@ -117,7 +118,6 @@ public class Enhance extends AbstractMoj
 
         String[] metadataExtensions = {"jdo", "jdoquery", "orm", "xml", "properties"};  //
we really want "jdo.properties", but this is easier
         String[] srcDirs = {"jdo", "orm", "testdata"};
-        String genericPkgName = "org";
         File toFile = null;
         File fromFile = null;
         String fromFileName = null;

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=1237213&r1=1237212&r2=1237213&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
08:47:25 2012
@@ -1,7 +1,5 @@
-package org.apache.jdo.exectck;
-
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2006-2012 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,12 +13,14 @@ package org.apache.jdo.exectck;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package org.apache.jdo.exectck;
+
 import org.apache.commons.io.FileUtils;
-import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Collection;
 import java.util.HashSet;
 
 /**
@@ -29,10 +29,8 @@ import java.util.HashSet;
  * @goal installSchema
  * 
  * @phase integration-test
- *
  */
-public class InstallSchema
-        extends AbstractMojo {
+public class InstallSchema extends AbstractTCKMojo {
 
     /**
      * Location of TCK generated output.
@@ -43,103 +41,38 @@ public class InstallSchema
     private boolean doInstallSchema;
 
     /**
-     * Root of the TCK installation.
-     * @parameter expression="${project.base.directory}"
-     *      default-value="${basedir}"
-     * @required
-     */
-//    private String baseDirectory;
-    
-    /**
-     * Location of TCK generated output.
-     * @parameter expression="${project.build.directory}"
-     *      default-value="${basedir}/target"
-     * @required
-     */
-    private String buildDirectory;
-    
-    /**
-     * Location of the logs directory.
-     * @parameter expression="${project.log.directory}"
-     *      default-value="${project.build.directory}/logs"
-     * @required
-     */
-    private File logsDirectory;
-    
-    /**
-     * Location of the configuration directory.
-     * @parameter expression="${project.conf.directory}"
-     *      default-value="${basedir}/src/conf"
-     * @required
+     * List of mappings required by the current configuration
      */
-    private String confDirectory;
-    
-    /**
-     * Location of the configuration directory.
-     * @parameter expression="${project.sql.directory}"
-     *      default-value="${basedir}/src/sql"
-     * @required
-     */
-    private String sqlDirectory;
-
-    /**
-     * List of configuration files, each describing a test configuration.
-     * Note: Collection can only be configured in pom.xml. Using multi-valued
-     *       type because long String cannot be broken across lines in pom.xml.
-     * @parameter
-     * @optional
-     */
-    private HashSet<String> cfgs;
-
-    /**
-     * List of configuration files, each describing a test configuration.
-     * Allows command line override of configured cfgs value.
-     * @parameter expression="${jdo.tck.cfglist}
-     * default-value="company1-1Relationships.conf company1-MRelationships.conf companyAnnotated1-1RelationshipsFCPM.conf
companyAnnotated1-MRelationshipsFCPM.conf companyAnnotatedAllRelationshipsFCConcrete.conf
companyAnnotatedAllRelationshipsFCPM.conf companyAnnotatedAllRelationshipsJPAConcrete.conf
companyAnnotatedAllRelationshipsJPAPM.conf companyAnnotatedAllRelationshipsPCConcrete.conf
companyAnnotatedAllRelationshipsPCPM.conf companyAnnotatedAllRelationshipsPIPM.conf companyAnnotatedEmbeddedFCPM.conf
companyAnnotatedEmbeddedJPAConcrete.conf companyAnnotatedEmbeddedJPAPM.conf companyAnnotatedM-MRelationshipsFCConcrete.conf
companyAnnotatedM-MRelationshipsFCPM.conf companyAnnotatedNoRelationshipsFCConcrete.conf companyAnnotatedNoRelationshipsFCPM.conf
companyAnnotatedNoRelationshipsPCConcrete.conf companyAnnotatedNoRelationshipsPCPM.conf companyAnnotatedNoRelationshipsPIPM.conf
companyEmbedded.conf companyListWithoutJoin.conf companyMapWithoutJoin.conf companyM-MRelation
 ships.conf companyNoRelationships.conf companyOverrideAnnotatedAllRelationshipsFCPM.conf
companyPMClass.conf companyPMInterface.conf compoundIdentity.conf detach.conf enhancement.conf
extents.conf fetchgroup.conf fetchplan.conf inheritance1.conf inheritance2.conf inheritance3.conf
inheritance4.conf instancecallbacks.conf jdohelper.conf jdoql.conf jdoql1.conf lifecycle.conf
models1.conf models.conf pm.conf pmf.conf query.conf relationshipAllRelationships.conf relationshipNoRelationships.conf
runonce.conf schemaAttributeClass.conf schemaAttributeOrm.conf schemaAttributePackage.conf
security.conf transactions.conf"
-     * @optional
-     */
-    private String cfgList;
-    
-    /**
-     * List of databases to run tests under.
-     * Currently only derby is supported.
-     * @parameter expression="${jdo.tck.dblist}" default-value="derby"
-     * @required
-     */
-    private String dblist;
-    private HashSet<String> dbs;
-    
-    /**
-     * List of identity types to be tested.
-     * @parameter expression="${jdo.tck.identitytypes}"
-     *      default-value="applicationidentity datastoreidentity"
-     * @required
-     */
-    private String identitytypes;
-    private HashSet<String> idtypes;
-    
-    /**
-     * List of mappings required by the current configurationd
-     */
-    private HashSet<String> mappings;
+    protected Collection<String> mappings = new HashSet<String>();
 
     @Override
-    public void execute()
-            throws MojoExecutionException {
+    public void execute() throws MojoExecutionException {
 
         if (!doInstallSchema) {
             System.out.println("Skipping InstallSchema goal!");
             return;
         }
-        
-        dbs = new HashSet();
-        idtypes = new HashSet();
-        mappings = new HashSet();
-
-        System.out.println("cfgList is " + cfgList);
-        if (cfgList != null) {
-            cfgs = new HashSet();
-            PropertyUtils.string2Set(cfgList, cfgs);
+
+        if (cfgs == null) {
+        	if (cfgList != null) {
+        		System.out.println("cfgList is " + cfgList);
+        		cfgs = new HashSet<String>();
+        		PropertyUtils.string2Set(cfgList, cfgs);
+        	}
+        	else {
+        		// Fallback to "src/conf/configurations.list"
+        		setCfgListFromFile();
+                if (cfgList != null) {
+                    cfgs = new HashSet<String>();
+                    PropertyUtils.string2Set(cfgList, cfgs);
+                }
+
+                if (cfgList == null) {
+                    throw new MojoExecutionException(
+                        "Could not find configurations to run TCK. " +
+                        "Set cfgList parameter on command line or cfgs in pom.xml.");
+            	}
+        	}
         }
 
         PropertyUtils.string2Set(dblist, dbs);
@@ -186,6 +119,14 @@ public class InstallSchema
                         + " to " + dbDir + ": " + ex.getLocalizedMessage());
             }
 
+            if (mappings.contains("0")) {
+            	// If schema was explicitly specified as "0" change to "" since
+            	// the schema file in that case is "schema.sql". Note that this
+            	// removes a duplicate entry too
+            	mappings.remove("0");
+            	mappings.add("");
+            }
+
             // Create database
             for (String idtype : idtypes) {
 
@@ -195,9 +136,6 @@ public class InstallSchema
                             + "database" + File.separator + db + "_" + idtype
                             + "_" + mapping + ".txt");
 
-                    if (mapping.equals("0")) {
-                        mapping = "";
-                    }
                     System.out.println("*> Installing schema" + mapping
                                 + ".sql for " + db + " " + idtype);
 

Modified: db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java?rev=1237213&r1=1237212&r2=1237213&view=diff
==============================================================================
--- db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java (original)
+++ db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java Sun Jan 29
08:47:25 2012
@@ -1,39 +1,47 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2006-2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.jdo.exectck;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.Collection;
+import java.util.List;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- *
  * Helper class that sets properties required for running the JDO TCK.
  *
  */
 public class PropertyUtils {
 
     /**
-     * Separates white space separated items from a String into HashSet entries
+     * Separates white space separated items from a String into Collection entries
      * Used to collect command line argument lists into a Collection
      *
      * @param names String of white space separated items
      * @param list  HashSet to contain String items
      */
-    public static void string2Set(String names, HashSet<String> list) {
-//        System.out.println("names are " + names);
+    public static void string2Set(String names, Collection<String> list) {
         String[] items = names.split("[ \t\n]");
         for (String s : items) {
             list.add(s);
         }
-//        System.out.println("List names are " + list.toString());
     }
 
     /**
@@ -43,7 +51,7 @@ public class PropertyUtils {
      * @param names String of white space separated items
      * @param list  HashSet to contain String items
      */
-    public static void string2List(String names, ArrayList<String> list) {
+    public static void string2List(String names, List<String> list) {
 //        System.out.println("names are " + names);
         String[] items = names.split("[ \t\n]");
         for (String s : items) {
@@ -54,13 +62,13 @@ public class PropertyUtils {
 
     /**
      * Parses a set of config files for the mapping entry and
-     * provides the mapping values in a HashSet<String>.
+     * provides the mapping values in a Collection<String>.
      * @param cfglist config file names
      * @param confDir directory where config files are found
      * @param mappings object to containg mapping values
      */
-    public static void mappingsSet(HashSet<String> cfglist, String confDir,
-            HashSet<String> mappings) {
+    public static void mappingsSet(Collection<String> cfglist, String confDir,
+            Collection<String> mappings) {
 
         for (String cfg : cfglist) {
             String mapping = "";
@@ -94,8 +102,6 @@ public class PropertyUtils {
      * Open a properties file and return a Properties object
      */
     public static Properties getProperties(String fname){
-//        System.out.println("Goal RunTCK, getProperties: parsing properties from "
-//                + fname);
         Properties props = new Properties();
         FileInputStream fis = null;
             try {

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=1237213&r1=1237212&r2=1237213&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 08:47:25
2012
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2006-2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.jdo.exectck;
 
 import java.io.BufferedWriter;
@@ -9,7 +24,6 @@ import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
@@ -17,7 +31,6 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.apache.commons.io.FileUtils;
 import org.apache.jdo.exectck.Utilities.InvocationResult;
-import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 
@@ -30,7 +43,7 @@ import org.apache.maven.plugin.MojoFailu
  * @phase integration-test
  *
  */
-public class RunTCK extends AbstractMojo {
+public class RunTCK extends AbstractTCKMojo {
 
     /**
      * To skip running of TCK, set to false.
@@ -54,34 +67,6 @@ public class RunTCK extends AbstractMojo
      */
     private boolean debugTCK;
     /**
-     * Location of TCK generated output.
-     * @parameter expression="${project.build.directory}"
-     *      default-value="${basedir}/target"
-     * @required
-     */
-    private String buildDirectory;
-    /**
-     * Location of the logs directory.
-     * @parameter expression="${project.log.directory}"
-     *      default-value="${project.build.directory}/logs"
-     * @required
-     */
-    private File logsDirectory;
-    /**
-     * Location of the configuration directory.
-     * @parameter expression="${project.conf.directory}"
-     *      default-value="${basedir}/src/conf"
-     * @required
-     */
-    private String confDirectory;
-    /**
-     * Location of the configuration directory.
-     * @parameter expression="${project.sql.directory}"
-     *      default-value="${basedir}/src/sql"
-     * @required
-     */
-    private String sqlDirectory;
-    /**
      * Implementation to be tested (jdori or iut).
      * Any value other than "jdori" will test an appropriately configured IUT
      * @parameter expression="${jdo.tck.impl}"
@@ -103,22 +88,7 @@ public class RunTCK extends AbstractMojo
      * @required
      */
     private String iutLibsDirectory;
-    /**
-     * List of configuration files, each describing a test configuration.
-     * Note: Collection can only be configured in pom.xml. Using multi-valued
-     *       type because long String cannot be broken across lines in pom.xml.
-     * @parameter
-     * @optional
-     */
-    private ArrayList<String> cfgs;
-    /**
-     * List of configuration files, each describing a test configuration.
-     * Allows command line override of configured cfgs value.
-     * @parameter expression="${jdo.tck.cfglist}"
-     * default-value="company1-1Relationships.conf company1-MRelationships.conf companyAnnotated1-1RelationshipsFCPM.conf
companyAnnotated1-MRelationshipsFCPM.conf companyAnnotatedAllRelationshipsFCConcrete.conf
companyAnnotatedAllRelationshipsFCPM.conf companyAnnotatedAllRelationshipsJPAConcrete.conf
companyAnnotatedAllRelationshipsJPAPM.conf companyAnnotatedAllRelationshipsPCConcrete.conf
companyAnnotatedAllRelationshipsPCPM.conf companyAnnotatedAllRelationshipsPIPM.conf companyAnnotatedEmbeddedFCPM.conf
companyAnnotatedEmbeddedJPAConcrete.conf companyAnnotatedEmbeddedJPAPM.conf companyAnnotatedM-MRelationshipsFCConcrete.conf
companyAnnotatedM-MRelationshipsFCPM.conf companyAnnotatedNoRelationshipsFCConcrete.conf companyAnnotatedNoRelationshipsFCPM.conf
companyAnnotatedNoRelationshipsPCConcrete.conf companyAnnotatedNoRelationshipsPCPM.conf companyAnnotatedNoRelationshipsPIPM.conf
companyEmbedded.conf companyListWithoutJoin.conf companyMapWithoutJoin.conf companyM-MRelation
 ships.conf companyNoRelationships.conf companyOverrideAnnotatedAllRelationshipsFCPM.conf
companyPMClass.conf companyPMInterface.conf compoundIdentity.conf detach.conf enhancement.conf
extents.conf fetchgroup.conf fetchplan.conf inheritance1.conf inheritance2.conf inheritance3.conf
inheritance4.conf instancecallbacks.conf jdohelper.conf jdoql.conf jdoql1.conf lifecycle.conf
models1.conf models.conf pm.conf pmf.conf query.conf relationshipAllRelationships.conf relationshipNoRelationships.conf
runonce.conf schemaAttributeClass.conf schemaAttributeOrm.conf schemaAttributePackage.conf
security.conf transactions.conf"
-     * @optional
-     */
-    private String cfgList;
+
     /**
      * Name of file in src/conf containing pmf properties.
      * @parameter expression="${jdo.tck.pmfproperties}"
@@ -134,27 +104,7 @@ public class RunTCK extends AbstractMojo
      * @required
      */
     private String exclude;
-    /**
-     * List of databases to run tests under.
-     * Currently only derby is supported.
-     * @parameter expression="${jdo.tck.dblist}"
-     *      default-value="derby"
-     * @required
-     */
-    private String dblist;
-    private HashSet<String> dbs;
-    /**
-     * List of identity types to be tested.
-     * @parameter expression="${jdo.tck.identitytypes}"
-     *      default-value="applicationidentity datastoreidentity"
-     * @required
-     */
-    private String identitytypes;
-    private HashSet<String> idtypes;
-    /**
-     * List of mappings required by the current configuration
-     */
-    private HashSet<String> mappings;
+
     /**
      * Run the TCK tests in verbose mode.
      * @parameter expression="${jdo.tck.verbose}
@@ -190,13 +140,7 @@ public class RunTCK extends AbstractMojo
      * @optional
      */
     private String jvmproperties;
-    /**
-     * The port number the JVM should listen for a debugger on.
-     * @parameter expression="${jdo.tck.debug.port}"
-     *      default-value="8787"
-     * @optional
-     */
-    private String debugPort;
+
     /**
      * User-supplied arguments for debug directives.
      * @parameter expression="${jdo.tck.debug.jvmargs}"
@@ -237,9 +181,6 @@ public class RunTCK extends AbstractMojo
             return;
         }
 
-        dbs = new HashSet();
-        idtypes = new HashSet();
-        mappings = new HashSet();
         Properties props = null;
         boolean alreadyran = false;
         String runonce = "false";
@@ -253,17 +194,25 @@ public class RunTCK extends AbstractMojo
         if (impl.equals("iut")) {
             pmfProperties="iut-pmf.properties";
         }
-        if (cfgs != null) {
-//            System.out.println("Configurations specified in cfgs are " + cfgs.toString());
-        } else if (cfgList != null) {
-            cfgs = new ArrayList();
-            PropertyUtils.string2List(cfgList, cfgs);
-//            System.out.println("Configurations are " + cfgs.toString());
-        } else {
-            throw new MojoExecutionException(
-                    "Could not find configurations to run TCK. "
-                    + "Set cfgList parameter on command line "
-                    + "or cfgs in pom.xml.");
+
+        if (cfgs == null) {
+            if (cfgList != null) {
+                cfgs = new ArrayList<String>();
+                PropertyUtils.string2List(cfgList, (List<String>)cfgs);
+            } else {
+            	// Fallback to "src/conf/configurations.list"
+            	setCfgListFromFile();
+                if (cfgList != null) {
+                    cfgs = new ArrayList<String>();
+                    PropertyUtils.string2List(cfgList, (List<String>)cfgs);
+                }
+
+                if (cfgList == null) {
+                    throw new MojoExecutionException(
+                        "Could not find configurations to run TCK. " +
+                        "Set cfgList parameter on command line or cfgs in pom.xml");
+            	}
+            }
         }
 
         PropertyUtils.string2Set(dblist, dbs);



Mime
View raw message