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
A little enhancement of report #1303
base: master
Are you sure you want to change the base?
A little enhancement of report #1303
Conversation
Hi @the-end-sea-of-the-world, welcome to the JaCoCo project and thanks for your contribution! We try to provide a regression test for every feature. What about adding (or extending) the existing tests to validate your code? Also your implementation will not work on Unix/Linux system where the path separator is a forward slash /. Instead of parsing Strings the |
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.
- Add unit test
- Use
java.io.File
API to also support Unix path separators
Thanks for your suggestion, I will try to modify it. |
Hello, I have changed the code to use |
@the-end-sea-of-the-world thanks for the update! To be honest I don't think we will maintain the demo code in the JaCoCo project. May I ask you to remove it? |
@@ -78,4 +78,88 @@ public void should_not_print_any_output_when_quiet_option_is_given() | |||
assertNoOutput(err); | |||
} | |||
|
|||
@Test | |||
public void should_not_print_error_message_when_parent_file_of_xml_does_not_exist() throws Exception { |
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.
The exitsting ReportTest
is the better place to test the Report
class.
private IReportVisitor createReportVisitor() throws IOException { | ||
final List<IReportVisitor> visitors = new ArrayList<IReportVisitor>(); | ||
|
||
if (xml != null) { | ||
final File folder = xml.getParentFile(); |
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 extract a private method createParent()
to avoid code duplication.
Thanks for your advice. There are a lot of things in school these days. I will modify the code on the weekend. |
@marchof all the problems have been solved. Is there any other one? |
Deal with issue #1100. Check the parent file of csv and xml, create if it does not exist.