You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by ke...@apache.org on 2006/12/12 14:53:14 UTC

svn commit: r486141 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Author: kevj
Date: Tue Dec 12 05:53:13 2006
New Revision: 486141

URL: http://svn.apache.org/viewvc?view=rev&rev=486141
Log:
-test for hasfreespace condition

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Added: ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml?view=auto&rev=486141
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml Tue Dec 12 05:53:13 2006
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<project name="hasfreespace-test" default="all" basedir="." xmlns:au="antlib:org.apache.ant.antunit">
+
+  <target name="test-not-enough-space-human">
+    <au:assertFalse>
+      <hasfreespace partition="c:" needed="1P"/>			
+    </au:assertFalse>	
+  </target>
+
+  <target name="test-enough-space-human">
+    <au:assertTrue>
+      <hasfreespace partition="c:" needed="1K"/>			
+    </au:assertTrue>	
+  </target>
+
+  <target name="test-not-enough-space">
+  	<property name="long.max-value" value="9223372036854775807"/>
+    <au:assertFalse>
+   	  <hasfreespace partition="c:" needed="${long.max-value}"/>
+    </au:assertFalse>
+  </target>
+		
+  <target name="test-enough-space">
+    <au:assertTrue>
+      <hasfreespace partition="c:" needed="1"/>			
+    </au:assertTrue>	
+  </target>
+
+  <target name="all">
+    <au:antunit>
+      <fileset file="${ant.file}"/>
+      <au:plainlistener/>
+    </au:antunit>
+  </target>
+
+</project>
\ No newline at end of file



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


Re: svn commit: r486141 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Posted by Kevin Jackson <fo...@gmail.com>.
Hi Peter,

> The antunit tests can check for the existance of the required
> classes/methods.
>

I've applied a similar mechanism to the antunit test and checked on a
java 5 runtime, the test skips as jdk6 isn't available and you get a
clean Build Successful message

Thanks for the tip

Kev

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


Re: svn commit: r486141 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Posted by Peter Reilly <pe...@gmail.com>.
On 12/13/06, Kevin Jackson <fo...@gmail.com> wrote:
> > Hi
> >
> > Could those tests be please be written in such way that these will not
> > fail / error under jdk 1.5 or lower?
>
> There is no support from the runtime for this functionality pre java6,
> so there is no way that these can perform as expected on lower jvms.
The antunit tests can check for the existance of the required
classes/methods.

for example in src/tests/antunit/core/uuencode/uuencode-test.xml
the following is used:

  <available property="sun.uudecode.avail" classname="sun.misc.UUDecoder"/>

  <target name="define" if="sun.uudecode.avail">
    <mkdir dir="${classes.dir}"/>
..
..
  <target name="test-simple" depends="define" if="sun.uudecode.avail">

Peter
Peter

>
> >
> > And do you feel 100% comfortable in adding this while working on the
> > release candidates?
> >
>
> Not 100% no, but since stuff is being added elsewhere (scripting,
> Resources etc), it seems we are not in a real release candidate stage
> right now.
>
> If there is a -1, I'll remove this immediately.  Right now people have
> correctly pointed out flaws in the original implementation which I've
> tried to correct, and there's a problem with StringUtils now using
> regexps, which I'm going to work on this morning, but so far, no one
> has vetoed
>
> Thanks
> Kev
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Re: svn commit: r486141 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Posted by Kevin Jackson <fo...@gmail.com>.
> Hi
>
> Could those tests be please be written in such way that these will not
> fail / error under jdk 1.5 or lower?

There is no support from the runtime for this functionality pre java6,
so there is no way that these can perform as expected on lower jvms.

>
> And do you feel 100% comfortable in adding this while working on the
> release candidates?
>

Not 100% no, but since stuff is being added elsewhere (scripting,
Resources etc), it seems we are not in a real release candidate stage
right now.

If there is a -1, I'll remove this immediately.  Right now people have
correctly pointed out flaws in the original implementation which I've
tried to correct, and there's a problem with StringUtils now using
regexps, which I'm going to work on this morning, but so far, no one
has vetoed

Thanks
Kev

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


Re: svn commit: r486141 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Posted by jm...@kruithof.xs4all.nl.
Hi

Could those tests be please be written in such way that these will not 
fail / error under jdk 1.5 or lower?

And do you feel 100% comfortable in adding this while working on the 
release candidates?

Br Martijn

> Author: kevj
> Date: Tue Dec 12 05:53:13 2006
> New Revision: 486141
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=486141
> Log:
> -test for hasfreespace condition
>
> Added:
>    ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml
>
> Added: ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml
> URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml?view=auto&rev=486141
> ==============================================================================
> --- ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml (added)
> +++ ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml Tue Dec 12 05:53:13 2006
> @@ -0,0 +1,36 @@
> +<?xml version="1.0"?>
> +<project name="hasfreespace-test" default="all" basedir="." xmlns:au="antlib:org.apache.ant.antunit">
> +
> +  <target name="test-not-enough-space-human">
> +    <au:assertFalse>
> +      <hasfreespace partition="c:" needed="1P"/>
> +    </au:assertFalse>
> +  </target>
> +
> +  <target name="test-enough-space-human">
> +    <au:assertTrue>
> +      <hasfreespace partition="c:" needed="1K"/>
> +    </au:assertTrue>
> +  </target>
> +
> +  <target name="test-not-enough-space">
> +  	<property name="long.max-value" value="9223372036854775807"/>
> +    <au:assertFalse>
> +   	  <hasfreespace partition="c:" needed="${long.max-value}"/>
> +    </au:assertFalse>
> +  </target>
> +
> +  <target name="test-enough-space">
> +    <au:assertTrue>
> +      <hasfreespace partition="c:" needed="1"/>
> +    </au:assertTrue>
> +  </target>
> +
> +  <target name="all">
> +    <au:antunit>
> +      <fileset file="${ant.file}"/>
> +      <au:plainlistener/>
> +    </au:antunit>
> +  </target>
> +
> +</project>
> \ No newline at end of file
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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