Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review test: fix maven launcher test to find path using File separator #2129

Merged
merged 2 commits into from
Jun 28, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/test/java/spoon/MavenLauncherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;

import java.io.File;
import java.util.Arrays;
import java.util.List;

Expand Down Expand Up @@ -63,7 +64,9 @@ public void mavenLauncherTestMultiModulesAndVariables() {
List<String> classpath = Arrays.asList(launcher.getEnvironment().getSourceClasspath());
// in order to work on CI, make sure the version is the same in Spoon pom.xml
// else, we cannot guarantee that the dependency is present in .m2 cache and the test might fail
String lookingFor = "junit/junit/4.12/junit-4.12.jar";

String fileSep = File.separator;
String lookingFor = "junit" + fileSep + "junit" + fileSep + "4.12" + fileSep + "junit-4.12.jar";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is much nicer to use:

Paths.get("junit", "junit", "4.12", "junit-4.12.jar")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did that quickly and I did not really check how to do it properly ;) I'll fix it, thanks!


boolean findIt = false;
for (String s : classpath) {
Expand Down