You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2008/03/04 13:15:02 UTC
svn commit: r633442 - in /ant/core/trunk/src/tests/antunit/taskdefs:
optional/script/scriptdef-test.xml propertyhelper-test.xml
Author: bodewig
Date: Tue Mar 4 04:15:00 2008
New Revision: 633442
URL: http://svn.apache.org/viewvc?rev=633442&view=rev
Log:
skip scripty AntUnit tests if BSF/javax.script are not there
Modified:
ant/core/trunk/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml
ant/core/trunk/src/tests/antunit/taskdefs/propertyhelper-test.xml
Modified: ant/core/trunk/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml?rev=633442&r1=633441&r2=633442&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml Tue Mar 4 04:15:00 2008
@@ -11,6 +11,13 @@
<target name="tearDown">
</target>
+ <condition property="prereqs-ok">
+ <or>
+ <available classname="org.apache.bsf.BSFManager"/>
+ <available classname="javax.script.ScriptEngineManager"/>
+ </or>
+ </condition>
+
<property name="script.manager" value="auto" />
<string id="script.code">
@@ -35,19 +42,19 @@
<!--purely to test that everything works -->
- <target name="testInline">
+ <target name="testInline" if="prereqs-ok">
<js>self.log("Hello");</js>
<scripttest/>
</target>
- <target name="testStringResource">
+ <target name="testStringResource" if="prereqs-ok">
<js>
<string value='self.log("Ant version =${ant.version}");' />
</js>
<scripttest/>
</target>
- <target name="testStringResourceRef">
+ <target name="testStringResourceRef" if="prereqs-ok">
<js>
<string refid="script.code" />
</js>
@@ -55,7 +62,7 @@
<assertPropSet />
</target>
- <target name="testStringResourceInline">
+ <target name="testStringResourceInline" if="prereqs-ok">
<js>
<string>
self.log("Ant version =${ant.version}");
@@ -66,7 +73,7 @@
<assertPropSet/>
</target>
- <target name="testPropertyResource">
+ <target name="testPropertyResource" if="prereqs-ok">
<js>
<propertyresource name="prop" />
</js>
@@ -74,7 +81,7 @@
<assertPropSet/>
</target>
- <target name="testMixedResources">
+ <target name="testMixedResources" if="prereqs-ok">
<js>
<string refid="script.code" />
<propertyresource name="prop" />
@@ -85,4 +92,4 @@
<scripttest/>
<assertPropSet name="property2" />
</target>
-</project>
\ No newline at end of file
+</project>
Modified: ant/core/trunk/src/tests/antunit/taskdefs/propertyhelper-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/propertyhelper-test.xml?rev=633442&r1=633441&r2=633442&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/propertyhelper-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/propertyhelper-test.xml Tue Mar 4 04:15:00 2008
@@ -2,7 +2,9 @@
<!-- each test verifies that the PropertyEvaluator delegate works -->
<import file="../antunit-base.xml" />
- <target name="setUp" unless="setup.complete">
+ <available property="prereqs-ok" classname="org.apache.bsf.BSFManager"/>
+
+ <target name="setUp" unless="setup.complete" if="prereqs-ok">
<script language="beanshell" manager="bsf">
import org.apache.tools.ant.PropertyHelper;
public class MapEvaluator implements PropertyHelper.PropertyEvaluator {
@@ -25,7 +27,7 @@
<property name="setup.complete" value="true" />
</target>
- <target name="testValueTypes" depends="setUp">
+ <target name="testValueTypes" depends="setUp" if="prereqs-ok">
<!-- verify BC, strings -->
<au:assertPropertyEquals name="string" value="${STRING}" />
@@ -45,14 +47,14 @@
<au:assertPropertyEquals name="int2" value="${int}" />
</target>
- <target name="testNull" depends="setUp">
+ <target name="testNull" depends="setUp" if="prereqs-ok">
<!-- demonstrate that a null value always implies a nonexistent property -->
<au:assertFalse>
<isset property="null" />
</au:assertFalse>
</target>
- <target name="testAvailable" depends="setUp">
+ <target name="testAvailable" depends="setUp" if="prereqs-ok">
<!-- verify the available task can set a non-string property -->
<available file="${ant.file}" type="file" property="available.string" value="bc" />
<au:assertPropertyEquals name="available.string" value="bc" />
@@ -60,7 +62,7 @@
<au:assertPropertyEquals name="available.object" value="${OBJECT}" />
</target>
- <target name="testCondition" depends="setUp">
+ <target name="testCondition" depends="setUp" if="prereqs-ok">
<!-- verify the condition task can set a non-string property -->
<echo>$${ant.file}=${ant.file}</echo>
<condition property="condition.true.string">
@@ -81,14 +83,14 @@
<au:assertPropertyEquals name="condition.else.int" value="${INT}" />
</target>
- <target name="testEmbeddedNonString">
+ <target name="testEmbeddedNonString" if="prereqs-ok">
<!-- verify that a property embedded in a string is a substring -->
<au:assertTrue>
<equals arg1="@${int}@" arg2="@1@" />
</au:assertTrue>
</target>
- <target name="testLoadProperties">
+ <target name="testLoadProperties" if="prereqs-ok">
<au:assertFalse>
<isset property="object2" />
</au:assertFalse>