ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vjapa...@apache.org
Subject svn commit: r1591309 - in /ctakes/trunk: ctakes-ytex-uima/pom.xml ctakes-ytex/pom.xml ctakes-ytex/scripts/build-classpath.xml ctakes-ytex/scripts/build-setup.xml
Date Wed, 30 Apr 2014 14:21:09 GMT
Author: vjapache
Date: Wed Apr 30 14:21:08 2014
New Revision: 1591309

URL: http://svn.apache.org/r1591309
Log:
#CTAKES-253, CTAKES-292 fix tests in ctakes-ytex-uima

Modified:
    ctakes/trunk/ctakes-ytex-uima/pom.xml
    ctakes/trunk/ctakes-ytex/pom.xml
    ctakes/trunk/ctakes-ytex/scripts/build-classpath.xml
    ctakes/trunk/ctakes-ytex/scripts/build-setup.xml

Modified: ctakes/trunk/ctakes-ytex-uima/pom.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-ytex-uima/pom.xml?rev=1591309&r1=1591308&r2=1591309&view=diff
==============================================================================
--- ctakes/trunk/ctakes-ytex-uima/pom.xml (original)
+++ ctakes/trunk/ctakes-ytex-uima/pom.xml Wed Apr 30 14:21:08 2014
@@ -115,31 +115,6 @@
 					<typeSystem>src/main/resources/org/apache/ctakes/ytex/types/TypeSystem.xml</typeSystem>
 				</configuration>
 			</plugin>
-			<plugin>
-				<!-- copy test ytex.properties and generated config -->
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>generate-test-config</id>
-						<phase>process-test-classes</phase>
-						<goals>
-							<goal>copy-resources</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
-							<resources>
-								<resource>
-									<directory>${basedir}/../ctakes-ytex/target/test-classes</directory>
-									<includes>
-										<include>org/apache/ctakes/ytex/**/*.properties</include>
-										<include>org/apache/ctakes/ytex/**/*.xml</include>
-									</includes>
-								</resource>
-							</resources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
 			<!-- ant scripts need project dependencies in the target/lib directory -->
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
@@ -161,48 +136,83 @@
 					</execution>
 				</executions>
 			</plugin>
-
+			<!-- run ant scripts to setup test properties and database -->
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<version>1.6</version>
+				<executions>
+					<execution>
+						<id>generate-test-config</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration>
+							<target>
+								<!-- default to hsql, override via -D -->
+								<property name="db.type" value="hsql" />
+								<ant antfile="build-setup.xml" dir="${basedir}/../ctakes-ytex/scripts" target="test.setup">
+									<property name="config.local" value="${project.build.testOutputDirectory}" />
+									<property name="db.type" value="${db.type}" />
+									<property name="ytex.test" value="true" />
+									<property name="ctakes.home" value="${project.basedir}/.." />
+								</ant>
+							</target>
+						</configuration>
+					</execution>			
+				</executions>
+			</plugin>
+			<!-- run all tests in the integration test phase -->
 			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-surefire-plugin</artifactId>
 				<configuration>
