db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r278825 - in /db/torque/test: ./ trunk/ trunk/maven-test-plugin/ trunk/maven-test-plugin/src/ trunk/maven-test-plugin/src/plugin-resources/ trunk/maven-test-plugin/src/plugin-resources/java/ trunk/maven-test-plugin/src/plugin-resources/java...
Date Mon, 05 Sep 2005 20:19:19 GMT
Author: tfischer
Date: Mon Sep  5 13:19:05 2005
New Revision: 278825

URL: http://svn.apache.org/viewcvs?rev=278825&view=rev
Log:
created structure for refactoring the runtimetest into an extra test
module

Added:
    db/torque/test/
    db/torque/test/trunk/
    db/torque/test/trunk/maven-test-plugin/   (with props)
    db/torque/test/trunk/maven-test-plugin/plugin.jelly
    db/torque/test/trunk/maven-test-plugin/plugin.properties
    db/torque/test/trunk/maven-test-plugin/project.xml
    db/torque/test/trunk/maven-test-plugin/src/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/
      - copied from r278819, db/torque/runtime/trunk/src/rttest/org/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/logging/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/logging/log4j.properties
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/runtime/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/runtime/Torque.properties
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/bookstore-schema.xml
      - copied unchanged from r278819, db/torque/runtime/trunk/src/rttest/bookstore-schema.xml
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/ext-schema.xml
      - copied unchanged from r278819, db/torque/runtime/trunk/src/rttest/ext-schema.xml
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/extext-schema.xml
      - copied unchanged from r278819, db/torque/runtime/trunk/src/rttest/extext-schema.xml
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/id-table-schema.xml
      - copied unchanged from r278819, db/torque/runtime/trunk/src/rttest/id-table-schema.xml
    db/torque/test/trunk/maven-test-plugin/src/plugin-resources/schema/test-schema.xml
      - copied unchanged from r278819, db/torque/runtime/trunk/src/rttest/test-schema.xml
    db/torque/test/trunk/profile/
    db/torque/test/trunk/profile/base/
    db/torque/test/trunk/profile/base/maven.xml
    db/torque/test/trunk/profile/base/project.xml
    db/torque/test/trunk/profile/mysql/   (with props)
    db/torque/test/trunk/profile/mysql/project.properties
    db/torque/test/trunk/profile/mysql/project.xml

Propchange: db/torque/test/trunk/maven-test-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep  5 13:19:05 2005
@@ -0,0 +1,3 @@
+build.properties
+jcoverage.ser
+target

