Skip to content

Commit 286cdba

Browse files
pesseSamuel Nitsche
authored andcommitted
Adjusted default run-Test and refactoring
1 parent 6bb3488 commit 286cdba

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ private RunCommand createRunCommand(String... args) {
3333
return runCmd;
3434
}
3535

36+
private String getConnectionString() {
37+
return sUser + "/" + sPass + "@" + sUrl;
38+
}
39+
3640
@Test
3741
public void reporterOptions_Default() {
38-
RunCommand runCmd = createRunCommand("app/app@xe");
42+
RunCommand runCmd = createRunCommand(getConnectionString());
3943

4044
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
4145

@@ -48,7 +52,7 @@ public void reporterOptions_Default() {
4852

4953
@Test
5054
public void reporterOptions_OneReporter() {
51-
RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-o=output.txt");
55+
RunCommand runCmd = createRunCommand(getConnectionString(), "-f=ut_documentation_reporter", "-o=output.txt");
5256

5357
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
5458

@@ -61,7 +65,7 @@ public void reporterOptions_OneReporter() {
6165

6266
@Test
6367
public void reporterOptions_OneReporterForceScreen() {
64-
RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-o=output.txt", "-s");
68+
RunCommand runCmd = createRunCommand(getConnectionString(), "-f=ut_documentation_reporter", "-o=output.txt", "-s");
6569

6670
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
6771

@@ -74,7 +78,7 @@ public void reporterOptions_OneReporterForceScreen() {
7478

7579
@Test
7680
public void reporterOptions_OneReporterForceScreenInverse() {
77-
RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-s", "-o=output.txt");
81+
RunCommand runCmd = createRunCommand(getConnectionString(), "-f=ut_documentation_reporter", "-s", "-o=output.txt");
7882

7983
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
8084

@@ -87,7 +91,7 @@ public void reporterOptions_OneReporterForceScreenInverse() {
8791

8892
@Test
8993
public void reporterOptions_TwoReporters() {
90-
RunCommand runCmd = createRunCommand("app/app@xe",
94+
RunCommand runCmd = createRunCommand(getConnectionString(),
9195
"-f=ut_documentation_reporter",
9296
"-f=ut_coverage_html_reporter", "-o=coverage.html", "-s");
9397

@@ -108,11 +112,14 @@ public void reporterOptions_TwoReporters() {
108112

109113
@Test
110114
public void run_Default() {
111-
RunCommand runCmd = createRunCommand(sUser + "/" + sPass + "@" + sUrl);
115+
RunCommand runCmd = createRunCommand(getConnectionString(),
116+
"-f=ut_documentation_reporter",
117+
"-c",
118+
"--failure-exit-code=2");
112119

113120
try {
114121
int result = runCmd.run();
115-
Assert.assertEquals(0, result);
122+
Assert.assertEquals(2, result);
116123
}
117124
catch ( Exception e ) {
118125
Assert.fail(e.getMessage());

0 commit comments

Comments
 (0)