File tree Expand file tree Collapse file tree 4 files changed +12
-20
lines changed
src/main/java/org/utplsql/cli Expand file tree Collapse file tree 4 files changed +12
-20
lines changed Original file line number Diff line number Diff line change 11package org .utplsql .cli ;
22
3- /** Interface to decouple JCommander commands
3+ /** This is the very basic interface that should be implemented by all utPLSQL cli commands
44 *
55 * @author pesse
66 */
77public interface ICommand {
8- int run ();
98
10- String getCommand ();
9+ /** We expect the command to handle all eventually occuring exceptions
10+ * and return an exit code
11+ *
12+ * @return exit code integer
13+ */
14+ int run ();
1115}
Original file line number Diff line number Diff line change 66import org .utplsql .api .reporter .inspect .ReporterInfo ;
77import org .utplsql .api .reporter .inspect .ReporterInspector ;
88import org .utplsql .cli .exception .DatabaseConnectionFailed ;
9- import picocli .CommandLine .*;
9+ import picocli .CommandLine .Command ;
10+ import picocli .CommandLine .Parameters ;
1011
1112import javax .sql .DataSource ;
1213import java .io .PrintStream ;
1314import java .sql .Connection ;
14- import java .util .*;
15+ import java .util .Arrays ;
16+ import java .util .Comparator ;
17+ import java .util .List ;
1518
1619@ Command ( name = "reporters" , description = "prints a list of reporters available in the specified database" )
1720public class ReportersCommand implements ICommand {
@@ -43,11 +46,6 @@ public int run() {
4346 return 0 ;
4447 }
4548
46- @ Override
47- public String getCommand () {
48- return "reporters" ;
49- }
50-
5149 private void writeReporters (List <ReporterInfo > reporterInfos , PrintStream out ) {
5250 reporterInfos .stream ()
5351 .sorted (Comparator .comparing (ReporterInfo ::getName ))
Original file line number Diff line number Diff line change @@ -249,11 +249,6 @@ public int run() {
249249 return getRunAction ().run ();
250250 }
251251
252- @ Override
253- public String getCommand () {
254- return null ;
255- }
256-
257252 @ Override
258253 public TestRunner newTestRunner (List <Reporter > reporterList ) {
259254 return getRunAction ().newTestRunner (reporterList );
Original file line number Diff line number Diff line change @@ -48,9 +48,4 @@ private void writeUtPlsqlVersion( String connectString ) throws SQLException {
4848 }
4949 }
5050 }
51-
52- @ Override
53- public String getCommand () {
54- return "info" ;
55- }
5651}
You can’t perform that action at this time.
0 commit comments