You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Dennis Du Krøger (JIRA)" <ji...@apache.org> on 2016/07/12 15:30:20 UTC

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

Dennis Du Krøger created METAMODEL-1104:
-------------------------------------------

             Summary: 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


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