-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
73 additions
and
57 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
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 |
---|---|---|
|
@@ -33,7 +33,18 @@ public void testLocationParsing(String scheme) { | |
String p1 = scheme + "://[email protected]/path/to/file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
||
@ParameterizedTest | ||
@ValueSource(strings = {"wasb", "wasbs"}) | ||
public void testWasbLocatonParsing(String scheme) { | ||
String p1 = scheme + "://[email protected]/path/to/file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
@@ -43,7 +54,7 @@ public void testEncodedString() { | |
String p1 = "abfs://[email protected]/path%20to%20file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path%20to%20file"); | ||
} | ||
|
@@ -67,7 +78,7 @@ public void testNoContainer() { | |
String p1 = "abfs://account.dfs.core.windows.net/path/to/file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().isPresent()).isFalse(); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
@@ -77,28 +88,16 @@ public void testNoPath() { | |
String p1 = "abfs://[email protected]"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo(""); | ||
} | ||
|
||
@Test | ||
public void testQueryAndFragment() { | ||
String p1 = "abfs://[email protected]/path/to/file?query=foo#123"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
||
@Test | ||
public void testQueryAndFragmentNoPath() { | ||
String p1 = "abfs://[email protected]?query=foo#123"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo(""); | ||
@ParameterizedTest | ||
@ValueSource(strings = {"file?.txt", "file%3F.txt"}) | ||
public void testQuestionMarkInFileName(String path) { | ||
String fullPath = String.format("abfs://[email protected]/%s", path); | ||
ADLSLocation location = new ADLSLocation(fullPath); | ||
assertThat(location.path()).contains(path); | ||
} | ||
} |
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
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