Skip to content

Commit 145190d

Browse files
fix
1 parent 9a39a00 commit 145190d

File tree

2 files changed

+15
-2
lines changed
  • core/esmf-aspect-meta-model-java/src

2 files changed

+15
-2
lines changed

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/ModelsRoot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public File determineAspectModelFile( final AspectModelUrn urn ) {
5959
private static File resolveByCanonicalPath( final Path path ) {
6060
File file = path.toFile();
6161
try {
62-
if ( Objects.equals( path.toString(), file.getCanonicalPath() ) ) {
62+
if ( Objects.equals( path.normalize().toString(), file.getCanonicalPath() ) ) {
6363
return file;
6464
}
6565
} catch ( IOException exception ) {

core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/fs/ModelsRootTest.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ void resolveByCanonicalPathShouldReturnFileWhenCanonicalPathMatches() throws Exc
1919

2020
File result = invokeResolveByCanonicalPath( testPath );
2121

22-
assertThat( result ).isEqualTo( testPath.toFile() );
22+
assertThat( result )
23+
.matches( File::exists )
24+
.isEqualTo( testPath.toFile() );
25+
}
26+
27+
@Test
28+
void resolveByCanonicalPathShouldReturnFileWhenCanonicalPathMatchesForSpecificPath() throws Exception {
29+
Path testPath = Paths.get( "src/test/resources/resolve_empty/../resolve", "Aspect.ttl" ).toAbsolutePath();
30+
31+
File result = invokeResolveByCanonicalPath( testPath );
32+
33+
assertThat( result )
34+
.matches( File::exists )
35+
.isEqualTo( testPath.toFile() );
2336
}
2437

2538
@Test

0 commit comments

Comments
 (0)