Skip to content

Commit 9039ac2

Browse files
committed
Fixes #21 : all parameters are now optional
* IT : Add 1 new integration test project * FEATURE : Sources / tests / paths / reporters are now optional * FIX : Fixes owner-param project * FIX : Fixes wrong base dir for sources and tests scripts
1 parent e49b4cd commit 9039ac2

File tree

25 files changed

+881
-383
lines changed

25 files changed

+881
-383
lines changed

utplsql-maven-plugin-it/src/it/java/org/utpsql/maven/plugin/test/UtPLSQLMojoIT.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void testTypeMappingProject() throws Exception {
117117
@Test
118118
public void testOwnerParameterProject() throws Exception {
119119
try {
120-
final String PROJECT_NAME = "type-mapping-project";
120+
final String PROJECT_NAME = "owner-param-project";
121121
File testProject = ResourceExtractor.simpleExtractResources(getClass(), "/" + PROJECT_NAME);
122122

123123
Verifier verifier;
@@ -137,6 +137,27 @@ public void testOwnerParameterProject() throws Exception {
137137
Assert.fail("Unexpected Exception running the test : " + e.getMessage());
138138
}
139139
}
140+
141+
@Test
142+
public void testMinimalistProject() throws Exception {
143+
try {
144+
final String PROJECT_NAME = "minimalist-project";
145+
File testProject = ResourceExtractor.simpleExtractResources(getClass(), "/" + PROJECT_NAME);
146+
147+
Verifier verifier;
148+
verifier = new Verifier(testProject.getAbsolutePath());
149+
verifier.addCliOption("-N");
150+
verifier.addCliOption("-Dutplsql-maven-plugin-version=" + pluginVersion);
151+
verifier.addCliOption("-DdbUrl=" + System.getProperty("dbUrl"));
152+
verifier.addCliOption("-DdbUser=" + System.getProperty("dbUser"));
153+
verifier.addCliOption("-DdbPass=" + System.getProperty("dbPass"));
154+
155+
verifier.executeGoal("test");
156+
} catch (Exception e) {
157+
e.printStackTrace();
158+
Assert.fail("Unexpected Exception running the test : " + e.getMessage());
159+
}
160+
}
140161

141162
/**
142163
*
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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-minimalist-test</artifactId>
8+
<version>1.0.0</version>
9+
<packaging>pom</packaging>
10+
11+
<name>utplsql-maven-plugin IT Minimalist</name>
12+
<properties>
13+
<!-- url, user, password are set with dbUrl, dbUser, dbPass system properties -->
14+
</properties>
15+
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>${project.groupId}</groupId>
20+
<artifactId>utplsql-maven-plugin</artifactId>
21+
<version>${utplsql-maven-plugin-version}</version>
22+
<executions>
23+
<execution>
24+
<goals>
25+
<goal>test</goal>
26+
</goals>
27+
</execution>
28+
</executions>
29+
30+
</plugin>
31+
</plugins>
32+
</build>
33+
</project>

utplsql-maven-plugin-it/src/it/resources/owner-param-project/expected-output/utplsql/coverage-sonar-reporter.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<coverage version="1">
2-
<file path="src/test/resources/owner-param-project/scripts/sources/foo/package_bodies/PKG_TEST_ME.sql">
2+
<file path="scripts/sources/foo/package_bodies/PKG_TEST_ME.sql">
33
<lineToCover lineNumber="8" covered="true"/>
44
<lineToCover lineNumber="9" covered="true"/>
55
<lineToCover lineNumber="10" covered="true"/>

utplsql-maven-plugin-it/src/it/resources/owner-param-project/expected-output/utplsql/sonar-test-reporter.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<testExecutions version="1">
2-
<file path="src/test/resources/owner-param-project/scripts/test/bar/package_bodies/TEST_PKG_TEST_ME.sql">
2+
<file path="scripts/test/bar/package_bodies/TEST_PKG_TEST_ME.sql">
33
<testCase name="test_fc_input_1" duration="1" >
44
</testCase>
55
<testCase name="test_fc_input_0" duration="1" >

utplsql-maven-plugin-it/src/it/resources/owner-param-project/pom.xml

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,69 +20,73 @@
2020
<groupId>${project.groupId}</groupId>
2121
<artifactId>utplsql-maven-plugin</artifactId>
2222
<version>${utplsql-maven-plugin-version}</version>
23-
<goals>
24-
<goal>test</goal>
25-
</goals>
26-
<configuration>
27-
<!-- Mandatory Attributes -->
23+
<executions>
24+
<execution>
25+
<goals>
26+
<goal>test</goal>
27+
</goals>
28+
<configuration>
29+
<!-- Mandatory Attributes -->
2830

29-
<ignoreFailure>false</ignoreFailure>
31+
<ignoreFailure>false</ignoreFailure>
3032

31-
<paths>
32-
<path>tests_owner</path>
33-
</paths>
33+
<paths>
34+
<path>tests_owner</path>
35+
</paths>
3436

35-
<reporters>
36-
<reporter>
37-
<name>UT_COVERAGE_SONAR_REPORTER</name>
38-
<fileOutput>utplsql/coverage-sonar-reporter.xml</fileOutput>
39-
<consoleOutput>true</consoleOutput>
40-
</reporter>
41-
<reporter>
42-
<name>UT_SONAR_TEST_REPORTER</name>
43-
<fileOutput>utplsql/sonar-test-reporter.xml</fileOutput>
44-
<consoleOutput>true</consoleOutput>
45-
</reporter>
46-
</reporters>
37+
<reporters>
38+
<reporter>
39+
<name>UT_COVERAGE_SONAR_REPORTER</name>
40+
<fileOutput>utplsql/coverage-sonar-reporter.xml</fileOutput>
41+
<consoleOutput>true</consoleOutput>
42+
</reporter>
43+
<reporter>
44+
<name>UT_SONAR_TEST_REPORTER</name>
45+
<fileOutput>utplsql/sonar-test-reporter.xml</fileOutput>
46+
<consoleOutput>true</consoleOutput>
47+
</reporter>
48+
</reporters>
4749

48-
<sources>
49-
<source>
50-
<directory>scripts/sources</directory>
51-
<includes>
52-
<include>**/*sql</include>
53-
</includes>
54-
</source>
55-
</sources>
56-
<sourcesOwner>code_owner</sourcesOwner>
57-
<sourcesRegexExpression>.*/\w+/(\w+)/(\w+)\.\w{3}</sourcesRegexExpression>
58-
<sourcesNameSubexpression>2</sourcesNameSubexpression>
59-
<sourcesTypeSubexpression>1</sourcesTypeSubexpression>
60-
<sourcesCustomTypeMapping>
61-
<customTypeMapping>
62-
<type>package body</type>
63-
<customMapping>package_bodies</customMapping>
64-
</customTypeMapping>
65-
</sourcesCustomTypeMapping>
50+
<sources>
51+
<source>
52+
<directory>scripts/sources</directory>
53+
<includes>
54+
<include>**/*sql</include>
55+
</includes>
56+
</source>
57+
</sources>
58+
<sourcesOwner>code_owner</sourcesOwner>
59+
<sourcesRegexExpression>.*/\w+/(\w+)/(\w+)\.\w{3}</sourcesRegexExpression>
60+
<sourcesNameSubexpression>2</sourcesNameSubexpression>
61+
<sourcesTypeSubexpression>1</sourcesTypeSubexpression>
62+
<sourcesCustomTypeMapping>
63+
<customTypeMapping>
64+
<type>package body</type>
65+
<customMapping>package_bodies</customMapping>
66+
</customTypeMapping>
67+
</sourcesCustomTypeMapping>
6668

67-
<tests>
68-
<test>
69-
<directory>scripts/test</directory>
70-
<includes>
71-
<include>**/*sql</include>
72-
</includes>
73-
</test>
74-
</tests>
75-
<testsOwner>tests_owner</testsOwner>
76-
<testsRegexExpression>.*/\w+/(\w+)/(\w+)\.\w{3}</testsRegexExpression>
77-
<testsNameSubexpression>2</testsNameSubexpression>
78-
<testsTypeSubexpression>1</testsTypeSubexpression>
79-
<testsCustomTypeMapping>
80-
<customTypeMapping>
81-
<type>package body</type>
82-
<customMapping>package_bodies</customMapping>
83-
</customTypeMapping>
84-
</testsCustomTypeMapping>
85-
</configuration>
69+
<tests>
70+
<test>
71+
<directory>scripts/test</directory>
72+
<includes>
73+
<include>**/*sql</include>
74+
</includes>
75+
</test>
76+
</tests>
77+
<testsOwner>tests_owner</testsOwner>
78+
<testsRegexExpression>.*/\w+/(\w+)/(\w+)\.\w{3}</testsRegexExpression>
79+
<testsNameSubexpression>2</testsNameSubexpression>
80+
<testsTypeSubexpression>1</testsTypeSubexpression>
81+
<testsCustomTypeMapping>
82+
<customTypeMapping>
83+
<type>package body</type>
84+
<customMapping>package_bodies</customMapping>
85+
</customTypeMapping>
86+
</testsCustomTypeMapping>
87+
</configuration>
88+
</execution>
89+
</executions>
8690
</plugin>
8791
</plugins>
8892
</build>

utplsql-maven-plugin/pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
<java.version>1.8</java.version>
2222
</properties>
2323
<dependencies>
24+
25+
<dependency>
26+
<groupId>org.apache.maven</groupId>
27+
<artifactId>maven-core</artifactId>
28+
<version>3.5.2</version>
29+
</dependency>
2430

2531
<dependency>
2632
<groupId>org.utplsql</groupId>
@@ -54,8 +60,13 @@
5460
</dependency>
5561

5662
<!-- test dependencies -->
57-
5863

64+
<dependency>
65+
<groupId>org.powermock</groupId>
66+
<artifactId>powermock-module-junit4</artifactId>
67+
<version>1.7.4</version>
68+
<scope>test</scope>
69+
</dependency>
5970

6071
<dependency>
6172
<groupId>org.apache.maven.plugin-testing</groupId>
@@ -84,8 +95,6 @@
8495
<version>3.8.0</version>
8596
<scope>test</scope>
8697
</dependency>
87-
88-
8998
</dependencies>
9099

91100
<build>

0 commit comments

Comments
 (0)