You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2004/12/07 22:46:21 UTC
cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
mbenson 2004/12/07 13:46:20
Modified: src/etc/testcases/taskdefs checksum.xml
Log:
Hack to make the testcases pass.
PR: 32506
Revision Changes Path
1.9 +5 -1 ant/src/etc/testcases/taskdefs/checksum.xml
Index: checksum.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/checksum.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- checksum.xml 8 Sep 2004 14:30:45 -0000 1.8
+++ checksum.xml 7 Dec 2004 21:46:18 -0000 1.9
@@ -20,18 +20,22 @@
<target name="createMd5">
<checksum file="../asf-logo.gif" fileext=".MD5" />
+ <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.MD5" />
</target>
<target name="createMD5SUMformat">
<checksum file="../asf-logo.gif" format="MD5SUM" fileext=".MD5SUM" />
+ <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.MD5SUM" />
</target>
<target name="createSVFformat">
<checksum file="../asf-logo.gif" format="SVF" fileext=".SVF" />
+ <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.SVF" />
</target>
<target name="createPattern">
<checksum file="../asf-logo.gif" pattern="foo{0}bar" fileext=".PATTERN" />
+ <fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.PATTERN" />
</target>
<target name="setProperty">
@@ -102,4 +106,4 @@
</fileset>
</checksum>
</target>
-</project>
\ No newline at end of file
+</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Peter Reilly <pe...@apache.org>.
That sounds like a good idea.
Peter
Matt Benson wrote:
>Hey, good point, I follow you... if the cvs client
>auto-converts the "expected" files, then they won't
>match the <fixcrlf>'d files. Hmm... maybe we should
>just change the unit test to read the files (using
><loadfile> with a <striplinebreaks> filter) into
>properties and compare those rather than using
>FileUtils.contentEquals(...)? Any other ideas?
>
>-Matt
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Martijn Kruithof <jm...@kruithof.xs4all.nl>.
Stefan Bodewig wrote:
>On Wed, 8 Dec 2004, Matt Benson <gu...@yahoo.com> wrote:
>
>
>
>>Hmm... maybe we should just change the unit test to read the files
>>(using <loadfile> with a <striplinebreaks> filter) into properties
>>and compare those rather than using FileUtils.contentEquals(...)?
>>
>>
>
>
>
We could also add a FileUtil.contentEquals(...) variant that ignores
differences in line endings.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 8 Dec 2004, Matt Benson <gu...@yahoo.com> wrote:
> Hmm... maybe we should just change the unit test to read the files
> (using <loadfile> with a <striplinebreaks> filter) into properties
> and compare those rather than using FileUtils.contentEquals(...)?
+1
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Matt Benson <gu...@yahoo.com>.
--- Matt Benson <gu...@yahoo.com> wrote:
[SNIP]
> match the <fixcrlf>'d files. Hmm... maybe we should
> just change the unit test to read the files (using
> <loadfile> with a <striplinebreaks> filter) into
> properties and compare those rather than using
> FileUtils.contentEquals(...)? Any other ideas?
[SNIP]
I will go ahead and commit this as a better
alternative to breaking "true Windows" CVS clients
until something better comes along.
-Matt
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Matt Benson <gu...@yahoo.com>.
Hey, good point, I follow you... if the cvs client
auto-converts the "expected" files, then they won't
match the <fixcrlf>'d files. Hmm... maybe we should
just change the unit test to read the files (using
<loadfile> with a <striplinebreaks> filter) into
properties and compare those rather than using
FileUtils.contentEquals(...)? Any other ideas?
-Matt
--- Peter Reilly <pe...@apache.org> wrote:
> Actually, I have had a quick look at the changes you
> made.
> I do not believe that they will work on windows with
> a dos style cvs client.
>
> For example:
> the xml target is now:
> <target name="createMd5">
> <checksum file="../asf-logo.gif" fileext=".MD5"
> />
> <fixcrlf eol="lf" srcdir=".."
> includes="asf-logo.gif.MD5" />
> </target>
> the test is:
>
> public void testCreateMd5() throws IOException {
> FileUtils fileUtils =
> FileUtils.newFileUtils();
> executeTarget("createMd5");
>
>
assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo.gif.md5"),
>
> project.resolveFile("../asf-logo.gif.MD5")));
> }
>
> The expected file is "expected/asf-logo.gif.md5".
> There will be a one
> character
> difference between the size of the file with dos
> line ending and a file
> with unix (or mac) line
> endings. With the change you make, the test will not
> compare a file with
> dos line endings
> to one with unix lineending and so will fail.
>
> Peter
>
>
> Matt Benson wrote:
>
> >--- Stefan Bodewig <bo...@apache.org> wrote:
> >
> >
> >
> >>On Wed, 08 Dec 2004, Peter Reilly
> >><pe...@apache.org> wrote:
> >>
> >>
> >>
> >>>I think it is more a cvs client issue. Some cvs
> >>>
> >>>
> >>clients on windows
> >>
> >>
> >>>convert to dos endings (correct behaviour for
> >>>
> >>>
> >>non-binary files) and
> >>
> >>
> >>>some do not (cygwin cvs client I think does not).
> >>>
> >>>
> >>Still, if it worked before ...
> >>
> >>
> >>
> >Hmmm... Peter is right, I do use the cygwin cvs
> client
> >on Windows. But again, if it worked before... if
> it's
> >a cygwin issue it possibly is dependent on the fact
> >that I have un*x selected as my default filetype.
> >Anyway...
> >
> >-Matt
> >
> >
> >
> >>Stefan
> >>
> >>
> >>
> >>
>
>---------------------------------------------------------------------
> >
> >
> >>To unsubscribe, e-mail:
> >>dev-unsubscribe@ant.apache.org
> >>For additional commands, e-mail:
> >>dev-help@ant.apache.org
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Meet the all-new My Yahoo! - Try it today!
> >http://my.yahoo.com
> >
> >
> >
>
>---------------------------------------------------------------------
> >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
>
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Peter Reilly <pe...@apache.org>.
Actually, I have had a quick look at the changes you made.
I do not believe that they will work on windows with
a dos style cvs client.
For example:
the xml target is now:
<target name="createMd5">
<checksum file="../asf-logo.gif" fileext=".MD5" />
<fixcrlf eol="lf" srcdir=".." includes="asf-logo.gif.MD5" />
</target>
the test is:
public void testCreateMd5() throws IOException {
FileUtils fileUtils = FileUtils.newFileUtils();
executeTarget("createMd5");
assertTrue(fileUtils.contentEquals(project.resolveFile("expected/asf-logo.gif.md5"),
project.resolveFile("../asf-logo.gif.MD5")));
}
The expected file is "expected/asf-logo.gif.md5". There will be a one
character
difference between the size of the file with dos line ending and a file
with unix (or mac) line
endings. With the change you make, the test will not compare a file with
dos line endings
to one with unix lineending and so will fail.
Peter
Matt Benson wrote:
>--- Stefan Bodewig <bo...@apache.org> wrote:
>
>
>
>>On Wed, 08 Dec 2004, Peter Reilly
>><pe...@apache.org> wrote:
>>
>>
>>
>>>I think it is more a cvs client issue. Some cvs
>>>
>>>
>>clients on windows
>>
>>
>>>convert to dos endings (correct behaviour for
>>>
>>>
>>non-binary files) and
>>
>>
>>>some do not (cygwin cvs client I think does not).
>>>
>>>
>>Still, if it worked before ...
>>
>>
>>
>Hmmm... Peter is right, I do use the cygwin cvs client
>on Windows. But again, if it worked before... if it's
>a cygwin issue it possibly is dependent on the fact
>that I have un*x selected as my default filetype.
>Anyway...
>
>-Matt
>
>
>
>>Stefan
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>dev-unsubscribe@ant.apache.org
>>For additional commands, e-mail:
>>dev-help@ant.apache.org
>>
>>
>>
>>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Meet the all-new My Yahoo! - Try it today!
>http://my.yahoo.com
>
>
>
>---------------------------------------------------------------------
>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: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Matt Benson <gu...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:
> On Wed, 08 Dec 2004, Peter Reilly
> <pe...@apache.org> wrote:
>
> > I think it is more a cvs client issue. Some cvs
> clients on windows
> > convert to dos endings (correct behaviour for
> non-binary files) and
> > some do not (cygwin cvs client I think does not).
>
> Still, if it worked before ...
>
Hmmm... Peter is right, I do use the cygwin cvs client
on Windows. But again, if it worked before... if it's
a cygwin issue it possibly is dependent on the fact
that I have un*x selected as my default filetype.
Anyway...
-Matt
> Stefan
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
>
>
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 08 Dec 2004, Peter Reilly <pe...@apache.org> wrote:
> I think it is more a cvs client issue. Some cvs clients on windows
> convert to dos endings (correct behaviour for non-binary files) and
> some do not (cygwin cvs client I think does not).
Still, if it worked before ...
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Peter Reilly <pe...@apache.org>.
I think it is more a cvs client issue.
Some cvs clients on windows convert to dos endings (correct behaviour
for non-binary files)
and some do not (cygwin cvs client I think does not).
Peter
Stefan Bodewig wrote:
>On 7 Dec 2004, <mb...@apache.org> wrote:
>
>
>
>> Hack to make the testcases pass.
>>
>>
>
>Sorry, I didn't manage to follow the bug report.
>
>Before I added pluggable output patterns to <checksum> the tests
>passed without the fixcrlf, so they should still do - unless I've
>broken something, which seems to be the case.
>
>Stefan
>
>---------------------------------------------------------------------
>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: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Posted by Stefan Bodewig <bo...@apache.org>.
On 7 Dec 2004, <mb...@apache.org> wrote:
> Hack to make the testcases pass.
Sorry, I didn't manage to follow the bug report.
Before I added pluggable output patterns to <checksum> the tests
passed without the fixcrlf, so they should still do - unless I've
broken something, which seems to be the case.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org