-
Notifications
You must be signed in to change notification settings - Fork 200
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
Unit tests #58
Unit tests #58
Conversation
Couple of questions/issues
|
You should always override equals and hashCode if you're comparing objects, your IDE should be able to generate sensible ones. |
@@ -154,4 +155,13 @@ public String toString() { | |||
} | |||
return name + " " + version + " " + url; | |||
} | |||
|
|||
@SuppressFBWarnings("EQ_COMPARETO_USE_OBJECT_EQUALS") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please no see my comment in the main thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good to know. I thought in particular generating the hashCode method was going to be really complicated, but that was fairly easy.
} | ||
installedPluginVersions.entrySet().stream() | ||
.sorted(Map.Entry.comparingByValue()) | ||
.forEach(p -> System.out.println(p.getKey() + " " + p.getValue())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could probably extract this to a method as it's called 3 times and then use something like:
.forEach(p -> System.out.println(p.getKey() + " " + p.getValue())); | |
.forEach(this::logPlugin); |
assertEquals("", expectedNoOutput.toString().trim()); | ||
} | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's currently commented out because it's not working. For some reason the value returned/output to the console is empty.
Looks like this was hit with the pom version issues. The tests are not on the CI server. |
Random thought: the windows failure in the test could be line endings. You might have to do more of line by line comparison to see if the output is being printed correctly, |
Yeah, I knew this was potentially going to be a problem. See my question #3. Is there an easier way for me to test without having to push a new commit each time? |
Windows VM? |
I think what you want to do is a simple string replace for the generated string like |
https://issues.jenkins-ci.org/browse/JENKINS-57864