Author: vhalbert(a)redhat.com
Date: 2009-12-17 13:49:48 -0500 (Thu, 17 Dec 2009)
New Revision: 1679
Modified:
trunk/test-integration/db/howto
trunk/test-integration/db/pom.xml
Log:
Teiid 781 - adding option to kit the ctc-client so that this doesn't have to be
rebuilt for every platform that we want to test on (build once - test everywhere)
Modified: trunk/test-integration/db/howto
===================================================================
--- trunk/test-integration/db/howto 2009-12-16 22:35:48 UTC (rev 1678)
+++ trunk/test-integration/db/howto 2009-12-17 18:49:48 UTC (rev 1679)
@@ -20,8 +20,9 @@
you want the connection for
- By default, the datasource assigned to a model will be (somewhat) random. There is not
coding to
- specifically control this assignment, as long as the -Dusedatasources option is not
used.
+ By default, the datasource assigned to a model will be (somewhat) random when starting
the test process. Once the
+ data source is associated with a model, it will be used for the duration of all tests
being performed. To override
+ this behavior, the -Dusedatasources option can be used.
If the -Dusedatasources option is used, then there is an implied model-to-datasource
assignment.
To understand how this assignment will be made, find the config properties file being
@@ -50,38 +51,61 @@
Setting up a Datasource to be used during Testing
==========================================
+NOTE: 2 Datasource directories, each containing a connection.properties file, are
required in order to run the integration tests.
+ Each data source can be pointing to the same database instance, but the schemas must be
different.
+
1. DEFINE DATASOURCE:
To define a datasource, see the readme.txt in src/main/resources/datasources regarding
defining a datasource
-2. CREATE TABLES
- To create the tables on the defined datasource, run the maven profile to execute the
process to create the required tables:
- a. to setup all sources at one time, run:
- mvn pre-integration-test -P setupdatasources -Dmaven.test.skip=true
- b. to setup a specific source,
- run: mvn pre-integration-test -Ddatasource=<datasourcedir> -Psingledatasource
-Dmaven.test.skip=true
- where <datasourcedir> is the name of the directory for the datasource
+2. CREATE TABLES IN A DATASOURCE
+ Options are to setup all data sources at once or setup a single data source.
+
+ a. to setup all data sources at one time, run:
+ mvn -Psetupdatasources
+ b. to setup a specific data source,
+ run: mvn -Ddatasource=<datasourcedir> -Psingledatasource
+ where <datasourcedir> is the name of the directory for the datasource
+
Example:
- mvn pre-integration-test -Ddatasource=oracle -Psingledatasource
-Dmaven.test.skip=true
+ mvn -Ddatasource=oracle -Psingledatasource
==========================================
Executing the db integration tests
==========================================
-The default profile in the pom.xml is set to compile and run the test. The following
are options for running tests:
+The default setup of the pom.xml is to only compile and assemble the
teiid-ctc-test-client jar. The following are different profile
+options for running tests:
- a. Run with no regard to which specific datasource to use (only those with
connections.properties file are considered):
- run: mvn install
- b. To run the tests, but specify which datasource(s) to use:
- run: mvn clean install -Dusedatasources=<comma seperated datasource names>
- Example: mvn clean install -Dusedatasources=oracle,sqlserver
+ a. Run All Tests: Run all tests with no regard to which specific datasource to use
(only those with connections.properties file are considered):
+
+ run: mvn install -Prunalltests
+ b. Run a Single Test: Run one test class with no regard to which specific datasource to
use
+
+ run: mvn install -Prunsingletest -Dclassname=<classname>
+
+ Example: mvn install -Prunsingletest -Dclassname=OffWrapTransactionTests
+
+
+
+==========================================
+Executing the db integration tests - using the -Dusedatasources option
+==========================================
+
+When running tests, by default, the process will randomly select which defined
datasources it will use and to which model they will be mapped.
+To control which datasources to use, add the -Dusedatasources option when running either
"run" profile (e.g., runalltests or runsingletest).
+
+ a. Example
+
+ run: mvn install -Prunalltests -Dusedatasources=<comma seperated datasource
names>
+
+ Example: mvn install -Prunalltests -Dusedatasources=oracle,sqlserver
- c. To run a single class of tests, run the "singleclass" profile
- run: mvn clean install -Psingleclass -Dclassname=<classname> ====>
don't add .java to classname
+
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2009-12-16 22:35:48 UTC (rev 1678)
+++ trunk/test-integration/db/pom.xml 2009-12-17 18:49:48 UTC (rev 1679)
@@ -238,15 +238,11 @@
</dependencies>
+
-
<profiles>
<profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
+ <id>runalltests</id>
<build>
<plugins>
<!-- Specify the compiler options and settings -->
@@ -260,11 +256,12 @@
<showWarnings>false</showWarnings>
</configuration>
</plugin>
+
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<additionalClasspathElements>
-
<additionalClasspathElement>${basedir}/lib/classes12_g.jar</additionalClasspathElement>
+
<additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/jbedsp-datadirect.jar</additionalClasspathElement>
@@ -280,9 +277,7 @@
<value>${datasourceloc}</value>
</property>
</systemProperties>
-
-
-
+
<!--
<forkMode>always</forkMode>
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
@@ -324,12 +319,8 @@
</profile>
<profile>
- <id>singleclass</id>
- <activation>
- <property>
- <name>classname</name>
- </property>
- </activation>
+ <id>runsingletest</id>
+
<build>
<plugins>
<!-- Specify the compiler options and settings -->
@@ -343,11 +334,12 @@
<showWarnings>false</showWarnings>
</configuration>
</plugin>
+
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <configuration>
+ <configuration>
<additionalClasspathElements>
-
<additionalClasspathElement>${basedir}/lib/classes12_g.jar</additionalClasspathElement>
+
<additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/jbedsp-datadirect.jar</additionalClasspathElement>
@@ -363,20 +355,15 @@
</property>
</systemProperties>
+<!--
+ <forkMode>always</forkMode>
- <forkMode>always</forkMode>
-<!--
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
-->
<includes>
<include>**/${classname}.java</include>
</includes>
- <excludes>
- <exclude>**/*Abstract*TestCase.java</exclude>
- <exclude>**/*Abstract*Test.java</exclude>
- <!-- hack to prevent anonymous inner classes in Tests from being run as tests
-->
- <exclude>**/Test*$*.java</exclude>
- </excludes>
+
</configuration>
</plugin>
@@ -390,18 +377,13 @@
<build>
<plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
-
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -446,18 +428,14 @@
</activation>
<build>
<plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -500,7 +478,7 @@
<profile>
- <id>testclient</id>
+ <id>runclienttests</id>
<activation>
<property>
<name>scenario.dir</name>
@@ -518,6 +496,13 @@
<showWarnings>false</showWarnings>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -555,6 +540,65 @@
</profile>
+ <profile>
+ <id>assemble</id>
+<!-- assemble will compile, but not run the tests prior to assemblying the kit -->
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <!-- Specify the compiler options and settings -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>false</showWarnings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${apache.ant.version}</version>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <!-- assemble all the console artifacts that make up the console kit
-->
+ <id>assemble-artifacts</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="product.version"
value="${project.version}" />
+ <!-- location to assemble the console artifacts -->
+ <property name="relative.artifact.dir"
value="target/distribution/artifacts/teiid-ctc-test-client-${project.version}"></property>
+ <ant
antfile="src/assembly/assemble-ctc-client.xml"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>