Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-380

Integration tests with errors on Windows caused by File separator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ext-resolver
    • Labels:
      None

      Description

      Line 43 of ArtifactDependenciesUnitTestCase.java outputs the following error:

      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)
      

      Changing the line from:

      FileUtil.removeDirectory(new File("target/profile-repository"));
      

      to:

      new File("target/profile-repository").delete();
      

      fixes it.

      Line 75 of ResourceUtil.java outputs the following error:

      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)
      

      Changing the line from:

      File localResource = new File(tmpDir, resourceName.replaceAll(File.separator, "-").replaceAll(File.pathSeparator, "-").replaceAll("\\s", "-"));
      

      to:

      File localResource = new File(tmpDir, resourceName.replaceAll("/", "-").replaceAll(File.pathSeparator, "-").replaceAll("\\s", "-"));
      

      fixes it.

        Attachments

          Activity

            People

            Assignee:
            silenius_jira Samuel Santos (Inactive)
            Reporter:
            silenius_jira Samuel Santos (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: