Author: vhalbert(a)redhat.com
Date: 2009-10-01 16:57:01 -0400 (Thu, 01 Oct 2009)
New Revision: 1516
Modified:
trunk/test-integration/db/howto
trunk/test-integration/db/pom.xml
Log:
Teiid 773 - changes to support running one test class at a time
Modified: trunk/test-integration/db/howto
===================================================================
--- trunk/test-integration/db/howto 2009-10-01 20:20:05 UTC (rev 1515)
+++ trunk/test-integration/db/howto 2009-10-01 20:57:01 UTC (rev 1516)
@@ -10,10 +10,7 @@
==========================================
- Unit test should be created under db/src/test/java
-- See SingleSourceTransactionTest.java as an example
-
- NOTE: the current tests are currently organized by the number of datasources they
require in order
- to give some organization to the test for tracking purposes.
+- See LocalTransactionDriverFalseOffTest.java as an example
- Test should extend org.teiid.transaction.test.BaseAbstractTransactionTestCase
@@ -22,12 +19,32 @@
- when calling: this.getSource("modelname") --- the "modelname"
represents the model for which
you want the connection for
- INFO: to know which source this model is mapped to, find the config properties file
being
- loaded for this test (default is the default-config.properties) and look for
- the model-to-datasource mapping(s)
-
- The default Transaction.vdb has 2 models: pm1 and pm2
+
+ 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.
+
+ 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
+ loaded for this test (default is the default-config.properties) and look for
+ the model-to-order mapping(s)
+
+ The default Transaction.vdb has 2 models: pm1 and pm2
+
+ example: pm1:1
+ pm2:2
+
+ Therefore, the model-to-order mapping will map to the relative order specified in the
usedatasources property.
+
+ example: -Dusedatasources=oracle,postgres
+
+ This will result in model pm1 --> oracle
+ pm2 --> postgres
+ To EXCLUDE a test from using a specific database type, call
addProperty(ConfigPropertyNames.EXCLUDE_DATASBASE_TYPES_PROP, "postgres");
+ during setup()
+
+ NOTE: The EXCLUDE option excludes based on db.type, where "usedatasources"
specifies the actual datasource (not by type)
+
==========================================
Setting up a Datasource to be used during Testing
@@ -61,6 +78,10 @@
run: mvn clean install -Dusedatasources=<comma seperated datasource names>
Example: mvn clean install -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-10-01 20:20:05 UTC (rev 1515)
+++ trunk/test-integration/db/pom.xml 2009-10-01 20:57:01 UTC (rev 1516)
@@ -99,6 +99,7 @@
<additionalClasspathElement>${basedir}/lib/classes12_g.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
<additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
+
<additionalClasspathElement>${basedir}/lib/jbedsp-datadirect.jar</additionalClasspathElement>
</additionalClasspathElements>
<systemProperties>
@@ -123,7 +124,7 @@
<exclude>**/*Abstract*TestCase.java</exclude>
<exclude>**/*Abstract*Test.java</exclude>
<!-- hack to prevent anonymous inner classes in Tests from being run as tests
-->
- <include>**/Test*$*.java</include>
+ <exclude>**/Test*$*.java</exclude>
</excludes>
</configuration>
@@ -134,6 +135,64 @@
</profile>
<profile>
+ <id>singleclass</id>
+ <activation>
+ <property>
+ <name>classname</name>
+ </property>
+ </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>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <additionalClasspathElements>
+
<additionalClasspathElement>${basedir}/lib/classes12_g.jar</additionalClasspathElement>
+
<additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
+
<additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
+
<additionalClasspathElement>${basedir}/lib/jbedsp-datadirect.jar</additionalClasspathElement>
+ </additionalClasspathElements>
+ <systemProperties>
+ <property>
+ <name>usedatasources</name>
+ <value>${usedatasources}</value>
+ </property>
+ </systemProperties>
+
+
+ <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>
+
+ </plugins>
+ </build>
+ </profile>
+
+
+ <profile>
<id>setupdatasources</id>
<build>
<plugins>
Show replies by date