-					<includes>
-						<include>**/Test*.java</include>
-						<include>**/*Test.java</include>
-						<include>**/*Tests.java</include>
-						<include>**/*TestCase.java</include>
-					</includes>
-					<systemPropertyVariables>
-						<log4j.configuration>file:${project.build.testOutputDirectory}/log4j.properties</log4j.configuration>
-					</systemPropertyVariables>
-					<argLine>-Xmx1536m</argLine>
-					<forkMode>always</forkMode>
-					<forkCount>1</forkCount>
-					<reuseForks>false</reuseForks>
-					<forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds>
-					<additionalClasspathElements>
-						<additionalClasspathElement>${project.basedir}/../ctakes-assertion-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-assertion-zoner-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-chunker-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-constituency-parser-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-core-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-coreference-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-dependency-parser-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-dictionary-lookup-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-drug-ner-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-lvg-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-ne-contexts-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-pos-tagger-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-relation-extractor-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-side-effect-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-smoking-status-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-temporal-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-ytex-res/src/main/resources</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/jcarafe-core_2.9.1-0.9.8.3.RC4.jar</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/jcarafe-ext_2.9.1-0.9.8.3.RC4.jar</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/med-facts-i2b2-1.2-SNAPSHOT.jar</additionalClasspathElement>
-						<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/med-facts-zoner-1.1.jar</additionalClasspathElement>
-					</additionalClasspathElements>
+					<skip>true</skip>
 				</configuration>
+				<executions>
+					<execution>
+						<id>surefire-it</id>
+						<phase>integration-test</phase>
+						<goals>
+							<goal>test</goal>
+						</goals>
+						<configuration>
+							<skip>false</skip>
+							<forkMode>always</forkMode>
+							<systemPropertyVariables>
+								<log4j.configuration>file:${project.basedir}/src/test/resources/log4j.properties</log4j.configuration>
+							</systemPropertyVariables>
+							<argLine>-Xmx1536m</argLine>
+							<forkMode>always</forkMode>
+							<forkCount>1</forkCount>
+							<reuseForks>false</reuseForks>
+							<forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds>
+							<additionalClasspathElements>
+								<additionalClasspathElement>${project.basedir}/../ctakes-assertion-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-assertion-zoner-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-chunker-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-constituency-parser-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-core-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-coreference-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-dependency-parser-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-dictionary-lookup-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-drug-ner-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-lvg-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-ne-contexts-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-pos-tagger-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-relation-extractor-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-side-effect-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-smoking-status-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-temporal-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-ytex-res/src/main/resources</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/jcarafe-core_2.9.1-0.9.8.3.RC4.jar</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/jcarafe-ext_2.9.1-0.9.8.3.RC4.jar</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/med-facts-i2b2-1.2-SNAPSHOT.jar</additionalClasspathElement>
+								<additionalClasspathElement>${project.basedir}/../ctakes-assertion/lib/med-facts-zoner-1.1.jar</additionalClasspathElement>
+							</additionalClasspathElements>
+						</configuration>
+					</execution>
+				</executions>
 			</plugin>
 			<plugin>
 				<artifactId>maven-clean-plugin</artifactId>
@@ -236,6 +246,21 @@
 										</execute>
 									</action>
 								</pluginExecution>
+								<pluginExecution>
+									<pluginExecutionFilter>
+										<groupId>org.apache.maven.plugins</groupId>
+										<artifactId>maven-antrun-plugin</artifactId>
+										<versionRange>[1.0,)</versionRange>
+										<goals>
+											<goal>run</goal>
+										</goals>
+									</pluginExecutionFilter>
+									<action>
+										<execute>
+											<runOnIncremental>false</runOnIncremental>
+										</execute>
+									</action>
+								</pluginExecution>								
 							</pluginExecutions>
 						</lifecycleMappingMetadata>
 					</configuration>

Modified: ctakes/trunk/ctakes-ytex/pom.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-ytex/pom.xml?rev=1591309&r1=1591308&r2=1591309&view=diff
==============================================================================
--- ctakes/trunk/ctakes-ytex/pom.xml (original)
+++ ctakes/trunk/ctakes-ytex/pom.xml Wed Apr 30 14:21:08 2014
@@ -292,24 +292,9 @@
 						</goals>
 						<configuration>
 							<target>
-								<!-- generate a test ytex config if we don't have one -->
-								<ant antfile="build-setup.xml" dir="scripts"
-									target="generateTestYtexProperties">
-									<property name="config.local" value="${project.build.testOutputDirectory}" />
-									<property name="ctakes.home" value="${project.basedir}/.." />
-								</ant>
-								<ant antfile="build-setup.xml" dir="scripts" target="templateToConfig">
-									<property name="config.local" value="${project.build.testOutputDirectory}" />
-									<property name="ctakes.home" value="${project.basedir}/.." />
-								</ant>
 								<!-- default to hsql, override via -D -->
 								<property name="db.type" value="hsql" />
-								<ant antfile="build-setup.xml" dir="scripts" target="deleteTestDb">
-									<property name="config.local" value="${project.build.testOutputDirectory}" />
-									<property name="db.type" value="${db.type}" />
-									<property name="ctakes.home" value="${project.basedir}/.." />
-								</ant>
-								<ant antfile="build.xml" dir="scripts/data" target="all">
+								<ant antfile="build-setup.xml" dir="scripts" target="test.setup">
 									<property name="config.local" value="${project.build.testOutputDirectory}" />
 									<property name="db.type" value="${db.type}" />
 									<property name="ytex.test" value="true" />

Modified: ctakes/trunk/ctakes-ytex/scripts/build-classpath.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-ytex/scripts/build-classpath.xml?rev=1591309&r1=1591308&r2=1591309&view=diff
==============================================================================
--- ctakes/trunk/ctakes-ytex/scripts/build-classpath.xml (original)
+++ ctakes/trunk/ctakes-ytex/scripts/build-classpath.xml Wed Apr 30 14:21:08 2014
@@ -55,17 +55,21 @@
 	<condition property="mm.home" value="${env.MM_HOME}">
 		<isset property="env.MM_HOME" />
 	</condition>
-	<!-- directory where ant extension libraries are located -->
-	<condition property="ant.lib.ext" value="${ctakes.home}/ctakes-ytex/target/lib" else="${ctakes.home}/lib">
+	<!-- cp for ant extension libraries -->
+	<path id="ant.cp.dev">
+		<pathelement location="${ctakes.home}/ctakes-ytex/target/lib/ant-contrib-1.0b3.jar"
/>
+		<pathelement location="${ctakes.home}/ctakes-ytex-uima/target/lib/ant-contrib-1.0b3.jar"
/>
+	</path>
+	<path id="ant.cp.prod">
+		<pathelement location="${ctakes.home}/lib/ant-contrib-1.0b3.jar" />
+	</path>
+	<condition property="ant.cp" value="ant.cp.dev" else="ant.cp.prod">
 		<isset property="ctakes.dev.mode" />
 	</condition>
-	<path id="ant.cp">
-		<pathelement location="${ant.lib.ext}/ant-contrib-1.0b3.jar" />
-	</path>
-	<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" onerror="ignore" classpathref="ant.cp"
/>
-	<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" onerror="ignore" classpathref="ant.cp"
/>
-	<taskdef name="propertycopy" classname="net.sf.antcontrib.property.PropertyCopy" onerror="ignore"
classpathref="ant.cp" />
-	<taskdef name="math" classname="net.sf.antcontrib.math.MathTask" onerror="ignore" classpathref="ant.cp"
/>
+	<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" onerror="ignore" classpathref="${ant.cp}"
/>
+	<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" onerror="ignore" classpathref="${ant.cp}"
/>
+	<taskdef name="propertycopy" classname="net.sf.antcontrib.property.PropertyCopy" onerror="ignore"
classpathref="${ant.cp}" />
+	<taskdef name="math" classname="net.sf.antcontrib.math.MathTask" onerror="ignore" classpathref="${ant.cp}"
/>
 	<path id="kernel.cp.dev">
 		<pathelement location="${config.local}" />
 		<dirset dir="${ctakes.home}" includes="**/src/main/resources" />
