Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1b7dd3

Browse files
committed
Implement remaining dynamic parameters
1 parent a7b8266 commit e1b7dd3

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

src/main/java/org/utplsql/api/testRunner/DynamicTestRunnerStatement.java

+7
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ private DynamicParameterList initParameterList() throws SQLException {
6565
.addIfNotEmpty("a_coverage_schemes", options.coverageSchemes.toArray(), CustomTypes.UT_VARCHAR2_LIST, oracleConnection)
6666
.addIfNotEmpty("a_source_file_mappings", sourceMappings, CustomTypes.UT_FILE_MAPPINGS, oracleConnection)
6767
.addIfNotEmpty("a_test_file_mappings", testMappings, CustomTypes.UT_FILE_MAPPINGS, oracleConnection)
68+
.addIfNotEmpty("a_include_objects", options.includeObjects.toArray(), CustomTypes.UT_VARCHAR2_LIST, oracleConnection)
69+
.addIfNotEmpty("a_exclude_objects", options.excludeObjects.toArray(), CustomTypes.UT_VARCHAR2_LIST, oracleConnection)
70+
.addIfNotEmpty("a_fail_on_errors", options.failOnErrors)
71+
.addIfNotEmpty("a_client_character_set", options.clientCharacterSet)
72+
.addIfNotEmpty("a_random_test_order", options.randomTestOrder)
73+
.addIfNotEmpty("a_random_test_order_seed", options.randomTestOrderSeed)
74+
.addIfNotEmpty("a_tags", options.getTagsAsString())
6875
.build();
6976
}
7077

src/test/java/org/utplsql/api/testRunner/DynamicTestRunnerStatementTest.java

+23
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,29 @@ void explore() throws SQLException {
8787
verify(callableStatement).setArray(6, null);
8888
verify(oracleConnection, times(2)).createOracleArray(CustomTypes.UT_FILE_MAPPINGS, expectedFileMapping);
8989

90+
assertThat(testRunnerStatement.getSql(), containsString("a_include_objects => ?"));
91+
verify(callableStatement).setArray(7, null);
92+
verify(oracleConnection).createOracleArray(CustomTypes.UT_VARCHAR2_LIST, options.includeObjects.toArray());
93+
94+
assertThat(testRunnerStatement.getSql(), containsString("a_exclude_objects => ?"));
95+
verify(callableStatement).setArray(8, null);
96+
verify(oracleConnection).createOracleArray(CustomTypes.UT_VARCHAR2_LIST, options.includeObjects.toArray());
97+
98+
assertThat(testRunnerStatement.getSql(), containsString("a_fail_on_errors => (case ? when 1 then true else false)"));
99+
verify(callableStatement).setInt(9, 1);
100+
101+
assertThat(testRunnerStatement.getSql(), containsString("a_client_character_set => ?"));
102+
verify(callableStatement).setString(10, "UTF8");
103+
104+
assertThat(testRunnerStatement.getSql(), containsString("a_random_test_order => (case ? when 1 then true else false)"));
105+
verify(callableStatement).setInt(11, 1);
106+
107+
assertThat(testRunnerStatement.getSql(), containsString("a_random_test_order_seed => ?"));
108+
verify(callableStatement).setInt(12, 123);
109+
110+
assertThat(testRunnerStatement.getSql(), containsString("a_tags => ?"));
111+
verify(callableStatement).setString(13, "WIP,long_running");
112+
90113

91114
}
92115
}

src/test/java/org/utplsql/api/testRunner/TestRunnerStatementProviderIT.java

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public static TestRunnerOptions getCompletelyFilledOptions() {
3333
options.randomTestOrder = true;
3434
options.randomTestOrderSeed = 123;
3535
options.tags.add("WIP");
36+
options.tags.add("long_running");
3637
return options;
3738
}
3839

0 commit comments

Comments
 (0)