forked from utPLSQL/utPLSQL-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunCommandArgumentsTest.java
More file actions
78 lines (65 loc) · 2.7 KB
/
RunCommandArgumentsTest.java
File metadata and controls
78 lines (65 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package org.utplsql.cli;
import org.junit.jupiter.api.Test;
import org.utplsql.api.TestRunner;
import java.util.ArrayList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
public class RunCommandArgumentsTest {
@Test
public void allArgumentsAreRecognized() {
IRunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString(),
"-p=app",
"-f=ut_sonar_test_reporter",
"-o=sonar_result.xml",
"-s",
"--tags=tag1,tag2",
"--coverage-schemes=schema1,some_other_schema",
"-d",
"-c",
"--failure-exit-code=10",
"-scc",
"-t=60",
"-exclude=app.betwnstr",
"-include=app.betwnstr",
"-source_path=src/test/resources/plsql/source",
"-owner=app",
"-regex_expression=\"*\"",
"-type_mapping=\"sql=PACKAGE BODY\"",
"-owner_subexpression=0",
"-type_subexpression=0",
"-name_subexpression=0",
"-test_path=src/test/resources/plsql/test",
"-owner=app",
"-regex_expression=\"*\"",
"-type_mapping=\"sql=PACKAGE BODY\"",
"-owner_subexpression=0",
"-type_subexpression=0",
"-name_subexpression=0"
);
TestRunner testRunner = runCmd.newTestRunner(new ArrayList<>());
}
@Test
void multiplePaths() {
IRunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString(),
"-p=app.test_betwnstr,app.test_award_bonus"
);
TestRunner testRunner = runCmd.newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().pathList, contains("app.test_betwnstr", "app.test_award_bonus") );
}
@Test
void provideTags() {
IRunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString(),
"--tags=tag1,tag.2"
);
TestRunner testRunner = runCmd.newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().tags, contains("tag1", "tag.2") );
}
@Test
void provideCoverageSchemes() {
IRunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString(),
"--coverage-schemes=schema-1,some_other_schema"
);
TestRunner testRunner = runCmd.newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().coverageSchemes, contains("schema-1", "some_other_schema") );
}
}