diff --git a/.gitignore b/.gitignore
index 46b48cc7f..2e3cbd33e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,6 @@ release/
*.gz
*.zip
node_modules/
+utPLSQL_latest_release/
+utPLSQL-cli/
+development/env.sh
diff --git a/.travis.yml b/.travis.yml
index 74d484d89..97eeeb15c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -45,7 +45,8 @@ env:
- UT3_DOCKER_REPO="utplsqlv3/oracledb"
- DOCKHER_HUB_REPO="${DOCKER_BASE_TAG:-$UT3_DOCKER_REPO}"
#utPLSQL released version directory
- - UTPLSQL_DIR="utPLSQL"
+ - UTPLSQL_DIR="utPLSQL_latest_release"
+ - UTPLSQL_CLI_FILE="utPLSQL-cli-develop-test3.zip"
matrix:
- ORACLE_VERSION="${DOCKER_TAG_11G:-11g-r2-xe}" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
- ORACLE_VERSION="${DOCKER_TAG_12C:-12c-r1-se2}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
@@ -68,7 +69,7 @@ before_install:
#- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g')
- git clone --depth=1 --branch=${SELFTESTING_BRANCH:-master} https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR
# download utPLSQL-cli develop
- - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test3.zip
+ - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=${UTPLSQL_CLI_FILE}
install:
#- unzip utPLSQL.zip
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..ef7c4c400
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,215 @@
+# How to contribute
+
+The following are the guidelines everyone should use to contribute to utPLSQL.
+Changes are welcome from all members of the Community.
+
+# Getting Started
+
+1. Create a [GitHub Account](https://github.com/join).
+2. Fork the utPLSQL Repository and setup your local Repository. _See [how to Fork](https://help.github.com/articles/fork-a-repo) article_
+ * Each of the steps below are detailed in **Get started with development** section.
+ * Clone your Fork to your local machine.
+ * Configure "upstream" remote to the [utPLSQL repository](https://github.com/utPLSQL/utPLSQL.git).
+3. For each change you want to make:
+ * Make sure your forked repository is up to date with upstream before you start coding. See [syncing your local repository](https://help.github.com/articles/syncing-a-fork) with upstream utPLSQL repository.
+ * Create a new branch for your change. We use `feature/feature_name` or `bugfix/fixed_issue_name` to identify branch types.
+ * Make your change in your new branch.
+ * Make sure your change is covered with unit tests.
+ * **Verify code compiles and all existing and new unit tests pass.**
+ * The quickest way to have a Pull Request not approved, is to submit code that does not compile or pass tests.
+ * Commit change to your local repository.
+ * Push change to your remote repository.
+ * Submit a [Pull Request](https://help.github.com/articles/using-pull-requests) into develop branch.
+ * Note: local and remote branches can be deleted after pull request has been merged.
+
+# Coding Standards
+
+* We use snake case for all identifiers in PLSQL code. This separates keywords in names with underscores. `execute_test`
+* All code is lower case.
+* Prefixes:
+ * Arguments to procedures and functions will start with `a_` an Example would be procedure `is_valid(a_owner_name varchar2)`
+ * Object types and packages will start with `ut_`
+ * Local variables `l_`
+ * Global variables `g_`
+ * Global Constants start with `gc_`
+ * Types in packages, objects start with `t_`
+ * Nested Tables start with `tt_`
+* varchar2 lengths are set in characters not bytes
+
+
+# Configuring local environment
+
+Your local environment can be of any flavor (Unix/Linux/Windows/Mac).
+At minimum you need to have Oracle database 11.2 XE accessible for the project and SYS account access to install and develop utPLSQL.
+
+We use four different database accounts (users) for development process.
+* `ut3_latest_release` - holds latest released version of utPLSQL. This schema holds the testing framework used for self-testing of utPLSQL development.
+* `ut3` - holds latest (current) development version of utPLSQL. This is the schema you will be working on.
+* `ut3_tester` - holds unit test packages for development of utPLSQL.
+* `ut3$user#` - used for testing accessibility to schema names with special characters.
+
+
+
+## Get started with development
+
+To get started with development, follow the below steps.
+
+_If you're using Windows, run the shell scripts using `GIT bash` - Windows-based bash command line._
+
+### Clone your fork of utPLSQL git repository
+
+```bash
+# clone your fork of utPLSQL
+git clone https://github.com/your account/utPLSQL.git utPLSQL
+
+cd utPLSQL
+
+# add main project repo as upstream
+git remote add upstream https://github.com/utPLSQL/utPLSQL.git
+
+# fetch all remote repositories
+git fetch --all
+```
+
+### Prepare environment script
+
+Copy the environment variables template `development/template.env.sh` to `development/env.sh`
+```bash
+cp development/template.env.sh development/env.sh
+chmod u+w development/env.sh
+```
+
+You might have to adjust the following lines in `development/env.sh`:
+```bash
+export SQLCLI=sql # For sqlcl client
+#export SQLCLI=sqlplus # For sqlplus client
+export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
+export ORACLE_PWD=oracle # Adjust your local SYS password
+```
+
+### Download utPLSQL release sources and utplsq-cli
+
+The below script is fetching latest release version from utPLSQL repository. Latest release version is used for self-testing.
+```bash
+development/refresh_sources.sh
+```
+
+### Setup local database for utPLSQL development
+
+```bash
+development/install.sh
+```
+
+### That's it
+
+You now have the following:
+- sources from `develop` branch of your fork of utPLSQL repository in `utPLSQL/ut3_latest_release` directory
+- sources from `master` branch of utPLSQL/utPLSQL repository in `utPLSQL/ut3_latest_release` directory
+- binaries of `utplsql-cli` in `utPLSQL/utPLSQL-cli` directory
+- database users created
+- utPLSQL develop version deployed to `ut3` schema
+- utPLSQL released version deployed to `ut3_latest_release`
+
+At any time, if you need to refresh your database, the below scripts might be helpful.
+
+## Running unit tests
+
+Currently we use two forms of unit tests in our CI build:
+- sql scripts as unit tests in the `old_tests` directory
+- utPLSQL v3 unit tests in the `test` directory
+
+Before you push any changes and create a pull request to the utPLSQL project repository, make sure that all of the tests are executing successfully in your local environment.
+
+Every new functionality needs to be documented by unit tests that cover both happy-path scenarios as well as edge-cases and exception paths.
+
+> **Important notice:**
+> We do our best to keep utPLSQL covered with unit tests.
+> Lack of sufficient unit testing is a perfect reason for PR to be rejected.
+
+To suite of legacy unit tests execute:
+```bash
+development/env.sh
+old_tests/runAll.sh
+```
+To run a full suite of unit tests execute:
+```bash
+development/env.sh
+test/install_and_run_tests.sh
+```
+
+You can review the results of tests as well as see information about code coverage in `./old_tests/coverage.html, ./coverage.html` files.
+
+
+## Cleanup of utPLSQL installation in local database
+
+```bash
+development/cleanup.sh
+```
+
+## Reinstalling utPLSQL development in `ut3` schema
+
+```bash
+development/refresh_ut3.sh
+```
+
+## Refreshing after release
+
+Whenever a new version of utPLSQL or a new version of utPLSQL-cli is available, use `development/refresh_sources.sh` to refresh files in your local project folders.
+
+
+## Modules
+
+Below diagram gives a high-level overview of utPLSQL v3 modules and their dependencies.
+Dependencies to `ut_util` are not shown as most of modules are depending on it.
+
+
+
+
+## Build Environment
+
+We are using private docker images to test utPLSQL for our Travis CI builds. The following versions of Oracle Database are being used.
+
+* 11g XE R2
+* 12c SE R1
+* 12c SE R2
+
+These images are based on the slimmed versions [official dockerfiles released by Oracle](https://github.com/utPLSQL/docker-scripts), but due to licensing restrictions, we can't make the images public.
+You can build your own and use it locally, or push to a private docker repository.
+
+The build steps are simple if you already have some experience using Docker. You can find detailed information about how to build your own image with a running database in: [example of creating an image with pre-built DB](https://github.com/oracle/docker-images/blob/master/OracleDatabase/samples/prebuiltdb/README.md)
+
+> You can find more info about the official Oracle images on the [Oracle Database on Docker](https://github.com/oracle/docker-images/tree/master/OracleDatabase) GitHub page.
+
+> If you are new to Docker, you can start by reading the [Getting Started With Docker](https://docs.docker.com/engine/getstarted/) docs.
+
+### Docker Build Notes
+
+* You need to comment out the VOLUME line. This step is required, because volumes are not saved when using `docker commit` command.
+* When the build process is complete, you will run the container to install the database. Once everything is set up and you see the message "DATABASE IS READY!", you may change the password and stop the running container. After the container is stopped, you can safely commit the container.
+* You can use the --squash experimental docker tag to reduce the image size. Example:
+```
+docker build --force-rm --no-cache --squash -t oracle/db-prebuilt .
+```
+
+Travis will use your Docker Hub credentials to pull the private images, and the following secure environment variables must be defined.
+
+Variable | Description
+---------|------------
+**DOCKER_USER**
**DOCKER_PASSWORD** | _Your Docker Hub website credentials. They will be used to pull the private database images._
+
+### SQLCL
+
+Our build configuration uses SQLCL to run the scripts, and you need to configure a few additional secure environment variables. After the first build, the downloaded file will be cached.
+
+Variable | Description
+---------|------------
+**ORACLE_OTN_USER
ORACLE_OTN_PASSWORD** | _Your Oracle website credentials. They will be used to download SQLCL._
+
+
+## New to GIT
+
+If you are new to GIT here are some links to help you with understanding how it works.
+
+- [GIT Documentation](http://git-scm.com/doc)
+- [Atlassian Git Tutorial](https://www.atlassian.com/git/tutorial/git-basics)
+- [What are other resources for learning Git and GitHub](https://help.github.com/articles/what-are-other-good-resources-for-learning-git-and-github)
diff --git a/development/cleanup.sh b/development/cleanup.sh
new file mode 100755
index 000000000..7f72d093e
--- /dev/null
+++ b/development/cleanup.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+#goto git root directory
+git rev-parse && cd "$(git rev-parse --show-cdup)"
+
+. development/env.sh
+
+"${SQLCLI}" sys/${ORACLE_PWD}@//${CONNECTION_STR} AS SYSDBA <<-SQL
+set echo on
+drop user ${UT3_OWNER} cascade;
+drop user ${UT3_RELEASE_VERSION_SCHEMA} cascade;
+drop user ${UT3_TESTER} cascade;
+drop user ${UT3_USER} cascade;
+
+begin
+ for i in (
+ select decode(owner,'PUBLIC','drop public synonym "','drop synonym "'||owner||'"."')|| synonym_name ||'"' drop_orphaned_synonym from dba_synonyms a
+ where not exists (select null from dba_objects b where a.table_name=b.object_name and a.table_owner=b.owner )
+ and a.table_owner <> 'SYS'
+ ) loop
+ execute immediate i.drop_orphaned_synonym;
+ end loop;
+end;
+/
+exit
+SQL
diff --git a/development/install.sh b/development/install.sh
new file mode 100755
index 000000000..a37dee0d2
--- /dev/null
+++ b/development/install.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+#goto git root directory
+git rev-parse && cd "$(git rev-parse --show-cdup)"
+
+. development/env.sh
+
+development/cleanup.sh
+
+.travis/install.sh
+.travis/install_utplsql_release.sh
+.travis/create_additional_grants_for_old_tests.sh
diff --git a/development/readme.md b/development/readme.md
deleted file mode 100644
index 5a0d0a50c..000000000
--- a/development/readme.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Build Folder
-
- Contains the build scripts that can be run locally on a developer's machine to build, run and test utPLSQL.
-
- These scripts are also used by the Jenkins Continuous Integration server to check each pull request before it is merged.
-
diff --git a/development/refresh_sources.sh b/development/refresh_sources.sh
new file mode 100755
index 000000000..27a65a92b
--- /dev/null
+++ b/development/refresh_sources.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+#goto git root directory
+git rev-parse && cd "$(git rev-parse --show-cdup)"
+
+. development/env.sh
+
+# remove sub-direcotry containing master branch shallow copy
+rm -rf ${UTPLSQL_DIR:-utPLSQL_latest_release}
+# clone utPLSQL master branch from upstream into utPLSQL sub-directory of your project
+git clone --depth=1 --branch=${SELFTESTING_BRANCH:-master} https://github.com/utPLSQL/utPLSQL.git ${UTPLSQL_DIR:-utPLSQL_latest_release}
+
+rm -rf utPLSQL-cli/*
+# download beta version of utPLSQL-cli
+curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=${UTPLSQL_CLI_FILE}
+# unzip utPLSQL-cli and remove the zip file
+unzip utPLSQL-cli.zip && chmod u+x utPLSQL-cli/bin/utplsql && rm utPLSQL-cli.zip
+
diff --git a/development/refresh_ut3.sh b/development/refresh_ut3.sh
new file mode 100644
index 000000000..542f5a01c
--- /dev/null
+++ b/development/refresh_ut3.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+#goto git root directory
+git rev-parse && cd "$(git rev-parse --show-cdup)"
+
+. development/env.sh
+
+cd source
+
+"${SQLCLI}" sys/${ORACLE_PWD}@//${CONNECTION_STR} AS SYSDBA <<-SQL
+@uninstall ${UT3_OWNER}
+@install ${UT3_OWNER}
+exit
+SQL
diff --git a/development/template.env.sh b/development/template.env.sh
new file mode 100755
index 000000000..861d7d1bd
--- /dev/null
+++ b/development/template.env.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+export SQLCLI=sql # For sqlcl client
+#export SQLCLI=sqlplus # For sqlplus client
+export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
+export ORACLE_PWD=oracle # Adjust your local SYS password
+export UTPLSQL_CLI_FILE="utPLSQL-cli-develop-test3.zip"
+export SELFTESTING_BRANCH=develop
+
+export UTPLSQL_DIR="utPLSQL_latest_release"
+export UT3_OWNER=ut3
+export UT3_OWNER_PASSWORD=ut3
+export UT3_RELEASE_VERSION_SCHEMA=ut3_latest_release
+export UT3_TESTER=ut3_tester
+export UT3_TESTER_PASSWORD=ut3
+export UT3_TABLESPACE=users
+export UT3_USER="UT3\$USER#"
+export UT3_USER_PASSWORD=ut3
+
diff --git a/development/utPSLQLv3-modules.png b/development/utPSLQLv3-modules.png
new file mode 100644
index 000000000..eecfdf684
Binary files /dev/null and b/development/utPSLQLv3-modules.png differ
diff --git a/docs/about/CONTRIBUTING.md b/docs/about/CONTRIBUTING.md
deleted file mode 100644
index 51c28babe..000000000
--- a/docs/about/CONTRIBUTING.md
+++ /dev/null
@@ -1,91 +0,0 @@
-## How to contribute ##
-
-The following are the guidelines everyone should use to contribute to utPLSQL.
-Changes are welcome from all members of the Community.
-
-## Getting Started ##
-
-1. Create a [GitHub Account](https://github.com/join).
-2. Fork the utPLSQL Repository and setup your local Repository.
- * Each of the steps below are detailed in the [How to Fork](https://help.github.com/articles/fork-a-repo) article!
- * Clone your Fork to your local machine.
- * Configure "upstream" remote to the [master utPLSQL repository](https://github.com/utPLSQL/utPLSQL.git).
- * Update the git submodules by issuing command: [git submodule update --remote --merge](http://stackoverflow.com/a/21195182)
-3. For each change you want to make:
- * Create a new branch for your change.
- * Make your change in your new branch.
- * Although changes can be made in the master branch, it easier long term if a new branch is used.
- * Make sure your change is covered with unit tests and/or is represented in examples
- * **Verify code compiles and all existing and new unit tests pass.**
- * The quickest way to have a Pull Request not be accepted, is to submit code that does not compile or pass tests.
- * Commit change to your local repository.
- * Push change to your remote repository
- * Submit a [Pull Request](https://help.github.com/articles/using-pull-requests).
- * Note: local and remote branches can be deleted after pull request has been accepted.
-
-**Note:** Getting changes from others requires [Syncing your Local repository](https://help.github.com/articles/syncing-a-fork) with Master utPLSQL repository. This can happen at any time.
-
-
-## Coding Standards ##
-
-* Snake case will be used. This separates keywords in names with underscores. `execute_test`
-* All names will be lower case.
-* Prefixes:
- * Arguments to procedures and functions will start with `a_` an Example would be procedure `is_valid(a_owner_name varchar2);`
- * Object types and packages will start with `ut_`
- * Local variables `l_`
- * Global variables `g_`
- * Global Constants start with `gc_`
- * Types in packages, objects start with `t_`
- * Nested Tables start with `tt_`
-* varchar2 lengths are set in characters not bytes
-
-
-## Testing Environment ##
-
-We are using docker images to test utPLSQL on our Travis CI builds. The following versions of Oracle Database are being used.
-
-* 11g XE R2
-* 12c SE R1
-* 12c SE R2
-
-These images are based on the official dockerfiles released by Oracle, but due to licensing restrictions, we can't make the images public. You can build your own and use it locally, or push to a private docker repository.
-
-The build steps are simple if you already have some experience using Docker. You can find detailed information about how to build your own image with a running database in: [example of creating an image with pre-built DB](https://github.com/oracle/docker-images/blob/master/OracleDatabase/samples/prebuiltdb/README.md)
-
-> You can find more info about the official Oracle images on the [Oracle Database on Docker](https://github.com/oracle/docker-images/tree/master/OracleDatabase) GitHub page.
-
-> If you are new to Docker, you can start by reading the [Getting Started With Docker](https://docs.docker.com/engine/getstarted/) docs.
-
-### Build Notes ###
-* You need to comment out the VOLUME line. This step is required, because volumes are not saved when using `docker commit` command.
-
-* When the build proccess is complete, you will run the container to install the database. Once everything is set up and you see the message "DATABASE IS READY!", you may change the password and stop the running container. After the container is stopped, you can safely commit the container.
-
-* You can use the --squash experimental docker tag to reduce the image size. Example:
-```
-docker build --force-rm --no-cache --squash -t oracle/db-prebuilt .
-```
-
-Travis will use your Docker Hub credentials to pull the private images, and the following secure environment variables must be defined.
-
-Variable | Description
----------|------------
-**DOCKER_USER**
**DOCKER_PASSWORD** | _Your Docker Hub website credentials. They will be used to pull the private database images._
-
-### SQLCL ###
-
-Our build configurarion uses SQLCL to run the scripts, and you need to configure a few additional secure environment variables. After the first build, the downloaded file will be cached.
-
-Variable | Description
----------|------------
-**ORACLE_OTN_USER
ORACLE_OTN_PASSWORD** | _Your Oracle website credentials. They will be used to download SQLCL._
-
-
-## New to GIT ##
-
-If you are new to GIT here are some links to help you with understanding how it works.
-
-- [GIT Documentation](http://git-scm.com/doc)
-- [Atlassian Git Tutorial](https://www.atlassian.com/git/tutorial/git-basics)
-- [What are other resources for learning Git and GitHub](https://help.github.com/articles/what-are-other-good-resources-for-learning-git-and-github)
diff --git a/docs/about/project-details.md b/docs/about/project-details.md
index d21012e0e..857fe8ab6 100644
--- a/docs/about/project-details.md
+++ b/docs/about/project-details.md
@@ -9,7 +9,7 @@
utPLSQL is open source project [hosted on GitHub](https://github.com/utPLSQL/utPLSQL).
Contributions, help and constructive feedback is always appreciated.
-If you are interested in helping please read our [guide to contributing](CONTRIBUTING.md)
+If you are interested in helping please read our [guide to contributing](https://github.com/utPLSQL/utPLSQL/CONTRIBUTING.md)
diff --git a/docs/index.md b/docs/index.md
index 08998381c..ffcfc10c1 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -21,7 +21,6 @@ The framework follows industry standards and best patterns of modern Unit Testin
- [License](about/license.md)
- [Support](about/support.md)
- [Authors](about/authors.md)
- - [Contributing](about/CONTRIBUTING.md)
# Demo project
diff --git a/mkdocs.yml b/mkdocs.yml
index 22c0fe04c..0539827b3 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -28,4 +28,3 @@ pages:
- License: about/license.md
- Support: about/support.md
- Authors: about/authors.md
- - Contributing: about/CONTRIBUTING.md
diff --git a/old_tests/RunAll.cmd b/old_tests/RunAll.cmd
deleted file mode 100644
index 041d2be96..000000000
--- a/old_tests/RunAll.cmd
+++ /dev/null
@@ -1,9 +0,0 @@
-echo off
-set UT3_OWNER=ut3
-set UT3_OWNER_PASSWORD=XNtxj8eEgA6X6b6f
-set ORACLE_SID=XE
-if not [%1] == [] (set UT3_OWNER=%1)
-if not [%2] == [] (set UT3_OWNER_PASSWORD=%2)
-if not [%3] == [] (set ORACLE_SID=%3)
-
-sqlplus %UT3_OWNER%/%UT3_OWNER_PASSWORD%@%ORACLE_SID% @RunAll.sql
diff --git a/old_tests/runAll.sh b/old_tests/runAll.sh
new file mode 100755
index 000000000..a8b52979a
--- /dev/null
+++ b/old_tests/runAll.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+set -ev
+#goto git root directory
+git rev-parse && cd "$(git rev-parse --show-cdup)"
+
+cd old_tests
+
+"$SQLCLI" ${UT3_OWNER}/${UT3_OWNER_PASSWORD}@//${CONNECTION_STR} @RunAll.sql
diff --git a/readme.md b/readme.md
index 8b4f67f33..1ecea3143 100644
--- a/readme.md
+++ b/readme.md
@@ -156,7 +156,7 @@ Finished in .036027 seconds
# Contributing to the project
We welcome new developers to join our community and contribute to the utPLSQL project.
-If you are interested in helping please read our [guide to contributing](docs/about/CONTRIBUTING.md)
+If you are interested in helping please read our [guide to contributing](CONTRIBUTING.md)
The best place to start is to read the documentation and get familiar with the existing code base.
A [slack chat](https://utplsql.slack.com/) is the place to go if you want to talk with team members.
To sign up to the chat use [this link](http://utplsql-slack-invite.herokuapp.com/)
diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh
index 1685a7ba6..0e000f2a2 100644
--- a/test/install_and_run_tests.sh
+++ b/test/install_and_run_tests.sh
@@ -1,5 +1,7 @@
#!/bin/bash
set -ev
+#goto git root directory
+git rev-parse && cd "$(git rev-parse --show-cdup)"
cd test
@@ -12,6 +14,7 @@ utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_ST
-test_path=test -c \
-f=ut_documentation_reporter -o=test_results.log -s \
-f=ut_coverage_sonar_reporter -o=coverage.xml \
+-f=ut_coverage_html_reporter -o=coverage.html \
-f=ut_coveralls_reporter -o=coverage.json \
-f=ut_sonar_test_reporter -o=test_results.xml
diff --git a/test/ut_utils/test_ut_utils.pkb b/test/ut_utils/test_ut_utils.pkb
index 7fc0e737b..17e2d80db 100644
--- a/test/ut_utils/test_ut_utils.pkb
+++ b/test/ut_utils/test_ut_utils.pkb
@@ -53,24 +53,24 @@ end;]' using p_expected_list;
common_clob_to_table_exec( 'abcdefg,hijk,axa,a', ',', ut3.ut_varchar2_list('abc','def','g','hij','k','axa','a'), 3);
common_clob_to_table_exec( ',a,,c,d,', ',', ut3.ut_varchar2_list('','a','','c','d',''), 1000);
end;
-
+
procedure test_to_char is
begin
ut.expect(ut3.ut_utils.test_result_to_char(-1),'test unknown').to_equal('Unknown(-1)');
ut.expect(ut3.ut_utils.test_result_to_char(null),'test unknown').to_equal('Unknown(NULL)');
ut.expect(ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_success),'test unknown').to_equal(ut3.ut_utils.tr_success_char);
end;
-
+
procedure test_to_string_blob is
l_text varchar2(32767) := 'A test char';
l_value blob := utl_raw.cast_to_raw(l_text);
- l_expected varchar2(32767) := ''''||rawtohex(l_value)||'''';
+ l_expected varchar2(32767) := ''''||rawtohex(l_value)||'''';
l_result varchar2(32767);
begin
l_result := ut3.ut_utils.to_String(l_value);
ut.expect(l_result).to_equal(l_expected);
end;
-
+
procedure test_to_string_clob is
l_value clob := 'A test char';
l_expected varchar2(32767) := ''''||l_value||'''';
@@ -78,8 +78,8 @@ end;]' using p_expected_list;
begin
l_result := ut3.ut_utils.to_String(l_value);
ut.expect(l_result).to_equal(l_expected);
- end;
-
+ end;
+
procedure test_to_string_date is
l_value date := to_date('2016-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss');
l_expected varchar2(100) := '2016-12-31T23:59:59';
@@ -88,7 +88,7 @@ end;]' using p_expected_list;
l_result := ut3.ut_utils.to_String(l_value);
ut.expect(l_result).to_equal(l_expected);
end;
-
+
procedure to_string_null is
begin
ut.expect(ut3.ut_utils.to_String(to_blob(NULL))).to_equal('NULL');
@@ -97,7 +97,7 @@ end;]' using p_expected_list;
ut.expect(ut3.ut_utils.to_String(to_number(NULL))).to_equal('NULL');
ut.expect(ut3.ut_utils.to_String(to_timestamp(NULL))).to_equal('NULL');
end;
-
+
procedure to_string is
l_value timestamp(9) := to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff');
l_value2 timestamp(9) with local time zone:= to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff');
@@ -109,25 +109,25 @@ end;]' using p_expected_list;
begin
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789';
-
+
l_result := ut3.ut_utils.to_String(l_value);
ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
-
+
l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789';
l_result := ut3.ut_utils.to_String(l_value2);
- ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
+ ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789 -08:00';
-
+
l_result := ut3.ut_utils.to_String(l_value3);
- ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
-
- l_expected := ''''||l_value4||'''';
+ ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
+
+ l_expected := ''''||l_value4||'''';
l_result := ut3.ut_utils.to_String(l_value4);
- ut.expect(l_result,'Returns a varchar2 eclosed in quotes').to_equal(l_expected);
-
+ ut.expect(l_result,'Returns a varchar2 eclosed in quotes').to_equal(l_expected);
+
end;
-
+
procedure to_string_big_blob is
l_text clob := lpad('A test char',32767,'1')||lpad('1',32767,'1');
l_value blob;
@@ -162,7 +162,7 @@ end;]' using p_expected_list;
ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string);
end;
-
+
procedure to_string_big_clob is
l_value clob := lpad('A test char',32767,'1')||lpad('1',32767,'1');
l_result varchar2(32767);
@@ -173,7 +173,7 @@ end;]' using p_expected_list;
ut.EXPECT(length(l_result)).to_equal(ut3.ut_utils.gc_max_output_string_length);
ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string);
end;
-
+
procedure to_string_big_number is
l_value number := 1234567890123456789012345678901234567890;
l_expected varchar2(100) := '1234567890123456789012345678901234567890';
@@ -184,7 +184,7 @@ end;]' using p_expected_list;
--Assert
ut.expect(l_result).TO_equal(l_expected);
end;
-
+
procedure to_string_big_varchar2 is
l_value varchar2(32767) := lpad('A test char',32767,'1');
l_result varchar2(32767);
@@ -205,20 +205,20 @@ end;]' using p_expected_list;
--Act
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
l_expected := l_delimiter||'123456789012345678901234567890123456789';
-
+
l_result := ut3.ut_utils.to_String(l_value);
-
+
--Assert
ut.expect(l_result).TO_equal(l_expected);
end;
-
+
procedure test_table_to_clob is
procedure exec_table_to_clob(a_list ut3.ut_varchar2_list, a_delimiter varchar2, a_expected clob) is
l_result clob;
begin
l_result := ut3.ut_utils.table_to_clob(a_list, a_delimiter);
-
+
ut.expect(l_result).to_equal(a_expected, a_nulls_are_equal => true);
end;
begin
@@ -254,7 +254,7 @@ end;]' using p_expected_list;
select value into gv_nls_value from nls_session_parameters where parameter = 'NLS_DATE_LANGUAGE';
execute immediate 'alter session set nls_date_language=ENGLISH';
execute immediate 'create or replace package tst_chars as
--- 2) Status of the process = ‘PE’ with no linked data
+-- 2) Status of the process = 😡PE😡 with no linked data
end;';
execute immediate 'alter session set nls_date_language=RUSSIAN';
@@ -265,12 +265,12 @@ end;';
execute immediate 'alter session set nls_date_language='||gv_nls_value;
execute immediate 'drop package tst_chars';
end;
-
+
procedure test_clob_to_table_multibyte is
l_varchar2_byte_limit integer := 32767;
l_workaround_byte_limit integer := 8191;
l_singlebyte_string_max_size varchar2(32767 char) := rpad('x',l_varchar2_byte_limit,'x');
- l_twobyte_character char(1 char) := 'æ';
+ l_twobyte_character char(1 char) := 'ðŸ˜';
l_clob_multibyte clob := l_twobyte_character||l_singlebyte_string_max_size; --here we have 32769(2+32767) bytes and 32768 chars
l_expected ut3.ut_varchar2_list := ut3.ut_varchar2_list();
l_result ut3.ut_varchar2_list;