Added: db/torque/test/trunk/maven-test-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/maven-test-plugin/plugin.jelly?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/plugin.jelly (added)
+++ db/torque/test/trunk/maven-test-plugin/plugin.jelly Mon Sep  5 13:19:05 2005
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2001-2004 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.
+ */
+ -->
+
+<!-- ======================================================================== -->
+<!--                                                                          -->
+<!--  maven Buildfile                                                         -->
+<!--                                                                          -->
+<!-- $Id: maven.xml 239655 2005-08-24 13:13:22Z henning $ -->
+<!--                                                                          -->
+<!-- ======================================================================== -->
+
+<project
+  xmlns:j="jelly:core"
+  default="base:test">
+
+  <goal name="torque:run-test">
+    <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/*" />
+      </fileset>
+      <filterset>
+        <filter token="DATABASE_DEFAULT" value="${torque.project}"/>
+        <filter token="DATABASE_ID_METHOD" value="${torque.test.base.idMethod}"/> 
+      </filterset>
+    </copy>
+  </goal>
+  
+  <goal name="torque:test:pre-test"
+      prereqs="torque:test:prepare">
+    <attainGoal name="torque:doc"/>
+    <attainGoal name="torque:create-db"/>
+    <attainGoal name="torque:sql"/>
+    <attainGoal name="torque:id-table-init-sql"/>
+    <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}" />
+    <javac
+      debug="${torque.compile.debug}"
+      deprecation="${torque.compile.deprecation}"
+      destdir="${torque.compile.build.dir}"
+      optimize="${torque.compile.optimize}"
+      srcdir="${torque.java.dir}">
+      <classpath refid="maven.dependency.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" />
+     
+    <taskdef
+      name="junit"
+      classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" />      
+    
+    <mkdir dir="${torque.log.dir}" />
+    <mkdir dir="${torque.junit.report.dir}" />
+    <junit printsummary="no" haltonfailure="yes" fork="true">
+      <classpath>
+        <pathelement location="${torque.compile.build.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"/>
+        </fileset>
+      </batchtest>
+    </junit>
+    <echo>junit completed</echo>
+  </goal>
+  
+  
+  <goal name="torque:test:post-test">
+
+    <attainGoal name="torque:datadtd"/>
+    <attainGoal name="torque:datadump"/>
+    
+    <!-- copy files generated by torque:datadump and torque:datadtd
+         to directory where it can be read by torque:datasql -->
+    <copy file="${torque.output.dir}/bookstore-bookstore-all-data.xml"
+      toFile="${torque.schema.dir}/bookstore-data.xml" />
+    <copy file="${torque.output.dir}/bookstore-data.dtd"
+      toDir="${torque.schema.dir}" />
+      
+    <attainGoal name="torque:datasql"/>
+    <attainGoal name="torque:jdbc"/>
+  </goal>  
+</project>
\ No newline at end of file

Added: db/torque/test/trunk/maven-test-plugin/plugin.properties
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/maven-test-plugin/plugin.properties?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/plugin.properties (added)
+++ db/torque/test/trunk/maven-test-plugin/plugin.properties Mon Sep  5 13:19:05 2005
@@ -0,0 +1,17 @@
+# we copy the complete source for the project to
+# ${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

Added: db/torque/test/trunk/maven-test-plugin/project.xml
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/maven-test-plugin/project.xml?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/project.xml (added)
+++ db/torque/test/trunk/maven-test-plugin/project.xml Mon Sep  5 13:19:05 2005
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <pomVersion>3</pomVersion> 
+  <artifactId>maven-torque-test-plugin</artifactId> 
+  <groupId>torque</groupId> 
+  <name>Maven-torque-test-plugin</name>
+  <currentVersion>3.2-rc2-dev</currentVersion>
+  <dependencies>
+
+    <dependency>
+      <artifactId>torque</artifactId>
+      <groupId>torque</groupId>
+      <version>${pom.currentVersion}</version>
+    </dependency>
+
+    <dependency>
+      <artifactId>torque-gen</artifactId>
+      <groupId>torque</groupId>
+      <version>${pom.currentVersion}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <properties>
+        <classloader>root</classloader>
+      </properties>
+    </dependency>
+
+    <dependency>
+      <artifactId>log4j</artifactId>
+      <groupId>log4j</groupId>
+      <version>1.2.8</version>
+    </dependency>
+
+  </dependencies>
+  
+  <build>
+    <resources> 
+      <resource> 
+        <directory>${basedir}/src/plugin-resources</directory> 
+        <targetPath>plugin-resources</targetPath> 
+      </resource> 
+      <resource> 
+        <directory>${basedir}</directory> 
+        <includes> 
+          <include>plugin.jelly</include> 
+          <include>plugin.properties</include> 
+          <include>project.properties</include> 
+          <include>project.xml</include> 
+        </includes> 
+      </resource> 
+    </resources> 
+  </build>
+</project>
+

Added: db/torque/test/trunk/maven-test-plugin/src/plugin-resources/logging/log4j.properties
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/maven-test-plugin/src/plugin-resources/logging/log4j.properties?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/src/plugin-resources/logging/log4j.properties (added)
+++ db/torque/test/trunk/maven-test-plugin/src/plugin-resources/logging/log4j.properties Mon
Sep  5 13:19:05 2005
@@ -0,0 +1,29 @@
+# Copyright 2001-2005 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.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id: log4j.properties 239624 2005-08-24 12:18:03Z henning $
+#
+# ------------------------------------------------------------------------
+
+log4j.rootLogger = DEBUG, torque
+
+log4j.appender.torque = org.apache.log4j.FileAppender
+log4j.appender.torque.file = target/tests/base/target/logs/base-test.log
+log4j.appender.torque.append = false
+log4j.appender.torque.layout = org.apache.log4j.PatternLayout
+log4j.appender.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
\ No newline at end of file

Added: db/torque/test/trunk/maven-test-plugin/src/plugin-resources/runtime/Torque.properties
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/maven-test-plugin/src/plugin-resources/runtime/Torque.properties?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/maven-test-plugin/src/plugin-resources/runtime/Torque.properties
(added)
+++ db/torque/test/trunk/maven-test-plugin/src/plugin-resources/runtime/Torque.properties
Mon Sep  5 13:19:05 2005
@@ -0,0 +1,9 @@
+torque.database.default = @DATABASE_DEFAULT@
+torque.database.bookstore.adapter = @DATABASE@
+
+#Using commons-dbcp
+torque.dsfactory.bookstore.factory = org.apache.torque.dsfactory.SharedPoolDataSourceFactory
+torque.dsfactory.bookstore.connection.driver = @DATABASE_DRIVER@
+torque.dsfactory.bookstore.connection.url = @DATABASE_URL@
+torque.dsfactory.bookstore.connection.user = @DATABASE_USER@
+torque.dsfactory.bookstore.connection.password = @DATABASE_PASSWORD@

Added: db/torque/test/trunk/profile/base/maven.xml
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/profile/base/maven.xml?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/profile/base/maven.xml (added)
+++ db/torque/test/trunk/profile/base/maven.xml Mon Sep  5 13:19:05 2005
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2001-2004 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.
+ */
+ -->
+
+<!-- ======================================================================== -->
+<!--                                                                          -->
+<!--  maven Buildfile                                                         -->
+<!--                                                                          -->
+<!-- $Id: maven.xml 239655 2005-08-24 13:13:22Z henning $ -->
+<!--                                                                          -->
+<!-- ======================================================================== -->
+
+<project
+  xmlns:maven="jelly:maven"
+  default="build">
+
+  <goal 
+    name="torque:build-run-test" 
+    description="Build Torque and run the test">
+    <maven:reactor
+      basedir="../../../.."
+      includes="templates/project.xml,generator/project.xml,runtime/project.xml"
+      excludes=""
+      goals="jar:install"
+      ignoreFailures="false"
+    />  
+    
+    <attainGoal name="torque:run-test" />
+  </goal>
+
+  <goal 
+    name="torque:clean-test" 
+    description="Build Torque and run the test">
+    <maven:reactor
+      basedir="../../../.."
+      includes="templates/project.xml,generator/project.xml,runtime/project.xml"
+      excludes=""
+      goals="clean"
+      ignoreFailures="false"
+    />  
+    <attainGoal name="clean" />
+  </goal>
+
+</project>

