Skip to content

Commit

Permalink
Fix for issue #1220. (#1221)
Browse files Browse the repository at this point in the history
Signed-off-by: William Rose <william.rose@nuance.com>
  • Loading branch information
wrosenuance authored and rhuss committed Apr 24, 2019
1 parent 4266c17 commit 70ce4f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

* **0.30-SNAPSHOT** (2019-04-23)
- Fix test cases on Windows ([#1220](https://github.com/fabric8io/docker-maven-plugin/issues/1220))

* **0.30.0** (2019-04-21)
- Restore ANSI color to Maven logging if disabled during plugin execution and enable color for Windows with Maven 3.5.0 or later. Color logging is enabled by default, but disabled if the Maven CLI disables color (e.g. in batch mode) ([#1108](https://github.com/fabric8io/docker-maven-plugin/issues/1108))
- Fix NPE if docker:save is called with -Dfile=file-name-only.tar ([#1203](https://github.com/fabric8io/docker-maven-plugin/issues/1203))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,26 @@ public void simpleDockerfileWithoutParentDir() {
"/context", "/other/Dockerfile", "/context", "/other/Dockerfile"
};

// If the tests are run on Windows, the expected paths need to be adjusted.
// On platforms that use the Unix convention, the following does not actually change
// the test data.
for (int i = 0; i < data.length; ++i) {
if(data[i] != null) {
File file = new File(data[i]);
if(data[i].startsWith("/")) {
file = file.getAbsoluteFile();
}
data[i] = file.getPath();
}
}

for (int i = 0; i < data.length; i+= 4) {
BuildImageConfiguration config =
new BuildImageConfiguration.Builder()
.contextDir(data[i])
.dockerFile(data[i + 1]).build();
config.initAndValidate(logger);


assertEquals(data[i + 2], config.getAbsoluteContextDirPath(params).getAbsolutePath());
assertEquals(data[i + 3], config.getAbsoluteDockerFilePath(params).getAbsolutePath());
}
Expand Down

0 comments on commit 70ce4f5

Please sign in to comment.