db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r279108 - in /db/torque/test/trunk/base: ./ src/ src/java/org/apache/torque/ src/java/org/apache/torque/engine/database/transform/ src/runtime/ src/schema/ src/sql/
Date Tue, 06 Sep 2005 21:04:45 GMT
Author: tfischer
Date: Tue Sep  6 14:04:30 2005
New Revision: 279108

URL: http://svn.apache.org/viewcvs?rev=279108&view=rev
Log:
An alternative to the test-plugin for maven. Documentation will follow.

Added:
    db/torque/test/trunk/base/   (with props)
    db/torque/test/trunk/base/maven.xml
      - copied, changed from r278825, db/torque/test/trunk/maven-test-plugin/plugin.jelly
    db/torque/test/trunk/base/project.properties
      - copied, changed from r278825, db/torque/test/trunk/maven-test-plugin/plugin.properties
    db/torque/test/trunk/base/project.xml
      - copied, changed from r278825, db/torque/test/trunk/profile/mysql/project.xml
    db/torque/test/trunk/base/src/
      - copied from r278825, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/
    db/torque/test/trunk/base/src/schema/bookstore-schema.xml
      - copied unchanged from r279091, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/bookstore-schema.xml
    db/torque/test/trunk/base/src/schema/ext-schema.xml
      - copied unchanged from r279091, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/ext-schema.xml
    db/torque/test/trunk/base/src/schema/extext-schema.xml
      - copied unchanged from r279091, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/extext-schema.xml
    db/torque/test/trunk/base/src/schema/id-table-schema.xml
      - copied unchanged from r279091, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/id-table-schema.xml
    db/torque/test/trunk/base/src/schema/test-schema.xml
      - copied unchanged from r279091, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/test-schema.xml
    db/torque/test/trunk/base/src/sql/
      - copied from r278838, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/sql/
    db/torque/test/trunk/base/src/sql/schema.sql
      - copied unchanged from r278839, db/torque/test/trunk/maven-test-plugin/src/plugin-resources/sql/schema.sql
Removed:
    db/torque/test/trunk/base/src/runtime/
Modified:
    db/torque/test/trunk/base/src/java/org/apache/torque/BaseRuntimeTestCase.java
    db/torque/test/trunk/base/src/java/org/apache/torque/engine/database/transform/SQLToAppDataRuntimeTest.java

Propchange: db/torque/test/trunk/base/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Sep  6 14:04:30 2005
@@ -0,0 +1,3 @@
+target
+velocity.log
+build.properties

Copied: db/torque/test/trunk/base/maven.xml (from r278825, db/torque/test/trunk/maven-test-plugin/plugin.jelly)
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/base/maven.xml?p2=db/torque/test/trunk/base/maven.xml&p1=db/torque/test/trunk/maven-test-plugin/plugin.jelly&r1=278825&r2=279108&rev=279108&view=diff
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/plugin.jelly (original)
+++ db/torque/test/trunk/base/maven.xml Tue Sep  6 14:04:30 2005
@@ -27,18 +27,50 @@
 
 <project
   xmlns:j="jelly:core"
+  xmlns:maven="jelly:maven"
   default="base:test">
 
-  <goal name="torque:run-test">
-    <attainGoal name="torque:test:test"/>
-    <attainGoal name="torque:test:post-test"/>
+  <goal name="torque-test:run">
+    <attainGoal name="torque-test:test"/>
+    <attainGoal name="torque-test:post-test"/>
   </goal>
 
-  <goal name="torque:test:prepare">
-  
-    <copy todir="${torque.home}/src">
-      <fileset dir="${plugin.resources}">
-        <include name="schema/*" />
+  <goal name="torque-test:prepare">
+    <property file="../profile/${torque.test.profile}/build.properties" />
+    <property file="../profile/${torque.test.profile}/project.properties" />
+    
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.database.createUrl" 
+      value="${torque.database.createUrl}" />
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.database.buildUrl" 
+      value="${torque.database.buildUrl}" />
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.generateBeans" 
+      value="${torque.generateBeans}" />
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.database" 
+      value="${torque.database}" />
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.database.driver" 
+      value="${torque.database.driver}" />
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.database.user" 
+      value="${torque.database.user}" />
+    <maven:set 
+      plugin="maven-torque-plugin" 
+      property="torque.database.password" 
+      value="${torque.database.password}" />
+
+    <copy todir="${torque.schema.dir}">
+      <fileset dir="src/schema">
+        <include name="*" />
       </fileset>
       <filterset>
         <filter token="DATABASE_DEFAULT" value="${torque.project}"/>
@@ -47,8 +79,8 @@
     </copy>
   </goal>
   
-  <goal name="torque:test:pre-test"
-      prereqs="torque:test:prepare">
+  <goal name="torque-test:pre-test"
+      prereqs="torque-test:prepare">
     <attainGoal name="torque:doc"/>
     <attainGoal name="torque:create-db"/>
     <attainGoal name="torque:sql"/>
@@ -56,69 +88,62 @@
     <attainGoal name="torque:insert-sql"/>
     <attainGoal name="torque:om"/>
     
-    <copy todir="${torque.home}/src/java">
-      <fileset dir="${plugin.resources}/java" />
-    </copy>
-    
-    <mkdir dir="${torque.compile.build.dir}" />
+    <mkdir dir="${torque.test.compile.dir}" />
     <javac
       debug="${torque.compile.debug}"
       deprecation="${torque.compile.deprecation}"
-      destdir="${torque.compile.build.dir}"
+      destdir="${torque.test.compile.dir}"
       optimize="${torque.compile.optimize}"
       srcdir="${torque.java.dir}">
       <classpath refid="maven.dependency.classpath"/>
     </javac>
+    
+    <javac
+      debug="${torque.compile.debug}"
+      deprecation="${torque.compile.deprecation}"
+      destdir="${torque.test.compile.dir}"
+      optimize="${torque.compile.optimize}"
+      srcdir="${torque.test.junit.src.dir}">
+      <classpath>
+        <pathelement location="${torque.test.compile.dir}"/>
+        <path refid="maven.dependency.classpath"/>
+      </classpath>
+    </javac>
   </goal>
   
-  <goal name="torque:test:test"
-     prereqs="torque:test:pre-test">
-    
-    <copy 
-      todir="${torque.home}" 
-      file="${plugin.resources}/runtime/Torque.properties">
-      <filterset>
-        <filter token="DATABASE" value="${torque.database}"/>
-        <filter token="DATABASE_DEFAULT" value="${torque.project}"/>
-        <filter token="DATABASE_URL" value="${torque.database.url}"/>
-        <filter token="DATABASE_USER" value="${torque.database.user}"/>
-        <filter token="DATABASE_DRIVER" value="${torque.database.driver}"/>
-        <filter token="DATABASE_PASSWORD" value="${torque.database.password}"/>
-      </filterset>
-    </copy>
-     
-    <copy 
-      todir="${torque.home}" 
-      file="${plugin.resources}/logging/log4j.properties" />
-     
+  <goal name="torque-test:test"
+     prereqs="torque-test:pre-test">
+         
     <taskdef
       name="junit"
       classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" />      
     
-    <mkdir dir="${torque.log.dir}" />
-    <mkdir dir="${torque.junit.report.dir}" />
+    <mkdir dir="${torque.test.log.dir}" />
+    <mkdir dir="${torque.test.junit.report.dir}" />
     <junit printsummary="no" haltonfailure="yes" fork="true">
+      <sysproperty 
+        key="torque.configuration.file" 
+        value="../profile/${torque.test.profile}/Torque.properties" />
       <classpath>
-        <pathelement location="${torque.compile.build.dir}"/>
+        <pathelement location="${torque.test.compile.dir}"/>
         <path refid="maven.dependency.classpath"/>
       </classpath>
 
       <formatter type="xml"/>
       <formatter type="plain" usefile="false"/>
 
-      <batchtest todir="${torque.junit.report.dir}">
-        <fileset dir="${torque.compile.build.dir}">
-          <include name="**/*Test.class"/>
-          <exclude name="**/test/**/*.class"/>
-          <exclude name="**/LargeSelectTest.class"/>
+      <batchtest todir="${torque.test.junit.report.dir}">
+        <fileset dir="${torque.test.junit.src.dir}">
+          <include name="**/*Test.java"/>
+          <exclude name="**/test/**/*.java"/>
+          <exclude name="**/LargeSelectTest.java"/>
         </fileset>
       </batchtest>
     </junit>
-    <echo>junit completed</echo>
   </goal>
   
   
-  <goal name="torque:test:post-test">
+  <goal name="torque-test:post-test">
 
     <attainGoal name="torque:datadtd"/>
     <attainGoal name="torque:datadump"/>

