Revision: 14802
http://gate.svn.sourceforge.net/gate/?rev=14802&view=rev
Author: ian_roberts
Date: 2011-12-16 22:49:10 +0000 (Fri, 16 Dec 2011)
Log Message:
-----------
Pass the basedir to the test as a system property so it will work when the cwd
of the ant process isn't the same as the plugin's base dir.
Modified Paths:
--------------
gate/trunk/plugins/Tagger_Measurements/build.xml
gate/trunk/plugins/Tagger_Measurements/test/src/gate/creole/measurements/MeasurementsTest.java
Modified: gate/trunk/plugins/Tagger_Measurements/build.xml
===================================================================
--- gate/trunk/plugins/Tagger_Measurements/build.xml 2011-12-16 22:29:07 UTC
(rev 14801)
+++ gate/trunk/plugins/Tagger_Measurements/build.xml 2011-12-16 22:49:10 UTC
(rev 14802)
@@ -76,10 +76,8 @@
<target name="distro.prepare" depends="clean.classes" />
- <target name="test" />
-
<!-- Unit tests -->
- <!--<property name="test.dir" location="test" />
+ <property name="test.dir" location="test" />
<property name="test.reports.dir" location="${test.dir}/reports" />
<property name="test.src.dir" location="${test.dir}/src" />
<property name="test.classes.dir" location="${test.dir}/classes" />
@@ -102,6 +100,8 @@
<target name="test" depends="test.compile">
<junit fork="yes" haltonfailure="no" printsummary="on">
<test name="gate.creole.measurements.MeasurementsTest"
toDir="${test.reports.dir}" />
+ <sysproperty key="gate.measurements.plugin.dir"
+ file="${basedir}" />
<formatter type="xml" />
<classpath>
<path refid="test.classpath" />
@@ -109,6 +109,5 @@
</classpath>
</junit>
</target>
- -->
</project>
Modified:
gate/trunk/plugins/Tagger_Measurements/test/src/gate/creole/measurements/MeasurementsTest.java
===================================================================
---
gate/trunk/plugins/Tagger_Measurements/test/src/gate/creole/measurements/MeasurementsTest.java
2011-12-16 22:29:07 UTC (rev 14801)
+++
gate/trunk/plugins/Tagger_Measurements/test/src/gate/creole/measurements/MeasurementsTest.java
2011-12-16 22:49:10 UTC (rev 14802)
@@ -24,7 +24,11 @@
@Override
public void setUp() throws MalformedURLException, IOException {
- parser = new MeasurementsParser((new
File("resources/units.dat")).toURI().toURL(), new
File("resources/common_words.txt").toURI().toURL());
+ File baseDir = null;
+ if(System.getProperty("gate.measurements.plugin.dir") != null) {
+ baseDir = new File(System.getProperty("gate.measurements.plugin.dir"));
+ }
+ parser = new MeasurementsParser((new File(baseDir,
"resources/units.dat")).toURI().toURL(), new File(baseDir,
"resources/common_words.txt").toURI().toURL());
}
@Override
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs