Skip to content

Commit

Permalink
Fix tests assertions for windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 2, 2023
1 parent 8050381 commit 7e60f26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void testBasicDeployFile(DeployFileMojo mojo) throws Exception {
assertTrue(p2.toString().endsWith(".pom"));

assertNotNull(request.getRepository());
assertEquals(url, request.getRepository().getUrl());
assertEquals(url.replace(File.separator, "/"), request.getRepository().getUrl());

// check the generated pom
File pom = p2.toFile();
Expand Down Expand Up @@ -157,7 +157,7 @@ public void testDeployIfClassifierIsSet(DeployFileMojo mojo) throws Exception {
assertTrue(p2.toString().endsWith(".pom"));
// remote repository
assertNotNull(request.getRepository());
assertEquals(url, request.getRepository().getUrl());
assertEquals(url.replace(File.separator, "/"), request.getRepository().getUrl());
}

@Test
Expand Down Expand Up @@ -188,7 +188,7 @@ public void testDeployIfArtifactIsNotJar(DeployFileMojo mojo) throws Exception {

assertNotNull(request.getRepository());
assertEquals(
"file://" + getBasedir() + "/target/remote-repo/deploy-file",
"file://" + getBasedir().replace(File.separator, "/") + "/target/remote-repo/deploy-file",
request.getRepository().getUrl());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void testBasicDeploy(DeployMojo mojo) throws Exception {
new ArtifactStub("org.apache.maven.test", "maven-deploy-test", "", "1.0-SNAPSHOT", "jar"),
new ArtifactStub("org.apache.maven.test", "maven-deploy-test", "", "1.0-SNAPSHOT", "pom"))),
artifacts);
assertEquals(getBasedir(), request.getRepository().getUrl());
assertEquals(getBasedir().replace(File.separator, "/"), request.getRepository().getUrl());
}

@Test
Expand Down Expand Up @@ -156,7 +156,7 @@ public void testBasicDeployWithPackagingAsPom(DeployMojo mojo) throws Exception
Collections.singleton(
new ArtifactStub("org.apache.maven.test", "maven-deploy-test", "", "1.0-SNAPSHOT", "pom")),
artifacts);
assertEquals(getBasedir(), request.getRepository().getUrl());
assertEquals(getBasedir().replace(File.separator, "/"), request.getRepository().getUrl());
}

@Test
Expand Down Expand Up @@ -194,7 +194,7 @@ public void testDeployWithAttachedArtifacts(DeployMojo mojo) throws Exception {
new ArtifactStub(
"org.apache.maven.test", "attached-artifact-test", "", "1.0-SNAPSHOT", "jar"))),
artifacts);
assertEquals(getBasedir(), request.getRepository().getUrl());
assertEquals(getBasedir().replace(File.separator, "/"), request.getRepository().getUrl());
}

@Test
Expand Down

0 comments on commit 7e60f26

Please sign in to comment.