summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorSteve Loughran <stevel@apache.org>2003-11-05 20:12:28 +0000
committerSteve Loughran <stevel@apache.org>2003-11-05 20:12:28 +0000
commit3838c6ba287baf4bb3566ed47b0c99840b7ebba8 (patch)
treeefe4356efedc6db7041a659f6674d18deac6c3e8 /src/etc
parent23bebfbdc21ac3706aaa3d84210c900c867d0f21 (diff)
downloadant-3838c6ba287baf4bb3566ed47b0c99840b7ebba8.tar.gz
<nice> as a task; unit tests tested on windows.
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275614 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/testcases/taskdefs/nice.xml50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/etc/testcases/taskdefs/nice.xml b/src/etc/testcases/taskdefs/nice.xml
new file mode 100644
index 000000000..0e80b3b46
--- /dev/null
+++ b/src/etc/testcases/taskdefs/nice.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<project name="nice" basedir=".">
+
+<description>
+Test nicing. To make the test more complex we may be running in a nice mode
+to start with, and we want to restore that value at the end. So every test
+that succeeds must restore the saved value.
+</description>
+ <target name="noop">
+ <nice/>
+ </target>
+
+ <target name="current">
+ <nice currentPriority="nice.now"/>
+ <fail unless="nice.now"/>
+ </target>
+
+ <target name="faster">
+ <nice newPriority="8" currentPriority="nice.old"/>
+ <nice currentPriority="nice.now"/>
+ <condition property="test.succeeded">
+ <equals arg1="${nice.now}" arg2="8" />
+ </condition>
+ <nice newPriority="${nice.old}"/>
+ <fail unless="test.succeeded"/>
+ </target>
+
+ <target name="slower">
+ <nice newPriority="3" currentPriority="nice.old"/>
+ <nice currentPriority="nice.now"/>
+ <condition property="test.succeeded">
+ <equals arg1="${nice.now}" arg2="3" />
+ </condition>
+ <nice newPriority="${nice.old}"/>
+ <fail unless="test.succeeded"/>
+ </target>
+
+ <target name="too_slow">
+ <nice currentPriority="nice.old"/>
+ <nice newPriority="0"/>
+ <nice newPriority="${nice.old}"/>
+ </target>
+
+ <target name="too_fast">
+ <nice currentPriority="nice.old"/>
+ <nice newPriority="20"/>
+ <nice newPriority="${nice.old}"/>
+ </target>
+
+</project> \ No newline at end of file