You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2011/02/22 15:01:38 UTC

[jira] Commented: (UIMA-2051) Import_implTest.testFindAbsoluteUrl fails on Hudson

    [ https://issues.apache.org/jira/browse/UIMA-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997802#comment-12997802 ] 

Marshall Schor commented on UIMA-2051:
--------------------------------------

The test :

1) sets up an Import_impl, with a path
2) asks the UIMA framework to resolve this into an "absolute" path, using a default resource manager,
which in turn picks up the working directory as the base dir to use for resolution,
3) then compares it to a computed "canonical" path

I think the issue arises because the /home in the "absolute" path is converted to /zonestorage/hudson/home in the canonical path.  The Javadocs for canonical path say:

This method first converts this pathname to absolute form if necessary, as if by invoking the getAbsolutePath() method, and then maps it to its unique form in a system-dependent way. This typically involves removing redundant names such as "." and ".." from the pathname, resolving symbolic links (on UNIX platforms), and converting drive letters to a standard case (on Microsoft Windows platforms).

I'm guessing the resolving symbolic links is what's happening here.

A simple fix is to change the test computation of the expected value from  
{noformat}
URL expectedUrl = new File(System.getProperty("user.dir"), "foo/bar/MyFile.xml").getCanonicalFile().toURL();
{noformat}
to
{noformat}
URL expectedUrl = new File(System.getProperty("user.dir"), "foo/bar/MyFile.xml").getAbsoluteFile().toURL();
{noformat}

I'll do this, and also check the rest of the tests in this file for more instances of this kind of thing.


> Import_implTest.testFindAbsoluteUrl fails on Hudson
> ---------------------------------------------------
>
>                 Key: UIMA-2051
>                 URL: https://issues.apache.org/jira/browse/UIMA-2051
>             Project: UIMA
>          Issue Type: Bug
>          Components: Build, Packaging and Test
>            Reporter: Jörn Kottmann
>            Priority: Minor
>
> This test fails on hudson and should be fixed.
> The following error messages is printed out:
> Error Message
> expected:<file:/zonestorage/hudson/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/uimaj-core/foo/bar/MyFile.xml> but was:<file:/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/uimaj-core/foo/bar/MyFile.xml>
> Stacktrace:
> junit.framework.AssertionFailedError: expected:<file:/zonestorage/hudson/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/uimaj-core/foo/bar/MyFile.xml> but was:<file:/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/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:124)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Re: [jira] Commented: (UIMA-2051) Import_implTest.testFindAbsoluteUrl fails on Hudson

Posted by Jörn Kottmann <ko...@gmail.com>.
Thanks, when you check in hudson will re-build the project (its polling 
hourly for SCM changes).

You can then see the status here:
https://hudson.apache.org/hudson/job/UIMA-SDK/

Anyway I can also trigger a re-build manually.

Jörn

On 2/22/11 3:01 PM, Marshall Schor (JIRA) wrote:
>      [ https://issues.apache.org/jira/browse/UIMA-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997802#comment-12997802 ]
>
> Marshall Schor commented on UIMA-2051:
> --------------------------------------
>
> The test :
>
> 1) sets up an Import_impl, with a path
> 2) asks the UIMA framework to resolve this into an "absolute" path, using a default resource manager,
> which in turn picks up the working directory as the base dir to use for resolution,
> 3) then compares it to a computed "canonical" path
>
> I think the issue arises because the /home in the "absolute" path is converted to /zonestorage/hudson/home in the canonical path.  The Javadocs for canonical path say:
>
> This method first converts this pathname to absolute form if necessary, as if by invoking the getAbsolutePath() method, and then maps it to its unique form in a system-dependent way. This typically involves removing redundant names such as "." and ".." from the pathname, resolving symbolic links (on UNIX platforms), and converting drive letters to a standard case (on Microsoft Windows platforms).
>
> I'm guessing the resolving symbolic links is what's happening here.
>
> A simple fix is to change the test computation of the expected value from
> {noformat}
> URL expectedUrl = new File(System.getProperty("user.dir"), "foo/bar/MyFile.xml").getCanonicalFile().toURL();
> {noformat}
> to
> {noformat}
> URL expectedUrl = new File(System.getProperty("user.dir"), "foo/bar/MyFile.xml").getAbsoluteFile().toURL();
> {noformat}
>
> I'll do this, and also check the rest of the tests in this file for more instances of this kind of thing.
>
>
>> Import_implTest.testFindAbsoluteUrl fails on Hudson
>> ---------------------------------------------------
>>
>>                  Key: UIMA-2051
>>                  URL: https://issues.apache.org/jira/browse/UIMA-2051
>>              Project: UIMA
>>           Issue Type: Bug
>>           Components: Build, Packaging and Test
>>             Reporter: Jörn Kottmann
>>             Priority: Minor
>>
>> This test fails on hudson and should be fixed.
>> The following error messages is printed out:
>> Error Message
>> expected:<file:/zonestorage/hudson/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/uimaj-core/foo/bar/MyFile.xml>  but was:<file:/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/uimaj-core/foo/bar/MyFile.xml>
>> Stacktrace:
>> junit.framework.AssertionFailedError: expected:<file:/zonestorage/hudson/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/uimaj-core/foo/bar/MyFile.xml>  but was:<file:/home/hudson/hudson-slave/workspace/UIMA-SDK/trunk/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:124)