You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Gilles Scokart <gs...@gmail.com> on 2008/08/06 11:38:57 UTC
Re: svn commit: r683187 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
Could someone retest that in an other environment (I only have access
to an IBM JVM).
Other fix will follow.
Gilles
2008/8/6 <gs...@apache.org>:
> Author: gscokart
> Date: Wed Aug 6 02:10:07 2008
> New Revision: 683187
>
> URL: http://svn.apache.org/viewvc?rev=683187&view=rev
> Log:
> fix unit test on IBM JVM (probably broken by IVY-868)
>
> Modified:
> ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
>
> Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
> URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java?rev=683187&r1=683186&r2=683187&view=diff
> ==============================================================================
> --- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java (original)
> +++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java Wed Aug 6 02:10:07 2008
> @@ -50,7 +50,7 @@
> assertEquals(new File("test/repositories/ivysettings.xml").getAbsolutePath().toUpperCase(),
> new File((String) settings.getVariables().getVariable("ivy.settings.file")).getAbsolutePath()
> .toUpperCase());
> - assertEquals(new File("test/repositories/ivysettings.xml").toURL().toExternalForm()
> + assertEquals(new File("test/repositories/ivysettings.xml").toURI().toURL().toExternalForm()
> .toUpperCase(), ((String) settings.getVariables().getVariable("ivy.settings.url"))
> .toUpperCase());
> assertEquals(new File("test/repositories").getAbsolutePath().toUpperCase(),
> @@ -82,7 +82,7 @@
> assertEquals(new File("build/cache"), settings.getDefaultCache());
> assertEquals(new File("test/repositories/ivysettings.xml").getAbsolutePath(), settings
> .getVariables().getVariable("ivy.settings.file"));
> - assertEquals(new File("test/repositories/ivysettings.xml").toURL().toExternalForm(),
> + assertEquals(new File("test/repositories/ivysettings.xml").toURI().toURL().toExternalForm(),
> settings.getVariables().getVariable("ivy.settings.url"));
> assertEquals(new File("test/repositories").getAbsolutePath(), settings.getVariables().getVariable(
> "ivy.settings.dir"));
>
>
>
--
Gilles Scokart
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: svn commit: r683187 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
Posted by Xavier Hanin <xa...@gmail.com>.
On Wed, Aug 6, 2008 at 2:42 PM, Stefan Bodewig <bo...@apache.org> wrote:
> On Wed, 6 Aug 2008, Xavier Hanin <xa...@gmail.com> wrote:
>
> On Wed, Aug 6, 2008 at 11:38 AM, Gilles Scokart <gs...@gmail.com>
> wrote:
>
> >> Could someone retest that in an other environment (I only have
> >> access to an IBM JVM).
> >
> > I'm not on my dev box now, so I can't confirm it works, but I see no
> > reason why it would fail. That being said, I think it would be
> > cleaner to extract this "trick" in a helper method.
>
> Since the code is used in the ant package, you might as well use
> org.apache.tools.ant.util.FileUtils' getFileURL or toURI methods which
> have the added benefit of working with Java < 1.4 as well.
Thanks for the tip. But the code concerned by this file to URL conversion
spans outside the ant package (this commit is only a small part, see Maarten
recent commit), so we need a solution which doesn't rely on Ant codebase.
Xavier
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/
Re: svn commit: r683187 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 6 Aug 2008, Xavier Hanin <xa...@gmail.com> wrote:
On Wed, Aug 6, 2008 at 11:38 AM, Gilles Scokart <gs...@gmail.com> wrote:
>> Could someone retest that in an other environment (I only have
>> access to an IBM JVM).
>
> I'm not on my dev box now, so I can't confirm it works, but I see no
> reason why it would fail. That being said, I think it would be
> cleaner to extract this "trick" in a helper method.
Since the code is used in the ant package, you might as well use
org.apache.tools.ant.util.FileUtils' getFileURL or toURI methods which
have the added benefit of working with Java < 1.4 as well.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: svn commit: r683187 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
Posted by Xavier Hanin <xa...@gmail.com>.
On Wed, Aug 6, 2008 at 11:38 AM, Gilles Scokart <gs...@gmail.com> wrote:
> Could someone retest that in an other environment (I only have access
> to an IBM JVM).
I'm not on my dev box now, so I can't confirm it works, but I see no reason
why it would fail. That being said, I think it would be cleaner to extract
this "trick" in a helper method. Maybe sg on FileUtil:
FileUtil#toURL(File file) {
return file.toURI().toURL();
}
This would help documenting why we use this trick, and fix everything at
once if we later need another way to get an URL from a File.
Xavier
>
> Other fix will follow.
>
> Gilles
>
>
> 2008/8/6 <gs...@apache.org>:
> > Author: gscokart
> > Date: Wed Aug 6 02:10:07 2008
> > New Revision: 683187
> >
> > URL: http://svn.apache.org/viewvc?rev=683187&view=rev
> > Log:
> > fix unit test on IBM JVM (probably broken by IVY-868)
> >
> > Modified:
> > ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
> >
> > Modified:
> ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
> > URL:
> http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java?rev=683187&r1=683186&r2=683187&view=diff
> >
> ==============================================================================
> > --- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
> (original)
> > +++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java Wed
> Aug 6 02:10:07 2008
> > @@ -50,7 +50,7 @@
> > assertEquals(new
> File("test/repositories/ivysettings.xml").getAbsolutePath().toUpperCase(),
> > new File((String)
> settings.getVariables().getVariable("ivy.settings.file")).getAbsolutePath()
> > .toUpperCase());
> > - assertEquals(new
> File("test/repositories/ivysettings.xml").toURL().toExternalForm()
> > + assertEquals(new
> File("test/repositories/ivysettings.xml").toURI().toURL().toExternalForm()
> > .toUpperCase(), ((String)
> settings.getVariables().getVariable("ivy.settings.url"))
> > .toUpperCase());
> > assertEquals(new
> File("test/repositories").getAbsolutePath().toUpperCase(),
> > @@ -82,7 +82,7 @@
> > assertEquals(new File("build/cache"),
> settings.getDefaultCache());
> > assertEquals(new
> File("test/repositories/ivysettings.xml").getAbsolutePath(), settings
> > .getVariables().getVariable("ivy.settings.file"));
> > - assertEquals(new
> File("test/repositories/ivysettings.xml").toURL().toExternalForm(),
> > + assertEquals(new
> File("test/repositories/ivysettings.xml").toURI().toURL().toExternalForm(),
> > settings.getVariables().getVariable("ivy.settings.url"));
> > assertEquals(new File("test/repositories").getAbsolutePath(),
> settings.getVariables().getVariable(
> > "ivy.settings.dir"));
> >
> >
> >
>
>
>
> --
> Gilles Scokart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/