- Notifications
You must be signed in to change notification settings - Fork 11
Adds support of custom type parameters (#5) #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alberto-hernandez merged 2 commits into utPLSQL:develop from jgarec:feature/add_type_mapping_params Jun 7, 2018
Merged
Changes from 1 commit
Commits
Show all changes
2 commits Select commit Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions 50 utplsql-maven-plugin/src/main/java/org/utplsql/maven/plugin/CustomTypeMapping.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package org.utplsql.maven.plugin; | ||
| | ||
| /** | ||
| * Bean used by maven to populate its model. | ||
| * | ||
| * <customTypeMapping> | ||
| * <type>...</type> | ||
| * <mapping>...</mapping> | ||
| * </customTypeMapping> | ||
| * | ||
| */ | ||
| public class CustomTypeMapping { | ||
| /** | ||
| * Object type. | ||
| */ | ||
| private String type; | ||
| | ||
| /** | ||
| * Custom mapping value. | ||
| */ | ||
| private String customMapping; | ||
| | ||
| /** | ||
| * @return The Object type. | ||
| */ | ||
| public String getType() { | ||
| return type; | ||
| } | ||
| | ||
| /** | ||
| * @param type The Object type. | ||
| */ | ||
| public void setType(final String type) { | ||
| this.type = type; | ||
| } | ||
| | ||
| /** | ||
| * @return Custom mapping value. | ||
| */ | ||
| public String getCustomMapping() { | ||
| return customMapping; | ||
| } | ||
| | ||
| /** | ||
| * @param mapping Custom mapping value. | ||
| */ | ||
| public void setCustomMapping(final String customMapping) { | ||
| this.customMapping = customMapping; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions 12 ...c/test/resources/type-mapping-project/expected-output/utplsql/coverage-sonar-reporter.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <coverage version="1"> | ||
| <file path="src/test/resources/type-mapping-project/scripts/sources/app/package_bodies/PKG_TEST_ME.sql"> | ||
| <lineToCover lineNumber="8" covered="true"/> | ||
| <lineToCover lineNumber="9" covered="true"/> | ||
| <lineToCover lineNumber="10" covered="true"/> | ||
| <lineToCover lineNumber="11" covered="true"/> | ||
| <lineToCover lineNumber="13" covered="true"/> | ||
| <lineToCover lineNumber="19" covered="true"/> | ||
| <lineToCover lineNumber="22" covered="true"/> | ||
| <lineToCover lineNumber="23" covered="true"/> | ||
| </file> | ||
| </coverage> |
18 changes: 18 additions & 0 deletions 18 ...n/src/test/resources/type-mapping-project/expected-output/utplsql/sonar-test-reporter.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <testExecutions version="1"> | ||
| <file path="src/test/resources/type-mapping-project/scripts/test/app/package_bodies/TEST_PKG_TEST_ME.sql"> | ||
| <testCase name="test_fc_input_1" duration="1" > | ||
| </testCase> | ||
| <testCase name="test_fc_input_0" duration="1" > | ||
| </testCase> | ||
| <testCase name="test_fc_input_null" duration="1" > | ||
| </testCase> | ||
| <testCase name="test_pr_test_me_null" duration="1" > | ||
| </testCase> | ||
| <testCase name="test_pr_test_me_not_null" duration="1" > | ||
| </testCase> | ||
| <testCase name="test_pr_test_me_exists" duration="1" > | ||
| </testCase> | ||
| <testCase name="test_pr_test_me_cursor" duration="1" > | ||
| </testCase> | ||
| </file> | ||
| </testExecutions> |
94 changes: 94 additions & 0 deletions 94 utplsql-maven-plugin/src/test/resources/type-mapping-project/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| | ||
| <groupId>org.utplsql</groupId> | ||
| <artifactId>utplsql-maven-plugin-test</artifactId> | ||
| <version>1.0.0-SNAPSHOT</version> | ||
| <packaging>maven-plugin</packaging> | ||
| | ||
| <name>utplsql-maven-plugin Maven Plugin Test</name> | ||
| | ||
| | ||
| <properties> | ||
| <dbUrl>jdbc:oracle:thin:@127.0.0.1:1521:xe</dbUrl> | ||
| <!-- | ||
| <dbUser>ut3</dbUser> | ||
| <dbPass>XNtxj8eEgA6X6b6f</dbPass> | ||
| --> | ||
| </properties> | ||
| | ||
| <build> | ||
| | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>${pom.groupId}</groupId> | ||
| <artifactId>utplsql-maven-plugin</artifactId> | ||
| <version>${pom.version}</version> | ||
| <goals> | ||
| <goal>test</goal> | ||
| </goals> | ||
| <configuration> | ||
| <!-- Mandatory Attributes --> | ||
| | ||
| <ignoreFailure>false</ignoreFailure> | ||
| | ||
| <paths> | ||
| <path>app</path> | ||
| </paths> | ||
| | ||
| <reporters> | ||
| <reporter> | ||
| <name>UT_COVERAGE_SONAR_REPORTER</name> | ||
| <fileOutput>utplsql/coverage-sonar-reporter.xml</fileOutput> | ||
| <consoleOutput>true</consoleOutput> | ||
| </reporter> | ||
| <reporter> | ||
| <name>UT_SONAR_TEST_REPORTER</name> | ||
| <fileOutput>utplsql/sonar-test-reporter.xml</fileOutput> | ||
| <consoleOutput>true</consoleOutput> | ||
| </reporter> | ||
| </reporters> | ||
| | ||
| <sources> | ||
| <source> | ||
| <directory>src/test/resources/type-mapping-project/scripts/sources</directory> | ||
| <includes> | ||
| <include>**/*sql</include> | ||
| </includes> | ||
| </source> | ||
| </sources> | ||
| <sourcesRegexExpression>.*(\\|\/)(\w+)(\\|\/)(\w+)(\\|\/)(\w+).(\w{3})</sourcesRegexExpression> | ||
| <sourcesOwnerSubexpression>2</sourcesOwnerSubexpression> | ||
| <sourcesNameSubexpression>6</sourcesNameSubexpression> | ||
| <sourcesTypeSubexpression>4</sourcesTypeSubexpression> | ||
| <sourcesCustomTypeMapping> | ||
| <customTypeMapping> | ||
| <type>package body</type> | ||
| <customMapping>package_bodies</customMapping> | ||
| </customTypeMapping> | ||
| </sourcesCustomTypeMapping> | ||
| | ||
| <tests> | ||
| <test> | ||
| <directory>src/test/resources/type-mapping-project/scripts/test</directory> | ||
| <includes> | ||
| <include>**/*sql</include> | ||
| </includes> | ||
| </test> | ||
| </tests> | ||
| <testsRegexExpression>.*(\\|\/)(\w+)(\\|\/)(\w+)(\\|\/)(\w+).(\w{3})</testsRegexExpression> | ||
| ||
| <testsOwnerSubexpression>2</testsOwnerSubexpression> | ||
| <testsNameSubexpression>6</testsNameSubexpression> | ||
| <testsTypeSubexpression>4</testsTypeSubexpression> | ||
| <testsCustomTypeMapping> | ||
| <customTypeMapping> | ||
| <type>package body</type> | ||
| <customMapping>package_bodies</customMapping> | ||
| </customTypeMapping> | ||
| </testsCustomTypeMapping> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
28 changes: 28 additions & 0 deletions 28 ...rc/test/resources/type-mapping-project/scripts/sources/app/package_bodies/PKG_TEST_ME.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| CREATE OR REPLACE PACKAGE BODY APP.PKG_TEST_ME IS | ||
| | ||
| -- | ||
| -- This | ||
| -- | ||
| FUNCTION FC_TEST_ME(PPARAM1 IN VARCHAR2) RETURN NUMBER IS | ||
| BEGIN | ||
| IF PPARAM1 IS NULL THEN | ||
| RETURN NULL; | ||
| ELSIF PPARAM1 = '1' THEN | ||
| RETURN 1; | ||
| ELSE | ||
| RETURN 0; | ||
| END IF; | ||
| END FC_TEST_ME; | ||
| | ||
| PROCEDURE PR_TEST_ME(PSNAME IN VARCHAR2) IS | ||
| BEGIN | ||
| IF PSNAME IS NULL THEN | ||
| NULL; | ||
| ELSE | ||
| INSERT INTO TO_TEST_ME (SNAME) VALUES (PSNAME); | ||
| COMMIT; | ||
| END IF; | ||
| END PR_TEST_ME; | ||
| | ||
| END PKG_TEST_ME; | ||
| / |
8 changes: 8 additions & 0 deletions 8 ...ugin/src/test/resources/type-mapping-project/scripts/sources/app/packages/PKG_TEST_ME.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- | ||
| -- This package is used TO demonstrate the utPL/SQL possibilities | ||
| -- | ||
| CREATE OR REPLACE PACKAGE app.PKG_TEST_ME AS | ||
| FUNCTION FC_TEST_ME(PPARAM1 IN VARCHAR2) RETURN NUMBER; | ||
| PROCEDURE PR_TEST_ME(PSNAME IN VARCHAR2); | ||
| END PKG_TEST_ME; | ||
| / |
8 changes: 8 additions & 0 deletions 8 ...-plugin/src/test/resources/type-mapping-project/scripts/sources/app/tables/TO_TEST_ME.tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- | ||
| -- This is a table used to demonstrate the UNIT test framework. | ||
| -- | ||
| CREATE TABLE TO_TEST_ME | ||
| ( | ||
| SNAME VARCHAR2(10) | ||
| ) | ||
| / |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change from
pathstosuitepaths?pathsseem too ambiguous and not self-descriptive enough.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followed in #17