You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2016/07/28 15:13:20 UTC

[jira] [Resolved] (METAMODEL-1104) ResourceFactoryRegsitryImplTest broken on Windows

     [ https://issues.apache.org/jira/browse/METAMODEL-1104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kasper Sørensen resolved METAMODEL-1104.
----------------------------------------
       Resolution: Fixed
         Assignee: Kasper Sørensen
    Fix Version/s: 4.5.4

> ResourceFactoryRegsitryImplTest broken on Windows
> -------------------------------------------------
>
>                 Key: METAMODEL-1104
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-1104
>             Project: Apache MetaModel
>          Issue Type: Bug
>    Affects Versions: 4.5.4
>            Reporter: Dennis Du Krøger
>            Assignee: Kasper Sørensen
>             Fix For: 4.5.4
>
>
> {{ResourceFactoryRegistryImplTest.testGetQualifiedFileResource()}} assumes Unix paths, which breaks the build on Windows machines:
> {code}
> java.lang.IllegalArgumentException: Illegal character in path at index 10: file:///C:\[path to MM folder]\core\src\test\resources\unicode-text-utf8.txt
> {code}
> Quick fix:
> {code:java}
>         final String uri = this.getClass().getClassLoader().getResource("unicode-text-utf8.txt").toString();
>         final Resource res = registry.createResource(new SimpleResourceProperties(uri));
> {code}
> (uri becomes file:/C:/[mm path]/core/target/test-classes/unicode-text-utf8.txt)
> When referring to test resources, it is usually more compatible and flexible to use {{getResource()}} instead of {{new File()}} calls (a bit of a nono since it assumes build system and working dir)...
> Not entirely sure what to do about the {{testGetUnqualifiedRelativeFileResource()}}, though. It again makes assumptions about file system layout, but at least it doesn't break anything



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)