Skip to content

Commit c80dc8c

Browse files
committed
Refactor RunCommandTest to cover new approach
No need for RunActionTest anymore
1 parent b88d5c5 commit c80dc8c

File tree

3 files changed

+4
-139
lines changed

3 files changed

+4
-139
lines changed

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
public class PicocliRunCommandTest {
1717

1818
private RunCommandConfig parseForConfig( String... args ) throws Exception {
19-
Object obj = new UtplsqlPicocliCommand();
20-
CommandLine cline = new CommandLine(obj);
21-
cline.setTrimQuotes(true);
22-
List<CommandLine> parsed = cline.parse(args);
23-
24-
RunPicocliCommand runCmd = parsed.get(1).getCommand();
25-
return runCmd.getRunCommandConfig();
19+
return TestHelper.parseRunConfig(args);
2620
}
2721

2822
@Test

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

Lines changed: 0 additions & 129 deletions
This file was deleted.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void reporterOptions_TwoReporters() {
8181
assertEquals(CoreReporters.UT_DOCUMENTATION_REPORTER.name(), reporterOptions1.getReporterName());
8282
assertNull(reporterOptions1.getOutputFileName());
8383
assertFalse(reporterOptions1.outputToFile());
84-
assertTrue(reporterOptions1.outputToScreen());
84+
assertFalse(reporterOptions1.outputToScreen());
8585

8686
ReporterOptions reporterOptions2 = reporterOptionsList.get(1);
8787
assertEquals(CoreReporters.UT_COVERAGE_HTML_REPORTER.name(), reporterOptions2.getReporterName());
@@ -91,7 +91,7 @@ void reporterOptions_TwoReporters() {
9191
}
9292

9393
@Test
94-
void randomOrder_default() {
94+
void randomOrder_default() throws Exception {
9595
IRunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString());
9696

9797
TestRunnerOptions options = runCmd.newTestRunner(new ArrayList<>()).getOptions();
@@ -102,7 +102,7 @@ void randomOrder_default() {
102102
@Test
103103
void randomOrder_withoutSeed() {
104104
IRunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString(),
105-
"-random");
105+
"-r");
106106

107107
TestRunnerOptions options = runCmd.newTestRunner(new ArrayList<>()).getOptions();
108108
assertThat(options.randomTestOrder, equalTo(true));

0 commit comments

Comments
 (0)