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 mc...@apache.org on 2010/12/18 23:37:59 UTC
svn commit: r1050727 - in /db/jdo/trunk/exectck: ./ pom.xml
src/main/java/org/apache/jdo/exectck/Enhance.java
src/main/java/org/apache/jdo/exectck/RunTCK.java
Author: mcaisse
Date: Sat Dec 18 22:37:59 2010
New Revision: 1050727
URL: http://svn.apache.org/viewvc?rev=1050727&view=rev
Log:
JDO-647 - Fix pom.xml. Can't trim if string may be null. Put ext/lib onclasspath. Copy jdoconfig.xml, persistence.xml to classes/META_INF.
Modified:
db/jdo/trunk/exectck/ (props changed)
db/jdo/trunk/exectck/pom.xml
db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
db/jdo/trunk/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
Propchange: db/jdo/trunk/exectck/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Dec 18 22:37:59 2010
@@ -0,0 +1 @@
+.RunTCK.java.sav.swp
Modified: db/jdo/trunk/exectck/pom.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/exectck/pom.xml?rev=1050727&r1=1050726&r2=1050727&view=diff
==============================================================================
--- db/jdo/trunk/exectck/pom.xml (original)
+++ db/jdo/trunk/exectck/pom.xml Sat Dec 18 22:37:59 2010
@@ -54,7 +54,7 @@
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
- <version>2.2.0-m3e</version>
+ <version>2.2.0-m3</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
@@ -64,12 +64,12 @@
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-enhancer</artifactId>
- <version>2.1.2-release</version>
+ <version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jpa</artifactId>
- <version>2.1.3-release</version>
+ <version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
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=1050727&r1=1050726&r2=1050727&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 Sat Dec 18 22:37:59 2010
@@ -102,8 +102,6 @@ public class Enhance extends AbstractMoj
+ enhancedDir);
}
-
-
String[] pcPkgNames = {"org/apache/jdo/tck/api/",
"org/apache/jdo/tck/pc/",
"org/apache/jdo/tck/models/inheritance/"};
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=1050727&r1=1050726&r2=1050727&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 Sat Dec 18 22:37:59 2010
@@ -90,6 +90,13 @@ public class RunTCK extends AbstractMojo
*/
private String impl;
/**
+ * Location of third party libraries such as JNDI.
+ * @parameter expression="${project.lib.ext.directory}"
+ * default-value="${basedir}/../lib/ext"
+ * @required
+ */
+ private String extLibsDirectory;
+ /**
* 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.
@@ -217,6 +224,8 @@ public class RunTCK extends AbstractMojo
List<String> command;
String cpString = null;
InvocationResult result;
+ File fromFile = null;
+ File toFile = null;
if (cfgs != null) {
// System.out.println("Configurations specified in cfgs are " + cfgs.toString());
@@ -233,7 +242,7 @@ public class RunTCK extends AbstractMojo
PropertyUtils.string2Set(dblist, dbs);
PropertyUtils.string2Set(identitytypes, idtypes);
- System.out.println("*>TCK to be run for " + impl
+ System.out.println("*>TCK to be run for implementation " + impl
+ " on \n configurations: "
+ cfgs.toString() + "\n databases: " + dbs.toString()
+ "\n identity types: " + identitytypes.toString());
@@ -248,7 +257,7 @@ public class RunTCK extends AbstractMojo
+ "classes" + File.separator + pmfProperties);
String excludeFile = confDirectory + File.separator + exclude;
propsString.add("-Djdo.tck.exclude="
- + PropertyUtils.getProperties(excludeFile).getProperty("jdo.tck.exclude").trim());
+ + PropertyUtils.getProperties(excludeFile).getProperty("jdo.tck.exclude"));
// Create configuration log directory
String timestamp = Utilities.now();
@@ -262,6 +271,22 @@ public class RunTCK extends AbstractMojo
}
propsString.add("-Djdo.tck.log.directory=" + thisLogDir);
+ // Copy JDO config files to classes dir
+ try {
+ fromFile = new File(confDirectory + File.separator + impl + "-jdoconfig.xml");
+ toFile = new File(buildDirectory + File.separator + "classes" +
+ File.separator + "META-INF" + File.separator + "jdoconfig.xml");
+ System.out.println("Copying from " + fromFile + " to " + toFile);
+ FileUtils.copyFile(fromFile, toFile);
+ fromFile = new File(confDirectory + File.separator + impl + "-persistence.xml");
+ toFile = new File(buildDirectory + File.separator + "classes" +
+ File.separator + "META-INF" + File.separator + "persistence.xml");
+ System.out.println("Copying from " + fromFile + " to " + toFile);
+ FileUtils.copyFile(fromFile, toFile);
+ } catch (IOException ex) {
+ Logger.getLogger(RunTCK.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
// Get ClassLoader URLs to build classpath below
URL[] cpURLs = ((URLClassLoader) Thread.currentThread().getContextClassLoader()).getURLs();
ArrayList<URL> urlList = new ArrayList<URL>(Arrays.asList(cpURLs));
@@ -298,6 +323,13 @@ public class RunTCK extends AbstractMojo
+ "classes" + File.separator).toURI().toURL();
cpList.add(url1);
cpList.add(url2);
+ String[] jars = {"jar"};
+ Iterator<File> fi = FileUtils.iterateFiles(
+ new File(extLibsDirectory), jars, true);
+ while (fi.hasNext()) {
+ cpList.add(fi.next().toURI().toURL());
+ }
+
} catch (MalformedURLException ex) {
ex.printStackTrace();
Logger.getLogger(RunTCK.class.getName()).log(Level.SEVERE, null, ex);
@@ -313,23 +345,23 @@ public class RunTCK extends AbstractMojo
props = PropertyUtils.getProperties(confDirectory
+ File.separator + cfg);
propsString.add("-Djdo.tck.testdata="
- + props.getProperty("jdo.tck.testdata").trim());
+ + props.getProperty("jdo.tck.testdata"));
propsString.add("-Djdo.tck.standarddata="
- + props.getProperty("jdo.tck.standarddata").trim());
+ + props.getProperty("jdo.tck.standarddata"));
propsString.add("-Djdo.tck.mapping.companyfactory="
- + props.getProperty("jdo.tck.mapping.companyfactory").trim());
+ + props.getProperty("jdo.tck.mapping.companyfactory"));
// propsString.append("-Djdo.tck.description=\"" +
-// props.getProperty("jdo.tck.description").trim() + "\"");
+// props.getProperty("jdo.tck.description") + "\"");
propsString.add("-Djdo.tck.requiredOptions="
- + props.getProperty("jdo.tck.requiredOptions").trim());
+ + props.getProperty("jdo.tck.requiredOptions"));
propsString.add("-Djdo.tck.signaturefile="
+ signaturefile);
- String mapping = props.getProperty("jdo.tck.mapping").trim();
+ String mapping = props.getProperty("jdo.tck.mapping");
if (mapping == null) {
throw new MojoExecutionException(
"Could not find mapping value in conf file: " + cfg);
}
- String classes = props.getProperty("jdo.tck.classes").trim();
+ String classes = props.getProperty("jdo.tck.classes");
if (classes == null) {
throw new MojoExecutionException(
"Could not find classes value in conf file: " + cfg);
@@ -340,7 +372,7 @@ public class RunTCK extends AbstractMojo
propsString.add("-Djdo.tck.schemaname=" + idtype + mapping);
propsString.add("-Djdo.tck.cfg=" + cfg);
- runonce = props.getProperty("runonce").trim();
+ runonce = props.getProperty("runonce");
runonce = (runonce == null) ? "false" : runonce;
// Add Mapping and schemaname to properties file
@@ -423,8 +455,6 @@ public class RunTCK extends AbstractMojo
String fromDirName = buildDirectory + File.separator + "enhanced"
+ File.separator + impl + File.separator + idtype + File.separator;
String[] metadataExtensions = {"jdo", "jdoquery", "orm", "xml", "properties"};
- File fromFile = null;
- File toFile = null;
String fromFileName = null;
String pkgName = null;
int startIdx = -1;