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 1
1
package org .utplsql .cli ;
2
2
3
- /** Interface to decouple JCommander commands
3
+ /** This is the very basic interface that should be implemented by all utPLSQL cli commands
4
4
*
5
5
* @author pesse
6
6
*/
7
7
public interface ICommand {
8
- int run ();
9
8
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 ();
11
15
}
Original file line number Diff line number Diff line change 6
6
import org .utplsql .api .reporter .inspect .ReporterInfo ;
7
7
import org .utplsql .api .reporter .inspect .ReporterInspector ;
8
8
import org .utplsql .cli .exception .DatabaseConnectionFailed ;
9
- import picocli .CommandLine .*;
9
+ import picocli .CommandLine .Command ;
10
+ import picocli .CommandLine .Parameters ;
10
11
11
12
import javax .sql .DataSource ;
12
13
import java .io .PrintStream ;
13
14
import java .sql .Connection ;
14
- import java .util .*;
15
+ import java .util .Arrays ;
16
+ import java .util .Comparator ;
17
+ import java .util .List ;
15
18
16
19
@ Command ( name = "reporters" , description = "prints a list of reporters available in the specified database" )
17
20
public class ReportersCommand implements ICommand {
@@ -43,11 +46,6 @@ public int run() {
43
46
return 0 ;
44
47
}
45
48
46
- @ Override
47
- public String getCommand () {
48
- return "reporters" ;
49
- }
50
-
51
49
private void writeReporters (List <ReporterInfo > reporterInfos , PrintStream out ) {
52
50
reporterInfos .stream ()
53
51
.sorted (Comparator .comparing (ReporterInfo ::getName ))
Original file line number Diff line number Diff line change @@ -249,11 +249,6 @@ public int run() {
249
249
return getRunAction ().run ();
250
250
}
251
251
252
- @ Override
253
- public String getCommand () {
254
- return null ;
255
- }
256
-
257
252
@ Override
258
253
public TestRunner newTestRunner (List <Reporter > reporterList ) {
259
254
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 {
48
48
}
49
49
}
50
50
}
51
-
52
- @ Override
53
- public String getCommand () {
54
- return "info" ;
55
- }
56
51
}
You can’t perform that action at this time.
0 commit comments