slachiewicz commented on issue #192: [MNG-6261] - using java File api to compare
URL: https://github.com/apache/maven/pull/192#issuecomment-442282452
 
 
   +1
   
   And one more small testcase - should pass before/after patch
   `org.apache.maven.model.building.FileModelSource#getRelatedSource` - one use 
of normalize
   
   ```
      @Test
       public void testDiffrentPaths () throws IOException {
           Path tempDirParent = Files.createTempDirectory( "FileModelSource-" );
           Path subdir = Files.createDirectory( tempDirParent.resolve( "test" ) 
);
           Path pomFile = Files.createTempFile(subdir, "myCustomPom-", ".xml" );
   
           Path relativeFile = subdir.resolve( "../test/" + 
pomFile.getFileName() );
   
           assertNotEquals( pomFile, relativeFile );
           assertEquals( pomFile.normalize(), relativeFile.normalize());
   
           assertNotEquals( pomFile.toFile(), relativeFile.toFile() );
           assertNotEquals( pomFile.toFile().toURI(), 
relativeFile.toFile().toURI() );
   
           assertEquals( pomFile.toFile().getCanonicalFile(), 
relativeFile.toFile().getCanonicalFile() );
           assertEquals( pomFile.toFile().toURI().normalize(), 
relativeFile.toFile().toURI().normalize() );
   
           FileModelSource instance = new FileModelSource( pomFile.toFile() );
   
           assertNotEquals(instance, new FileModelSource( relativeFile.toFile() 
) );
       }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to