Added: db/torque/test/trunk/profile/base/project.xml
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/profile/base/project.xml?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/profile/base/project.xml (added)
+++ db/torque/test/trunk/profile/base/project.xml Mon Sep  5 13:19:05 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <extend>../../../../runtime/project.xml</extend>
+  
+  <dependencies>
+    <dependency>
+      <artifactId>torque</artifactId>
+      <groupId>torque</groupId>
+      <version>${pom.currentVersion}</version>
+    </dependency>
+    <dependency>
+      <artifactId>torque-gen</artifactId>
+      <groupId>torque</groupId>
+      <version>${pom.currentVersion}</version>
+    </dependency>
+    <dependency>
+      <artifactId>log4j</artifactId>
+      <groupId>log4j</groupId>
+      <version>1.2.8</version>
+    </dependency>
+  </dependencies>
+</project>
+

Propchange: db/torque/test/trunk/profile/mysql/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep  5 13:19:05 2005
@@ -0,0 +1,2 @@
+build.properties
+target

Added: db/torque/test/trunk/profile/mysql/project.properties
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/profile/mysql/project.properties?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/profile/mysql/project.properties (added)
+++ db/torque/test/trunk/profile/mysql/project.properties Mon Sep  5 13:19:05 2005
@@ -0,0 +1,17 @@
+#settings for the schema file
+torque.test.base.idMethod = idbroker
+
+#settings that will go straight through to the generator
+torque.database.createUrl = jdbc:mysql://localhost:3306/mysql
+torque.database.buildUrl = jdbc:mysql://localhost:3306/bookstore
+torque.generateBeans = true
+
+#settings for both generator and runtime
+torque.database = mysql
+torque.database.driver = org.gjt.mm.mysql.Driver
+torque.database.user = root
+torque.database.password =
+
+#settings for runtime
+torque.database.url = jdbc:mysql://localhost:3306/bookstore
+torque.database.validationQuery = SELECT 1

Added: db/torque/test/trunk/profile/mysql/project.xml
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/profile/mysql/project.xml?rev=278825&view=auto
==============================================================================
--- db/torque/test/trunk/profile/mysql/project.xml (added)
+++ db/torque/test/trunk/profile/mysql/project.xml Mon Sep  5 13:19:05 2005
@@ -0,0 +1,14 @@
+<?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>
+</project>
+



---------------------------------------------------------------------
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