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 #3354 from liquibase/fix-uriresource-resolve
Fixed URIResource.resolveSibling
- Loading branch information
Showing
4 changed files
with
27 additions
and
4 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
17 changes: 15 additions & 2 deletions
17
liquibase-core/src/test/groovy/liquibase/resource/URIResourceAccessorTest.groovy
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 |
---|---|---|
@@ -1,10 +1,23 @@ | ||
package liquibase.resource | ||
|
||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
|
||
class URIResourceAccessorTest extends Specification { | ||
|
||
// "file:/c:/" | "file:/c:/" | ||
// "http://example.local/nowhere.txt" | "http://example.local/nowhere.txt" | ||
@Unroll | ||
def resolveSibling() { | ||
when: | ||
def newResource = new URIResource(path, URI.create(uri)).resolveSibling(input) | ||
|
||
then: | ||
newResource.uri.toString() == expectedUri | ||
newResource.path == expectedPath | ||
|
||
where: | ||
path | uri | input | expectedUri | expectedPath | ||
"my/file.xml" | "file:/local/my/file.xml" | "other.csv" | "file:/local/my/other.csv" | "my/other.csv" | ||
"liquibase/harness/data/changelogs/loadData.xml" | "jar:file:/C:/Users/example/liquibase-test-harness-1.0.6.jar!/liquibase/harness/data/changelogs/loadData.xml" | "load.csv" | "jar:file:/C:/Users/example/liquibase-test-harness-1.0.6.jar!/liquibase/harness/data/changelogs/load.csv" | "liquibase/harness/data/changelogs/load.csv" | ||
"my/file.xml" | "http:/local/my/file.xml" | "other.csv" | "http:/local/my/other.csv" | "my/other.csv" | ||
} | ||
} |
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