Copied: db/torque/test/trunk/base/project.properties (from r278825, db/torque/test/trunk/maven-test-plugin/plugin.properties)
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/base/project.properties?p2=db/torque/test/trunk/base/project.properties&p1=db/torque/test/trunk/maven-test-plugin/plugin.properties&r1=278825&r2=279108&rev=279108&view=diff
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/plugin.properties (original)
+++ db/torque/test/trunk/base/project.properties Tue Sep  6 14:04:30 2005
@@ -2,16 +2,13 @@
 # ${basedir}/target/tests/base in order to be able
 # to do the filtering. This must be made known
 # to the maven-plugin
-torque.home=${basedir}/target/tests/base
-torque.output.dir=${torque.home}/target
-torque.schema.dir=${torque.home}/src/schema
-torque.java.dir = ${torque.home}/src/java
-torque.ojb.dir = ${torque.home}/src/ojb
-
 #settings for the generator
 torque.project = bookstore
 torque.targetPackage = org.apache.torque.test
 
-torque.compile.build.dir=${torque.home}/target/classes
-torque.log.dir=${torque.home}/target/logs
-torque.junit.report.dir=${torque.home}/target/reports
+torque.java.dir=target/java 
+torque.schema.dir=target/schema 
+torque.test.compile.dir=target/classes
+torque.test.log.dir=target/logs
+torque.test.junit.src.dir=src/java
+torque.test.junit.report.dir=target/reports

Copied: db/torque/test/trunk/base/project.xml (from r278825, db/torque/test/trunk/profile/mysql/project.xml)
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/base/project.xml?p2=db/torque/test/trunk/base/project.xml&p1=db/torque/test/trunk/profile/mysql/project.xml&r1=278825&r2=279108&rev=279108&view=diff
==============================================================================
--- db/torque/test/trunk/profile/mysql/project.xml (original)
+++ db/torque/test/trunk/base/project.xml Tue Sep  6 14:04:30 2005
@@ -1,14 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project>
-  <extend>../base/project.xml</extend>
-  <artifactId>torque-mysql-test</artifactId> 
-  <name>Torque-mysql-test</name>
-  <dependencies>
-    <dependency>
-      <artifactId>mysql-connector-java</artifactId>
-      <groupId>mysql</groupId>
-      <version>3.1.6-bin</version>
-    </dependency> 
-  </dependencies>
+  <extend>../profile/${torque.test.profile}/project.xml</extend>
 </project>
 

Modified: db/torque/test/trunk/base/src/java/org/apache/torque/BaseRuntimeTestCase.java
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/base/src/java/org/apache/torque/BaseRuntimeTestCase.java?rev=279108&r1=278825&r2=279108&view=diff
==============================================================================
--- db/torque/test/trunk/base/src/java/org/apache/torque/BaseRuntimeTestCase.java (original)
+++ db/torque/test/trunk/base/src/java/org/apache/torque/BaseRuntimeTestCase.java Tue Sep
 6 14:04:30 2005
@@ -27,9 +27,9 @@
  */
 public abstract class BaseRuntimeTestCase extends TestCase
 {
-    /** The path to the configuration file. */
-    private static final String CONFIG_FILE
-            = "target/test/rttest/Torque.properties";
+    /** The system property containing the path to the configuration file. */
+    private static final String CONFIG_FILE_SYSTEM_PROPERTY
+            = "torque.configuration.file";
 
     /** Whether torque has been initialized. */
     static boolean hasInitialized = false;
@@ -54,7 +54,9 @@
             {
                 try
                 {
-                    Torque.init(CONFIG_FILE);
+                    Torque.init(
+                            System.getProperty(
+                                    CONFIG_FILE_SYSTEM_PROPERTY));
                     hasInitialized = true;
                 }
                 catch (Exception e)

Modified: db/torque/test/trunk/base/src/java/org/apache/torque/engine/database/transform/SQLToAppDataRuntimeTest.java
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/base/src/java/org/apache/torque/engine/database/transform/SQLToAppDataRuntimeTest.java?rev=279108&r1=278825&r2=279108&view=diff
==============================================================================
--- db/torque/test/trunk/base/src/java/org/apache/torque/engine/database/transform/SQLToAppDataRuntimeTest.java
(original)
+++ db/torque/test/trunk/base/src/java/org/apache/torque/engine/database/transform/SQLToAppDataRuntimeTest.java
Tue Sep  6 14:04:30 2005
@@ -39,7 +39,7 @@
 public class SQLToAppDataRuntimeTest extends BaseRuntimeTestCase
 {
     /** The path to the configuration file. */
-    private static final String SQL_FOLDER = "target/test/rttest/sql";
+    private static final String SQL_FOLDER = "src/sql";
 
     private Vector files;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message