File tree Expand file tree Collapse file tree 3 files changed +104
-3
lines changed
java/org/utplsql/maven/plugin
resources/unit-tests/include_object Expand file tree Collapse file tree 3 files changed +104
-3
lines changed Original file line number Diff line number Diff line change @@ -306,11 +306,11 @@ public void db_config_using_system_properties() throws Exception {
306
306
}
307
307
308
308
/**
309
- * DB configuration from System Properties
309
+ * Exclude object from coverage report
310
310
* <p>
311
- * Given : a pom.xml without dbUrl, dbUser and dbPass configured
311
+ * Given : a pom.xml with excludeObject set
312
312
* When : pom is read
313
- * Then : System Properties must be used to configure database
313
+ * Then : excludeObject is present
314
314
*/
315
315
@ Test
316
316
public void exclude_object () throws Exception {
@@ -322,6 +322,23 @@ public void exclude_object() throws Exception {
322
322
assertEquals ("app.pkg_test_me,app.test_pkg_test_me" , utPlsqlMojo .excludeObject );
323
323
}
324
324
325
+ /**
326
+ * Include object from coverage report
327
+ * <p>
328
+ * Given : a pom.xml with includeObject set
329
+ * When : pom is read
330
+ * Then : includeObject is present
331
+ */
332
+ @ Test
333
+ public void include_object () throws Exception {
334
+ UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo ("include_object" );
335
+ assertNotNull (utPlsqlMojo );
336
+
337
+ utPlsqlMojo .execute ();
338
+
339
+ assertEquals ("app.pkg_test_me,app.test_pkg_test_me" , utPlsqlMojo .includeObject );
340
+ }
341
+
325
342
private UtPlsqlMojo createUtPlsqlMojo (String directory ) throws Exception {
326
343
return (UtPlsqlMojo ) rule .lookupConfiguredMojo (new File ("src/test/resources/unit-tests/" + directory ), "test" );
327
344
}
Original file line number Diff line number Diff line change
1
+ package org .utplsql .maven .plugin .util ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+
5
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
6
+ import static org .utplsql .maven .plugin .util .StringUtil .isBlank ;
7
+ import static org .utplsql .maven .plugin .util .StringUtil .isEmpty ;
8
+ import static org .utplsql .maven .plugin .util .StringUtil .isNotBlank ;
9
+ import static org .utplsql .maven .plugin .util .StringUtil .isNotEmpty ;
10
+
11
+ class StringUtilTest {
12
+
13
+ @ Test
14
+ void is_empty () {
15
+ assertTrue (isEmpty ("" ));
16
+ }
17
+
18
+ @ Test
19
+ void is_not_empty () {
20
+ assertTrue (isNotEmpty ("abc" ));
21
+ }
22
+
23
+ @ Test
24
+ void is_blank () {
25
+ assertTrue (isBlank (" " ));
26
+ }
27
+
28
+ @ Test
29
+ void is_not_blank () {
30
+ assertTrue (isNotBlank ("abc" ));
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
2
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
4
+ <modelVersion >4.0.0</modelVersion >
5
+
6
+ <groupId >org.utplsql</groupId >
7
+ <artifactId >utplsql-maven-plugin-test</artifactId >
8
+ <version >3.1.0-SNAPSHOT</version >
9
+ <packaging >pom</packaging >
10
+
11
+ <properties >
12
+ <dbUrl >jdbc:oracle:thin:@127.0.0.1:1521:xe</dbUrl >
13
+ <dbUser >UT3</dbUser >
14
+ <dbPass >UT3</dbPass >
15
+ </properties >
16
+
17
+ <build >
18
+ <directory >../../../target</directory >
19
+ <plugins >
20
+ <plugin >
21
+ <groupId >org.utplsql</groupId >
22
+ <artifactId >utplsql-maven-plugin</artifactId >
23
+ <version >@proj</version >
24
+ <goals >
25
+ <goal >test</goal >
26
+ </goals >
27
+ <configuration >
28
+ <ignoreFailure >false</ignoreFailure >
29
+ <paths >
30
+ <path >app</path >
31
+ </paths >
32
+ <reporters >
33
+ <reporter >
34
+ <name >UT_DOCUMENTATION_REPORTER</name >
35
+ </reporter >
36
+ <reporter >
37
+ <name >UT_COVERAGE_SONAR_REPORTER</name >
38
+ <fileOutput >coverage-sonar-report.xml</fileOutput >
39
+ <consoleOutput >false</consoleOutput >
40
+ </reporter >
41
+ <reporter >
42
+ <name >UT_SONAR_TEST_REPORTER</name >
43
+ <fileOutput >utplsql/sonar-test-report.xml</fileOutput >
44
+ <consoleOutput >true</consoleOutput >
45
+ </reporter >
46
+ </reporters >
47
+ <includeObject >app.pkg_test_me,app.test_pkg_test_me</includeObject >
48
+ </configuration >
49
+ </plugin >
50
+ </plugins >
51
+ </build >
52
+ </project >
You can’t perform that action at this time.
0 commit comments