Repository navigation
Expand file tree
/
Copy pathRunCommandConfigParamsArePassedToTestRunnerTest.java
More file actions
57 lines (49 loc) · 2.26 KB
/
Copy pathRunCommandConfigParamsArePassedToTestRunnerTest.java
File metadata and controls
57 lines (49 loc) · 2.26 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
package org.utplsql.cli;
import org.junit.jupiter.api.Test;
import org.utplsql.api.TestRunner;
import org.utplsql.cli.config.RunCommandConfig;
import java.util.ArrayList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class RunCommandConfigParamsArePassedToTestRunnerTest {
@Test
void tags() {
RunCommandConfig config = new RunCommandConfig.Builder()
.tags(new String[]{"tag1", "tag2"})
.create();
TestRunner testRunner = new RunAction(config).newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().tags, contains("tag1", "tag2") );
}
@Test
void coverageSchemes() {
RunCommandConfig config = new RunCommandConfig.Builder()
.coverageSchemes(new String[]{"schema1", "another_schema", "and-another-one"})
.create();
TestRunner testRunner = new RunAction(config).newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().coverageSchemes, contains("schema1", "another_schema", "and-another-one") );
}
@Test
void oraStuckTimeout() {
RunCommandConfig config = new RunCommandConfig.Builder()
.oraStuckTimeout(2)
.create();
TestRunner testRunner = new RunAction(config).newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().oraStuckTimeout, equalTo(2) );
}
@Test
void expressionFilters() {
RunCommandConfig config = new RunCommandConfig.Builder()
.includeSchemaExpr("^APP$")
.excludeSchemaExpr("^APP_TEST$")
.includeObjectExpr("^PKG_")
.excludeObjectExpr("_TMP$")
.create();
TestRunner testRunner = new RunAction(config).newTestRunner(new ArrayList<>());
assertThat( testRunner.getOptions().includeSchemaExpr, equalTo("^APP$") );
assertThat( testRunner.getOptions().excludeSchemaExpr, equalTo("^APP_TEST$") );
assertThat( testRunner.getOptions().includeObjectExpr, equalTo("^PKG_") );
assertThat( testRunner.getOptions().excludeObjectExpr, equalTo("_TMP$") );
}
}