@@ -99,7 +103,7 @@
 		<equals arg1="mssql" arg2="${db.type}" />
 	</condition>
 	<target name="echoproperties">
-		<pathconvert property="ant.cp.path" refid="ant.cp" />
+		<pathconvert property="ant.cp.path" refid="${ant.cp}" />
 		<pathconvert property="kernel.cp.path" refid="${kernel.cp}" />
 		<echoproperties />
 	</target>

Modified: ctakes/trunk/ctakes-ytex/scripts/build-setup.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-ytex/scripts/build-setup.xml?rev=1591309&r1=1591308&r2=1591309&view=diff
==============================================================================
--- ctakes/trunk/ctakes-ytex/scripts/build-setup.xml (original)
+++ ctakes/trunk/ctakes-ytex/scripts/build-setup.xml Wed Apr 30 14:21:08 2014
@@ -112,4 +112,7 @@ Call with option -projecthelp for more i
 	</target>
 	<target name="templateToConfig" depends="templateToConfig.init,templateToConfig.updateConfig"
description="generate config files from templates using values specified in ytex.properties">
 	</target>
+	<target name="test.setup" description="setup properties and database for unit tests"
depends="generateTestYtexProperties,templateToConfig,deleteTestDb">
+		<ant dir="data" target="all" inheritAll="true"/>
+	</target>
 </project>



Mime
View raw message