ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r551372 - in /ant/core/trunk/src: etc/testcases/types/scriptcondition.xml tests/antunit/types/scriptcondition-test.xml tests/junit/org/apache/tools/ant/types/optional/ScriptConditionTest.java
Date Wed, 27 Jun 2007 22:47:25 GMT
Author: mbenson
Date: Wed Jun 27 15:47:24 2007
New Revision: 551372

URL: http://svn.apache.org/viewvc?view=rev&rev=551372
Log:
antunitize scriptcondition test

Added:
    ant/core/trunk/src/tests/antunit/types/scriptcondition-test.xml   (with props)
Removed:
    ant/core/trunk/src/etc/testcases/types/scriptcondition.xml
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/optional/ScriptConditionTest.java

Added: ant/core/trunk/src/tests/antunit/types/scriptcondition-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/types/scriptcondition-test.xml?view=auto&rev=551372
==============================================================================
--- ant/core/trunk/src/tests/antunit/types/scriptcondition-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/types/scriptcondition-test.xml Wed Jun 27 15:47:24 2007
@@ -0,0 +1,73 @@
+<project name="scriptcondition-test" default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
+  <import file="../antunit-base.xml" />
+
+  <macrodef name="t">
+    <element name="test" implicit="yes" />
+    <attribute name="message"/>
+    <sequential>
+      <au:assertTrue message="query @{message} failed; result was false">
+        <test />
+      </au:assertTrue>
+    </sequential>
+  </macrodef>
+
+  <macrodef name="f">
+    <element name="test" implicit="yes" />
+    <attribute name="message"/>
+    <sequential>
+      <au:assertFalse message="test @{message} failed; result was true">
+        <test />
+      </au:assertFalse>
+    </sequential>
+  </macrodef>
+
+  <!-- this is here to test the macro is well coded -->
+ <target name="testMacro">
+    <t message="testMacro">
+      <istrue value="true"/>
+    </t>
+    <f message="testMacro2">
+      <istrue value="false"/>
+    </f>
+  </target>
+
+ <target name="testNolanguage">
+    <au:expectfailure message="Absence of language attribute not detected"
+                           expectedMessage="script language must be specified">
+      <t message="testNolanguage">
+        <scriptcondition>
+          self.setValue(true);
+        </scriptcondition>
+      </t>
+    </au:expectfailure>
+  </target>
+
+  <target name="testClearByDefault">
+    <f message="testClearByDefault">
+      <scriptcondition language="javascript">
+      </scriptcondition>
+    </f>
+  </target>
+
+  <target name="testValueWorks">
+    <t message="testValueWorks">
+      <scriptcondition language="javascript" value="true" />
+    </t>
+  </target>
+
+  <target name="testSetWorks">
+    <t message="testSetWorks">
+      <scriptcondition language="javascript" value="false">
+        self.setValue(true);
+      </scriptcondition>
+    </t>
+  </target>
+
+  <target name="testClearWorks">
+    <f message="testClearWorks">
+      <scriptcondition language="javascript" value="true">
+        self.setValue(false);
+      </scriptcondition>
+    </f>
+  </target>
+</project>

Propchange: ant/core/trunk/src/tests/antunit/types/scriptcondition-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message