-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from TNG/bugfix/fix-jdk13-module-name-resolution
fix broken JRT URL handling for JDK >= 13
- Loading branch information
Showing
5 changed files
with
89 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
archunit/src/test/java/com/tngtech/archunit/core/importer/NormalizedUriTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.tngtech.archunit.core.importer; | ||
|
||
import java.net.URI; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class NormalizedUriTest { | ||
@Test | ||
public void normalizes_URI() { | ||
NormalizedUri uri = NormalizedUri.from(URI.create("prot:/some/.././uri/.")); | ||
|
||
assertThat(uri.toURI()).isEqualTo(URI.create("prot:/uri/")); | ||
} | ||
|
||
@Test | ||
public void normalizes_URI_from_string() { | ||
NormalizedUri uri = NormalizedUri.from("prot:/some/../uri/."); | ||
|
||
assertThat(uri.toURI()).isEqualTo(URI.create("prot:/uri/")); | ||
} | ||
|
||
@Test | ||
public void parses_first_segment() { | ||
NormalizedUri uri = NormalizedUri.from("jrt:/java.base/java/io/File.class"); | ||
|
||
assertThat(uri.getFirstSegment()).isEqualTo("java.base"); | ||
|
||
uri = NormalizedUri.from("jrt:/java.base"); | ||
|
||
assertThat(uri.getFirstSegment()).isEqualTo("java.base"); | ||
} | ||
|
||
@Test | ||
public void parses_tail_segments() { | ||
NormalizedUri uri = NormalizedUri.from("jrt:/java.base/java/io/File.class"); | ||
|
||
assertThat(uri.getTailSegments()).isEqualTo("java/io/File.class"); | ||
|
||
uri = NormalizedUri.from("jrt:/java.base"); | ||
|
||
assertThat(uri.getTailSegments()).isEmpty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters