Skip to content

Commit 3b5e168

Browse files
committed
Include RunAction into RunCommand
1 parent d8cbce2 commit 3b5e168

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/main/java/org/utplsql/cli/RunPicocliCommand.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
import org.utplsql.cli.config.FileMapperConfig;
44
import org.utplsql.cli.config.ReporterConfig;
55
import org.utplsql.cli.config.RunCommandConfig;
6-
import picocli.CommandLine.*;
6+
import picocli.CommandLine.ArgGroup;
7+
import picocli.CommandLine.Command;
8+
import picocli.CommandLine.Option;
9+
import picocli.CommandLine.Parameters;
710

811
import java.util.*;
9-
import java.util.concurrent.Callable;
1012

1113
@Command( name = "run", description = "run tests")
12-
public class RunPicocliCommand implements Callable<RunCommandConfig> {
14+
public class RunPicocliCommand implements ICommand {
1315

1416
@Parameters(description = ConnectionInfo.COMMANDLINE_PARAM_DESCRIPTION)
1517
private String connectionString;
@@ -172,9 +174,7 @@ private String[] splitOrEmpty(String value) {
172174
}
173175
}
174176

175-
@Override
176-
public RunCommandConfig call() throws Exception {
177-
177+
public RunCommandConfig getRunCommandConfig() {
178178
// Prepare path elements
179179
ArrayList<String> suitePaths = new ArrayList<>();
180180
for ( String pathElem : paths ) {
@@ -227,4 +227,15 @@ else if ( logDebug ) {
227227
randomTestOrder,
228228
randomTestOrderSeed);
229229
}
230+
231+
@Override
232+
public int run() {
233+
RunAction action = new RunAction(getRunCommandConfig());
234+
return action.run();
235+
}
236+
237+
@Override
238+
public String getCommand() {
239+
return null;
240+
}
230241
}

src/test/java/org/utplsql/cli/PicocliRunCommandTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private RunCommandConfig parseForConfig( String... args ) throws Exception {
2121
List<CommandLine> parsed = cline.parse(args);
2222

2323
RunPicocliCommand runCmd = parsed.get(1).getCommand();
24-
return runCmd.call();
24+
return runCmd.getRunCommandConfig();
2525
}
2626

2727
@Test

src/test/java/org/utplsql/cli/TestHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static RunCommandConfig parseRunConfig(String... args ) throws Exception {
4343
List<CommandLine> parsed = cline.parse(args);
4444

4545
RunPicocliCommand runCmd = parsed.get(1).getCommand();
46-
return runCmd.call();
46+
return runCmd.getRunCommandConfig();
4747
}
4848

4949
static RunAction createRunAction(String... args) throws Exception {

0 commit comments

Comments
 (0)