[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-380) Integration tests with errors on Windows caused by File separator

Samuel Santos (JIRA) jira-events at lists.jboss.org
Mon Feb 6 20:29:48 EST 2012


    [ https://issues.jboss.org/browse/SHRINKWRAP-380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664661#comment-12664661 ] 

Samuel Santos commented on SHRINKWRAP-380:
------------------------------------------

Those are just quick fixes, there are probably better fixes.
Please comment.
                
> Integration tests with errors on Windows caused by File separator
> -----------------------------------------------------------------
>
>                 Key: SHRINKWRAP-380
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-380
>             Project: ShrinkWrap
>          Issue Type: Bug
>          Components: ext-resolver
>            Reporter: Samuel Santos
>            Assignee: Samuel Santos
>
> Line 43 of ArtifactDependenciesUnitTestCase.java outputs the following error:
> {noformat}
> testPomBasedArtifactLocatedInClassPath(org.jboss.shrinkwrap.resolver.impl.maven.ArtifactDependenciesUnitTestCase)  Time elapsed: 0.034 sec  <<< ERROR!
> java.io.IOException: Could not delete directory f:\projects\GitHub\resolver\impl-maven\target\profile-repository\org\jboss\shrinkwrap\test\test-dependency\1.0.0
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:48)
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:45)
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:45)
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:45)
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:45)
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:45)
> 	at org.jboss.shrinkwrap.resolver.util.FileUtil.removeDirectory(FileUtil.java:45)
> 	at org.jboss.shrinkwrap.resolver.impl.maven.ArtifactDependenciesUnitTestCase.cleanup(ArtifactDependenciesUnitTestCase.java:43)
> {noformat}
> Changing the line from:
> {code}
> FileUtil.removeDirectory(new File("target/profile-repository"));
> {code}
> to:
> {code}
> new File("target/profile-repository").delete();
> {code}
> fixes it.
> Line 75 of ResourceUtil.java outputs the following error:
> {noformat}
> testPomBasedArtifactLocatedInClassPath(org.jboss.shrinkwrap.resolver.impl.maven.ArtifactDependenciesUnitTestCase)  Time elapsed: 0.17 sec  <<< ERROR!
> java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
> \
>  ^
> 	at java.util.regex.Pattern.error(Pattern.java:1924)
> 	at java.util.regex.Pattern.compile(Pattern.java:1671)
> 	at java.util.regex.Pattern.<init>(Pattern.java:1337)
> 	at java.util.regex.Pattern.compile(Pattern.java:1022)
> 	at java.lang.String.replaceAll(String.java:2210)
> 	at org.jboss.shrinkwrap.resolver.impl.maven.util.ResourceUtil.temporaryFile(ResourceUtil.java:75)
> 	at org.jboss.shrinkwrap.resolver.impl.maven.util.ResourceUtil.getLocalResourcePathFromResourceName(ResourceUtil.java:51)
> 	at org.jboss.shrinkwrap.resolver.impl.maven.util.ResourceUtil.resolvePathByQualifier(ResourceUtil.java:62)
> 	at org.jboss.shrinkwrap.resolver.impl.maven.MavenDependencyResolverImpl.configureFrom(MavenDependencyResolverImpl.java:28)
> 	at org.jboss.shrinkwrap.resolver.impl.maven.ArtifactDependenciesUnitTestCase.testPomBasedArtifactLocatedInClassPath(ArtifactDependenciesUnitTestCase.java:89)
> {noformat}
> Changing the line from:
> {code}
> File localResource = new File(tmpDir, resourceName.replaceAll(File.separator, "-").replaceAll(File.pathSeparator, "-").replaceAll("\\s", "-"));
> {code}
> to:
> {code}
> File localResource = new File(tmpDir, resourceName.replaceAll("/", "-").replaceAll(File.pathSeparator, "-").replaceAll("\\s", "-"));
> {code}
> fixes it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the shrinkwrap-issues mailing list