2828public class DummyExecutor implements Executor {
2929
3030 private final FileSystem fileSystem ;
31+ private final BugReporter bugReporter ;
3132 private final Path inputDir ;
3233 private final ManualClock clock = new ManualClock ();
3334 @ Nullable private final OptionsProvider optionsProvider ;
35+ @ Nullable private final ShowSubcommands showSubcommands ;
3436
3537 public DummyExecutor (
36- FileSystem fileSystem , Path inputDir , @ Nullable OptionsProvider optionsProvider ) {
38+ FileSystem fileSystem ,
39+ BugReporter bugReporter ,
40+ Path inputDir ,
41+ @ Nullable OptionsProvider optionsProvider ,
42+ @ Nullable ShowSubcommands showSubcommands ) {
3743 this .fileSystem = fileSystem ;
44+ this .bugReporter = bugReporter ;
3845 this .inputDir = inputDir ;
3946 this .optionsProvider = optionsProvider ;
47+ this .showSubcommands = showSubcommands ;
48+ }
49+
50+ public DummyExecutor (
51+ FileSystem fileSystem , Path inputDir , @ Nullable OptionsProvider optionsProvider ) {
52+ this (
53+ fileSystem ,
54+ BugReporter .defaultInstance (),
55+ inputDir ,
56+ optionsProvider ,
57+ /*showSubcommands=*/ null );
4058 }
4159
4260 public DummyExecutor (FileSystem fileSystem , Path inputDir ) {
@@ -64,7 +82,7 @@ public Clock getClock() {
6482
6583 @ Override
6684 public BugReporter getBugReporter () {
67- return BugReporter . defaultInstance () ;
85+ return bugReporter ;
6886 }
6987
7088 @ Override
@@ -82,6 +100,9 @@ public OptionsProvider getOptions() {
82100
83101 @ Override
84102 public ShowSubcommands reportsSubcommands () {
103+ if (showSubcommands != null ) {
104+ return showSubcommands ;
105+ }
85106 throw new UnsupportedOperationException ();
86107 }
87108}
0 commit comments