You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Michael Baessler <mb...@michael-baessler.de> on 2008/02/18 17:20:39 UTC

test failure for 2.2.1 release

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);

So the expected URL from the report above is:
    
file:/home/imreg/uimaj-2.2.1-incubating/uimaj/../uimaj-core/foo/bar/MyFile.xml 

where
    /home/imreg/uimaj-2.2.1-incubating/uimaj/../uimaj-core/
is the System.getProperty("user.dir") part.

Does anyone know details about the representation of the user.dir with 
uimaj/../uimaj-core?

-- Michael




Re: test failure for 2.2.1 release

Posted by Adam Lally <al...@alum.rpi.edu>.
On Feb 18, 2008 11:20 AM, Michael Baessler <mb...@michael-baessler.de> 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