-
Notifications
You must be signed in to change notification settings - Fork 16
Feature/new cli library #154
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
Changes from 1 commit
6717057
038981f
b21f651
ce849fc
5520562
f9c4cf7
d8cbce2
3b5e168
60997d7
d13ae5b
5e86b01
00f3f5f
2ce4e91
b88d5c5
c80dc8c
8eec2cb
ded39d3
6922e52
5aa4c1d
60fcfaf
a3608b5
09bf357
1b65b51
77fd752
e443e3c
0bdca7d
ae0e9c4
f47c0de
bb18ea1
1a984ff
81e0953
a8acbb9
10bef7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| import java.sql.Connection; | ||
| import java.sql.SQLException; | ||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.concurrent.ExecutorService; | ||
|
|
||
|
|
@@ -23,10 +24,16 @@ class ReporterManager { | |
| private ExecutorService executorService; | ||
|
|
||
| ReporterManager(List<String> reporterParams ) { | ||
| initReporterOptionsList(reporterParams); | ||
| parseReporterOptionsList(reporterParams); | ||
| initReporterOptionsList(); | ||
| } | ||
|
|
||
| private void initReporterOptionsList( List<String> reporterParams ) { | ||
| ReporterManager( ReporterOptions[] reporterOptions ) { | ||
| this.reporterOptionsList = Arrays.asList(reporterOptions); | ||
| initReporterOptionsList(); | ||
| } | ||
|
|
||
| private void parseReporterOptionsList( List<String> reporterParams ) { | ||
| reporterOptionsList = new ArrayList<>(); | ||
| ReporterOptions reporterOptions = null; | ||
|
|
||
|
|
@@ -44,13 +51,21 @@ private void initReporterOptionsList( List<String> reporterParams ) { | |
| reporterOptions.forceOutputToScreen(true); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private void initReporterOptionsList( ) { | ||
|
|
||
| // If no reporter parameters were passed, use default reporter. | ||
| if (reporterOptionsList.isEmpty()) { | ||
| reporterOptionsList.add(new ReporterOptions(CoreReporters.UT_DOCUMENTATION_REPORTER.name())); | ||
| reporterOptionsList = new ArrayList<>(); | ||
| reporterOptionsList.add(getDefaultReporterOption()); | ||
| } | ||
| } | ||
|
|
||
| private ReporterOptions getDefaultReporterOption() { | ||
| return new ReporterOptions(CoreReporters.UT_DOCUMENTATION_REPORTER.name()); | ||
| } | ||
|
|
||
| private void abortGathering(Throwable e) { | ||
| addGatherError(e); | ||
| executorService.shutdownNow(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realized this might be an issue. We get the executorService from the outside but we shut it down here. I'm concerned if the caller is ok with its executorService been shut down.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's actually the purpose: If one Reporter Consumption fails, it should abort all the other Reporter threads.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets abort tasks then, not the excutor
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, will make that more clear in a restructured version |
||
|
|
||
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.
haveGatherErrorsOccuredandgetGatherErrors(below) are not used andhaveGatherErrorsOccuredcontains typo