On Feb 18, 2008 11:20 AM, Michael Baessler <[EMAIL PROTECTED]> wrote:
> I got a failure report for uima 2.2.1 as shown below. The error occurs
> when running "mvn install" from uimaj. All works fine when running "mvn
> install" from uimaj-core.
>
> Test set: org.apache.uima.resource.metadata.impl.Import_implTest
> -------------------------------------------------------------------------------
> Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.101
> sec <<< FAILURE!
> testFindAbsoluteUrl(org.apache.uima.resource.metadata.impl.Import_implTest)
> Time elapsed: 0.004 sec  <<< FAILURE!
> junit.framework.AssertionFailedError:
> expected:<file:/home/imreg/uimaj-2.2.1-incubating/uimaj/../uimaj-core/foo/bar/MyFile.xml>
> but
> was:<file:/home/imreg/uimaj-2.2.1-incubating/uimaj-core/foo/bar/MyFile.xml>
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.failNotEquals(Assert.java:282)
>         at junit.framework.Assert.assertEquals(Assert.java:64)
>         at junit.framework.Assert.assertEquals(Assert.java:71)
>         at
> org.apache.uima.resource.metadata.impl.Import_implTest.testFindAbsoluteUrl(Import_implTest.java:123)
>
> I tried to reproduce the error with different JVMs but without success.
> When looking at the code I see:
>
>       importObj.setLocation("foo/bar/MyFile.xml");
>       URL absUrl =
> importObj.findAbsoluteUrl(UIMAFramework.newDefaultResourceManager());
>       URL expectedUrl = new File(System.getProperty("user.dir"),
> "foo/bar/MyFile.xml").toURL();
>       assertEquals(expectedUrl, absUrl);
>
><snip/>

I'm not sure why this happens in some case and not others, but it
might be fixable using File.getCanonicalPath().  So something like:

URL expectedUrl = new File(System.getProperty("user.dir"),
"foo/bar/MyFile.xml").getCanonicalFile().toURL();

 -Adam

Reply via email to