Skip to content

Commit 76c7e4a

Browse files
committed
#70 Updated to new API and added oraStuckTimeout parameter
1 parent 955f8bf commit 76c7e4a

File tree

16 files changed

+574
-9
lines changed

16 files changed

+574
-9
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ Please refer to the following usage example for the parameters descriptions:
152152
<!-- Enables DBMS_OUTPUT -->
153153
<!-- Defaults to: false -->
154154
<dbmsOutput>false</dbmsOutput>
155+
156+
<!-- Sets a timeout around Reporter creation and retries when not ready after a while. -->
157+
<!-- 0 = no timeout. -->
158+
<ora-stuck-timeout>0</ora-stuck-timeout>
155159

156160
<!-- A list of tags to run. -->
157161
<tags>

mvnw

Lines changed: 85 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mvnw.cmd

Lines changed: 43 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@
7878
<dependency>
7979
<groupId>org.apache.maven.shared</groupId>
8080
<artifactId>maven-shared-utils</artifactId>
81-
<version>3.1.0</version>
81+
<version>3.3.4</version>
8282
</dependency>
8383

8484
<dependency>
8585
<groupId>org.utplsql</groupId>
8686
<artifactId>java-api</artifactId>
87-
<version>3.1.8</version>
87+
<version>3.1.9</version>
8888
</dependency>
8989

9090
<dependency>

src/main/java/org/utplsql/maven/plugin/UtPlsqlMojo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ public class UtPlsqlMojo extends AbstractMojo {
125125
@Parameter
126126
boolean dbmsOutput;
127127

128+
@Parameter(defaultValue = "0")
129+
Integer oraStuckTimeout;
130+
128131
private final SqlFileScanner sqlFileScanner = new SqlFileScanner();
129132

130133
@Override
@@ -160,7 +163,8 @@ public void execute() throws MojoExecutionException {
160163
.addTags(tags)
161164
.randomTestOrder(randomTestOrder)
162165
.randomTestOrderSeed(randomTestOrderSeed)
163-
.failOnErrors(!ignoreFailure);
166+
.failOnErrors(!ignoreFailure)
167+
.oraStuckTimeout(oraStuckTimeout);
164168

165169
if (isNotBlank(excludeObject)) {
166170
if (excludeObject.contains(",")) {

src/test/java/org/utplsql/maven/plugin/UtPlsqlMojoIT.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,11 @@ void include_object(MavenExecutionResult result) {
7575

7676
assertThatReportsAreGeneratedAsExpected(result, "sonar-test-report.xml", "coverage-sonar-report.xml");
7777
}
78+
79+
@MavenTest
80+
void ora_stuck_timeout(MavenExecutionResult result) {
81+
assertThat(result).isSuccessful();
82+
83+
assertThatReportsAreGeneratedAsExpected(result, "sonar-test-report.xml", "coverage-sonar-report.xml");
84+
}
7885
}

src/test/java/org/utplsql/maven/plugin/UtPlsqlMojoTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,22 @@ public void skip_utplsql_tests() throws Exception {
272272
* <p>
273273
* Given : a pom.xml with dbmsOutput=true
274274
* When : pom is read
275+
* Then : Property is set
276+
*/
277+
@Test
278+
public void ora_stuck_timeout() throws Exception {
279+
UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo("ora_stuck_timeout");
280+
assertNotNull(utPlsqlMojo);
281+
282+
utPlsqlMojo.execute();
283+
}
284+
285+
286+
/**
287+
* Ora Stuck Timeout
288+
* <p>
289+
* Given : a pom.xml with ora-stuck-timeout set
290+
* When : pom is read
275291
* Then : DBMS_OUTPUT is enabled
276292
*/
277293
@Test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<coverage version="1">
2+
<file path="scripts/sources/APP.PKG_TEST_ME.pkb">
3+
<lineToCover lineNumber="7" covered="true"/>
4+
<lineToCover lineNumber="8" covered="true"/>
5+
<lineToCover lineNumber="9" covered="true"/>
6+
<lineToCover lineNumber="10" covered="true"/>
7+
<lineToCover lineNumber="12" covered="true"/>
8+
<lineToCover lineNumber="18" covered="true"/>
9+
<lineToCover lineNumber="21" covered="true"/>
10+
<lineToCover lineNumber="22" covered="true"/>
11+
</file>
12+
</coverage>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<testExecutions version="1">
2+
<file path="scripts/tests/APP.TEST_PKG_TEST_ME.pkb">
3+
<testCase name="test_fc_input_1" duration="1" >
4+
</testCase>
5+
<testCase name="test_fc_input_0" duration="1" >
6+
</testCase>
7+
<testCase name="test_fc_input_null" duration="1" >
8+
</testCase>
9+
<testCase name="test_pr_test_me_null" duration="1" >
10+
</testCase>
11+
<testCase name="test_pr_test_me_not_null" duration="1" >
12+
</testCase>
13+
<testCase name="test_pr_test_me_exists" duration="1" >
14+
</testCase>
15+
<testCase name="test_pr_test_me_cursor" duration="1" >
16+
</testCase>
17+
</file>
18+
</testExecutions>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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>ora-stuck-timeout</artifactId>
8+
<version>1.0.0</version>
9+
<packaging>pom</packaging>
10+
11+
<properties>
12+
<dbUrl>jdbc:oracle:thin:@localhost:1521:xe</dbUrl>
13+
<dbUser>UT3</dbUser>
14+
<dbPass>UT3</dbPass>
15+
</properties>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.utplsql</groupId>
21+
<artifactId>utplsql-maven-plugin</artifactId>
22+
<version>@project.version@</version>
23+
<executions>
24+
<execution>
25+
<goals>
26+
<goal>test</goal>
27+
</goals>
28+
<configuration>
29+
<oraStuckTimeout>1</oraStuckTimeout>
30+
<ignoreFailure>false</ignoreFailure>
31+
<paths>
32+
<path>app</path>
33+
</paths>
34+
<reporters>
35+
<reporter>
36+
<name>UT_COVERAGE_SONAR_REPORTER</name>
37+
<fileOutput>utplsql/coverage-sonar-report.xml</fileOutput>
38+
<consoleOutput>true</consoleOutput>
39+
</reporter>
40+
<reporter>
41+
<name>UT_SONAR_TEST_REPORTER</name>
42+
<fileOutput>utplsql/sonar-test-report.xml</fileOutput>
43+
<consoleOutput>true</consoleOutput>
44+
</reporter>
45+
</reporters>
46+
<sources>
47+
<source>
48+
<directory>scripts/sources</directory>
49+
<includes>
50+
<include>**/**.pks</include>
51+
<include>**/**.pkb</include>
52+
</includes>
53+
</source>
54+
</sources>
55+
<tests>
56+
<test>
57+
<directory>scripts/tests</directory>
58+
<includes>
59+
<include>**/**.pks</include>
60+
<include>**/**.pkb</include>
61+
</includes>
62+
</test>
63+
</tests>
64+
</configuration>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
</plugins>
69+
</build>
70+
</project>

0 commit comments

Comments
 (0)