diff --git a/.gitattributes b/.gitattributes index 5e0c801de..2cda5ad55 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,6 +6,8 @@ test export-ignore .gitignore export-ignore .gitmodules export-ignore mkdocs.yml export-ignore +BUILD_NO export-ignore +mkdocs_offline.yml export-ignore sonar-project.properties export-ignore ^docs/** linguist-documentation *.pkb linguist-language=PLSQL diff --git a/.github/DISCUSSION_TEMPLATE/README.md b/.github/DISCUSSION_TEMPLATE/README.md new file mode 100644 index 000000000..f6c0905f4 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/README.md @@ -0,0 +1,150 @@ +# GitHub Discussions β€” setup guide for utPLSQL/utPLSQL + +This folder contains the discussion category form templates that power structured +GitHub Discussions for the utPLSQL project. + +--- + +## File β†’ category mapping + + + +| File | Category name to create in GitHub | Format | Who can post | +|------------------------|-----------------------------------|-----------------------|--------------------------------| +| `announcements.yml` | πŸ“’ Announcements | Announcement | Maintainers only | +| `rfcs-design.yml` | πŸ’‘ RFCs & Design | Open-ended discussion | Everyone | +| `architecture.yml` | πŸ— Architecture | Open-ended discussion | Everyone | +| `release-planning.yml` | πŸ—“ Release Planning | Open-ended discussion | Maintainers only (recommended) | +| `q-a.yml` | ❓ Q&A | Question / Answer | Everyone | +| `show-and-tell.yml` | πŸ”¬ Show & Tell | Open-ended discussion | Everyone | +| `contributors.yml` | 🀝 Contributors | Open-ended discussion | Everyone | +| `general.yml` | πŸ’¬ General | Open-ended discussion | Everyone | + +> **Polls** are a built-in GitHub Discussions type and do not support YAML templates. +> Create a πŸ—³ Polls category manually (type: Poll) β€” no template file needed. + +--- + +## Step-by-step setup + +### 1. Enable Discussions +Go to **Settings β†’ Features** and check **Discussions**. + +### 2. Create the categories +Go to **Discussions β†’ Categories β†’ ✏️ Edit categories** (gear icon). + +Create each category listed in the table above. +**Order matters** β€” drag to set the display order shown below: + +1. πŸ“’ Announcements +2. πŸ’‘ RFCs & Design +3. πŸ— Architecture +4. πŸ—“ Release Planning +5. ❓ Q&A +6. πŸ”¬ Show & Tell +7. 🀝 Contributors +8. πŸ—³ Polls +9. πŸ’¬ General + +### 3. Commit the templates +Copy all `.yml` files from this folder into `.github/DISCUSSION_TEMPLATE/` in +the **default branch** (usually `develop` for utPLSQL). + +``` +.github/ +└── DISCUSSION_TEMPLATE/ + β”œβ”€β”€ announcements.yml + β”œβ”€β”€ rfcs-design.yml + β”œβ”€β”€ architecture.yml + β”œβ”€β”€ release-planning.yml + β”œβ”€β”€ q-a.yml + β”œβ”€β”€ show-and-tell.yml + β”œβ”€β”€ contributors.yml + └── general.yml +``` + +### 4. Configure category permissions + +| Category | Setting | +|------------------|--------------------------------------------------| +| Announcements | Set to **Maintainers only** in category settings | +| Release Planning | Recommended: **Maintainers only** | +| All others | Open to all | + +### 5. Create the welcome pinned post + +Create a first discussion in **Announcements** titled +**"Welcome to utPLSQL Discussions β€” how to use this space"** + +Suggested body: + +```markdown +## Welcome πŸ‘‹ + +This is the place for design discussions, feature proposals, and community +conversation around utPLSQL. + +### Where to post + +| I want to… | Use | +|---|---| +| Propose a new feature or behaviour change | πŸ’‘ RFCs & Design | +| Discuss internal architecture | πŸ— Architecture | +| Ask a usage / how-to question | ❓ Q&A | +| Share a CI pipeline, integration, or tip | πŸ”¬ Show & Tell | +| Ask about contributing / development setup | 🀝 Contributors | +| Vote on priorities | πŸ—³ Polls | +| Anything else | πŸ’¬ General | + +### Discussions vs Issues + +**Discussions** are for ideas that are still open, need input, or require consensus. +**Issues** are for well-scoped work that someone can pick up and implement. + +A maintainer will convert a Discussion to an Issue once scope is agreed. + +### Real-time chat + +For quick questions: [utPLSQL Slack](https://utplsql.slack.com) +For decisions that need a permanent record: post here. +``` + +Pin this post from the discussion's `…` menu β†’ **Pin discussion**. + +### 6. Update the README + +Add a Discussions badge to the project README: + +```markdown +[![GitHub Discussions](https://img.shields.io/github/discussions/utPLSQL/utPLSQL)](https://github.com/utPLSQL/utPLSQL/discussions) +``` + +And add a short paragraph in the "Community" or "Contributing" section pointing +to Discussions as the place for design proposals. + +--- + +## Operating guidelines + +### Discussion β†’ Issue conversion rule + +| Category | Convert when… | +|---------------|----------------------------------------------------------------------| +| RFCs & Design | Consensus reached, scope is defined | +| Architecture | Breaking change formally agreed by maintainers | +| Q&A | A confirmed bug surfaces in the thread | +| Contributors | A gap in docs or tooling is identified that can be filed as an issue | + +Use the **"Create issue from discussion"** button (available in the discussion's sidebar). + +### Housekeeping + +- Lock **Announcements** threads after 30 days. +- Close **Polls** after 14 days; post a summary comment with the result before closing. +- Label cross-references: apply the same labels used on issues + (`enhancement`, `breaking-change`, `coverage`, `oracle-version`, etc.) + to discussions for consistent search. diff --git a/.github/DISCUSSION_TEMPLATE/announcements.yml b/.github/DISCUSSION_TEMPLATE/announcements.yml new file mode 100644 index 000000000..262746e11 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/announcements.yml @@ -0,0 +1,54 @@ +title: "[Announcement] " +labels: ["announcement"] +body: + - type: markdown + attributes: + value: | + > **Maintainers only.** This category is restricted to project maintainers. + > Announcements are pinned and locked after 30 days. + + - type: dropdown + id: announcement_type + attributes: + label: Announcement type + options: + - New release + - Release candidate / pre-release + - Roadmap update + - Deprecation notice + - Security advisory + - Community / governance update + - Other + validations: + required: true + + - type: input + id: version + attributes: + label: Version (if applicable) + placeholder: "e.g. 3.2.0" + validations: + required: false + + - type: textarea + id: body + attributes: + label: Announcement body + description: | + Write the full announcement here. + For releases, include: highlights, breaking changes, upgrade notes, and a link to the full changelog. + validations: + required: true + + - type: textarea + id: links + attributes: + label: Key links + description: Release tag, changelog, migration guide, Docker image, CLI download, etc. + placeholder: | + - Release: https://github.com/utPLSQL/utPLSQL/releases/tag/v… + - Changelog: … + - Docker: … + - CLI: … + validations: + required: false diff --git a/.github/DISCUSSION_TEMPLATE/architecture.yml b/.github/DISCUSSION_TEMPLATE/architecture.yml new file mode 100644 index 000000000..f3df8e29c --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/architecture.yml @@ -0,0 +1,100 @@ +title: "[Architecture] " +labels: ["architecture", "design"] +body: + - type: markdown + attributes: + value: | + ## Architecture discussion + Use this template for internal design decisions: changes to the suite-loading mechanism, + the coverage engine, DDL trigger behaviour, reporter infrastructure, or any + cross-cutting concern that affects the internals of utPLSQL. + + This category is primarily for **contributors and maintainers**. + If you want to propose a user-facing feature, use **RFCs & Design** instead. + + - type: input + id: title_short + attributes: + label: Component / area + description: Which internal component or subsystem does this discussion concern? + placeholder: "e.g. Suite loader, Coverage engine, Annotation parser, Event system" + validations: + required: true + + - type: textarea + id: context + attributes: + label: Context and current design + description: Briefly describe how the relevant part works today. + validations: + required: true + + - type: textarea + id: problem + attributes: + label: Problem or design question + description: What specific decision needs to be made, or what limitation needs to be addressed? + validations: + required: true + + - type: textarea + id: options + attributes: + label: Options under consideration + description: | + List the design options you are weighing. For each option describe: + - How it works + - Pros + - Cons + - Impact on Oracle compatibility + placeholder: | + **Option A β€” …** + How: … + Pros: … + Cons: … + + **Option B β€” …** + How: … + Pros: … + Cons: … + validations: + required: true + + - type: textarea + id: preferred + attributes: + label: Preferred direction (if any) + description: If you already lean toward one option, say so and why. Leave blank if genuinely open. + validations: + required: false + + - type: dropdown + id: breaking + attributes: + label: Does this introduce a breaking change? + options: + - "No" + - "Yes β€” public API change (ut_runner, ut packages, annotations)" + - "Yes β€” output/reporter format change" + - "Yes β€” internal package change (no public API impact)" + - "Unsure" + validations: + required: true + + - type: textarea + id: migration + attributes: + label: Migration / compatibility notes + description: If breaking, describe the migration path for users and downstream integrations. + validations: + required: false + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I have reviewed the existing architecture docs and source + required: true + - label: Relevant unit / integration tests have been considered + required: false diff --git a/.github/DISCUSSION_TEMPLATE/contributors.yml b/.github/DISCUSSION_TEMPLATE/contributors.yml new file mode 100644 index 000000000..6325961de --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/contributors.yml @@ -0,0 +1,56 @@ +title: "[Contributors] " +labels: ["contributors"] +body: + - type: markdown + attributes: + value: | + ## Contributors + Questions about **contributing to utPLSQL** β€” development environment setup, + the test suite, pull request process, coding conventions, or anything else + that helps you get your first (or next) contribution merged. + + **Useful links before posting:** + - [CONTRIBUTING.md](../../blob/develop/CONTRIBUTING.md) + - [Development environment setup](../../blob/develop/docs/development/developer-guide.md) + - [Open issues labelled `good first issue`](../../issues?q=is%3Aopen+label%3A%22good+first+issue%22) + + - type: dropdown + id: topic + attributes: + label: Topic + options: + - Dev environment / Docker setup + - Running the test suite locally + - Understanding the codebase + - PR review process + - Coding conventions / style + - Good first issue β€” looking for guidance + - Release process + - Documentation contribution + - Other + validations: + required: true + + - type: textarea + id: question + attributes: + label: Question or request + description: What do you need help with? + validations: + required: true + + - type: textarea + id: context + attributes: + label: What you have tried + description: Steps already taken, error messages, links to relevant code, etc. + validations: + required: false + + - type: input + id: os + attributes: + label: Host OS / environment + placeholder: "e.g. macOS 14, Windows 11, Ubuntu 22.04, Docker on Linux" + validations: + required: false diff --git a/.github/DISCUSSION_TEMPLATE/general.yml b/.github/DISCUSSION_TEMPLATE/general.yml new file mode 100644 index 000000000..0e3b8d100 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/general.yml @@ -0,0 +1,28 @@ +title: "" +labels: ["general"] +body: + - type: markdown + attributes: + value: | + ## General discussion + For open-ended conversations that don't fit another category: + project direction, community topics, suggestions, or anything else. + + If your post turns out to be a feature proposal, a maintainer may move it to + **RFCs & Design**. If it is a question about using utPLSQL, consider posting + in **Q&A** instead so a helpful answer can be marked. + + - type: textarea + id: body + attributes: + label: What's on your mind? + validations: + required: true + + - type: textarea + id: context + attributes: + label: Additional context + description: Background, links, related issues or discussions. + validations: + required: false diff --git a/.github/DISCUSSION_TEMPLATE/q-a.yml b/.github/DISCUSSION_TEMPLATE/q-a.yml new file mode 100644 index 000000000..e4ff1d452 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/q-a.yml @@ -0,0 +1,87 @@ +title: "[Q&A] " +labels: ["question"] +body: + - type: markdown + attributes: + value: | + ## Question & Answer + Ask anything about **using** utPLSQL β€” installation, writing tests, CI integration, + reporters, annotations, code coverage, etc. + + **Tips for a fast answer:** + - Include your utPLSQL version and Oracle version. + - Paste a minimal reproducer (test package + expected vs actual output). + - Check the [documentation](https://utplsql.github.io/utPLSQL/) and + [closed Q&A discussions](../../discussions/categories/q-a?discussions_q=is%3Aclosed) first. + + > If this turns out to be a **bug**, a maintainer will convert this discussion into an Issue. + + - type: input + id: utplsql_version + attributes: + label: utPLSQL version + placeholder: "e.g. 3.1.13" + validations: + required: true + + - type: dropdown + id: oracle_version + attributes: + label: Oracle version + options: + - Oracle 11g + - Oracle 12c + - Oracle 18c + - Oracle 19c + - Oracle 21c + - Oracle 23c / 23ai + - Other / unsure + validations: + required: true + + - type: textarea + id: question + attributes: + label: Question + description: Describe what you are trying to do and what you have tried so far. + validations: + required: true + + - type: textarea + id: reproducer + attributes: + label: Minimal reproducer + description: | + Paste a minimal test package and/or the relevant ut_runner call. + Include the full error message or unexpected output if applicable. + render: sql + validations: + required: false + + - type: textarea + id: expected + attributes: + label: Expected behaviour + validations: + required: false + + - type: textarea + id: actual + attributes: + label: Actual behaviour / error + validations: + required: false + + - type: dropdown + id: install_method + attributes: + label: Installation method + options: + - utPLSQL-cli + - SQL*Plus script + - Docker / utPLSQL-docker + - Liquibase / Flyway + - Other + - N/A + validations: + required: false diff --git a/.github/DISCUSSION_TEMPLATE/release-planning.yml b/.github/DISCUSSION_TEMPLATE/release-planning.yml new file mode 100644 index 000000000..5663d7613 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/release-planning.yml @@ -0,0 +1,90 @@ +title: "[Release] v" +labels: ["release-planning"] +body: + - type: markdown + attributes: + value: | + ## Release planning discussion + Use this template to discuss the scope of an upcoming release: + what goes in, what gets deferred, and what the acceptance criteria are. + + **Maintainers:** pin this discussion and link it from the corresponding GitHub Milestone. + + - type: input + id: version + attributes: + label: Target version + placeholder: "e.g. 3.2.0" + validations: + required: true + + - type: dropdown + id: release_type + attributes: + label: Release type + options: + - Major (breaking changes) + - Minor (new features, backward-compatible) + - Patch (bug fixes only) + validations: + required: true + + - type: textarea + id: goals + attributes: + label: Release goals + description: What are the 2–4 key things this release should achieve? + placeholder: | + 1. + 2. + 3. + validations: + required: true + + - type: textarea + id: scope_in + attributes: + label: In scope (proposed issues / PRs) + description: | + Link the GitHub Issues and PRs targeted for this release. + Use the format: `- [ ] #123 β€” short description` + placeholder: | + - [ ] #123 β€” ... + - [ ] #456 β€” ... + validations: + required: false + + - type: textarea + id: scope_out + attributes: + label: Out of scope / explicitly deferred + description: Issues that were considered but will not be included β€” and why. + validations: + required: false + + - type: input + id: target_date + attributes: + label: Target release date (approximate) + placeholder: "e.g. 2025-Q2" + validations: + required: false + + - type: textarea + id: oracle_matrix + attributes: + label: Oracle version test matrix + description: Which Oracle versions must pass CI before this release ships? + placeholder: | + - [ ] Oracle 19c + - [ ] Oracle 21c + - [ ] Oracle 23ai + validations: + required: false + + - type: textarea + id: notes + attributes: + label: Additional notes + validations: + required: false diff --git a/.github/DISCUSSION_TEMPLATE/rfcs-design.yml b/.github/DISCUSSION_TEMPLATE/rfcs-design.yml new file mode 100644 index 000000000..32c0a33c7 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/rfcs-design.yml @@ -0,0 +1,88 @@ +title: "[RFC] " +labels: ["rfc", "design"] +body: + - type: markdown + attributes: + value: | + ## Request for Comments β€” design proposal + Use this template to propose a new feature, a change to existing behaviour, or a significant refactoring. + Once there is consensus and a clear scope, a maintainer will convert this discussion into one or more GitHub Issues. + + **Before posting:** search existing RFCs and open issues to avoid duplicates. + + - type: input + id: summary + attributes: + label: Summary + description: One sentence β€” what are you proposing? + placeholder: "Add support for ..." + validations: + required: true + + - type: textarea + id: problem + attributes: + label: Problem / motivation + description: What problem does this solve? Who is affected and how often? + placeholder: | + Currently, when ... it is not possible to ... + This forces users to ... + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: Proposed solution + description: Describe the solution in as much detail as you have. Pseudo-code, SQL, or PL/SQL snippets are welcome. + placeholder: | + ```sql + -- example of the proposed API + ``` + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: What other approaches did you look at? Why did you rule them out? + validations: + required: false + + - type: textarea + id: breaking + attributes: + label: Breaking-change impact + description: | + Does this change affect existing annotations, package APIs, or test output formats? + List affected public symbols (ut_runner, ut, annotations, reporters …). + validations: + required: false + + - type: dropdown + id: oracle_versions + attributes: + label: Oracle version relevance + description: Which Oracle versions does this apply to? + multiple: true + options: + - All supported versions + - Oracle 11g + - Oracle 12c + - Oracle 18c + - Oracle 19c + - Oracle 21c + - Oracle 23c / 23ai + validations: + required: true + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I have searched existing discussions and issues for duplicates + required: true + - label: I am willing to help implement or review this feature + required: false diff --git a/.github/DISCUSSION_TEMPLATE/show-and-tell.yml b/.github/DISCUSSION_TEMPLATE/show-and-tell.yml new file mode 100644 index 000000000..4443c5de6 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/show-and-tell.yml @@ -0,0 +1,79 @@ +title: "[Show & Tell] " +labels: ["show-and-tell"] +body: + - type: markdown + attributes: + value: | + ## Show & Tell + Share how you are using utPLSQL in the wild β€” CI pipelines, IDE integrations, + custom reporters, coverage setups, framework wrappers, or anything else the + community might learn from. + + Posts here are a great source of real-world examples for the documentation. + + - type: input + id: title_short + attributes: + label: What are you sharing? + placeholder: "e.g. utPLSQL + GitHub Actions CI pipeline for Oracle 23ai" + validations: + required: true + + - type: dropdown + id: category + attributes: + label: Category + multiple: true + options: + - CI/CD integration + - IDE / SQL client integration + - Custom reporter + - Code coverage setup + - Framework wrapper / helper library + - Docker / containerised testing + - Annotation patterns + - Performance / large test suite + - Other + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + description: Describe what you built or configured and why it might be useful to others. + validations: + required: true + + - type: textarea + id: snippet + attributes: + label: Code or configuration snippet + description: Paste the most relevant excerpt. Link to a repo or Gist if you have one. + render: yaml + validations: + required: false + + - type: input + id: utplsql_version + attributes: + label: utPLSQL version used + placeholder: "e.g. 3.1.13" + validations: + required: false + + - type: input + id: oracle_version + attributes: + label: Oracle version + placeholder: "e.g. Oracle 19c" + validations: + required: false + + - type: textarea + id: links + attributes: + label: Links + description: Repository, blog post, documentation page, etc. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 681bc7f3a..f0335781e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -23,4 +23,4 @@ Add any other context or screenshots about the feature request here. > Please do not create issues for generic SQL or PL/SQL questions. There are other forums and communities to help you with those. See [ASKTom](https://asktom.oracle.com) for example. **Want to discuss** -If you want to discuss your issue, join [our SLACK chat](https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww). +If you want to discuss a problem, please go to [utPLSQL discussions](https://github.com/utPLSQL/utPLSQL/discussions) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 668f1e5a4..be6e18ca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: build: name: Build and test on ${{matrix.db_version_name}} DB runs-on: ubuntu-latest + timeout-minutes: 90 env: ORACLE_VERSION: ${{matrix.oracle-version}} ORACLE_SID: ${{matrix.oracle-sid}} @@ -28,42 +29,17 @@ jobs: matrix: include: - id: 1 - db_version_name: '11XE' - oracle-sid: 'XE' - oracle-version: "gvenzl/oracle-xe:11-full" - oracle-base: '/u01/app/oracle' - - id: 2 - db_version_name: '12.1EE' + db_version_name: '19se' oracle-sid: 'ORCLCDB' - oracle-version: "utplsqlv3/oracledb:12c-r1-ee-small" - oracle-base: '/opt/oracle' -# - id: 3 -# db_version_name: '12.2se' -# oracle-sid: 'ORCLCDB' -# oracle-version: "utplsqlv3/oracledb:12c-r2-se2-small" -# oracle-base: '/opt/oracle' - - id: 4 - db_version_name: '18XE' - oracle-sid: 'XE' - oracle-version: "gvenzl/oracle-xe:18-slim" - oracle-base: '/opt/oracle' -# TODO - need to add healthcheck.sh into our containers -# - id: 5 -# db_version_name: '19se' -# oracle-sid: 'ORCLCDB' -# oracle-version: "utplsqlv3/oracledb:19c-se2-small" -# oracle-base: '/opt/oracle' - - id: 6 + oracle-version: "utplsqlv3/oracledb:19c-se2-small" + - id: 2 db_version_name: '21XE' oracle-sid: 'XE' - oracle-version: "gvenzl/oracle-xe:21-slim" - oracle-base: '/opt/oracle' - - id: 7 - db_version_name: '23free' + oracle-version: "gvenzl/oracle-xe:21-slim-faststart" + - id: 3 + db_version_name: '23-free' oracle-sid: 'FREEPDB1' - oracle-version: "gvenzl/oracle-free:23-slim" - oracle-base: '/opt/oracle' - + oracle-version: "gvenzl/oracle-free:23-slim-faststart" services: html_checker: image: ghcr.io/validator/validator:latest @@ -88,13 +64,13 @@ jobs: --health-cmd healthcheck.sh steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: c-py/action-dotenv-to-setenv@v2 + - uses: c-py/action-dotenv-to-setenv@v5 with: env-file: .github/variables/.env - - uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action + - uses: FranzDiebold/github-env-vars-action@v2.8.0 #https://github.com/marketplace/actions/github-environment-variables-action - name: Set build version number env variables id: set-build-version-number-vars @@ -111,52 +87,68 @@ jobs: - name: Update privileges on sources run: chmod -R go+w ./{source,test,examples,${UTPLSQL_DIR}/source} + - name: Cache OJDBC jars + id: cache-ojdbc + uses: actions/cache@v4 + with: + path: ${{ env.OJDBC_HOME }} + key: ${{ runner.os }}-ojdbc-${{ env.OJDBC_URL }}-v1 + - name: Add OJDBC home + if: steps.cache-ojdbc.outputs.cache-hit != 'true' id: get-ojdbc run: mkdir -p ${OJDBC_HOME} && curl -Lk -o ${OJDBC_HOME}/ojdbc8.jar ${OJDBC_URL}/ojdbc8.jar && curl -Lk -o ${OJDBC_HOME}/orai18n.jar ${OJDBC_URL}/orai18n.jar + - name: Cache utPLSQL-cli + id: cache-utplsql-cli + uses: actions/cache@v4 + with: + path: utPLSQL-cli + key: ${{ runner.os }}-utplsql-cli-v3.1.8 + - name: Install utPLSQL-cli + if: steps.cache-utplsql-cli.outputs.cache-hit != 'true' id: install-utplsql-cli - run: curl -Lk -o utPLSQL-cli.zip "https://github.com/utPLSQL/utPLSQL-cli/releases/download/v3.1.8/utPLSQL-cli.zip" && unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli + run: curl -Lk -o utPLSQL-cli.zip "https://github.com/utPLSQL/utPLSQL-cli/releases/download/3.1.9/utPLSQL-cli.zip" && unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli - name: Install utPLSQL id: install-utplsql - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle .github/scripts/install.sh - name: Check code style if: ${{ matrix.id == 1 }} id: check-coding-style - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint "$SQLCLI" ${DOCKER_ENV} ${ORACLE_VERSION} $UT3_DEVELOP_SCHEMA/$UT3_DEVELOP_SCHEMA_PASSWORD@//$CONNECTION_STR @development/utplsql_style_check.sql + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle "$SQLCLI" ${UT3_DEVELOP_SCHEMA}/${UT3_DEVELOP_SCHEMA_PASSWORD}@//${CONNECTION_STR} @/utPLSQL/development/utplsql_style_check.sql - name: Validate utPLSQL uninstall if: ${{ matrix.id == 1 }} id: validate-uninstall - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/uninstall_validate_utplsql.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle .github/scripts/uninstall_validate_utplsql.sh - name: Reinstall utPLSQL if: ${{ matrix.id == 1 }} id: reinstall-utplsql - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle .github/scripts/install.sh - name: Create test users id: create-test-users - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/create_test_users.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle .github/scripts/create_test_users.sh - name: Install utPLSQL release id: install-utplsql-release - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install_utplsql_release.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle .github/scripts/install_utplsql_release.sh - name: Run Examples id: run-examples - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/run_examples.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle .github/scripts/run_examples.sh - name: Install tests id: install-tests - run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} test/install_tests.sh + run: docker exec -w /utPLSQL ${DOCKER_ENV} oracle test/install_tests.sh - name: Run Tests id: run-tests - run: bash test/run_tests.sh + run: test/run_tests.sh #Start Needed to diagnose occasional failures of DB on test runs - name: Prepare diagnostic directory @@ -172,7 +164,7 @@ jobs: - name: Upload ORACLE_BASE/diag data Artifact id: upload if: ${{ always() && steps.run-tests.outcome == 'failure' }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: my-artifact$-${{matrix.db_version_name}} path: ${{github.workspace}}/database-diag @@ -183,7 +175,7 @@ jobs: run: bash .github/scripts/validate_report_files.sh - name: Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos files: ./cobertura.xml @@ -191,22 +183,22 @@ jobs: fail_ci_if_error: true # optional (default = false) - name: Publish unit test results - uses: EnricoMi/publish-unit-test-result-action@v1.24 + uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: files: junit_test_results.xml - name: SonarCloud Scan id: sonar - if: ${{ always() && matrix.db_version_name == '21XE' }} - uses: SonarSource/sonarcloud-github-action@master + if: ${{ always() && matrix.db_version_name == '23-free' }} + uses: SonarSource/sonarqube-scan-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: args: > -Dsonar.buildString=${{ format( '{0}.{1}', env.UTPLSQL_BUILD_VERSION, matrix.id ) }} - -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//oracle:1521/{0}', env.ORACLE_SID ) }} + -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//localhost:1521/{0}', env.ORACLE_SID ) }} -Dsonar.plsql.jdbc.driver.path=${{ format( '{0}/ojdbc8.jar', env.OJDBC_HOME ) }} publish: @@ -214,6 +206,7 @@ jobs: needs: [ build ] concurrency: publish runs-on: ubuntu-latest + timeout-minutes: 30 env: API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} if: | @@ -225,14 +218,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: echo "API_TOKEN_GITHUB=${GITHUB_TOKEN}" >> $GITHUB_ENV - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ env.API_TOKEN_GITHUB }} - - uses: c-py/action-dotenv-to-setenv@v2 + - uses: c-py/action-dotenv-to-setenv@v5 with: env-file: .github/variables/.env - - uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action + - uses: FranzDiebold/github-env-vars-action@v2.8.0 #https://github.com/marketplace/actions/github-environment-variables-action - name: Set buid version number env variables id: set-build-version-number-vars @@ -267,6 +260,7 @@ jobs: concurrency: trigger needs: [ build, publish ] runs-on: ubuntu-latest + timeout-minutes: 15 if: | github.repository == 'utPLSQL/utPLSQL' && github.base_ref == null && ( startsWith( github.ref, 'refs/heads/release/v' ) || github.ref == 'refs/heads/develop' ) @@ -276,7 +270,7 @@ jobs: # repo: [ 'utPLSQL/utPLSQL-v2-v3-migration' ] steps: - name: Repository Dispatch - uses: peter-evans/repository-dispatch@v1 + uses: peter-evans/repository-dispatch@v4 with: token: ${{ secrets.API_TOKEN_GITHUB }} repository: ${{ matrix.repo }} @@ -287,6 +281,7 @@ jobs: name: Post Workflow Status To Slack needs: [ build, publish, dispatch ] runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Slack Workflow Notification uses: Gamesight/slack-workflow-status@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e29bd5c1..ab043b6eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,15 +14,16 @@ jobs: name: Upload archives concurrency: upload runs-on: ubuntu-latest + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: c-py/action-dotenv-to-setenv@v2 + - uses: c-py/action-dotenv-to-setenv@v5 with: env-file: .github/variables/.env - - uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action + - uses: FranzDiebold/github-env-vars-action@v2.8.0 #https://github.com/marketplace/actions/github-environment-variables-action - name: Set build version number env variables run: .github/scripts/set_release_version_numbers_env.sh @@ -69,6 +70,7 @@ jobs: name: Post Workflow Status To Slack needs: [ upload_artifacts ] runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Slack Workflow Notification uses: Gamesight/slack-workflow-status@master diff --git a/BUILD_NO b/BUILD_NO index 26de2ed80..61cb37f72 100644 --- a/BUILD_NO +++ b/BUILD_NO @@ -1 +1 @@ -4197 +4375 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..f75662f75 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,600 @@ +# Changelog + +All notable changes to utPLSQL are documented here. +Releases are available on the [GitHub Releases page](https://github.com/utPLSQL/utPLSQL/releases). + +--- + +## [v3.2.01] - 2026-04-22 + +## Important + - Dropped support for Oracle Database versions older than 19c + +## New features + - Add TAP reporter by @WayneNani in [#1305](https://github.com/utPLSQL/utPLSQL/pull/1305) + +## Enhancements and bug fixes + - Added duplicate detection on cursor comparison using `join_by` by @lwasylow in [#1295](https://github.com/utPLSQL/utPLSQL/pull/1295) + - Fix code causing the object duration Oracle exception on oracle 23.26 by @lwasylow in [#1310](https://github.com/utPLSQL/utPLSQL/pull/1310) + - Packages with annotation-like comments are not test suites by @jgebal in [#1313](https://github.com/utPLSQL/utPLSQL/pull/1313) + - Performance improvements to annotation parsing by @lwasylow in [#1312](https://github.com/utPLSQL/utPLSQL/pull/1319) + - Updated documentation and copyright banners across source files @jgebal in [#1319](https://github.com/utPLSQL/utPLSQL/pull/1319) + +--- + +## [v3.1.14] - 2024-02-19 + +## New features + + - Added support for `and` and `or` operators when running tests by tags by @lwasylow in [#1250](https://github.com/utPLSQL/utPLSQL/pull/1250) + +## Enhancements + + - Allow for test runs over 4 hours by @jgebal in [#1243](https://github.com/utPLSQL/utPLSQL/pull/1243) + - Framework performance improvements by @jgebal in [#1249](https://github.com/utPLSQL/utPLSQL/pull/1249) + - Support multiple expectation failures with teamcity reporter by @jgebal in [#1251](https://github.com/utPLSQL/utPLSQL/pull/1251) + - Update TFS reporter to correct format by @lwasylow in [#1270](https://github.com/utPLSQL/utPLSQL/pull/1270) + +## Bug fixes + + - Address issue where the `not_to(contain)` did not run correctly by @lwasylow in [#1246](https://github.com/utPLSQL/utPLSQL/pull/1246) + - Fix regex to be NLS_SORT independent by @jgebal in [#1253](https://github.com/utPLSQL/utPLSQL/pull/1253) + - Fix output length error and output buffer. by @jgebal in [#1255](https://github.com/utPLSQL/utPLSQL/pull/1255) + - (docs): Update running-unit-tests.md - remove example by @gassenmj in [#1261](https://github.com/utPLSQL/utPLSQL/pull/1261) + - The line-rate is not recorded for packages and classes in cobertura coverage reporter by @lwasylow in [#1269](https://github.com/utPLSQL/utPLSQL/pull/1269) + - (docs): Fix nested list issue by @iamrachid in [#1274](https://github.com/utPLSQL/utPLSQL/pull/1274) + +--- + +## [v3.1.13] - 2022-12-11 + +## New features + + - Add ability to run tests by part of a name. Fixed in [#1203](https://github.com/utPLSQL/utPLSQL/pull/1203), resolves [#470](https://github.com/utPLSQL/utPLSQL/issues/470) + +## Enhancements + + - Added documentation section on creating a custom reporter. Fixed in [#1225](https://github.com/utPLSQL/utPLSQL/pull/1225), resolves [#710](https://github.com/utPLSQL/utPLSQL/issues/701) + - Add ability to specify code coverage objects include/exclude masks as regular expressions. Fixed in [#1186](https://github.com/utPLSQL/utPLSQL/issues/1186), resolves [#1053](https://github.com/utPLSQL/utPLSQL/issues/1053) + +## Bug fixes + + - Comparing collection that have long type names. Fixed in [#1238](https://github.com/utPLSQL/utPLSQL/issues/1238), resolves [#1235](https://github.com/utPLSQL/utPLSQL/issues/1235). + - Code coverage reporting on code with long lines. Fixed in [#1240](https://github.com/utPLSQL/utPLSQL/issues/1240), resolves [#1232](https://github.com/utPLSQL/utPLSQL/issues/1232), [#1087](https://github.com/utPLSQL/utPLSQL/issues/1087). + - Code coverage reporting does not exclude tests. Fixed in [#1226](https://github.com/utPLSQL/utPLSQL/issues/1226), resolves [#1222](https://github.com/utPLSQL/utPLSQL/issues/1222). + - Uninstall script buffer overflow. Fixed in [#1221](https://github.com/utPLSQL/utPLSQL/issues/1221), resolves [#1220](https://github.com/utPLSQL/utPLSQL/issues/1220). + +## Internal improvements + + - Improved process of generating utPLSQL documentation. Implemented in [689bbd0](https://github.com/utPLSQL/utPLSQL/commit/689bbd0e365ed919315c29727bc10fbfc0dadce8), resolves [#1237](https://github.com/utPLSQL/utPLSQL/issues/1237). + - Removed username env variables for internal development. Implemented in [#1201](https://github.com/utPLSQL/utPLSQL/issues/1221), resolves [#1200](https://github.com/utPLSQL/utPLSQL/issues/1200). + - Test execution data of utPLSQL project not showing on SonarCloud. Implemented in [#1199](https://github.com/utPLSQL/utPLSQL/issues/1199), resolves [#1198](https://github.com/utPLSQL/utPLSQL/issues/1198). + +--- + +## [v3.1.12] - 2022-02-25 + +## New features + - Added support for description in the `--%disabled` annotation. See [documentation](https://github.com/utPLSQL/utPLSQL/blob/4515e0b5a3b4b0de0c2198db3235ef8614bff4d8/docs/userguide/annotations.md#disabled). Implemented in: [#1183](https://github.com/utPLSQL/utPLSQL/pull/1183), resolves [#610](https://github.com/utPLSQL/utPLSQL/issues/610). + - Added support for native `JSON` datatype on Oracle `21c`. Implemented in [#1181](https://github.com/utPLSQL/utPLSQL/pull/1181), resolves [#1114](https://github.com/utPLSQL/utPLSQL/issues/1114). + - Added new mather `to_be_within( distance|pct ).of_(expoected)`. See [documentation](https://github.com/utPLSQL/utPLSQL/blob/fd7ef9c14111a48e03fff7851f990c7192539170/docs/userguide/expectations.md#to_be_within-of). Implemented in [#1076](https://github.com/utPLSQL/utPLSQL/pull/1076), resolves [#77](https://github.com/utPLSQL/utPLSQL/issues/77). + +## Enhancements + +- Improved performance of SQL used to retrieve Coverage sources. Implemented in [#1187](https://github.com/utPLSQL/utPLSQL/pull/1187), resolves [#1169](https://github.com/utPLSQL/utPLSQL/issues/1169). +- Added ability for utPLSQL to gather coverage on code invoking DBMS_STATS package. Implemented in [#1184](https://github.com/utPLSQL/utPLSQL/pull/1184), resolves [#1097](https://github.com/utPLSQL/utPLSQL/issues/1097), [#1094](https://github.com/utPLSQL/utPLSQL/issues/1094). +- Fixed typos and improved documentation. Implemented in [#1173](https://github.com/utPLSQL/utPLSQL/pull/1173), [#1171](https://github.com/utPLSQL/utPLSQL/pull/1171) + +## Bug fixes + +- Actual and Expected are now correctly reported when comparing `JSON` data. Implemented in [#1181](https://github.com/utPLSQL/utPLSQL/pull/1181), resolves [#1113](https://github.com/utPLSQL/utPLSQL/issues/1113). +- Packages with removed annotations are now correctly recognized as non-utPLSQL packages. Implemented in [#1180](https://github.com/utPLSQL/utPLSQL/pull/1180), resolves [#1177](https://github.com/utPLSQL/utPLSQL/issues/1177). +- Fixed issues with comparison of nested object structures. Implemented in [#1179](https://github.com/utPLSQL/utPLSQL/pull/1179), resolves [#1082](https://github.com/utPLSQL/utPLSQL/issues/1082), [#1083](https://github.com/utPLSQL/utPLSQL/issues/1083), [#1098](https://github.com/utPLSQL/utPLSQL/issues/1098). + +## Internal improvements + +- Moved build and test process for utPLSQL from Travis to GithubActions. Implemented in [#1175](https://github.com/utPLSQL/utPLSQL/pull/1175) + +--- + +## [v3.1.11] - 2021-11-17 + +## Enhancements + +- utPLSQL can now be used to generate coverage reports for external tools. See [documentation](https://github.com/utPLSQL/utPLSQL/blob/955de5c2dc527a98a6f5dc0dd8bd8d81a44c459f/docs/userguide/coverage.md#reporting-coverage-outside-of-utplsql) + Implemented in: [#1079](https://github.com/utPLSQL/utPLSQL/pull/1079), resolves [#1025](https://github.com/utPLSQL/utPLSQL/issues/1025) +- Enhanced UT_COVERAGE_COBERTURA_REPORTER to better support TFS and GitLab. Implemented in [#1137](https://github.com/utPLSQL/utPLSQL/pull/1137) and [#1140](https://github.com/utPLSQL/utPLSQL/pull/1140), resolves [#1107](https://github.com/utPLSQL/utPLSQL/issues/1107) +- Added support for installation on Oracle 21c - removed dependency on DBMS_OBFUSCATION_TOOLKIT. Implemented in [#1112](https://github.com/utPLSQL/utPLSQL/pull/1112), resolves [#1111](https://github.com/utPLSQL/utPLSQL/issues/1111) and [#1127](https://github.com/utPLSQL/utPLSQL/issues/1127) +- Added support for running utPLSQL framework in parallel-enabled database. Implemented in [#1160](https://github.com/utPLSQL/utPLSQL/pull/1160), resolves [#1134](https://github.com/utPLSQL/utPLSQL/issues/1134) + +## Bug fixes + +- Suite structure is built properly even with other than English TNS settings. Implemented in [#1061](https://github.com/utPLSQL/utPLSQL/pull/1061), resolves [#1060](https://github.com/utPLSQL/utPLSQL/issues/1060) +- Fixed XML content reporting (CDATA) in UT_REALTIME_REPORTER used by SQLDeveloper plugin. Implemented in [#1075](https://github.com/utPLSQL/utPLSQL/pull/1075), resolves [#1073](https://github.com/utPLSQL/utPLSQL/issues/1073) +- Fixed XML content reporting (CDATA) in JUnit reporter - regression. Implemented in [#1085](https://github.com/utPLSQL/utPLSQL/pull/1085), resolves [#1084](https://github.com/utPLSQL/utPLSQL/issues/1084) +- Fixed issue with utPLSQL failing to run coverage reporting when trigger has overlapping name with procedure/function/package/type. Implemented in [#1091](https://github.com/utPLSQL/utPLSQL/pull/1091), resolves [#1086](https://github.com/utPLSQL/utPLSQL/issues/1086) +- Fixed issue with parsing utPLSQL suites with DDL trigger when usign AUTHID clause. Implemented in [#1093](https://github.com/utPLSQL/utPLSQL/pull/1093), resolves [#1088](https://github.com/utPLSQL/utPLSQL/issues/1088) + +## Internal improvements + +- Improved how privilege checks are handled by framework installation. Implemented in [#1056](https://github.com/utPLSQL/utPLSQL/pull/1056), resolves [#1050](https://github.com/utPLSQL/utPLSQL/issues/1050) +- Restructured installation instructions to make it more readable. Implemented in [#1063](https://github.com/utPLSQL/utPLSQL/pull/1063), resolves [#1062](https://github.com/utPLSQL/utPLSQL/issues/1062) +- Updated database requirements in documentation. Implemented in [#1065](https://github.com/utPLSQL/utPLSQL/pull/1065), resolves [#1064](https://github.com/utPLSQL/utPLSQL/issues/1064) +- Removed duplicated call to install profiler tables. Implemented in [#1164](https://github.com/utPLSQL/utPLSQL/pull/1164), resolves [#1149](https://github.com/utPLSQL/utPLSQL/issues/1149) +- Fixed failing internal framework tests on Oracle 21c. Implemented in [#1158](https://github.com/utPLSQL/utPLSQL/pull/1158), resolves [#1151](https://github.com/utPLSQL/utPLSQL/issues/1151) +- Fixed confusing typo in documentation. Resolves [#1154](https://github.com/utPLSQL/utPLSQL/issues/1154) +- Moved build process from travis-ci.org to travis-ci.com. Implemented in [#1152](https://github.com/utPLSQL/utPLSQL/pull/1152) +- Added an example of reporter reporting all expectations, not only the failing ones. Implemented in [#1092](https://github.com/utPLSQL/utPLSQL/pull/1092) + +--- + +## [v3.1.10] - 2020-02-23 + +## Enhancements + +- utPLSQL test runner is now validating arguments of `--%throws` annotations at runtime [#721](https://github.com/utPLSQL/utPLSQL/issues/721) [#1033](https://github.com/utPLSQL/utPLSQL/issues/1033) +- Documented limitations of insignificant spaces comparison in compound data [#880](https://github.com/utPLSQL/utPLSQL/issues/880) +- utPLSQL will now detect empty annotation cache for schema even with DLL trigger enabled [#975](https://github.com/utPLSQL/utPLSQL/issues/975) +- Order of procedures and annotation now determines default order of tests in suite [#1036](https://github.com/utPLSQL/utPLSQL/issues/1036) + +## Bug fixes + +- Nested contexts are now properly identified [#1034](https://github.com/utPLSQL/utPLSQL/issues/1034) +- TeamCity test reporter is now including error message [#1045](https://github.com/utPLSQL/utPLSQL/issues/1045) + +## Internal improvements + +- All self-tests for utPLSQL framework can now be executed using test-owner schema [#969](https://github.com/utPLSQL/utPLSQL/issues/969) +- Misleading rollback warning is no longer showing when running self-tests for utPLSQL [#982](https://github.com/utPLSQL/utPLSQL/issues/982) + +--- + +## [v3.1.9] - 2019-11-10 + +## New features + +- Added ability to define [nested contexts](https://github.com/utPLSQL/utPLSQL/blob/v3.1.9/docs/userguide/annotations.md#context) within test suite [#938](https://github.com/utPLSQL/utPLSQL/issues/938) +- Added ability to [exclude tests/suites by tags](https://github.com/utPLSQL/utPLSQL/blob/v3.1.9/docs/userguide/annotations.md#excluding-testssuites-by-tags) when invoking a test-run [#1007](https://github.com/utPLSQL/utPLSQL/issues/1007) [#983](https://github.com/utPLSQL/utPLSQL/issues/983) +- Added new annotation [`--%name`](https://github.com/utPLSQL/utPLSQL/blob/v3.1.9/docs/userguide/annotations.md#name) to allow for providing custom name for contexts [#1016](https://github.com/utPLSQL/utPLSQL/issues/1016) + +## Important changes + +The value of `--%context` annotation is no longer representing context `name`. +This value is now context description (displayname). +With this change, the `--%context` annotation is now aligned with `--%test` and `--%suite` annotation syntax. + +New annotation `--%name` was introduced to facilitate naming of contexts. + +## Enhancements + +- Improved documentation for running tests +- Improved documentation for tags [#1003](https://github.com/utPLSQL/utPLSQL/issues/1003) +- Improved documentation for annotations + +## Bug fixes + +- Fixed bug with bad stacktrace showing in failing/erroring test [#1000](https://github.com/utPLSQL/utPLSQL/issues/1000) +- Fixed issue with lack of validation for context name [#966](https://github.com/utPLSQL/utPLSQL/issues/966) +- Fixed problem with install script privilege check for installation with DDL trigger [#992](https://github.com/utPLSQL/utPLSQL/issues/992) +- Fixed issue with some common column names causing cursor comparison to fail [#997](https://github.com/utPLSQL/utPLSQL/issues/997) +- Fixed issue with invocation of standalone expectations on cursor [#998](https://github.com/utPLSQL/utPLSQL/issues/998) + +## Internal improvements + +- Fixed runability of utplsql self-tests [#968](https://github.com/utPLSQL/utPLSQL/issues/968) + +--- + +## [v3.1.8] - 2019-09-03 + +## New features + +- Added support for [session context](https://github.com/utPLSQL/utPLSQL/blob/v3.1.8/docs/userguide/annotations.md#sys_context) to provide test and suite information during test run [#963](https://github.com/utPLSQL/utPLSQL/issues/963) [#781](https://github.com/utPLSQL/utPLSQL/issues/781) +- Added ability to [invoke expectations without running framework](https://github.com/utPLSQL/utPLSQL/blob/v3.1.8/docs/userguide/expectations.md#running-expectations-outside-utplsql-framework) [#956](https://github.com/utPLSQL/utPLSQL/issues/956) [#963](https://github.com/utPLSQL/utPLSQL/issues/963) +- Failing expectations are now reported with call stack [#967](https://github.com/utPLSQL/utPLSQL/issues/967) [#963](https://github.com/utPLSQL/utPLSQL/issues/963) + +## Enhancements + +- Improved framework table private data protection [#922](https://github.com/utPLSQL/utPLSQL/issues/922) [#954](https://github.com/utPLSQL/utPLSQL/issues/954) +- Improved install process. It is now unified for installation with both public and private synonyms [#957](https://github.com/utPLSQL/utPLSQL/issues/957) [#954](https://github.com/utPLSQL/utPLSQL/issues/954) +- Improved reporting of warnings for integration with SQLDeveloper [#964](https://github.com/utPLSQL/utPLSQL/issues/964) +- Improved query to retrieve coverage sources [#981](https://github.com/utPLSQL/utPLSQL/issues/981) [#970](https://github.com/utPLSQL/utPLSQL/issues/970) +- Improved security around malicious utPLSQL owner name [#920](https://github.com/utPLSQL/utPLSQL/issues/920) + +## Bug fixes + +- Fixed cursor comparison on Oracle 11.2 [#947](https://github.com/utPLSQL/utPLSQL/issues/947) +- Fixed issue with retrieving suite data [#977](https://github.com/utPLSQL/utPLSQL/issues/977) [#974](https://github.com/utPLSQL/utPLSQL/issues/974) [#978](https://github.com/utPLSQL/utPLSQL/issues/978) +- Application context is now reset in session after test run [#951](https://github.com/utPLSQL/utPLSQL/issues/951) + +--- + +## [v3.1.7] - 2019-06-18 + +## New features + +- Added support for [comparing `json`](https://github.com/utPLSQL/utPLSQL/blob/v3.1.7/docs/userguide/expectations.md#comparing-json-objects) in Oracle 12.2 and above [#924](https://github.com/utPLSQL/utPLSQL/issues/924) +- Introduced [`tag` annotation](https://github.com/utPLSQL/utPLSQL/blob/v3.1.7/docs/userguide/annotations.md#tags) to enable tagging of tests and suites [#66](https://github.com/utPLSQL/utPLSQL/issues/66) +- Added support for [random order](https://github.com/utPLSQL/utPLSQL/blob/v3.1.7/docs/userguide/running-unit-tests.md#random-order) of test execution [#422](https://github.com/utPLSQL/utPLSQL/issues/422) + +## Enhancements + +- Added optional [install with DDL trigger](https://github.com/utPLSQL/utPLSQL/blob/v3.1.7/docs/userguide/install.md#installation-with-ddl-trigger) to speed up framework start [#901](https://github.com/utPLSQL/utPLSQL/issues/901) +- Removed dependency on `dbms_utility.name_resolve` [#569](https://github.com/utPLSQL/utPLSQL/issues/569) [#885](https://github.com/utPLSQL/utPLSQL/issues/885) +- New output buffer table structures improving performance and addressing timeout issues [#915](https://github.com/utPLSQL/utPLSQL/issues/915) + +## Bug fixes + +- Fixed `ut_realtime_reporter` missing warnings in test and suite output structures [#936](https://github.com/utPLSQL/utPLSQL/issues/936) +- Fixed output_buffer purging error [#934](https://github.com/utPLSQL/utPLSQL/issues/934) +- Fixed `join_by / exclude / include` invalid syntax on collection in anydata compare [#912](https://github.com/utPLSQL/utPLSQL/issues/912) +- Fixed `ut_junit_reporter` producing invalid output on failing tests with long failure message [#927](https://github.com/utPLSQL/utPLSQL/issues/927) +- Fixed `ut_sonar_test_reporter` producing invalid output on failing tests with long failure message [#925](https://github.com/utPLSQL/utPLSQL/issues/925) +- Fixed `ut_coverage_cobertura_reporter` producing wrong line breaks which breaks the xml validation against DTD [#917](https://github.com/utPLSQL/utPLSQL/issues/917) +- Fixed `exclude` option for ref cursor where column order was not resolved correctly [#911](https://github.com/utPLSQL/utPLSQL/issues/911) +- Fixed `unordered` option for ref cursor with null values [#914](https://github.com/utPLSQL/utPLSQL/issues/914) +- Fixed number precision when selecting from dual [#907](https://github.com/utPLSQL/utPLSQL/issues/907) +- Fixed ref cursor errors with generated column names [#902](https://github.com/utPLSQL/utPLSQL/issues/902) +- Fixed `ORA-00907` when comparing ref cursors with BINARY_ columns [#899](https://github.com/utPLSQL/utPLSQL/issues/899) +- Fixed wrong results when comparing CLOBs with `to_be_like` in Oracle Database 11.2.0.4 due to Oracle Bug 14402514 [#891](https://github.com/utPLSQL/utPLSQL/issues/891) +- Fixed performance issue with code coverage report on huge PL/SQL code base [#882](https://github.com/utPLSQL/utPLSQL/issues/882) + +## Documentation improvements + +- Added install instructions for DDL trigger [#874](https://github.com/utPLSQL/utPLSQL/issues/874) + +## Internal enhancements + +- Fixed SQL vulnerability on all input parameters used in dynamic SQL and PL/SQL [#921](https://github.com/utPLSQL/utPLSQL/issues/921) +- Fixed message id in output buffer [#916](https://github.com/utPLSQL/utPLSQL/issues/916) +- Included 19c database in self testing [#909](https://github.com/utPLSQL/utPLSQL/issues/909) +- Introduced testing with multiple schemas and different grants [#893](https://github.com/utPLSQL/utPLSQL/issues/893) +- Fixed installation script warnings [#879](https://github.com/utPLSQL/utPLSQL/issues/879) + +--- + +## [v3.1.6] - 2019-03-24 + +Bugfix release for `v3.1.5` + +## Bug fixes + +- Fixed a bug in release `3.1.5` where `to_equal` matcher was failing due to privileges when comparing non sql diffable types [#870](https://github.com/utPLSQL/utPLSQL/issues/870) + +## Improvements +- Reduced number of information displaying about user defined type. We will now display only type name instead of full structure [#866](https://github.com/utPLSQL/utPLSQL/issues/866) + +--- + +## [v3.1.5] - 2019-03-20 + +Bugfix release for `v3.1.4` + +## Bug fixes + +- Fixed a bug in release `3.1.4` where `to_be_empty` matcher was failing due to privileges [#864](https://github.com/utPLSQL/utPLSQL/issues/864) + +--- + +## [v3.1.4] - 2019-03-19 + +**This release contains a bug that is fixed by release 3.1.5** +Please use release 3.1.5 rather than this release. + +## New features + +- Added `to_contain` matcher for collections and cursors [#79](https://github.com/utPLSQL/utPLSQL/issues/79) +- Added `unordered_columns` (`uc`) option for cursor comparison to ignore the order of the columns [#779](https://github.com/utPLSQL/utPLSQL/issues/779) +- Added `ut_debug_reporter` for debug logging [#480](https://github.com/utPLSQL/utPLSQL/issues/480) +- Added `ut_realtime_reporter` for utPLSQL-SQLDeveloper extension [#795](https://github.com/utPLSQL/utPLSQL/issues/795) + +## Important Changes + +- Due to improvements of the cursor comparison, it is now necessary to use `ut.set_nls()` before creating the cursor and `ut.reset_nls()` after the __expectation__ when comparing dates. [More info in the docs](https://github.com/utPLSQL/utPLSQL/blob/v3.1.4/docs/userguide/expectations.md#comparing-cursor-data-containing-date-fields) + +## Enhancements + +- Improved performance of cursor comparison [#780](https://github.com/utPLSQL/utPLSQL/issues/780) +- Added support for installation on databases with block size < 8KB [#848](https://github.com/utPLSQL/utPLSQL/issues/848) +- Added initial timeout to `ut_output_buffer` [#840](https://github.com/utPLSQL/utPLSQL/issues/840) +- Enhanced performance of `get_reporters_list` function [#814](https://github.com/utPLSQL/utPLSQL/issues/814) +- Moved calls of `dbms_lock.sleep` to `dbms_session` for newer DB versions [#806](https://github.com/utPLSQL/utPLSQL/issues/806) +- utPLSQL coverage will now work without re-install after DB-upgrade from 12.1 to 12.2 [#803](https://github.com/utPLSQL/utPLSQL/issues/803) + +## Bug fixes + +- Fixed problem with REGEXP in annotation parsing with NLS CANADIAN FRENCH [#844](https://github.com/utPLSQL/utPLSQL/issues/844) +- Fixed issue with Rollback to savepoint failing on distributed transaction [#839](https://github.com/utPLSQL/utPLSQL/issues/839) +- Fixed reporting of differences when comparing collections scalar values [#835](https://github.com/utPLSQL/utPLSQL/issues/835) +- Fixed issue with test run failing due to too many transaction invalidators [#834](https://github.com/utPLSQL/utPLSQL/issues/834) +- Fixed randomly occurring error during cursor comparison [#827](https://github.com/utPLSQL/utPLSQL/issues/827) +- utPLSQL install script will now support special characters in passwords [#804](https://github.com/utPLSQL/utPLSQL/issues/804) + +## Documentation improvements + +- Fixed documentation examples for context annotation [#851](https://github.com/utPLSQL/utPLSQL/issues/851) +- Added description on how to check version of utPLSQL [#822](https://github.com/utPLSQL/utPLSQL/issues/822) + +## Internal enhancements + +- Implemented Sonar analysis on DBA Views [#850](https://github.com/utPLSQL/utPLSQL/issues/850) +- Finished migration from old-tests [#475](https://github.com/utPLSQL/utPLSQL/issues/475) +- Fixed shell scripts to support multiple unix dialects (especially for macOS) [#796](https://github.com/utPLSQL/utPLSQL/issues/796) +- Added info on project support from Redgate [#841](https://github.com/utPLSQL/utPLSQL/issues/841) +- Added `code_of_conduct` [#836](https://github.com/utPLSQL/utPLSQL/issues/836) +- Added issue templates [#842](https://github.com/utPLSQL/utPLSQL/issues/842) +- Added utPLSQL logo [#845](https://github.com/utPLSQL/utPLSQL/issues/845) + +--- + +## [v3.1.3] - 2018-11-20 + +## New features + +- added function `ut_runner.is_test` [#788](https://github.com/utPLSQL/utPLSQL/issues/788) +- added function `ut_runner.is_suite` [#787](https://github.com/utPLSQL/utPLSQL/issues/787) +- added function `ut_runner.has_suites` [#786](https://github.com/utPLSQL/utPLSQL/issues/786) +- added ability to disable automatic rollback for a test-run [#784](https://github.com/utPLSQL/utPLSQL/issues/784) +- when invoked with package name, utPLSQL will now run only tests from specified package even if package has child packages by suitepath [#776](https://github.com/utPLSQL/utPLSQL/issues/776) + +## Enhancements + +- Improved performance of schema-scanning and utPLSQL startup [#778](https://github.com/utPLSQL/utPLSQL/issues/778) +- Improved performance of output-buffer [#777](https://github.com/utPLSQL/utPLSQL/issues/777) +- Improved documentation to mention ability to pass client encoding for HTML & XML reports [#775](https://github.com/utPLSQL/utPLSQL/issues/775) +- Improved documentation for cursor comparison to mention challenges with TIMESTAMP bind variables + +## Bug-fixes + +- utPLSQL code coverage will now work properly with long object names [#716](https://github.com/utPLSQL/utPLSQL/issues/716) +- utPLSQL installation will now also work properly, when user performing the install has `ANY` grants [#737](https://github.com/utPLSQL/utPLSQL/issues/737) +- fixed documentation bug for `--%context` with `--%displayname` [#726](https://github.com/utPLSQL/utPLSQL/issues/726) +- fixed Teamcity reporter issues with missing escape for some characters and long messages [#747](https://github.com/utPLSQL/utPLSQL/issues/747) +- fixed issue with sonar test results reporter when contexts are used [#749](https://github.com/utPLSQL/utPLSQL/issues/749) +- fixed issue with ORA-07455 getting thrown on cursor comparison [#752](https://github.com/utPLSQL/utPLSQL/issues/752) +- fixed issue with wrong failure message for unordered data [#764](https://github.com/utPLSQL/utPLSQL/issues/764) +- fixed missing privilege issue for unordered/join-by cursor data comparison [#765](https://github.com/utPLSQL/utPLSQL/issues/765) [#770](https://github.com/utPLSQL/utPLSQL/issues/770) + +## Internal enhancements + +- added suite-level cache to allow for faster retrieval of suite contents and enable implementation of additional features [#783](https://github.com/utPLSQL/utPLSQL/issues/783) + +--- + +## [v3.1.2] - 2018-07-22 + +## New features + +- Added ability to join and compare cursor content by specific columns (PK/UK) [#453](https://github.com/utPLSQL/utPLSQL/issues/453) +- Added support for comma separated list of suite paths/packages when calling `ut.run` [#479](https://github.com/utPLSQL/utPLSQL/issues/479) +- Added ability to run a test package that got invalidated due to dependency invalidation [#489](https://github.com/utPLSQL/utPLSQL/issues/489) +- Added support for package level constants and predefined exceptions in `--%throws` annotation [#685](https://github.com/utPLSQL/utPLSQL/issues/685) +- Added support for standalone `--%beforeall`, `--%beforeeach`, `--%afterall`, `--%aftereach` annotations with list of procedures to execute [#649](https://github.com/utPLSQL/utPLSQL/issues/649) +- Added support for list of procedure names in before/after annotations [#649](https://github.com/utPLSQL/utPLSQL/issues/649) +- Added support for BLOB/CLOB in `is_empty()` matcher [#707](https://github.com/utPLSQL/utPLSQL/issues/707) + +## Enhancements + +- utPLSQL will now provide additional warnings, when unsupported annotations are found in a unit test suite package [#624](https://github.com/utPLSQL/utPLSQL/issues/624) +- utPLSQL will now produce valid XML in UT_JUNIT_REPORTER when dbms_output or test results contain ` **Important notice:** > We do our best to keep utPLSQL covered with unit tests. @@ -145,8 +145,8 @@ Every new functionality needs to be documented by unit tests that cover both hap To run a full suite of unit tests execute: ```bash -development/env.sh -test/install_and_run_tests.sh +. ./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 `./coverage.html` file. @@ -162,45 +162,20 @@ 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. +We are using a combination of private and publicly available docker images to test utPLSQL. The following versions of Oracle Database are used for testing: -* 11g XE R2 -* 12c SE R1 -* 12c SE R2 -* 18c SE +* 19c-Standard Edition (private image) +* 21-free +* 23-free -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._ +The Free varsions are publicly available and you can set up your local development environment to use one of from [here](https://github.com/gvenzl/oci-oracle-free) -### SQLCL +These [private image]((https://github.com/utPLSQL/docker-scripts) is a slimmed version of [the official Oracle database dockerfiles](https://github.com/oracle/docker-images/tree/master/OracleDatabase) . Due to licensing restrictions, the image cannot be public. -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._ +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) +> If you are new to Docker, you can start by reading the [Getting Started With Docker](https://docs.docker.com/get-started/) docs. ## New to GIT diff --git a/VERSION b/VERSION index 5fcdcb942..48e1527d1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.1.14-develop +v3.2.01-develop diff --git a/development/refresh_sources.sh b/development/refresh_sources.sh index 83518d7cc..87869d581 100755 --- a/development/refresh_sources.sh +++ b/development/refresh_sources.sh @@ -9,6 +9,7 @@ git rev-parse && cd "$(git rev-parse --show-cdup)" rm -rf ${UTPLSQL_DIR:-utPLSQL_latest_release} # clone utPLSQL main branch from upstream into utPLSQL sub-directory of your project git clone --depth=1 --branch=${SELFTESTING_BRANCH:-main} https://github.com/utPLSQL/utPLSQL.git ${UTPLSQL_DIR:-utPLSQL_latest_release} +rm -rf ${UTPLSQL_DIR:-utPLSQL_latest_release}/.git rm -rf utPLSQL-cli/* # download latest release version of utPLSQL-cli diff --git a/development/releasing.md b/development/releasing.md index c1e49184d..ac2091632 100644 --- a/development/releasing.md +++ b/development/releasing.md @@ -6,7 +6,7 @@ To create a release follow the below steps - Create a **draft** of a Release with a new tag number `vX.Y.X` sourced from the `develop` branch on [github releases page](https://github.com/utPLSQL/utPLSQL/releases) - Populate release description using the `Generate release notes` button - Review the auto-generated release notes and update tem if needed - - Split the default `## What's Changed` list into `## New features`, `## Enhancements`, `## Bug fixes`. See previous release notes for details + - Optionally, split the default `## What's Changed` list into `## New features`, `## Enhancements`, `## Bug fixes`. See previous release notes for details ## Performing a release - Publish [the previously prepared](#release-preparation) release draft. diff --git a/development/template.env.sh b/development/template.env.sh index 7761a70c4..fdbed4b6b 100755 --- a/development/template.env.sh +++ b/development/template.env.sh @@ -1,10 +1,10 @@ #!/bin/bash -export SQLCLI=sql # For sqlcl client -#export SQLCLI=sqlplus # For sqlplus client -export CONNECTION_STR=127.0.0.1:1521/xe ORACLE_VERSION=11g-r2-xe# Adjust the connect string -export ORACLE_PWD=oracle # Adjust your local SYS password -export UTPLSQL_CLI_VERSION="3.1.6" +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_VERSION="v3.1.8" export SELFTESTING_BRANCH=develop export UTPLSQL_DIR="utPLSQL_latest_release" diff --git a/docs/about/authors.md b/docs/about/authors.md index 203d450d1..e55e244a7 100644 --- a/docs/about/authors.md +++ b/docs/about/authors.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) ### utPLSQL v3 Major Contributors @@ -20,7 +20,7 @@ Many thanks to all the [contributors](https://github.com/utPLSQL/utPLSQL/graphs/ ### Special thanks to prior major contributors -- Steven Feuerstein - Original Author +- Steven Feuerstein - Original Author of utPLSQL v1 and v2 - Chris Rimmer - Patrick Barel - Paul Walker diff --git a/docs/about/license.md b/docs/about/license.md index 28aea5fed..bd60e0af4 100644 --- a/docs/about/license.md +++ b/docs/about/license.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) # Version Information @@ -9,9 +9,5 @@ External code used in the development of this project, but is not required for u | Tool | License | Purpose | | ---- | --------| --------| -| [Travis-Oracle](https://github.com/cbandy/travis-oracle) | [ISC](https://github.com/cbandy/travis-oracle/blob/master/LICENSE) | Install Oracle for Travis Builds | | [mkDocs](http://www.mkdocs.org/) | [BSD](http://www.mkdocs.org/about/license/) | Produce HTML version of documentation | -**Note:** - -Version 1 & 2 of utPLSQL were licensed under GPL, version 3 was a complete rewrite from scratch which a allowed us to change the license to be more permissive. diff --git a/docs/about/project-details.md b/docs/about/project-details.md index 8e6730847..4f1086a89 100644 --- a/docs/about/project-details.md +++ b/docs/about/project-details.md @@ -1,10 +1,10 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) # utPLSQL Project Details [![chat](http://img.shields.io/badge/GitHub_Project-Active-blue.svg)](https://github.com/utPLSQL/utPLSQL) [![license](http://img.shields.io/badge/license-apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) -[![chat](http://img.shields.io/badge/chat-slack-blue.svg)](https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww) +[![GitHub Discussions](https://img.shields.io/github/discussions/utPLSQL/utPLSQL)](https://github.com/utPLSQL/utPLSQL/discussions) [![twitter](https://img.shields.io/twitter/follow/utPLSQL.svg?style=social&label=Follow)](https://twitter.com/utPLSQL) diff --git a/docs/about/support.md b/docs/about/support.md index 0748fd479..ae284c8b7 100644 --- a/docs/about/support.md +++ b/docs/about/support.md @@ -1,6 +1,7 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) # How to get support -- Feel free to post questions, bugs or issues in the [issues area of GitHub](https://github.com/utPLSQL/utPLSQL/issues) -- [Join](https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww) developers team on [utPLSQL Slack](https://utplsql.slack.com/) +- Look into [utPLSQL github discussions](https://github.com/utPLSQL/utPLSQL/discussions) to find support, ask questions and share ideas +- If needed open a new [issue on github](https://github.com/utPLSQL/utPLSQL/issues) for bugs or feature requests + diff --git a/docs/images/tap_reporter_colored.png b/docs/images/tap_reporter_colored.png new file mode 100644 index 000000000..d4a5e9326 Binary files /dev/null and b/docs/images/tap_reporter_colored.png differ diff --git a/docs/images/tap_reporter_no_color.png b/docs/images/tap_reporter_no_color.png new file mode 100644 index 000000000..e7379a889 Binary files /dev/null and b/docs/images/tap_reporter_no_color.png differ diff --git a/docs/images/tap_reporter_suitepath.png b/docs/images/tap_reporter_suitepath.png new file mode 100644 index 000000000..488c7cfbf Binary files /dev/null and b/docs/images/tap_reporter_suitepath.png differ diff --git a/docs/index.md b/docs/index.md index 320784892..bced9d1e9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) ## What is utPLSQL diff --git a/docs/userguide/advanced_data_comparison.md b/docs/userguide/advanced_data_comparison.md index 34b4eddcc..d18e15f23 100644 --- a/docs/userguide/advanced_data_comparison.md +++ b/docs/userguide/advanced_data_comparison.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) # Advanced data comparison diff --git a/docs/userguide/annotations.md b/docs/userguide/annotations.md index b3602ef10..6ee24ed59 100644 --- a/docs/userguide/annotations.md +++ b/docs/userguide/annotations.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) Annotations are used to configure tests and suites in a declarative way similar to modern OOP languages. This way, test configuration is stored along with the test logic inside the test package. No additional configuration files or tables are needed for test cases. The annotation names are based on popular testing frameworks such as JUnit. @@ -46,7 +46,7 @@ package test_package is --%disabled procedure my_first_procedure; - $if dbms_db_version.version >= 12 $then --This is ok - annotation before procedure + $if dbms_db_version.version >= 19 $then --This is ok - annotation before procedure --%test() procedure my_first_procedure; $end @@ -71,7 +71,7 @@ package test_package is procedure proc1; --%test() --This is wrong as there is a compiler directive between procedure and annotation - $if dbms_db_version.version >= 12 $then + $if dbms_db_version.version >= 19 $then procedure proc_12; $end @@ -1755,7 +1755,7 @@ The `--%throws` annotation allows you to specify a list of exceptions as one of: - number literals - example `--%throws(-20134)` - variables of type exception defined in a package specification - example `--%throws(exc_pkg.c_exception_No_variable)` - variables of type number defined in a package specification - example `--%throws(exc_pkg.c_some_exception)` -- [predefined oracle exceptions](https://docs.oracle.com/cd/E11882_01/timesten.112/e21639/exceptions.htm#CIHFIGFE) - example `--%throws(no_data_found)` +- [predefined oracle exceptions](https://docs.oracle.com/en//database/oracle/oracle-database/19/lnpls/predefined-exceptions.html) - example `--%throws(no_data_found)` The annotation is ignored, when no valid arguments are provided. Examples of invalid annotations `--%throws()`,`--%throws`, `--%throws(abe, 723pf)`. diff --git a/docs/userguide/best-practices.md b/docs/userguide/best-practices.md index 379024e73..0bd08a80d 100644 --- a/docs/userguide/best-practices.md +++ b/docs/userguide/best-practices.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) The following are best practices we at utPLSQL have learned about PL/SQL and Unit Testing. diff --git a/docs/userguide/coverage.md b/docs/userguide/coverage.md index 24855cbb5..43187f22c 100644 --- a/docs/userguide/coverage.md +++ b/docs/userguide/coverage.md @@ -1,6 +1,6 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) -utPLSQL comes with a built-in coverage reporting engine. The code coverage reporting uses package DBMS_PROFILER (and DBMS_PLSQL_CODE_COVERAGE on Oracle database version 12.2 and above) provided with Oracle database. +utPLSQL comes with a built-in coverage reporting engine. The code coverage reporting combines data from package DBMS_PROFILER and DBMS_PLSQL_CODE_COVERAGE. Code coverage is gathered for the following source types: * package bodies @@ -27,7 +27,7 @@ The following code coverage reporters are supplied with utPLSQL: * `ut_coverage_cobertura_reporter` - generates a basic Cobertura coverage (http://cobertura.sourceforge.net/xml/coverage-04.dtd) report providing detailed information on code coverage with line numbers. This coverage report is designed to be consumed by services like TFS and Jenkins. Check this link for an example of XML generated by Java: https://raw.githubusercontent.com/jenkinsci/cobertura-plugin/master/src/test/resources/hudson/plugins/cobertura/coverage-with-data.xml ## Security model -utPLSQL code coverage uses DBMS_PROFILER to gather information about the execution of code under test and therefore follows the [DBMS_PROFILER's Security Model](https://docs.oracle.com/database/121/ARPLS/d_profil.htm#ARPLS67465). +utPLSQL code coverage uses DBMS_PROFILER to gather information about the execution of code under test and therefore follows the [DBMS_PROFILER's Security Model](https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_PROFILER.html#GUID-DEE5EA97-14AA-4AF2-A5F7-4AB1D004B99F). In order to be able to gather coverage information, the user executing unit tests needs to be either: * The owner of the code that is being tested @@ -63,14 +63,15 @@ The report allow you to navigate to each source file and inspect line by line co ![Coverage Details page](../images/coverage_html_details.png) -### Oracle 12.2 extended coverage with profiler and block coverage -Using data collected from profiler and block coverage running parallel we are able to enrich information about coverage. -For every line recorded by the profiler if we have a partially covered same line in block coverage we will display that information -presenting line as partially covered, displaying number of block and how many blocks have been covered in that line.The feature will be automatically enabled in the Oracle database version 12.2 and higher, for older versions current profiler will be used. +### Partial Coverage -utPLSQL installation automatically creates tables needed by `dbms_plsql_code_coverage` on databases in versions above 12c Release 1. -Due to security model of `dbms_plsql_code_coverage` package, utPLSQL grants access to those tables and creates synonyms for those tables. -The access and synonyms will be public when using the headless installation. This approach avoids complexity of forcing every user of utPLSQL framework to create tables on their own. +#### What it does +Partial coverage combines two data sources β€” the profiler and block coverage β€” to give you a more detailed picture of which parts of your code have been tested. +When a line appears in both sources, and block coverage shows it was only partially covered, the display will reflect that: you'll see the line marked as partially covered, along with how many blocks on that line were executed out of the total. + +#### Setup and permissions +utPLSQL automatically creates the tables required by Oracle's dbms_plsql_code_coverage package β€” you don't need to create them manually. +Because of how dbms_plsql_code_coverage handles security, utPLSQL also takes care of granting access to those tables and creating the necessary synonyms. In a headless installation, both the grants and synonyms are made public, keeping things simple without requiring every utPLSQL user to set up their own tables. Sample output: diff --git a/docs/userguide/exception-reporting.md b/docs/userguide/exception-reporting.md index e2a8bc7da..6b6ae8bc9 100644 --- a/docs/userguide/exception-reporting.md +++ b/docs/userguide/exception-reporting.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) utPLSQL is responsible for handling exceptions wherever they occur in the test run. The framework is trapping most of the exceptions so that the test execution is not affected by individual tests or test packages throwing an exception. The framework provides a full stacktrace for every exception that was thrown. The reported stacktrace does not include any utPLSQL library calls in it. diff --git a/docs/userguide/expectations.md b/docs/userguide/expectations.md index 472c9654e..aa7efdde0 100644 --- a/docs/userguide/expectations.md +++ b/docs/userguide/expectations.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) ## Expectation concepts @@ -52,7 +52,7 @@ Shortcut syntax, where matcher is directly part of expectation: ut.expect( a_actual ).not_to_{matcher}; --example - ut.expect( 1 ).to_( be_null() ); + ut.expect( 1 ).to_be_null(); ``` When using shortcut syntax you don't need to surround matcher with brackets. Shortcut syntax is provided for convenience. @@ -648,9 +648,7 @@ Syntax: `ut.expect( a_actual ).to_be_like( a_mask [, a_escape_char] )` -Parameters `a_mask` and `a_escape_char` represent valid parameters of the [Oracle LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142). - -If you use Oracle Database version 11.2.0.4, you may run into Oracle Bug 14402514: WRONG RESULTS WITH LIKE ON CLOB USING ESCAPE CHARACTER. In this case we recommend to use `match` instead of `be_like`. +Parameters `a_mask` and `a_escape_char` represent valid parameters of the [Oracle LIKE condition](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Pattern-matching-Conditions.html). Usage: ```sql linenums="1" @@ -806,7 +804,7 @@ Syntax: `ut.expect( a_actual ).to_match( a_pattern [, a_modifiers] );` -Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle REGEXP_LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501) +Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle REGEXP_LIKE condition](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Pattern-matching-Conditions.html#GUID-D2124F3A-C6E4-4CCA-A40E-2FFCABFD8E19) Usage: ```sql linenums="1" @@ -1224,9 +1222,7 @@ utPLSQL is capable of comparing compound data-types including: - Comparison of cursor returning `TIMESTAMP` **columns** against cursor returning `TIMESTAMP` **bind variables** requires variables to be cast to proper precision. This is an Oracle SQL - PLSQL compatibility issue and usage of CAST is the only known workaround for now. See [Comparing cursor data containing TIMESTAMP bind variables](#comparing-cursor-data-containing-timestamp-bind-variables) for examples. - To compare nested table/varray type you need to convert it to `anydata` by using `anydata.convertCollection()` - To compare object type you need to convert it to `anydata` by using `anydata.convertObject()` -- It is possible to compare PL/SQL records, collections, varrays and associative arrays. To compare this types of data, use cursor comparison feature of utPLSQL and TABLE operator in SQL query - - On Oracle 11g Release 2 - pipelined table functions are needed (see section [Implicit (Shadow) Types in this artcile](https://oracle-base.com/articles/misc/pipelined-table-functions)) - - On Oracle 12c and above - use [TABLE function on nested tables/varrays/associative arrays of PL/SQL records](https://oracle-base.com/articles/12c/using-the-table-operator-with-locally-defined-types-in-plsql-12cr1) +- It is possible to compare PL/SQL records, collections, varrays and associative arrays. To compare this types of data, use cursor comparison feature of utPLSQL and [TABLE operator in SQL query](https://oracle-base.com/articles/12c/using-the-table-operator-with-locally-defined-types-in-plsql-12cr1) - utPLSQL is not able to distinguish between NULL and whitespace-only column/attribute value when comparing compound data. This is due to Oracle limitation on of XMLType. See [issue #880](https://github.com/utPLSQL/utPLSQL/issues/880) for details. *Note: This behavior might be fixed in future releases, when utPLSQL is no longer depending on XMLType for compound data comparison.* @@ -1763,10 +1759,10 @@ FAILURE ## Comparing Json objects -utPLSQL is capable of comparing json data-types of `json_element_t` **on Oracle 12.2 and above**, and also `json` **on Oracle 21 and above** +utPLSQL is capable of comparing json data-types of `json_element_t`, and also `json` **on Oracle 21 and above** !!! note - Whenever a database is upgraded to compatible version the utPLSQL needs to be reinstalled to pick up json changes. E.g. upgrade from 18c to 21c to enable `json` type compare. + Whenever a database is upgraded to compatible version the utPLSQL needs to be reinstalled to pick up json changes. E.g. upgrade from 19c to 23 AI to enable `json` type compare. ### Notes on comparison of json data diff --git a/docs/userguide/getting-started.md b/docs/userguide/getting-started.md index 9c4d8813a..db5a08115 100644 --- a/docs/userguide/getting-started.md +++ b/docs/userguide/getting-started.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) # Getting started with TDD and utPLSQL diff --git a/docs/userguide/install.md b/docs/userguide/install.md index c322639df..095fd4085 100644 --- a/docs/userguide/install.md +++ b/docs/userguide/install.md @@ -1,26 +1,16 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) ## Supported database versions -utPLSQL is continuously tested against following versions of Oracle databases +- Oracle Database 19c or newer (SE/EE/Cloud/Free) -* 11g R2 -* 12c -* 12c R2 -* 18c -* 19c +We do our best to assure full compatibility with **actively supported** versions of Oracle databases. +See [this page](https://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf#page=6) for Oracle Database Releases and their Support Lifetime by Oracle. -We do our best to assure full compatibility with supported versions of Oracle databases [See](http://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf#page=6) - -## Requirements - -utPLSQL will run on any Oracle Database version 11g relase 2 or above. ### Licensed features required -utPLSQL doesn't require any extra licensed features of Oracle database. It can be installed on any Standard Edition Oracle Database. - -In fact, it even supports Oracle 11g XE which is a free Oracle Database version with minimal features and storage limits. +utPLSQL doesn't require any extra licensed features of Oracle database. It can be installed on any Edition of Oracle Database. ### Storage requirements @@ -124,9 +114,6 @@ The scripts need to be executed by `SYSDBA`, in order to grant access to `DBMS_L - `DBMS_LOCK` is required for session synchronization between main session and session consuming realtime reports.
- The user performing the installation must have the `ADMINISTER DATABASE TRIGGER` privilege. This is required for installation of trigger that is responsible for parsing annotations at at compile-time of a package.
- When installed with DDL trigger, utPLSQL will not be registering unit tests for any of oracle-maintained schemas.
- - For Oracle 11g following users are excluded:
- ANONYMOUS, APPQOSSYS, AUDSYS, DBSFWUSER, DBSNMP, DIP, GGSYS, GSMADMIN_INTERNAL, GSMCATUSER, GSMUSER, ORACLE_OCM, OUTLN, REMOTE_SCHEDULER_AGENT, SYS, SYS$UMF, SYSBACKUP, SYSDG, SYSKM, SYSRAC, SYSTEM, WMSYS, XDB, XS$NULL
- - For Oracle 12c and above the users returned by below query are excluded by utPLSQL:
`select username from all_users where oracle_maintained='Y';`
### Installation without DDL trigger @@ -179,7 +166,7 @@ If the installing user and utPLSQL owner is one and the same, the user must have In addition, the user must be granted the execute privilege on `DBMS_LOCK` and `DBMS_CRYPTO` packages. -utPLSQL is using [DBMS_PROFILER tables](https://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_profil.htm#i999476) for code coverage. The tables required by DBMS_PROFILER will be created in the installation schema unless they already exist. +utPLSQL is using [DBMS_PROFILER tables](https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_PROFILER.html) for code coverage. The tables required by DBMS_PROFILER will be created in the installation schema unless they already exist. It is up to DBA to maintain the storage of the profiler tables. @@ -274,7 +261,7 @@ select ## Additional requirements In order to use the Code Coverage functionality of utPLSQL, users executing the tests must have the CREATE privilege on the PLSQL code that the coverage is gathered on. -This is a requirement of [DBMS_PROFILER package](https://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_profil.htm#i999476). +This is a requirement of [DBMS_PROFILER package](https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_PROFILER.html#GUID-DEE5EA97-14AA-4AF2-A5F7-4AB1D004B99F). In practice, user running tests for PLSQL code that he does not own, needs to have CREATE ANY PROCEDURE/CREATE ANY TRIGGER privileges. Running code coverage on objects that the user does not own will **not produce any coverage information** without those privileges. diff --git a/docs/userguide/querying_suites.md b/docs/userguide/querying_suites.md index 463bcef97..4f2a53b28 100644 --- a/docs/userguide/querying_suites.md +++ b/docs/userguide/querying_suites.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) ## Obtaining information about suites diff --git a/docs/userguide/reporters.md b/docs/userguide/reporters.md index 41468a3a5..a29c5c3ef 100644 --- a/docs/userguide/reporters.md +++ b/docs/userguide/reporters.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) utPLSQL provides several reporting formats. The sections below describe most of them. @@ -126,6 +126,20 @@ Details: utPLSQL comes with a set of build-in coverage reporters. [Code coverage](coverage.md) section describes in details how to use configure and use code coverage. +## TAP Reporter + +The `ut_tap_reporter` produces output compatible with the [Test Anything Protocol](https://testanything.org) (Version 14). TAP output can be consumed by a TAP consumer that can aggregate results from testsuites across different programming languages while maintaining good readability for humans. + +![tap_output_no_color](../images/tap_reporter_no_color.png) + +If you use a compatible terminal, you can also have a colored result. Only top level `not ok`-results will be colored: + +![tap_colored_output](../images/tap_reporter_colored.png) + +Suites (and suitepaths) and contexts are included as [commented subtests](https://testanything.org/tap-version-14-specification.html#:~:text=Commented%20Subtests) including a summary of the tests performed for that specific context/suite. This example package has the suitepath "org.utplsql.tests.helpers": + +![tap_include_suitepath](../images/tap_reporter_suitepath.png) + ## Debug reporter The `ut_debug_reporter` provides a highly verbose output containing thorough details about framework and test execution. @@ -175,6 +189,16 @@ If you need to produce a colored text output from the custom reporter, then you It is recommended to create the reporter type in the schema where utPLSQL is installed (by default it is the `UT3` schema). Note that before running the utPLSQL uninstall scripts, all custom reporters should be dropped (cf. [the installation documentation](install.md)). In particular, when upgrading to a newer version of utPLSQL, one has to drop the custom reporters and recreate them after the upgrade. +!!! note + Please make sure that grants have been added and synonyms created for the custom reporter in order for reporter to be accessible the same way as other reporters. + Assuming that reporter with name `customer_reporter` was created in schema `UT3` +```sql + grant execute on ut3.custom_reporter to public; + create or replace public synonym custom_reporter for ut3.custom_reporter; +``` + + + !!! note It is possible, but cumbersome, to use another schema for storing the custom reporters. This requires to create a synonym for the base reporter type in the schema that is going to own the custom reporter, and to provide appropriate grants both to the owner of the custom reporter and to the user running the reporter. After upgrading or reinstalling utPLSQL, the extra privileges need to be recreated. This approach is not recommended. diff --git a/docs/userguide/running-unit-tests.md b/docs/userguide/running-unit-tests.md index 502bd49bd..a9906cb78 100644 --- a/docs/userguide/running-unit-tests.md +++ b/docs/userguide/running-unit-tests.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) utPLSQL framework provides two main entry points to run unit tests from within the database: diff --git a/docs/userguide/upgrade.md b/docs/userguide/upgrade.md index cb49a0424..f3ffa333c 100644 --- a/docs/userguide/upgrade.md +++ b/docs/userguide/upgrade.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-v3.1.14.4197--develop-blue.svg) +![version](https://img.shields.io/badge/version-v3.2.01.4375--develop-blue.svg) # Upgrading from version 2 diff --git a/examples/RunAllExamples.sql b/examples/RunAllExamples.sql index faa3388cf..f5f42b7f3 100644 --- a/examples/RunAllExamples.sql +++ b/examples/RunAllExamples.sql @@ -3,22 +3,8 @@ set echo on set feedback on set linesize 1000 -declare - l_run_number binary_integer; -begin - dbms_profiler.start_profiler( run_number => l_run_number); -end; -/ - -- Examples for users @@RunUserExamples.sql -- Framework developer examples @@RunDeveloperExamples.sql - -declare - l_return_code binary_integer; -begin - l_return_code := dbms_profiler.stop_profiler(); -end; -/ diff --git a/examples/annoation_parser_testing/annotation_parser_test.sql b/examples/annoation_parser_testing/annotation_parser_test.sql new file mode 100644 index 000000000..d1ff43fcd --- /dev/null +++ b/examples/annoation_parser_testing/annotation_parser_test.sql @@ -0,0 +1,298 @@ +-- Annotation Manager Volume Benchmark +-- 1000 generated packages, cold cache per iteration + +set serveroutput on size unlimited +set timing off +set feedback off + +declare + c_packages constant pls_integer := 1000; + c_procs_per_pkg constant pls_integer := 20; + c_contexts_per_pkg constant pls_integer := 4; + c_pkg_prefix constant varchar2(20) := 'TST_GEN_PKG_'; + c_iterations constant pls_integer := 4; + c_perf_threshold constant number := 0.80; + + l_baseline_total_ms number := 0; + l_new_total_ms number := 0; + l_start timestamp; + l_elapsed interval day to second; + + -- Source holders + l_source_lines dbms_preprocessor.source_lines_t; + l_source_clob clob; + l_result ut_annotations; + + -- Correctness tracking + l_missing_from_cache pls_integer := 0; + l_count_mismatches pls_integer := 0; + l_mismatch_detail varchar2(32767); + + -- Cache check + l_cursor sys_refcursor; + l_annotated_obj ut_annotated_object; + l_name varchar2(128); + l_annotations ut_annotations; + l_cache_count pls_integer := 0; + + -- Per-package timing + l_pkg_baseline_ms number; + l_pkg_new_ms number; + l_pkg varchar2(30); + l_ratio number; + + -- Expected annotation count β€” mirrors generator logic exactly + function expected_annotation_count( + a_pkg_number pls_integer, + a_procs pls_integer, + a_contexts pls_integer + ) return pls_integer is + l_count pls_integer := 0; + begin + l_count := l_count + 2; -- %suite + %suitepath + l_count := l_count + 2; -- %beforeall + %afterall + l_count := l_count + 2; -- %beforeeach + %aftereach + + -- package level conditional + if mod(a_pkg_number, 3) = 0 then l_count := l_count + 1; end if; -- %displayname + if mod(a_pkg_number, 5) = 0 then l_count := l_count + 1; end if; -- %rollback + + -- contexts: each contributes %context + %endcontext + l_count := l_count + (a_contexts * 2); + + -- per procedure + for i in 1 .. a_procs loop + l_count := l_count + 1; -- %test + if mod(i, 3) = 0 then l_count := l_count + 1; end if; -- %tags + if mod(i, 6) = 0 then l_count := l_count + 1; end if; -- %throws + if mod(i, 8) = 0 then l_count := l_count + 1; end if; -- %disabled + if mod(i, 5) = 0 then l_count := l_count + 2; end if; -- %beforetest + %aftertest + end loop; + + return l_count; + end expected_annotation_count; + +begin + dbms_output.put_line('Packages : ' || c_packages); + dbms_output.put_line('Procs/pkg : ' || c_procs_per_pkg); + dbms_output.put_line('Contexts/pkg: ' || c_contexts_per_pkg); + dbms_output.put_line('Iterations : ' || c_iterations); + dbms_output.put_line('Started : ' || to_char(systimestamp,'YYYY-MM-DD HH24:MI:SS.FF3')); + + -- Phase 1: Performance benchmark (cold cache per package per iteration) + dbms_output.put_line(chr(10) || '-- Phase 1: Performance --'); + dbms_output.put_line( + rpad('package', 20) || ' | ' || + lpad('baseline_ms', 11) || ' | ' || + lpad('new_ms', 6) || ' | ' || + lpad('ratio', 5) || ' | ' || + 'status' + ); + dbms_output.put_line(rpad('-', 70, '-')); + + for p in 1 .. c_packages loop + l_pkg := c_pkg_prefix || lpad(p, 4, '0'); + + -- load source once per package + l_source_lines := dbms_preprocessor.get_post_processed_source( + object_type => 'PACKAGE', + schema_name => user, + object_name => l_pkg + ); + + dbms_lob.createtemporary(l_source_clob, true); + for i in 1 .. l_source_lines.count loop + dbms_lob.writeappend(l_source_clob, length(l_source_lines(i)), l_source_lines(i)); + end loop; + + -- baseline: clob version + l_pkg_baseline_ms := 0; + for iter in 1 .. c_iterations loop + ut_annotation_manager.purge_cache(user, 'PACKAGE'); + l_start := systimestamp; + l_result := ut_annotation_parser.parse_object_annotations(l_source_clob); + l_elapsed := systimestamp - l_start; + l_pkg_baseline_ms := l_pkg_baseline_ms + + extract(second from l_elapsed) * 1000; + end loop; + l_pkg_baseline_ms := l_pkg_baseline_ms / c_iterations; + + -- new: source_lines_t version + l_pkg_new_ms := 0; + for iter in 1 .. c_iterations loop + ut_annotation_manager.purge_cache(user, 'PACKAGE'); + l_start := systimestamp; + l_result := ut_annotation_parser.parse_object_annotations(l_source_lines); + l_elapsed := systimestamp - l_start; + l_pkg_new_ms := l_pkg_new_ms + + extract(second from l_elapsed) * 1000; + end loop; + l_pkg_new_ms := l_pkg_new_ms / c_iterations; + + -- accumulate + l_baseline_total_ms := l_baseline_total_ms + l_pkg_baseline_ms; + l_new_total_ms := l_new_total_ms + l_pkg_new_ms; + + l_ratio := round(l_pkg_new_ms / nullif(l_pkg_baseline_ms, 0), 3); + + -- print every 100 packages to avoid flooding output + if mod(p, 100) = 0 or p = 1 then + dbms_output.put_line( + rpad(l_pkg, 20) || ' | ' || + lpad(round(l_pkg_baseline_ms, 3), 11) || ' | ' || + lpad(round(l_pkg_new_ms, 3), 6) || ' | ' || + lpad(l_ratio, 5) || ' | ' || + case when l_ratio <= c_perf_threshold + then 'PASS (' || round((1-l_ratio)*100,1) || '% faster)' + else 'SLOW (ratio=' || l_ratio || ')' + end + ); + end if; + + dbms_lob.freetemporary(l_source_clob); + end loop; + + -- ------------------------------------------------------------------------- + -- Phase 1 summary + -- ------------------------------------------------------------------------- + l_ratio := round(l_new_total_ms / nullif(l_baseline_total_ms, 0), 3); + + dbms_output.put_line(rpad('-', 70, '-')); + dbms_output.put_line('Baseline total ms : ' || round(l_baseline_total_ms, 3)); + dbms_output.put_line('New total ms : ' || round(l_new_total_ms, 3)); + dbms_output.put_line('Overall ratio : ' || l_ratio); + dbms_output.put_line('Improvement : ' || round((1 - l_ratio) * 100, 1) || '%'); + + -- Phase 2: Cache presence check + dbms_output.put_line(chr(10) || '-- Phase 2: Cache presence --'); + + ut_annotation_manager.purge_cache(user, 'PACKAGE'); + ut_annotation_manager.rebuild_annotation_cache(user, 'PACKAGE'); + + -- query cache tables directly to avoid validate_annotation_cache side effects + open l_cursor for + select ut_annotated_object( + i.object_owner, i.object_name, i.object_type, i.parse_time, + cast( + collect( + ut_annotation( + c.annotation_position, c.annotation_name, + c.annotation_text, c.subobject_name + ) order by c.annotation_position + ) as ut_annotations + ) + ) + from ut_annotation_cache_info i + join ut_annotation_cache c on i.cache_id = c.cache_id + where i.object_owner = user + and i.object_type = 'PACKAGE' + and i.object_name like c_pkg_prefix || '%' + group by i.object_owner, i.object_type, i.object_name, i.parse_time; + + loop + fetch l_cursor into l_annotated_obj; + exit when l_cursor%notfound; + l_cache_count := l_cache_count + 1; + end loop; + close l_cursor; + + dbms_output.put_line('Expected in cache : ' || c_packages); + dbms_output.put_line('Found in cache : ' || l_cache_count); + dbms_output.put_line('Cache check : ' || + case when l_cache_count = c_packages + then 'PASS β€” all ' || c_packages || ' packages found in cache' + else 'FAIL β€” missing ' || (c_packages - l_cache_count) || ' packages from cache' + end + ); + + -- Phase 3: Annotation count correctness + dbms_output.put_line(chr(10) || '-- Phase 3: Annotation count correctness --'); + + -- reopen same direct cache query for correctness check + open l_cursor for + select ut_annotated_object( + i.object_owner, i.object_name, i.object_type, i.parse_time, + cast( + collect( + ut_annotation( + c.annotation_position, c.annotation_name, + c.annotation_text, c.subobject_name + ) order by c.annotation_position + ) as ut_annotations + ) + ) + from ut_annotation_cache_info i + join ut_annotation_cache c on i.cache_id = c.cache_id + where i.object_owner = user + and i.object_type = 'PACKAGE' + and i.object_name like c_pkg_prefix || '%' + group by i.object_owner, i.object_type, i.object_name, i.parse_time; + + loop + fetch l_cursor into l_annotated_obj; + exit when l_cursor%notfound; + l_name := l_annotated_obj.object_name; + l_annotations := l_annotated_obj.annotations; + + declare + l_pkg_number pls_integer; + l_expected pls_integer; + begin + l_pkg_number := to_number(substr(l_name, length(c_pkg_prefix) + 1)); + l_expected := expected_annotation_count( + l_pkg_number, + c_procs_per_pkg, + c_contexts_per_pkg + ); + + if l_annotations.count != l_expected then + l_count_mismatches := l_count_mismatches + 1; + if l_count_mismatches <= 10 then + l_mismatch_detail := l_mismatch_detail || chr(10) || + ' ' || l_name || + ': expected=' || l_expected || + ' actual=' || l_annotations.count; + end if; + end if; + end; + end loop; + close l_cursor; + + dbms_output.put_line('Packages checked : ' || c_packages); + dbms_output.put_line('Count mismatches : ' || l_count_mismatches); + if l_count_mismatches > 0 then + dbms_output.put_line('Mismatch detail (first 10):' || l_mismatch_detail); + end if; + dbms_output.put_line('Count check : ' || + case when l_count_mismatches = 0 + then 'PASS β€” all annotation counts match expected' + else 'FAIL β€” ' || l_count_mismatches || ' packages have wrong annotation count' + end + ); + + dbms_output.put_line(chr(10) || '================================================='); + dbms_output.put_line('FINAL RESULTS'); + dbms_output.put_line('================================================='); + dbms_output.put_line('Performance : ' || + case when l_ratio <= c_perf_threshold then 'PASS' else 'FAIL' end); + dbms_output.put_line('Cache : ' || + case when l_cache_count = c_packages then 'PASS' else 'FAIL' end); + dbms_output.put_line('Counts : ' || + case when l_count_mismatches = 0 then 'PASS' else 'FAIL' end); + dbms_output.put_line('Overall : ' || + case when l_ratio <= c_perf_threshold + and l_cache_count = c_packages + and l_count_mismatches = 0 + then 'PASS' + else 'FAIL' + end + ); + dbms_output.put_line('Finished : ' || + to_char(systimestamp, 'YYYY-MM-DD HH24:MI:SS.FF3')); + dbms_output.put_line('================================================='); + + -- cleanup + ut_annotation_manager.purge_cache(user, 'PACKAGE'); + +end; +/ diff --git a/examples/annoation_parser_testing/create_test_packages.sql b/examples/annoation_parser_testing/create_test_packages.sql new file mode 100644 index 000000000..94a7f3de2 --- /dev/null +++ b/examples/annoation_parser_testing/create_test_packages.sql @@ -0,0 +1,185 @@ +declare + c_packages constant pls_integer := 1000; + c_procs_per_pkg constant pls_integer := 20; + + l_spec varchar2(32767); + l_body varchar2(32767); + l_pkg varchar2(30); + l_errors pls_integer := 0; + + procedure append_to_source(a_source in out nocopy varchar2, a_text varchar2) is + begin + a_source := a_source || a_text; + end; + + procedure append_line(a_source in out nocopy varchar2, a_text varchar2 default null) is + begin + a_source := a_source || a_text || chr(10); + end; + +begin + + for r in ( + select object_name + from user_objects + where object_name like 'TST_GEN_PKG_%' + and object_type = 'PACKAGE' + order by object_name + ) loop + begin + execute immediate 'drop package ' || r.object_name; + exception + when others then + dbms_output.put_line('ERROR dropping ' || r.object_name || ': ' || sqlerrm); + end; + end loop; + dbms_output.put_line('Existing packages dropped.'); + + for p in 1 .. c_packages loop + l_pkg := 'TST_GEN_PKG_' || lpad(p, 4, '0'); + l_spec := null; + l_body := null; + + -- Package spec + append_line(l_spec, 'create or replace package ' || l_pkg || ' as'); + append_line(l_spec); + append_line(l_spec, ' --%suite(Generated suite ' || p || ')'); + append_line(l_spec, ' --%suitepath(generated.vol_test)'); + + if mod(p, 3) = 0 then + append_line(l_spec, ' --%displayname(Suite display name for pkg ' || p || ')'); + end if; + if mod(p, 5) = 0 then + append_line(l_spec, ' --%rollback(manual)'); + end if; + + append_line(l_spec); + append_line(l_spec, ' --%beforeall'); + append_line(l_spec, ' procedure setup_suite;'); + append_line(l_spec); + append_line(l_spec, ' --%afterall'); + append_line(l_spec, ' procedure teardown_suite;'); + append_line(l_spec); + append_line(l_spec, ' --%beforeeach'); + append_line(l_spec, ' procedure setup_test;'); + append_line(l_spec); + append_line(l_spec, ' --%aftereach'); + append_line(l_spec, ' procedure teardown_test;'); + append_line(l_spec); + + for i in 1 .. c_procs_per_pkg loop + declare + l_proc varchar2(30) := 'test_proc_' || lpad(i, 3, '0'); + begin + if mod(i - 1, 5) = 0 then + append_line(l_spec, ' --%context(context_' || ceil(i/5) || ')'); + append_line(l_spec); + end if; + + if mod(i, 4) = 0 then + append_line(l_spec, ' /* multi-line comment for ' || l_proc || ' */'); + end if; + + append_line(l_spec, ' --%test(Test ' || i || ' in pkg ' || p || ')'); + + if mod(i, 3) = 0 then + append_line(l_spec, ' --%tags(tag_' || mod(i,5) || ',smoke)'); + end if; + if mod(i, 6) = 0 then + append_line(l_spec, ' --%throws(-20001)'); + end if; + if mod(i, 8) = 0 then + append_line(l_spec, ' --%disabled(generated disabled test ' || i || ')'); + end if; + if mod(i, 5) = 0 then + append_line(l_spec, ' --%beforetest(setup_test)'); + append_line(l_spec, ' --%aftertest(teardown_test)'); + end if; + + append_line(l_spec, ' -- regular comment'); + append_line(l_spec, ' procedure ' || l_proc || ';'); + append_line(l_spec); + + if mod(i, 5) = 0 then + append_line(l_spec, ' --%endcontext'); + append_line(l_spec); + end if; + end; + end loop; + + append_line(l_spec, 'end ' || l_pkg || ';'); + + -- ----------------------------------------------------------------------- + -- Package body + -- ----------------------------------------------------------------------- + append_line(l_body, 'create or replace package body ' || l_pkg || ' as'); + append_line(l_body); + + for stub in ( + select column_value as proc_name + from table(ut_varchar2_list( + 'setup_suite','teardown_suite', + 'setup_test','teardown_test' + )) + ) loop + append_line(l_body, ' procedure ' || stub.proc_name || ' is'); + append_line(l_body, ' begin'); + append_line(l_body, ' null;'); + append_line(l_body, ' end ' || stub.proc_name || ';'); + append_line(l_body); + end loop; + + for i in 1 .. c_procs_per_pkg loop + declare + l_proc varchar2(30) := 'test_proc_' || lpad(i, 3, '0'); + begin + append_line(l_body, ' procedure ' || l_proc || ' is'); + append_line(l_body, ' begin'); + if mod(i, 4) = 0 then + append_line(l_body, ' ut.expect(''/* not a comment */'').to_equal(''/* not a comment */'');'); + elsif mod(i, 4) = 1 then + append_line(l_body, ' ut.expect(' || i || ').to_be_greater_than(0);'); + elsif mod(i, 4) = 2 then + append_line(l_body, ' ut.expect(q''[-- not a comment]'').to_equal(q''[-- not a comment]'');'); + else + append_line(l_body, ' ut.expect(''test_' || i || ''').not_to_be_null();'); + end if; + append_line(l_body, ' end ' || l_proc || ';'); + append_line(l_body); + end; + end loop; + + append_line(l_body, 'end ' || l_pkg || ';'); + + -- Execute DDL β€” with error capture so one bad package doesn't stop all + begin + execute immediate l_spec; + execute immediate l_body; + exception + when others then + l_errors := l_errors + 1; + dbms_output.put_line('ERROR on ' || l_pkg || ': ' || sqlerrm); + end; + + if mod(p, 100) = 0 then + dbms_output.put_line('Created ' || p || ' packages...'); + end if; + + end loop; + + dbms_output.put_line('----------------------------------------'); + dbms_output.put_line('Done. packages=' || c_packages || + ' errors=' || l_errors); + + -- quick sanity check + declare + l_count pls_integer; + begin + select count(*) into l_count + from user_objects + where object_name like 'TST_GEN_PKG_%' + and object_type = 'PACKAGE'; + dbms_output.put_line('Packages in user_objects: ' || l_count); + end; +end; +/ diff --git a/mkdocs.yml b/mkdocs.yml index 713722620..49356fd4e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,7 +8,7 @@ edit_uri: "" site_url: http://utPLSQL.org/ site_name: utPLSQL-framework site_description: utPLSQL Ultimate Testing Framework for Oracle PL/SQL & SQL -copyright: Copyright © 2016 - 2022 utPLSQL Team +copyright: Copyright © 2016 - 2026 utPLSQL Team repo_url: https://github.com/utPLSQL/utPLSQL extra_css: - stylesheets/extra.css @@ -44,8 +44,8 @@ extra: social: - icon: fontawesome/brands/twitter link: https://twitter.com/utPLSQL - - icon: fontawesome/brands/slack - link: https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww + - icon: fontawesome/regular/comment + link: https://github.com/utPLSQL/utPLSQL/discussions - icon: fontawesome/brands/github link: https://github.com/utPLSQL - icon: fontawesome/solid/envelope diff --git a/mkdocs_offline.yml b/mkdocs_offline.yml index 31c90615e..9f0ef57af 100644 --- a/mkdocs_offline.yml +++ b/mkdocs_offline.yml @@ -44,8 +44,8 @@ extra: social: - icon: fontawesome/brands/twitter link: https://twitter.com/utPLSQL - - icon: fontawesome/brands/slack - link: https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww + - icon: fontawesome/regular/comment + link: https://github.com/utPLSQL/utPLSQL/discussions - icon: fontawesome/brands/github link: https://github.com/utPLSQL - icon: fontawesome/solid/envelope diff --git a/readme.md b/readme.md index 141c68ffe..df3da2749 100644 --- a/readme.md +++ b/readme.md @@ -1,102 +1,47 @@ ![utPLSQL v3 | Testing Framework for PL/SQL](docs/images/utPLSQL-testing-framework-transparent_120.png) ----------- - [![license](https://img.shields.io/github/license/utPLSQL/utPLSQL.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![latest-release](https://img.shields.io/github/release/utPLSQL/utPLSQL.svg)](https://github.com/utPLSQL/utPLSQL/releases) -[![Download statistics](https://img.shields.io/github/downloads/utPLSQL/utPLSQL/total.svg)](http://gra.caldis.me/?url=https://github.com/utPLSQL/utPLSQL) -[![chat](http://img.shields.io/badge/slack-team--chat-blue.svg)](https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww) -[![twitter](https://img.shields.io/twitter/follow/utPLSQL.svg?style=social&label=Follow)](https://twitter.com/utPLSQL) - +[![GitHub Discussions](https://img.shields.io/github/discussions/utPLSQL/utPLSQL)](https://github.com/utPLSQL/utPLSQL/discussions) +[![X](https://img.shields.io/twitter/follow/utPLSQL.svg?style=social&label=Follow)](https://twitter.com/utPLSQL) [![build](https://github.com/utPLSQL/utPLSQL/actions/workflows/build.yml/badge.svg)](https://github.com/utPLSQL/utPLSQL/actions/workflows/build.yml) -[![QualityGate](https://sonarcloud.io/api/project_badges/measure?project=utPLSQL&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=utPLSQL) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=utPLSQL&metric=coverage)](https://sonarcloud.io/summary/new_code?id=utPLSQL) - ----------- -utPLSQL version 3 is a complete rewrite of utPLSQL v2 from scratch. -Version 2 still supports older versions of Oracle that are no longer available. -The community that had developed on GitHub decided that a new internal architecture was needed, from that version 3 was born. - -# Introduction -utPLSQL is a Unit Testing framework for Oracle PL/SQL and SQL. -The framework follows industry standards and best patterns of modern Unit Testing frameworks like [JUnit](http://junit.org/junit4/) and [RSpec](http://rspec.info/) +[![QualityGate](https://sonarcloud.io/api/project_badges/measure?project=utPLSQL_utPLSQL&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=utPLSQL_utPLSQL) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=utPLSQL_utPLSQL&metric=coverage)](https://sonarcloud.io/summary/new_code?id=utPLSQL_utPLSQL) +utPLSQL is a unit testing framework for Oracle PL/SQL and SQL, following industry standards and best practices of modern testing frameworks like [JUnit](http://junit.org/junit4/) and [RSpec](http://rspec.info/). -# Key features +## Key Features -- multiple ways to compare data with [matchers](docs/userguide/expectations.md) -- native comparison of complex types (objects/collections/cursors) -- in-depth and consistent reporting of failures and errors for tests -- tests identified and configured by [annotations](docs/userguide/annotations.md) -- hierarchies of test suites configured with annotations -- automatic (configurable) transaction control -- Build-in [coverage](docs/userguide/coverage.md) reporting -- Integration with SonarQube, Coveralls, Jenkins and Teamcity with [reporters](docs/userguide/reporters.md) -- plugin architecture for reporters and matchers -- flexible and simple test invocation -- multi-reporting from test-run from [command line](https://github.com/utPLSQL/utPLSQL-cli) +- Multiple ways to compare data with [matchers](docs/userguide/expectations.md) +- Native comparison of complex types (objects, collections, cursors) +- In-depth and consistent reporting of failures and errors +- Tests identified and configured by [annotations](docs/userguide/annotations.md) +- Hierarchies of test suites configured with annotations +- Automatic (configurable) transaction control +- Built-in [coverage](docs/userguide/coverage.md) reporting +- Integration with SonarQube, Coveralls, Jenkins and TeamCity via [reporters](docs/userguide/reporters.md) +- Plugin architecture for reporters and matchers +- Flexible and simple test invocation +- Multi-format reporting from the [command line client](https://github.com/utPLSQL/utPLSQL-cli) -Requirements: - - Version of Oracle under [extended support](http://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf) (Currently 11.2 and above) +## Requirements -# Download +- Oracle Database 19c or newer -Published releases are available for download on the [utPLSQL GitHub Releases Page.](https://github.com/utPLSQL/utPLSQL/releases) +## Installation -# Documentation +Published releases are available for download on the [utPLSQL GitHub Releases page](https://github.com/utPLSQL/utPLSQL/releases). -Full documentation of the project is automatically published on [utPLSQL github pages](https://utplsql.github.io/utPLSQL/) +To install utPLSQL into a new database schema and grant it to public, execute the script `install_headless.sql`. +This creates a new user `UT3`, grants all required privileges, and creates PUBLIC synonyms. -[Cheat-sheets](https://www.cheatography.com/jgebal/lists/utplsql-v3-cheat-sheets/) +For all install options see the [Install Guide](docs/userguide/install.md). -# Installation +## Quick Start -To install the utPLSQL into a new database schema and grant it to public, execute the script `install_headless.sql`. -This will create a new user `UT3`, grant all required privileges to that user and create PUBLIC synonyms needed. +**1. Write a test package** -For detailed instructions on other install options see the [Install Guide](docs/userguide/install.md) - - -# Running tests - -To execute using development IDE (TOAD/SQLDeveloper/PLSQLDeveloper/other) use one of following commands. -```sql -begin - ut.run(); -end; -/ -``` -```sql -exec ut.run(); -``` -```sql -select * from table(ut.run()); -``` - -The above commands will run all the suites in the current schema and provide report to dbms_output or as a select statement. - -# Command line client - -You can use the utPLSQL command line client [utPLSQL-cli](https://github.com/utPLSQL/utPLSQL-cli) to run tests without the need for Oracle Client or any IDE like SQLDeveloper/TOAD etc. - -Amongst many benefits it provides ability to: -* see the progress of test execution for long-running tests - real-time reporting -* use many reporting formats simultaneously and save reports to files (publish) -* map your project source files and test files into database objects - -Download the [latest client](https://github.com/utPLSQL/utPLSQL-cli/releases/latest) and are good to go. -See [project readme](https://github.com/utPLSQL/utPLSQL-cli/blob/develop/README.md) for details. - - -# Example unit test packages - -**For examples of using Continuous Integration Server & SonarCloud with utPLSQL see the [utPLSQL demo project](https://github.com/utPLSQL/utPLSQL-demo-project/).** - - -The below test package is a fully-functional Unit Test package for testing a [`betwnstr` function](examples/between_string/betwnstr.sql). -The package specification is [annotated](docs/userguide/annotations.md) with special comments. -The annotations define that a package is a unit test suite, they also allow defining a description for the suite as well as the test itself. -The package body consists of procedures containing unit test code. To validate [an expectation](docs/userguide/expectations.md) in test, use `ut.expect( actual_data ).to_( ... )` syntax. +Annotate a package specification to define a test suite and its tests, then implement each test procedure in the package body: ```sql create or replace package test_between_string as @@ -106,12 +51,6 @@ create or replace package test_between_string as -- %test(Returns substring from start position to end position) procedure normal_case; - -- %test(Returns substring when start position is zero) - procedure zero_start_position; - - -- %test(Returns string until end if end position is greater than string length) - procedure big_end_position; - -- %test(Returns null for null input string value) procedure null_string; end; @@ -124,16 +63,6 @@ create or replace package body test_between_string as ut.expect( betwnstr( '1234567', 2, 5 ) ).to_( equal('2345') ); end; - procedure zero_start_position is - begin - ut.expect( betwnstr( '1234567', 0, 5 ) ).to_( equal('12345') ); - end; - - procedure big_end_position is - begin - ut.expect( betwnstr( '1234567', 0, 500 ) ).to_( equal('1234567') ); - end; - procedure null_string is begin ut.expect( betwnstr( null, 2, 5 ) ).to_( be_null ); @@ -143,63 +72,83 @@ end; / ``` -Outputs from running the above tests +**2. Run your tests** + +```sql +exec ut.run(); +``` + +**3. See the results** + ``` Between string function Returns substring from start position to end position - Returns substring when start position is zero - Returns string until end if end position is greater than string length Returns null for null input string value Finished in .036027 seconds -4 tests, 0 failures +2 tests, 0 failures +``` + +For complete working examples see [examples/](examples/). + +## Running Tests + +From any Oracle-compatible IDE (SQL Developer, TOAD, PL/SQL Developer): + +```sql +begin + ut.run(); +end; +/ +``` +```sql +exec ut.run(); +``` +```sql +select * from table(ut.run()); ``` +These commands run all suites in the current schema and report test results to `DBMS_OUTPUT` or as a result set. -# Contributing to the project +## Command Line Client -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](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](https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww). +[utPLSQL-cli](https://github.com/utPLSQL/utPLSQL-cli) lets you run tests without an Oracle Client or IDE. It provides: +- Real-time test reporting +- Simultaneous output of multiple report formats into different files +- Source files and test files mapping for coverage reports ----------- -[__Authors__](docs/about/authors.md) +Download the [latest release](https://github.com/utPLSQL/utPLSQL-cli/releases/latest) and see the [CLI readme](https://github.com/utPLSQL/utPLSQL-cli/blob/develop/README.md) for details. +## Documentation ----------- -__Project Directories__ +Full documentation is published at [https://www.utplsql.org/utPLSQL/](https://www.utplsql.org/utPLSQL/). -* .github - contains files needed for github Actions integration -* .travis - contains files needed for travis-ci integration -* client_source - Sources to be used on the client-side. Developer workstation or CI platform to run the tests. -* development - Set of useful scripts and utilities for development and debugging of utPLSQL -* docs - Documentation of the project -* examples - Example source code and unit tests -* source - The installation code for utPLSQL -* tests - Tests for utPLSQL framework +[Cheat-sheets](https://www.cheatography.com/jgebal/lists/utplsql-v3-cheat-sheets/) are available for quick reference. ----------- +See the [Changelog](CHANGELOG.md) for the full version history. -If you have a great feature in mind, that you would like to see in utPLSQL v3 please create an [issue on GitHub](https://github.com/utPLSQL/utPLSQL/issues) or discuss it with us in the [slack chat rooms](https://utplsql.slack.com/). Use [invite link](https://join.slack.com/t/utplsql/shared_invite/zt-xwm68udy-4cF_3PNEyczYEbWr38W5ww) to join the chat. +Migrating from legacy utPLSQL v2? See the [version 2 to version 3 comparison](docs/compare_version2_to_3.md). +## Contributing -# Version 2 to Version 3 Comparison +We welcome contributions of all kinds. Please read the [contributing guide](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md) before getting started. -[Version 2 to Version 3 Comparison](docs/compare_version2_to_3.md) +[GitHub Discussions](https://github.com/utPLSQL/utPLSQL/discussions) is the place to ask questions and connect with the team. -# Supporters +## Supporters -The utPLSQL project is community-driven and is not commercially motivated. Nonetheless, donations and other contributions are always welcome, and are detailed below. +utPLSQL is community-driven and not commercially motivated. Donations and contributions are always welcome. - +
supported_by_redgateutPLSQL has been supported by Redgate in the form of sponsored stickers and t-shirts. Thank you for helping us spreading the word!utPLSQL has been supported by Redgate in the form of sponsored stickers and t-shirts. Thank you for helping us spread the word!
+--- + +[Authors](docs/about/authors.md) diff --git a/sonar-project.properties b/sonar-project.properties index d088e9ccb..efcaeb5e6 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,9 +1,9 @@ # must be unique in a given SonarQube instance sonar.organization=utplsql -sonar.projectKey=utPLSQL +sonar.projectKey=utPLSQL_utPLSQL # this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. sonar.projectName=utPLSQL -sonar.projectVersion=v3.1.14-develop +sonar.projectVersion=v3.2.01-develop # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # Since SonarQube 4.2, this property is optional if sonar.modules is set. @@ -15,7 +15,7 @@ sonar.coverage.exclusions=**/*.sql,**/*.pks sonar.tests=./test sonar.testExecutionReportPaths=./test_results.xml sonar.links.issue=https://github.com/utPLSQL/utPLSQL/issues -sonar.links.ci=https://travis-ci.org/utPLSQL/utPLSQL +sonar.links.ci=https://github.com/utPLSQL/utPLSQL/actions sonar.links.homepage=https://github.com/utPLSQL/utPLSQL sonar.projectDescription=PL/SQL Unit Testing Framework sonar.plsql.file.suffixes=sql,tab,pkb,tpb diff --git a/source/api/ut.pkb b/source/api/ut.pkb index cff35b771..d61de040a 100644 --- a/source/api/ut.pkb +++ b/source/api/ut.pkb @@ -2,7 +2,7 @@ create or replace package body ut is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/api/ut.pks b/source/api/ut.pks index f72c82a0c..6fd98dd9f 100644 --- a/source/api/ut.pks +++ b/source/api/ut.pks @@ -2,7 +2,7 @@ create or replace package ut authid current_user as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/api/ut_runner.pkb b/source/api/ut_runner.pkb index 3ec2a5393..755683cc9 100644 --- a/source/api/ut_runner.pkb +++ b/source/api/ut_runner.pkb @@ -2,7 +2,7 @@ create or replace package body ut_runner is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/api/ut_runner.pks b/source/api/ut_runner.pks index 85eff1c93..2c6bba888 100644 --- a/source/api/ut_runner.pks +++ b/source/api/ut_runner.pks @@ -2,7 +2,7 @@ create or replace package ut_runner authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/api/ut_suite_item_info.tpb b/source/api/ut_suite_item_info.tpb index 3315f7a16..727707ae9 100644 --- a/source/api/ut_suite_item_info.tpb +++ b/source/api/ut_suite_item_info.tpb @@ -1,7 +1,7 @@ create or replace type body ut_suite_item_info is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/api/ut_suite_item_info.tps b/source/api/ut_suite_item_info.tps index 2c92f261d..f632b2f52 100644 --- a/source/api/ut_suite_item_info.tps +++ b/source/api/ut_suite_item_info.tps @@ -1,7 +1,7 @@ create or replace type ut_suite_item_info as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/api/ut_suite_items_info.tps b/source/api/ut_suite_items_info.tps index 208098f9d..e47b350e5 100644 --- a/source/api/ut_suite_items_info.tps +++ b/source/api/ut_suite_items_info.tps @@ -1,7 +1,7 @@ create or replace type ut_suite_items_info as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/check_object_grants.sql b/source/check_object_grants.sql index 5f560e6b1..0e7a9b4c9 100644 --- a/source/check_object_grants.sql +++ b/source/check_object_grants.sql @@ -1,3 +1,20 @@ +/* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + declare $if dbms_db_version.version >= 18 $then c_expected_grants constant dbmsoutput_linesarray := dbmsoutput_linesarray('DBMS_CRYPTO'); diff --git a/source/check_sys_grants.sql b/source/check_sys_grants.sql index 79b657328..f81157183 100644 --- a/source/check_sys_grants.sql +++ b/source/check_sys_grants.sql @@ -1,3 +1,20 @@ +/* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + define expected_grants = "&1" declare c_expected_grants constant dbmsoutput_linesarray := dbmsoutput_linesarray( &expected_grants ); diff --git a/source/core/annotations/ut_annotated_object.tps b/source/core/annotations/ut_annotated_object.tps index 3fda363fe..21f6ab330 100644 --- a/source/core/annotations/ut_annotated_object.tps +++ b/source/core/annotations/ut_annotated_object.tps @@ -1,7 +1,7 @@ create type ut_annotated_object as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotated_objects.tps b/source/core/annotations/ut_annotated_objects.tps index c67c1bd53..63679b699 100644 --- a/source/core/annotations/ut_annotated_objects.tps +++ b/source/core/annotations/ut_annotated_objects.tps @@ -1,7 +1,7 @@ create type ut_annotated_objects as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation.tps b/source/core/annotations/ut_annotation.tps index 3d0311571..18747516a 100644 --- a/source/core/annotations/ut_annotation.tps +++ b/source/core/annotations/ut_annotation.tps @@ -1,7 +1,7 @@ create type ut_annotation as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation_cache.sql b/source/core/annotations/ut_annotation_cache.sql index 67149ce60..7d69b1db6 100644 --- a/source/core/annotations/ut_annotation_cache.sql +++ b/source/core/annotations/ut_annotation_cache.sql @@ -1,7 +1,7 @@ create table ut_annotation_cache ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/annotations/ut_annotation_cache_info.sql b/source/core/annotations/ut_annotation_cache_info.sql index 167973a04..6248f4fbc 100644 --- a/source/core/annotations/ut_annotation_cache_info.sql +++ b/source/core/annotations/ut_annotation_cache_info.sql @@ -1,7 +1,7 @@ create table ut_annotation_cache_info ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/annotations/ut_annotation_cache_manager.pkb b/source/core/annotations/ut_annotation_cache_manager.pkb index e1131b3bd..52184e17d 100644 --- a/source/core/annotations/ut_annotation_cache_manager.pkb +++ b/source/core/annotations/ut_annotation_cache_manager.pkb @@ -1,7 +1,7 @@ create or replace package body ut_annotation_cache_manager as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation_cache_manager.pks b/source/core/annotations/ut_annotation_cache_manager.pks index 1e9734934..55d109f91 100644 --- a/source/core/annotations/ut_annotation_cache_manager.pks +++ b/source/core/annotations/ut_annotation_cache_manager.pks @@ -1,7 +1,7 @@ create or replace package ut_annotation_cache_manager authid definer as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation_cache_schema.sql b/source/core/annotations/ut_annotation_cache_schema.sql index 8889b9abf..b8ebaa40b 100644 --- a/source/core/annotations/ut_annotation_cache_schema.sql +++ b/source/core/annotations/ut_annotation_cache_schema.sql @@ -1,7 +1,7 @@ create table ut_annotation_cache_schema ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/annotations/ut_annotation_cache_seq.sql b/source/core/annotations/ut_annotation_cache_seq.sql index b371b382b..f0f1f17d7 100644 --- a/source/core/annotations/ut_annotation_cache_seq.sql +++ b/source/core/annotations/ut_annotation_cache_seq.sql @@ -1,7 +1,7 @@ create sequence ut_annotation_cache_seq /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/annotations/ut_annotation_manager.pkb b/source/core/annotations/ut_annotation_manager.pkb index 65f7b3e40..992af2fe0 100644 --- a/source/core/annotations/ut_annotation_manager.pkb +++ b/source/core/annotations/ut_annotation_manager.pkb @@ -1,7 +1,7 @@ create or replace package body ut_annotation_manager as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -143,34 +143,37 @@ create or replace package body ut_annotation_manager as l_parse_time date := sysdate; pragma autonomous_transaction; begin - loop - fetch a_sources_cursor bulk collect into l_names, l_lines limit c_lines_fetch_limit; - for i in 1 .. l_names.count loop - if l_names(i) != l_name then - l_annotations := ut_annotation_parser.parse_object_annotations(l_object_lines, a_object_type); - ut_annotation_cache_manager.update_cache( - ut_annotated_object(a_object_owner, l_name, a_object_type, l_parse_time, l_annotations) - ); - l_object_lines.delete; - end if; - - l_name := l_names(i); - l_object_lines(l_object_lines.count+1) := l_lines(i); - end loop; - exit when a_sources_cursor%notfound; + begin + loop + fetch a_sources_cursor bulk collect into l_names, l_lines limit c_lines_fetch_limit; + for i in 1 .. l_names.count loop + if l_names(i) != l_name then + l_annotations := ut_annotation_parser.parse_object_annotations(l_object_lines, a_object_type); + ut_annotation_cache_manager.update_cache( + ut_annotated_object(a_object_owner, l_name, a_object_type, l_parse_time, l_annotations) + ); + l_object_lines.delete; + end if; + + l_name := l_names(i); + l_object_lines(l_object_lines.count+1) := l_lines(i); + end loop; + exit when a_sources_cursor%notfound; - end loop; - if a_sources_cursor%rowcount > 0 then - l_annotations := ut_annotation_parser.parse_object_annotations(l_object_lines, a_object_type); - ut_annotation_cache_manager.update_cache( - ut_annotated_object(a_object_owner, l_name, a_object_type, l_parse_time, l_annotations) - ); - l_object_lines.delete; + end loop; + if a_sources_cursor%rowcount > 0 then + l_annotations := ut_annotation_parser.parse_object_annotations(l_object_lines, a_object_type); + ut_annotation_cache_manager.update_cache( + ut_annotated_object(a_object_owner, l_name, a_object_type, l_parse_time, l_annotations) + ); + l_object_lines.delete; + end if; + end; + if a_sources_cursor%isopen then + close a_sources_cursor; end if; - close a_sources_cursor; end; - procedure validate_annotation_cache( a_object_owner varchar2, a_object_type varchar2, @@ -231,23 +234,24 @@ create or replace package body ut_annotation_manager as function get_source_from_sql_text(a_object_name varchar2, a_sql_text ora_name_list_t, a_parts binary_integer) return sys_refcursor is l_sql_clob clob; - l_sql_lines ut_varchar2_rows := ut_varchar2_rows(); + l_sql_lines dbms_preprocessor.source_lines_t := dbms_preprocessor.source_lines_t(); + l_sql_lines_clob ut_varchar2_list := ut_varchar2_list(); l_result sys_refcursor; begin if a_parts > 0 then for i in 1..a_parts loop ut_utils.append_to_clob(l_sql_clob, a_sql_text(i)); end loop; - l_sql_clob := ut_utils.replace_multiline_comments(l_sql_clob); - -- replace comment lines that contain "-- create or replace" - l_sql_clob := regexp_replace(l_sql_clob, '^.*[-]{2,}\s*create(\s+or\s+replace).*$', modifier => 'mi'); - -- remove the "create [or replace] [[non]editionable] " so that we have only "type|package" for parsing - -- needed for dbms_preprocessor - l_sql_clob := regexp_replace(l_sql_clob, '^(.*?\s*create(\s+or\s+replace)?(\s+(editionable|noneditionable))?\s+?)((package|type).*)', '\5', 1, 1, 'ni'); - -- remove "OWNER." from create or replace statement. - -- Owner is not supported along with AUTHID - see issue https://github.com/utPLSQL/utPLSQL/issues/1088 - l_sql_clob := regexp_replace(l_sql_clob, '^(package|type)\s+("?[[:alpha:]][[:alnum:]$#_]*"?\.)(.*)', '\1 \3', 1, 1, 'ni'); - l_sql_lines := ut_utils.convert_collection( ut_utils.clob_to_table(l_sql_clob) ); + + l_sql_lines_clob := ut_utils.clob_to_table(l_sql_clob); + for i in 1..l_sql_lines_clob.count loop + l_sql_lines(i) := l_sql_lines_clob(i); + end loop; + + -- replace multiline comments that contain "-- create or replace" with single line comment to avoid parsing issues with dbms_preprocessor + l_sql_lines := ut_utils.replace_multiline_comments(l_sql_lines); + -- strip CREATE header (possibly split across lines) while preserving line numbers + l_sql_lines := ut_utils.strip_create_header_lines(l_sql_lines); end if; open l_result for select /*+ no_parallel */ a_object_name as name, column_value||chr(10) as text from table(l_sql_lines); diff --git a/source/core/annotations/ut_annotation_manager.pks b/source/core/annotations/ut_annotation_manager.pks index 20fcd810f..637577d59 100644 --- a/source/core/annotations/ut_annotation_manager.pks +++ b/source/core/annotations/ut_annotation_manager.pks @@ -1,7 +1,7 @@ create or replace package ut_annotation_manager authid current_user as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation_obj_cache_info.tps b/source/core/annotations/ut_annotation_obj_cache_info.tps index 1db3fd190..f7bdfa9a8 100644 --- a/source/core/annotations/ut_annotation_obj_cache_info.tps +++ b/source/core/annotations/ut_annotation_obj_cache_info.tps @@ -1,7 +1,7 @@ create type ut_annotation_obj_cache_info as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation_objs_cache_info.tps b/source/core/annotations/ut_annotation_objs_cache_info.tps index fc96e7d25..eb69f41e9 100644 --- a/source/core/annotations/ut_annotation_objs_cache_info.tps +++ b/source/core/annotations/ut_annotation_objs_cache_info.tps @@ -1,7 +1,7 @@ create type ut_annotation_objs_cache_info as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_annotation_parser.pkb b/source/core/annotations/ut_annotation_parser.pkb index 10bb76b3c..8682604f6 100644 --- a/source/core/annotations/ut_annotation_parser.pkb +++ b/source/core/annotations/ut_annotation_parser.pkb @@ -1,7 +1,7 @@ create or replace package body ut_annotation_parser as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -22,12 +22,10 @@ create or replace package body ut_annotation_parser as type tt_comment_list is table of varchar2(32767) index by binary_integer; gc_annotation_qualifier constant varchar2(1) := '%'; - gc_annot_comment_pattern constant varchar2(30) := '^( |'||chr(09)||')*-- *('||gc_annotation_qualifier||'.*?)$'; -- chr(09) is a tab character gc_comment_replacer_patter constant varchar2(50) := '{COMMENT#%N%}'; gc_comment_replacer_regex_ptrn constant varchar2(25) := '{COMMENT#(\d+)}'; gc_regexp_identifier constant varchar2(50) := '[[:alpha:]][[:alnum:]$#_]*'; - gc_annotation_block_pattern constant varchar2(200) := '(({COMMENT#.+}'||chr(10)||')+)( |'||chr(09)||')*(procedure|function)\s+(' || - gc_regexp_identifier || ')'; + gc_annotation_pattern constant varchar2(50) := gc_annotation_qualifier || gc_regexp_identifier || '[ '||chr(9)||']*(\(.*?\)\s*?$)?'; @@ -72,133 +70,144 @@ create or replace package body ut_annotation_parser as a_subobject_name varchar2 := null ) is l_loop_index binary_integer := 1; - l_annotation_index binary_integer; + l_annotation_index binary_integer := 1; begin - -- loop while there are unprocessed comment blocks - while 0 != nvl(regexp_instr(srcstr => a_source - ,pattern => gc_comment_replacer_regex_ptrn - ,occurrence => l_loop_index - ,subexpression => 1) - ,0) loop + -- loop while there are unprocessed comment blocks + while l_annotation_index is not null loop -- define index of the comment block and get it's content from cache l_annotation_index := regexp_substr( a_source ,gc_comment_replacer_regex_ptrn ,1 ,l_loop_index ,subexpression => 1); - add_annotation( a_annotations, l_annotation_index, a_comments( l_annotation_index ), a_subobject_name ); - l_loop_index := l_loop_index + 1; + if l_annotation_index is not null then + add_annotation( a_annotations, l_annotation_index, a_comments( l_annotation_index ), a_subobject_name ); + l_loop_index := l_loop_index + 1; + end if; end loop; end add_annotations; - procedure add_procedure_annotations(a_annotations in out nocopy ut_annotations, a_source clob, a_comments in out nocopy tt_comment_list) is - l_proc_comments varchar2(32767); - l_proc_name varchar2(250); - l_annot_proc_ind number; - l_annot_proc_block varchar2(32767); + procedure add_procedure_annotations( + a_annotations in out nocopy ut_annotations, + a_source in dbms_preprocessor.source_lines_t, + a_comments in out nocopy tt_comment_list + ) is + l_proc_comments varchar2(32767); + l_proc_name varchar2(250); + l_line varchar2(32767); + l_in_comment_block boolean := false; + l_i binary_integer; begin - -- loop through procedures and functions of the package and get all the comment blocks just before it's declaration - l_annot_proc_ind := 1; - loop - --find annotated procedure index - l_annot_proc_ind := regexp_instr(srcstr => a_source - ,pattern => gc_annotation_block_pattern - ,occurrence => 1 - ,modifier => 'i' - ,position => l_annot_proc_ind); - exit when l_annot_proc_ind = 0; - - --get the annotations with procedure name - l_annot_proc_block := regexp_substr(srcstr => a_source - ,pattern => gc_annotation_block_pattern - ,position => l_annot_proc_ind - ,occurrence => 1 - ,modifier => 'i'); - - --extract the annotations - l_proc_comments := trim(regexp_substr(srcstr => l_annot_proc_block - ,pattern => gc_annotation_block_pattern - ,modifier => 'i' - ,subexpression => 1)); - --extract the procedure name - l_proc_name := trim(regexp_substr(srcstr => l_annot_proc_block - ,pattern => gc_annotation_block_pattern - ,modifier => 'i' - ,subexpression => 5)); - - -- parse the comment block for the syntactically correct annotations and store them as an array - add_annotations(a_annotations, l_proc_comments, a_comments, l_proc_name); - - l_annot_proc_ind := instr(a_source, ';', l_annot_proc_ind + length(l_annot_proc_block) ); + l_i := 1; + while l_i <= a_source.count loop + l_line := a_source(l_i); + -- Comment placeholder line: start/continue accumulating a block + if instr(l_line, chr(123) ||'COMMENT#') > 0 then + if l_in_comment_block then + l_proc_comments := l_proc_comments || l_line || chr(10); + else + l_in_comment_block := true; + l_proc_comments := l_line || chr(10); + end if; + l_i := l_i + 1; + -- Whitespace-only line: allowed between comment block and proc decl + elsif l_in_comment_block and trim(replace(l_line, chr(9))) is null then + l_i := l_i + 1; + -- procedure/function declaration following a comment block + elsif l_in_comment_block + and regexp_like(l_line, '^\s*(procedure|function)\s+', 'i') + then + -- extract just the identifier name (subexpression 2) + l_proc_name := trim(regexp_substr(srcstr =>l_line + ,pattern => '^\s*(procedure|function)\s+('||gc_regexp_identifier||')' + ,modifier => 'i' + ,subexpression => 2)); + + -- pass accumulated comment placeholders + proc name to add_annotations + add_annotations(a_annotations, l_proc_comments, a_comments, l_proc_name); + + -- reset comment block state + l_in_comment_block := false; + l_proc_comments := null; + + -- advance past proc header to the terminating ';' + -- the header may span multiple lines e.g. with multi-line parameter lists + while l_i <= a_source.count loop + exit when instr(a_source(l_i), ';') > 0; + l_i := l_i + 1; + end loop; + l_i := l_i + 1; -- step past the ';' line itself + -- Any other line: reset comment block accumulator + else + l_in_comment_block := false; + l_proc_comments := null; + l_i := l_i + 1; + end if; end loop; end add_procedure_annotations; - function extract_and_replace_comments(a_source in out nocopy clob) return tt_comment_list is - l_comments tt_comment_list; - l_comment_pos binary_integer; - l_comment_line binary_integer; + function extract_and_replace_comments( + a_source in out nocopy dbms_preprocessor.source_lines_t + ) return tt_comment_list is + l_comments tt_comment_list; + l_line varchar2(32767); + l_comment_pos binary_integer; l_comment_replacer varchar2(50); - l_source clob := a_source; begin - l_comment_pos := 1; - loop - - l_comment_pos := regexp_instr(srcstr => a_source - ,pattern => gc_annot_comment_pattern - ,occurrence => 1 - ,modifier => 'm' - ,position => l_comment_pos); - - exit when l_comment_pos = 0; - - -- position index is shifted by 1 because gc_annot_comment_pattern contains ^ as first sign - -- but after instr index already points to the char on that line - l_comment_pos := l_comment_pos-1; - l_comment_line := length(substr(a_source,1,l_comment_pos))-length(replace(substr(a_source,1,l_comment_pos),chr(10)))+1; - l_comments(l_comment_line) := trim(regexp_substr(srcstr => a_source - ,pattern => gc_annot_comment_pattern - ,occurrence => 1 - ,position => l_comment_pos - ,modifier => 'm' - ,subexpression => 2)); - - l_comment_replacer := replace(gc_comment_replacer_patter, '%N%', l_comment_line); - - l_source := regexp_replace(srcstr => a_source - ,pattern => gc_annot_comment_pattern - ,replacestr => l_comment_replacer - ,position => l_comment_pos - ,occurrence => 1 - ,modifier => 'm'); - dbms_lob.freetemporary(a_source); - a_source := l_source; - dbms_lob.freetemporary(l_source); - l_comment_pos := l_comment_pos + length(l_comment_replacer); + for i in 1 .. a_source.count loop + l_line := a_source(i); + + -- fast path: skip lines that can't possibly match + -- must contain '--' and '%' to be an annotation comment + if instr(l_line, '--') = 0 or instr(l_line, gc_annotation_qualifier) = 0 then + continue; + end if; + + -- find '--' on the line + l_comment_pos := instr(l_line, '--'); + + -- verify everything before '--' is only spaces/tabs (matches ^ *( |\t)*--) + if trim(replace(substr(l_line, 1, l_comment_pos - 1), chr(9))) is not null then + continue; + end if; + + -- skip '--' and any spaces after it, then check for annotation qualifier '%' + l_comment_pos := l_comment_pos + 2; + -- skip optional spaces between -- and % + while l_comment_pos <= length(l_line) + and substr(l_line, l_comment_pos, 1) = ' ' + loop + l_comment_pos := l_comment_pos + 1; + end loop; + + -- must start with annotation qualifier at this position + if substr(l_line, l_comment_pos, 1) != gc_annotation_qualifier then + continue; + end if; + + -- extract annotation text (from % to end of line, trimmed) + l_comments(i) := trim(substr(l_line, l_comment_pos)); + + -- replace line with placeholder, preserving line number in token + l_comment_replacer := replace(gc_comment_replacer_patter, '%N%', i); + a_source(i) := l_comment_replacer; end loop; - ut_utils.debug_log(a_source); return l_comments; end extract_and_replace_comments; ------------------------------------------------------------ --public definitions ------------------------------------------------------------ - - function parse_object_annotations(a_source clob) return ut_annotations is - l_source clob := a_source; + function parse_object_annotations(a_source dbms_preprocessor.source_lines_t) return ut_annotations is + l_source dbms_preprocessor.source_lines_t := a_source; l_comments tt_comment_list; l_annotations ut_annotations := ut_annotations(); l_result ut_annotations; l_comment_index positive; begin - - l_source := ut_utils.replace_multiline_comments(l_source); - - -- replace all single line comments with {COMMENT#12} element and store it's content for easier processing - -- this call modifies l_source + l_source := ut_utils.replace_multiline_comments(l_source); l_comments := extract_and_replace_comments(l_source); - add_procedure_annotations(l_annotations, l_source, l_comments); - delete_processed_comments(l_comments, l_annotations); --at this point, only the comments not related to procedures are left, so we process them all as top-level @@ -208,16 +217,15 @@ create or replace package body ut_annotation_parser as l_comment_index := l_comments.next(l_comment_index); end loop; - dbms_lob.freetemporary(l_source); - - select /*+ no_parallel */ value(x) bulk collect into l_result from table(l_annotations) x order by x.position; + select /*+ no_parallel */ value(x) bulk collect into l_result from table(l_annotations) x order by x.position asc; return l_result; + end parse_object_annotations; function parse_object_annotations(a_source_lines dbms_preprocessor.source_lines_t, a_object_type varchar2) return ut_annotations is l_processed_lines dbms_preprocessor.source_lines_t; - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_annotations ut_annotations := ut_annotations(); ex_package_is_wrapped exception; pragma exception_init(ex_package_is_wrapped, -24241); @@ -233,13 +241,11 @@ create or replace package body ut_annotation_parser as else l_processed_lines := sys.dbms_preprocessor.get_post_processed_source(a_source_lines); end if; - --convert to clob for i in 1..l_processed_lines.count loop - ut_utils.append_to_clob(l_source, replace(l_processed_lines(i), chr(13)||chr(10), chr(10))); + l_source(i) := replace(l_processed_lines(i), chr(13)||chr(10), chr(10)); end loop; --parse annotations l_annotations := parse_object_annotations(l_source); - dbms_lob.freetemporary(l_source); exception when ex_package_is_wrapped or source_text_is_empty then null; diff --git a/source/core/annotations/ut_annotation_parser.pks b/source/core/annotations/ut_annotation_parser.pks index 2f474c883..5bc2700a4 100644 --- a/source/core/annotations/ut_annotation_parser.pks +++ b/source/core/annotations/ut_annotation_parser.pks @@ -1,7 +1,7 @@ create or replace package ut_annotation_parser authid current_user as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -29,16 +29,5 @@ create or replace package ut_annotation_parser authid current_user as */ function parse_object_annotations(a_source_lines dbms_preprocessor.source_lines_t, a_object_type varchar2) return ut_annotations; - - /** - * - * @private - * Parses source code and converts it to annotations - * - * @param a_source_lines ordered lines of source code to be parsed - * @return array containing annotations - */ - function parse_object_annotations(a_source clob) return ut_annotations; - end; / diff --git a/source/core/annotations/ut_annotations.tps b/source/core/annotations/ut_annotations.tps index a6579d236..7669f008b 100644 --- a/source/core/annotations/ut_annotations.tps +++ b/source/core/annotations/ut_annotations.tps @@ -1,7 +1,7 @@ create type ut_annotations /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_trigger_annotation_parsing.trg b/source/core/annotations/ut_trigger_annotation_parsing.trg index 437b7742d..75caea5e8 100644 --- a/source/core/annotations/ut_trigger_annotation_parsing.trg +++ b/source/core/annotations/ut_trigger_annotation_parsing.trg @@ -2,6 +2,22 @@ create or replace trigger ut_trigger_annotation_parsing after create or alter or drop on database begin + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ if (ora_dict_obj_owner = UPPER('&&UT3_OWNER') and ora_dict_obj_name = 'UT3_TRIGGER_ALIVE' and ora_dict_obj_type = 'SYNONYM') diff --git a/source/core/annotations/ut_trigger_check.pkb b/source/core/annotations/ut_trigger_check.pkb index 34e43ba46..d533044bb 100644 --- a/source/core/annotations/ut_trigger_check.pkb +++ b/source/core/annotations/ut_trigger_check.pkb @@ -1,7 +1,7 @@ create or replace package body ut_trigger_check is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/annotations/ut_trigger_check.pks b/source/core/annotations/ut_trigger_check.pks index cee0b06fd..8c095c71a 100644 --- a/source/core/annotations/ut_trigger_check.pks +++ b/source/core/annotations/ut_trigger_check.pks @@ -1,7 +1,7 @@ create or replace package ut_trigger_check authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage.pkb b/source/core/coverage/ut_coverage.pkb index 7eb5a34c2..e8e6ed529 100644 --- a/source/core/coverage/ut_coverage.pkb +++ b/source/core/coverage/ut_coverage.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage.pks b/source/core/coverage/ut_coverage.pks index 21f3b1f9e..6bcde8e64 100644 --- a/source/core/coverage/ut_coverage.pks +++ b/source/core/coverage/ut_coverage.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_block.pkb b/source/core/coverage/ut_coverage_block.pkb index a906b81a3..2d7e8bdac 100644 --- a/source/core/coverage/ut_coverage_block.pkb +++ b/source/core/coverage/ut_coverage_block.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage_block is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_block.pks b/source/core/coverage/ut_coverage_block.pks index 01caca035..1bd9c2d39 100644 --- a/source/core/coverage/ut_coverage_block.pks +++ b/source/core/coverage/ut_coverage_block.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage_block authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_helper.pkb b/source/core/coverage/ut_coverage_helper.pkb index e249b3381..16e0bf7a1 100644 --- a/source/core/coverage/ut_coverage_helper.pkb +++ b/source/core/coverage/ut_coverage_helper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage_helper is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_helper.pks b/source/core/coverage/ut_coverage_helper.pks index cd6ed9ec7..da4cba087 100644 --- a/source/core/coverage/ut_coverage_helper.pks +++ b/source/core/coverage/ut_coverage_helper.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage_helper authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_helper_block.pkb b/source/core/coverage/ut_coverage_helper_block.pkb index fb4d4812e..0cf009a10 100644 --- a/source/core/coverage/ut_coverage_helper_block.pkb +++ b/source/core/coverage/ut_coverage_helper_block.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage_helper_block is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_helper_block.pks b/source/core/coverage/ut_coverage_helper_block.pks index a147d9f4f..3ee1f266c 100644 --- a/source/core/coverage/ut_coverage_helper_block.pks +++ b/source/core/coverage/ut_coverage_helper_block.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage_helper_block authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_helper_profiler.pkb b/source/core/coverage/ut_coverage_helper_profiler.pkb index f29291efb..7f6e6e51d 100644 --- a/source/core/coverage/ut_coverage_helper_profiler.pkb +++ b/source/core/coverage/ut_coverage_helper_profiler.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage_helper_profiler is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_helper_profiler.pks b/source/core/coverage/ut_coverage_helper_profiler.pks index 0c54a83bf..2e56d10f7 100644 --- a/source/core/coverage/ut_coverage_helper_profiler.pks +++ b/source/core/coverage/ut_coverage_helper_profiler.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage_helper_profiler authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_profiler.pkb b/source/core/coverage/ut_coverage_profiler.pkb index 663ceab7f..1dc40bcbc 100644 --- a/source/core/coverage/ut_coverage_profiler.pkb +++ b/source/core/coverage/ut_coverage_profiler.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage_profiler is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_profiler.pks b/source/core/coverage/ut_coverage_profiler.pks index 9ce9a27f0..16145c34a 100644 --- a/source/core/coverage/ut_coverage_profiler.pks +++ b/source/core/coverage/ut_coverage_profiler.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage_profiler authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_reporter_base.tpb b/source/core/coverage/ut_coverage_reporter_base.tpb index da2bd27ad..f28226428 100644 --- a/source/core/coverage/ut_coverage_reporter_base.tpb +++ b/source/core/coverage/ut_coverage_reporter_base.tpb @@ -1,7 +1,7 @@ create or replace type body ut_coverage_reporter_base is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_reporter_base.tps b/source/core/coverage/ut_coverage_reporter_base.tps index 305c5d757..b917ea707 100644 --- a/source/core/coverage/ut_coverage_reporter_base.tps +++ b/source/core/coverage/ut_coverage_reporter_base.tps @@ -1,7 +1,7 @@ create or replace type ut_coverage_reporter_base under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/coverage/ut_coverage_sources_tmp.sql b/source/core/coverage/ut_coverage_sources_tmp.sql index c091d5955..35eb05510 100644 --- a/source/core/coverage/ut_coverage_sources_tmp.sql +++ b/source/core/coverage/ut_coverage_sources_tmp.sql @@ -1,7 +1,7 @@ create global temporary table ut_coverage_sources_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/events/ut_event_item.tps b/source/core/events/ut_event_item.tps index c0ea653ea..bb4556e03 100644 --- a/source/core/events/ut_event_item.tps +++ b/source/core/events/ut_event_item.tps @@ -1,7 +1,7 @@ create or replace type ut_event_item authid current_user as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/events/ut_event_listener.tps b/source/core/events/ut_event_listener.tps index bbcdbf218..ee34bb009 100644 --- a/source/core/events/ut_event_listener.tps +++ b/source/core/events/ut_event_listener.tps @@ -1,7 +1,7 @@ create or replace type ut_event_listener authid current_user as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/events/ut_event_manager.pkb b/source/core/events/ut_event_manager.pkb index f51019421..0b80b5a98 100644 --- a/source/core/events/ut_event_manager.pkb +++ b/source/core/events/ut_event_manager.pkb @@ -1,7 +1,7 @@ create or replace package body ut_event_manager as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/events/ut_event_manager.pks b/source/core/events/ut_event_manager.pks index 03b18b728..9cea89898 100644 --- a/source/core/events/ut_event_manager.pks +++ b/source/core/events/ut_event_manager.pks @@ -1,7 +1,7 @@ create or replace package ut_event_manager authid current_user as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_buffer_base.tpb b/source/core/output_buffers/ut_output_buffer_base.tpb index 20cec335e..f92827d28 100644 --- a/source/core/output_buffers/ut_output_buffer_base.tpb +++ b/source/core/output_buffers/ut_output_buffer_base.tpb @@ -1,7 +1,7 @@ create or replace type body ut_output_buffer_base is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_buffer_base.tps b/source/core/output_buffers/ut_output_buffer_base.tps index f2d9ec686..9615cdc5e 100644 --- a/source/core/output_buffers/ut_output_buffer_base.tps +++ b/source/core/output_buffers/ut_output_buffer_base.tps @@ -1,7 +1,7 @@ create or replace type ut_output_buffer_base force authid definer as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_buffer_info_tmp.sql b/source/core/output_buffers/ut_output_buffer_info_tmp.sql index af730d394..2aba5a55c 100644 --- a/source/core/output_buffers/ut_output_buffer_info_tmp.sql +++ b/source/core/output_buffers/ut_output_buffer_info_tmp.sql @@ -1,7 +1,7 @@ create table ut_output_buffer_info_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/output_buffers/ut_output_buffer_tmp.sql b/source/core/output_buffers/ut_output_buffer_tmp.sql index 1ab19e534..68b738d3f 100644 --- a/source/core/output_buffers/ut_output_buffer_tmp.sql +++ b/source/core/output_buffers/ut_output_buffer_tmp.sql @@ -1,7 +1,7 @@ create table ut_output_buffer_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/output_buffers/ut_output_bulk_buffer.tpb b/source/core/output_buffers/ut_output_bulk_buffer.tpb index cfc173e95..bc0ec6128 100644 --- a/source/core/output_buffers/ut_output_bulk_buffer.tpb +++ b/source/core/output_buffers/ut_output_bulk_buffer.tpb @@ -1,7 +1,7 @@ create or replace type body ut_output_bulk_buffer is /* utPLSQL - Version 3 - Copyright 2016 - 2023 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_bulk_buffer.tps b/source/core/output_buffers/ut_output_bulk_buffer.tps index d74d4ee14..31d7271fa 100644 --- a/source/core/output_buffers/ut_output_bulk_buffer.tps +++ b/source/core/output_buffers/ut_output_bulk_buffer.tps @@ -1,7 +1,7 @@ create or replace type ut_output_bulk_buffer under ut_output_buffer_base ( /* utPLSQL - Version 3 - Copyright 2016 - 2023 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_clob_buffer_tmp.sql b/source/core/output_buffers/ut_output_clob_buffer_tmp.sql index 9ff9f7413..fa61191ce 100644 --- a/source/core/output_buffers/ut_output_clob_buffer_tmp.sql +++ b/source/core/output_buffers/ut_output_clob_buffer_tmp.sql @@ -6,7 +6,7 @@ begin v_table_sql := 'create table ut_output_clob_buffer_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/output_buffers/ut_output_clob_table_buffer.tpb b/source/core/output_buffers/ut_output_clob_table_buffer.tpb index 3d49ab08d..8f1cd3187 100644 --- a/source/core/output_buffers/ut_output_clob_table_buffer.tpb +++ b/source/core/output_buffers/ut_output_clob_table_buffer.tpb @@ -1,7 +1,7 @@ create or replace type body ut_output_clob_table_buffer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_clob_table_buffer.tps b/source/core/output_buffers/ut_output_clob_table_buffer.tps index 191e64c01..2cfb2538b 100644 --- a/source/core/output_buffers/ut_output_clob_table_buffer.tps +++ b/source/core/output_buffers/ut_output_clob_table_buffer.tps @@ -1,7 +1,7 @@ create or replace type ut_output_clob_table_buffer under ut_output_buffer_base ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_data_row.tps b/source/core/output_buffers/ut_output_data_row.tps index c5dd95e98..ecfde404a 100644 --- a/source/core/output_buffers/ut_output_data_row.tps +++ b/source/core/output_buffers/ut_output_data_row.tps @@ -1,7 +1,7 @@ create or replace type ut_output_data_row as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_data_rows.tps b/source/core/output_buffers/ut_output_data_rows.tps index 097e9beff..c505e2fbf 100644 --- a/source/core/output_buffers/ut_output_data_rows.tps +++ b/source/core/output_buffers/ut_output_data_rows.tps @@ -1,7 +1,7 @@ create or replace type ut_output_data_rows as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_table_buffer.tpb b/source/core/output_buffers/ut_output_table_buffer.tpb index e8e2442a7..5fbd39907 100644 --- a/source/core/output_buffers/ut_output_table_buffer.tpb +++ b/source/core/output_buffers/ut_output_table_buffer.tpb @@ -1,7 +1,7 @@ create or replace type body ut_output_table_buffer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/output_buffers/ut_output_table_buffer.tps b/source/core/output_buffers/ut_output_table_buffer.tps index 154ce4de6..6c75421db 100644 --- a/source/core/output_buffers/ut_output_table_buffer.tps +++ b/source/core/output_buffers/ut_output_table_buffer.tps @@ -1,7 +1,7 @@ create or replace type ut_output_table_buffer under ut_output_buffer_base ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/session_context/ut_session_context.pkb b/source/core/session_context/ut_session_context.pkb index a97505e9c..2443a350a 100644 --- a/source/core/session_context/ut_session_context.pkb +++ b/source/core/session_context/ut_session_context.pkb @@ -1,7 +1,7 @@ create or replace package body ut_session_context as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/session_context/ut_session_context.pks b/source/core/session_context/ut_session_context.pks index 63da3399e..8df2decee 100644 --- a/source/core/session_context/ut_session_context.pks +++ b/source/core/session_context/ut_session_context.pks @@ -1,7 +1,7 @@ create or replace package ut_session_context as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/session_context/ut_session_info.tpb b/source/core/session_context/ut_session_info.tpb index 7d469651a..d9d576fb9 100644 --- a/source/core/session_context/ut_session_info.tpb +++ b/source/core/session_context/ut_session_info.tpb @@ -1,7 +1,7 @@ create or replace type body ut_session_info as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/session_context/ut_session_info.tps b/source/core/session_context/ut_session_info.tps index 17e596d88..aeb3361c3 100644 --- a/source/core/session_context/ut_session_info.tps +++ b/source/core/session_context/ut_session_info.tps @@ -1,7 +1,7 @@ create or replace type ut_session_info under ut_event_listener ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_console_reporter_base.tpb b/source/core/types/ut_console_reporter_base.tpb index 909e9355a..282a52a9a 100644 --- a/source/core/types/ut_console_reporter_base.tpb +++ b/source/core/types/ut_console_reporter_base.tpb @@ -1,7 +1,7 @@ create or replace type body ut_console_reporter_base is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_console_reporter_base.tps b/source/core/types/ut_console_reporter_base.tps index a2c4b6b8c..077af7e37 100644 --- a/source/core/types/ut_console_reporter_base.tps +++ b/source/core/types/ut_console_reporter_base.tps @@ -1,7 +1,7 @@ create or replace type ut_console_reporter_base under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_coverage_options.tpb b/source/core/types/ut_coverage_options.tpb index a091802af..6c81af773 100644 --- a/source/core/types/ut_coverage_options.tpb +++ b/source/core/types/ut_coverage_options.tpb @@ -1,7 +1,7 @@ create or replace type body ut_coverage_options as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_coverage_options.tps b/source/core/types/ut_coverage_options.tps index a8e3d5129..3813232df 100644 --- a/source/core/types/ut_coverage_options.tps +++ b/source/core/types/ut_coverage_options.tps @@ -1,7 +1,7 @@ create or replace type ut_coverage_options force as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_executable.tpb b/source/core/types/ut_executable.tpb index d2ce9b79d..c78cf4d77 100644 --- a/source/core/types/ut_executable.tpb +++ b/source/core/types/ut_executable.tpb @@ -1,7 +1,7 @@ create or replace type body ut_executable is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_executable.tps b/source/core/types/ut_executable.tps index aaa5a3a72..7d04c4e41 100644 --- a/source/core/types/ut_executable.tps +++ b/source/core/types/ut_executable.tps @@ -1,7 +1,7 @@ create or replace type ut_executable under ut_event_item( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_executable_test.tpb b/source/core/types/ut_executable_test.tpb index fa5872e04..e816a1b1b 100644 --- a/source/core/types/ut_executable_test.tpb +++ b/source/core/types/ut_executable_test.tpb @@ -1,7 +1,7 @@ create or replace type body ut_executable_test as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_executable_test.tps b/source/core/types/ut_executable_test.tps index 42b6080df..76f2d1c7d 100644 --- a/source/core/types/ut_executable_test.tps +++ b/source/core/types/ut_executable_test.tps @@ -1,7 +1,7 @@ create or replace type ut_executable_test authid current_user under ut_executable ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_executables.tps b/source/core/types/ut_executables.tps index d6d52b3d2..f5fbbdfad 100644 --- a/source/core/types/ut_executables.tps +++ b/source/core/types/ut_executables.tps @@ -1,7 +1,7 @@ create or replace type ut_executables as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_expectation_result.tpb b/source/core/types/ut_expectation_result.tpb index 0b3adf983..cf445b705 100644 --- a/source/core/types/ut_expectation_result.tpb +++ b/source/core/types/ut_expectation_result.tpb @@ -1,7 +1,7 @@ create or replace type body ut_expectation_result is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_expectation_result.tps b/source/core/types/ut_expectation_result.tps index d4b4c7548..5a430fe64 100644 --- a/source/core/types/ut_expectation_result.tps +++ b/source/core/types/ut_expectation_result.tps @@ -1,7 +1,7 @@ create or replace type ut_expectation_result under ut_event_item( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_expectation_results.tps b/source/core/types/ut_expectation_results.tps index e5e4c6223..50cc046ec 100644 --- a/source/core/types/ut_expectation_results.tps +++ b/source/core/types/ut_expectation_results.tps @@ -1,7 +1,7 @@ create or replace type ut_expectation_results as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_file_mapping.tpb b/source/core/types/ut_file_mapping.tpb index dab1e35c5..5b7133c56 100644 --- a/source/core/types/ut_file_mapping.tpb +++ b/source/core/types/ut_file_mapping.tpb @@ -1,7 +1,7 @@ create or replace type body ut_file_mapping as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_file_mapping.tps b/source/core/types/ut_file_mapping.tps index 941d95283..8fed2df00 100644 --- a/source/core/types/ut_file_mapping.tps +++ b/source/core/types/ut_file_mapping.tps @@ -1,7 +1,7 @@ create or replace type ut_file_mapping as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_file_mappings.tps b/source/core/types/ut_file_mappings.tps index 240fb8dd7..0e1653969 100644 --- a/source/core/types/ut_file_mappings.tps +++ b/source/core/types/ut_file_mappings.tps @@ -1,7 +1,7 @@ create or replace type ut_file_mappings as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_integer_list.tps b/source/core/types/ut_integer_list.tps index ec9a2a78f..00bce87c4 100644 --- a/source/core/types/ut_integer_list.tps +++ b/source/core/types/ut_integer_list.tps @@ -1,7 +1,7 @@ create or replace type ut_integer_list as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_key_value_pair.tps b/source/core/types/ut_key_value_pair.tps index 5a337e608..38dee5a7d 100644 --- a/source/core/types/ut_key_value_pair.tps +++ b/source/core/types/ut_key_value_pair.tps @@ -1,7 +1,7 @@ create or replace type ut_key_value_pair force as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_key_value_pairs.tps b/source/core/types/ut_key_value_pairs.tps index 24bdded36..327986e19 100644 --- a/source/core/types/ut_key_value_pairs.tps +++ b/source/core/types/ut_key_value_pairs.tps @@ -1,7 +1,7 @@ create or replace type ut_key_value_pairs as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_logical_suite.tpb b/source/core/types/ut_logical_suite.tpb index 036d40d51..ea9b42857 100644 --- a/source/core/types/ut_logical_suite.tpb +++ b/source/core/types/ut_logical_suite.tpb @@ -1,7 +1,7 @@ create or replace type body ut_logical_suite as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_logical_suite.tps b/source/core/types/ut_logical_suite.tps index c4f2f699b..ab2271e32 100644 --- a/source/core/types/ut_logical_suite.tps +++ b/source/core/types/ut_logical_suite.tps @@ -1,7 +1,7 @@ create or replace type ut_logical_suite force under ut_suite_item ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_object_name.tpb b/source/core/types/ut_object_name.tpb index 76acc15bf..e39231b0f 100644 --- a/source/core/types/ut_object_name.tpb +++ b/source/core/types/ut_object_name.tpb @@ -1,7 +1,7 @@ create or replace type body ut_object_name as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_object_name.tps b/source/core/types/ut_object_name.tps index 5f8f724c4..dc4fe2bca 100644 --- a/source/core/types/ut_object_name.tps +++ b/source/core/types/ut_object_name.tps @@ -1,7 +1,7 @@ create or replace type ut_object_name as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_object_names.tps b/source/core/types/ut_object_names.tps index 03830be17..2b42cce21 100644 --- a/source/core/types/ut_object_names.tps +++ b/source/core/types/ut_object_names.tps @@ -1,7 +1,7 @@ create or replace type ut_object_names as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_output_reporter_base.tpb b/source/core/types/ut_output_reporter_base.tpb index 48970be5a..fec4ebfab 100644 --- a/source/core/types/ut_output_reporter_base.tpb +++ b/source/core/types/ut_output_reporter_base.tpb @@ -1,7 +1,7 @@ create or replace type body ut_output_reporter_base is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_output_reporter_base.tps b/source/core/types/ut_output_reporter_base.tps index 21eed9957..f5827a97d 100644 --- a/source/core/types/ut_output_reporter_base.tps +++ b/source/core/types/ut_output_reporter_base.tps @@ -1,7 +1,7 @@ create or replace type ut_output_reporter_base under ut_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_path_item.tpb b/source/core/types/ut_path_item.tpb index 6cdb2b8ad..685178987 100644 --- a/source/core/types/ut_path_item.tpb +++ b/source/core/types/ut_path_item.tpb @@ -1,7 +1,7 @@ create or replace type body ut_path_item as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_path_item.tps b/source/core/types/ut_path_item.tps index c8ec81be5..5946cacbf 100644 --- a/source/core/types/ut_path_item.tps +++ b/source/core/types/ut_path_item.tps @@ -1,7 +1,7 @@ create or replace type ut_path_item as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_path_items.tps b/source/core/types/ut_path_items.tps index 0c87cf28c..7ae04e0b9 100644 --- a/source/core/types/ut_path_items.tps +++ b/source/core/types/ut_path_items.tps @@ -1,7 +1,7 @@ create or replace type ut_path_items as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_reporter_base.tpb b/source/core/types/ut_reporter_base.tpb index 3f8984331..445d9d351 100644 --- a/source/core/types/ut_reporter_base.tpb +++ b/source/core/types/ut_reporter_base.tpb @@ -1,7 +1,7 @@ create or replace type body ut_reporter_base is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -165,52 +165,54 @@ create or replace type body ut_reporter_base is end; overriding member procedure on_event( self in out nocopy ut_reporter_base, a_event_name varchar2, a_event_item ut_event_item) is + /* Resolves issue with ORA-21779 being thrown see issue: 1309 -> ( https://github.com/utPLSQL/utPLSQL/issues/1309#issuecomment-4020289898 ) */ + l_event_item ut_event_item := a_event_item; begin case a_event_name when ut_event_manager.gc_initialize - then self.on_initialize(treat(a_event_item as ut_run)); + then self.on_initialize(treat(l_event_item as ut_run)); when ut_event_manager.gc_before_run - then self.before_calling_run(treat(a_event_item as ut_run)); + then self.before_calling_run(treat(l_event_item as ut_run)); when ut_event_manager.gc_before_suite - then self.before_calling_suite(treat(a_event_item as ut_logical_suite)); + then self.before_calling_suite(treat(l_event_item as ut_logical_suite)); when ut_event_manager.gc_before_before_all - then self.before_calling_before_all(treat(a_event_item as ut_executable)); + then self.before_calling_before_all(treat(l_event_item as ut_executable)); when ut_event_manager.gc_before_before_each - then self.before_calling_before_each(treat(a_event_item as ut_executable)); + then self.before_calling_before_each(treat(l_event_item as ut_executable)); when ut_event_manager.gc_before_test - then self.before_calling_test(treat(a_event_item as ut_test)); + then self.before_calling_test(treat(l_event_item as ut_test)); when ut_event_manager.gc_before_before_test - then self.before_calling_before_test(treat(a_event_item as ut_executable)); + then self.before_calling_before_test(treat(l_event_item as ut_executable)); when ut_event_manager.gc_before_test_execute - then self.before_calling_test_execute(treat(a_event_item as ut_executable)); + then self.before_calling_test_execute(treat(l_event_item as ut_executable)); when ut_event_manager.gc_before_after_test - then self.before_calling_after_test(treat(a_event_item as ut_executable)); + then self.before_calling_after_test(treat(l_event_item as ut_executable)); when ut_event_manager.gc_before_after_each - then self.before_calling_after_each(treat(a_event_item as ut_executable)); + then self.before_calling_after_each(treat(l_event_item as ut_executable)); when ut_event_manager.gc_before_after_all - then self.before_calling_after_all(treat(a_event_item as ut_executable)); + then self.before_calling_after_all(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_run - then self.after_calling_run(treat(a_event_item as ut_run)); + then self.after_calling_run(treat(l_event_item as ut_run)); when ut_event_manager.gc_after_suite - then self.after_calling_suite(treat(a_event_item as ut_logical_suite)); + then self.after_calling_suite(treat(l_event_item as ut_logical_suite)); when ut_event_manager.gc_after_before_all - then self.after_calling_before_all(treat(a_event_item as ut_executable)); + then self.after_calling_before_all(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_before_each - then self.after_calling_before_each(treat(a_event_item as ut_executable)); + then self.after_calling_before_each(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_test - then self.after_calling_test(treat(a_event_item as ut_test)); + then self.after_calling_test(treat(l_event_item as ut_test)); when ut_event_manager.gc_after_before_test - then self.after_calling_before_test(treat(a_event_item as ut_executable)); + then self.after_calling_before_test(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_test_execute - then self.after_calling_test_execute(treat(a_event_item as ut_executable)); + then self.after_calling_test_execute(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_after_test - then self.after_calling_after_test(treat(a_event_item as ut_executable)); + then self.after_calling_after_test(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_after_each - then self.after_calling_after_each(treat(a_event_item as ut_executable)); + then self.after_calling_after_each(treat(l_event_item as ut_executable)); when ut_event_manager.gc_after_after_all - then self.after_calling_after_all(treat(a_event_item as ut_executable)); + then self.after_calling_after_all(treat(l_event_item as ut_executable)); when ut_event_manager.gc_finalize - then self.on_finalize(treat(a_event_item as ut_run)); + then self.on_finalize(treat(l_event_item as ut_run)); else null; end case; end; diff --git a/source/core/types/ut_reporter_base.tps b/source/core/types/ut_reporter_base.tps index de157136e..9df353060 100644 --- a/source/core/types/ut_reporter_base.tps +++ b/source/core/types/ut_reporter_base.tps @@ -1,7 +1,7 @@ create or replace type ut_reporter_base under ut_event_listener ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_reporter_info.tps b/source/core/types/ut_reporter_info.tps index f09c42e07..3491f7679 100644 --- a/source/core/types/ut_reporter_info.tps +++ b/source/core/types/ut_reporter_info.tps @@ -1,7 +1,7 @@ create or replace type ut_reporter_info as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_reporters.tps b/source/core/types/ut_reporters.tps index a2802bb26..ab6439dce 100644 --- a/source/core/types/ut_reporters.tps +++ b/source/core/types/ut_reporters.tps @@ -1,7 +1,7 @@ create or replace type ut_reporters as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_reporters_info.tps b/source/core/types/ut_reporters_info.tps index 82c264f36..3639f4c2c 100644 --- a/source/core/types/ut_reporters_info.tps +++ b/source/core/types/ut_reporters_info.tps @@ -1,7 +1,7 @@ create or replace type ut_reporters_info as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_results_counter.tpb b/source/core/types/ut_results_counter.tpb index 811389e0e..87fd83cf9 100644 --- a/source/core/types/ut_results_counter.tpb +++ b/source/core/types/ut_results_counter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_results_counter as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_results_counter.tps b/source/core/types/ut_results_counter.tps index 913ae0967..62b3d9ffd 100644 --- a/source/core/types/ut_results_counter.tps +++ b/source/core/types/ut_results_counter.tps @@ -1,7 +1,7 @@ create or replace type ut_results_counter as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_run.tpb b/source/core/types/ut_run.tpb index 660c88791..0956be32d 100644 --- a/source/core/types/ut_run.tpb +++ b/source/core/types/ut_run.tpb @@ -1,7 +1,7 @@ create or replace type body ut_run as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_run.tps b/source/core/types/ut_run.tps index 1878a2d46..ef3631082 100644 --- a/source/core/types/ut_run.tps +++ b/source/core/types/ut_run.tps @@ -1,7 +1,7 @@ create or replace type ut_run under ut_suite_item ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_run_info.tpb b/source/core/types/ut_run_info.tpb index 6edc0f109..1370de3cc 100644 --- a/source/core/types/ut_run_info.tpb +++ b/source/core/types/ut_run_info.tpb @@ -1,7 +1,7 @@ create or replace type body ut_run_info as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_run_info.tps b/source/core/types/ut_run_info.tps index 4a3da691f..df82c380d 100644 --- a/source/core/types/ut_run_info.tps +++ b/source/core/types/ut_run_info.tps @@ -1,7 +1,7 @@ create or replace type ut_run_info under ut_event_item ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_stack.tpb b/source/core/types/ut_stack.tpb index b5f4e8747..da0c371a6 100644 --- a/source/core/types/ut_stack.tpb +++ b/source/core/types/ut_stack.tpb @@ -1,7 +1,7 @@ create or replace type body ut_stack as /* utPLSQL - Version 3 - Copyright 2016 - 2023 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_stack.tps b/source/core/types/ut_stack.tps index 23112fdde..5a5f90263 100644 --- a/source/core/types/ut_stack.tps +++ b/source/core/types/ut_stack.tps @@ -3,7 +3,7 @@ create or replace type ut_stack as object ( tokens ut_varchar2_list, /* utPLSQL - Version 3 - Copyright 2016 - 2023 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite.tpb b/source/core/types/ut_suite.tpb index e3a4687d8..9558565ed 100644 --- a/source/core/types/ut_suite.tpb +++ b/source/core/types/ut_suite.tpb @@ -1,7 +1,7 @@ create or replace type body ut_suite as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite.tps b/source/core/types/ut_suite.tps index ff7f3e171..199e05ea4 100644 --- a/source/core/types/ut_suite.tps +++ b/source/core/types/ut_suite.tps @@ -1,7 +1,7 @@ create or replace type ut_suite under ut_logical_suite ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_cache_row.tps b/source/core/types/ut_suite_cache_row.tps index c147a8757..f294b3697 100644 --- a/source/core/types/ut_suite_cache_row.tps +++ b/source/core/types/ut_suite_cache_row.tps @@ -1,7 +1,7 @@ create or replace type ut_suite_cache_row as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_cache_rows.tps b/source/core/types/ut_suite_cache_rows.tps index 9b6919df5..c69c8672f 100644 --- a/source/core/types/ut_suite_cache_rows.tps +++ b/source/core/types/ut_suite_cache_rows.tps @@ -1,7 +1,7 @@ create type ut_suite_cache_rows as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_context.tpb b/source/core/types/ut_suite_context.tpb index be92e6fc9..52e57924a 100644 --- a/source/core/types/ut_suite_context.tpb +++ b/source/core/types/ut_suite_context.tpb @@ -1,7 +1,7 @@ create or replace type body ut_suite_context as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_context.tps b/source/core/types/ut_suite_context.tps index 5e3d20f87..51d318235 100644 --- a/source/core/types/ut_suite_context.tps +++ b/source/core/types/ut_suite_context.tps @@ -1,7 +1,7 @@ create or replace type ut_suite_context under ut_suite ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_item.tpb b/source/core/types/ut_suite_item.tpb index 648f10dd1..965d2416e 100644 --- a/source/core/types/ut_suite_item.tpb +++ b/source/core/types/ut_suite_item.tpb @@ -1,7 +1,7 @@ create or replace type body ut_suite_item as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_item.tps b/source/core/types/ut_suite_item.tps index 8184f2a63..8ba3c6183 100644 --- a/source/core/types/ut_suite_item.tps +++ b/source/core/types/ut_suite_item.tps @@ -1,7 +1,7 @@ create or replace type ut_suite_item force under ut_event_item ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_suite_items.tps b/source/core/types/ut_suite_items.tps index 615283446..ee3466c5d 100644 --- a/source/core/types/ut_suite_items.tps +++ b/source/core/types/ut_suite_items.tps @@ -1,7 +1,7 @@ create or replace type ut_suite_items as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_test.tpb b/source/core/types/ut_test.tpb index 946f8990d..21ca44713 100644 --- a/source/core/types/ut_test.tpb +++ b/source/core/types/ut_test.tpb @@ -1,7 +1,7 @@ create or replace type body ut_test as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_test.tps b/source/core/types/ut_test.tps index dbba64961..215e3e9d6 100644 --- a/source/core/types/ut_test.tps +++ b/source/core/types/ut_test.tps @@ -1,7 +1,7 @@ create or replace type ut_test force under ut_suite_item ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_varchar2_list.tps b/source/core/types/ut_varchar2_list.tps index f0b5df509..95a5545a8 100644 --- a/source/core/types/ut_varchar2_list.tps +++ b/source/core/types/ut_varchar2_list.tps @@ -1,7 +1,7 @@ create or replace type ut_varchar2_list as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/types/ut_varchar2_rows.tps b/source/core/types/ut_varchar2_rows.tps index e7fa29c29..c6f05df86 100644 --- a/source/core/types/ut_varchar2_rows.tps +++ b/source/core/types/ut_varchar2_rows.tps @@ -1,7 +1,7 @@ create or replace type ut_varchar2_rows as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_dbms_output_cache.sql b/source/core/ut_dbms_output_cache.sql index e61b403c8..802f30942 100644 --- a/source/core/ut_dbms_output_cache.sql +++ b/source/core/ut_dbms_output_cache.sql @@ -1,15 +1,16 @@ /* -utPLSQL - Version 3 -Copyright 2016 - 2021 utPLSQL Project -Licensed under the Apache License, Version 2.0 (the "License"): -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ /* * This table is not a global temporary table as it needs to allow cross-session data exchange diff --git a/source/core/ut_expectation_processor.pkb b/source/core/ut_expectation_processor.pkb index c165a9ee5..654a838ca 100644 --- a/source/core/ut_expectation_processor.pkb +++ b/source/core/ut_expectation_processor.pkb @@ -1,7 +1,7 @@ create or replace package body ut_expectation_processor as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_expectation_processor.pks b/source/core/ut_expectation_processor.pks index dd9187526..1837188eb 100644 --- a/source/core/ut_expectation_processor.pks +++ b/source/core/ut_expectation_processor.pks @@ -1,7 +1,7 @@ create or replace package ut_expectation_processor authid current_user as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_file_mapper.pkb b/source/core/ut_file_mapper.pkb index 425360533..077319d76 100644 --- a/source/core/ut_file_mapper.pkb +++ b/source/core/ut_file_mapper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_file_mapper is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_file_mapper.pks b/source/core/ut_file_mapper.pks index adc4c983f..71e045d7e 100644 --- a/source/core/ut_file_mapper.pks +++ b/source/core/ut_file_mapper.pks @@ -1,7 +1,7 @@ create or replace package ut_file_mapper authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_metadata.pkb b/source/core/ut_metadata.pkb index 360b7b97d..aec9a3c8d 100644 --- a/source/core/ut_metadata.pkb +++ b/source/core/ut_metadata.pkb @@ -1,7 +1,7 @@ create or replace package body ut_metadata as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_metadata.pks b/source/core/ut_metadata.pks index 27bfa5d30..31cf4889b 100644 --- a/source/core/ut_metadata.pks +++ b/source/core/ut_metadata.pks @@ -1,7 +1,7 @@ create or replace package ut_metadata authid current_user as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_savepoint_seq.sql b/source/core/ut_savepoint_seq.sql index 5b0cda35e..2026ab0e3 100644 --- a/source/core/ut_savepoint_seq.sql +++ b/source/core/ut_savepoint_seq.sql @@ -1,7 +1,7 @@ create sequence ut_savepoint_seq /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/ut_suite_builder.pkb b/source/core/ut_suite_builder.pkb index ebb113370..2ebdb980c 100644 --- a/source/core/ut_suite_builder.pkb +++ b/source/core/ut_suite_builder.pkb @@ -1,7 +1,7 @@ create or replace package body ut_suite_builder is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_suite_builder.pks b/source/core/ut_suite_builder.pks index 352601a6d..7e43a720e 100644 --- a/source/core/ut_suite_builder.pks +++ b/source/core/ut_suite_builder.pks @@ -1,7 +1,7 @@ create or replace package ut_suite_builder authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_suite_cache.sql b/source/core/ut_suite_cache.sql index 182caabd0..1d7389e9f 100644 --- a/source/core/ut_suite_cache.sql +++ b/source/core/ut_suite_cache.sql @@ -1,7 +1,7 @@ create table ut_suite_cache /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/ut_suite_cache_manager.pkb b/source/core/ut_suite_cache_manager.pkb index 6d621c339..fb7c2c888 100644 --- a/source/core/ut_suite_cache_manager.pkb +++ b/source/core/ut_suite_cache_manager.pkb @@ -1,7 +1,7 @@ create or replace package body ut_suite_cache_manager is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -306,7 +306,7 @@ create or replace package body ut_suite_cache_manager is l_object_owner varchar2(250) := upper(a_object_owner); l_object_name varchar2(250) := upper(a_object_name); begin - if a_suite_items is not null and a_suite_items.count = 0 then + if a_suite_items is null or a_suite_items.count = 0 then delete from ut_suite_cache t where t.object_owner = l_object_owner diff --git a/source/core/ut_suite_cache_manager.pks b/source/core/ut_suite_cache_manager.pks index 81b1e0136..bd236678d 100644 --- a/source/core/ut_suite_cache_manager.pks +++ b/source/core/ut_suite_cache_manager.pks @@ -1,7 +1,7 @@ create or replace package ut_suite_cache_manager authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_suite_cache_package.sql b/source/core/ut_suite_cache_package.sql index 7a146ff83..40b7b8dec 100644 --- a/source/core/ut_suite_cache_package.sql +++ b/source/core/ut_suite_cache_package.sql @@ -1,7 +1,7 @@ create table ut_suite_cache_package ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/ut_suite_cache_schema.sql b/source/core/ut_suite_cache_schema.sql index 636816e65..cace332e3 100644 --- a/source/core/ut_suite_cache_schema.sql +++ b/source/core/ut_suite_cache_schema.sql @@ -1,7 +1,7 @@ create table ut_suite_cache_schema ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/ut_suite_cache_seq.sql b/source/core/ut_suite_cache_seq.sql index e1e560286..020c25c4d 100644 --- a/source/core/ut_suite_cache_seq.sql +++ b/source/core/ut_suite_cache_seq.sql @@ -1,7 +1,7 @@ create sequence ut_suite_cache_seq /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/core/ut_suite_manager.pkb b/source/core/ut_suite_manager.pkb index c418de638..ad7f27f59 100644 --- a/source/core/ut_suite_manager.pkb +++ b/source/core/ut_suite_manager.pkb @@ -1,7 +1,7 @@ create or replace package body ut_suite_manager is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_suite_manager.pks b/source/core/ut_suite_manager.pks index 07539139a..8ac7cc8ad 100644 --- a/source/core/ut_suite_manager.pks +++ b/source/core/ut_suite_manager.pks @@ -1,7 +1,7 @@ create or replace package ut_suite_manager authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_suite_tag_filter.pkb b/source/core/ut_suite_tag_filter.pkb index 2d9436301..353793bc5 100644 --- a/source/core/ut_suite_tag_filter.pkb +++ b/source/core/ut_suite_tag_filter.pkb @@ -1,7 +1,7 @@ create or replace package body ut_suite_tag_filter is /* utPLSQL - Version 3 - Copyright 2016 - 2023 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_suite_tag_filter.pks b/source/core/ut_suite_tag_filter.pks index e824ae275..0493bd194 100644 --- a/source/core/ut_suite_tag_filter.pks +++ b/source/core/ut_suite_tag_filter.pks @@ -1,7 +1,7 @@ create or replace package ut_suite_tag_filter authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2023 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/core/ut_utils.pkb b/source/core/ut_utils.pkb index 81d47221b..9afb2ffb0 100644 --- a/source/core/ut_utils.pkb +++ b/source/core/ut_utils.pkb @@ -1,7 +1,7 @@ create or replace package body ut_utils is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -23,8 +23,10 @@ create or replace package body ut_utils is gc_invalid_xml_char constant varchar2(50) := '[^_[:alnum:]\.-]'; gc_full_valid_xml_name constant varchar2(50) := '^([[:alpha:]])([_[:alnum:]\.-])*$'; gc_owner_hash constant integer(11) := dbms_utility.get_hash_value( ut_owner(), 0, power(2,31)-1); + gc_open_chars constant varchar2(4):= '[{(<'; + gc_close_chars constant varchar2(4):= ']})>'; + gc_max_plsql_source_len constant integer := 32767; - function surround_with(a_value varchar2, a_quote_char varchar2) return varchar2 is begin return case when a_quote_char is not null then a_quote_char||a_value||a_quote_char else a_value end; @@ -658,94 +660,234 @@ create or replace package body ut_utils is return l_result; end; - function replace_multiline_comments(a_source clob) return clob is - l_result clob; - l_ml_comment_start binary_integer := 1; - l_comment_start binary_integer := 1; - l_text_start binary_integer := 1; - l_escaped_text_start binary_integer := 1; - l_escaped_text_end_char varchar2(1 char); - l_end binary_integer := 1; - l_ml_comment clob; - l_newlines_count binary_integer; - l_offset binary_integer := 1; - l_length binary_integer := coalesce(dbms_lob.getlength(a_source), 0); - begin - l_ml_comment_start := instr(a_source,'/*'); - l_comment_start := instr(a_source,'--'); - l_text_start := instr(a_source,''''); - l_escaped_text_start := instr(a_source,q'[q']'); - while l_offset > 0 and l_ml_comment_start > 0 loop - - if l_ml_comment_start > 0 and (l_ml_comment_start < l_comment_start or l_comment_start = 0) - and (l_ml_comment_start < l_text_start or l_text_start = 0)and (l_ml_comment_start < l_escaped_text_start or l_escaped_text_start = 0) - then - l_end := instr(a_source,'*/',l_ml_comment_start+2); - append_to_clob(l_result, dbms_lob.substr(a_source, l_ml_comment_start-l_offset, l_offset)); + function scan_line(a_line in varchar2, a_in_ml_comment in out boolean) return varchar2 is + -- Normal scan + l_remaining varchar2(32767) := a_line; + l_line varchar2(32767); + l_ml_start binary_integer; + l_comment_start binary_integer; + l_text_start binary_integer; + l_eq_text_start binary_integer; + l_eq_end_char varchar2(1 char); + l_pos binary_integer; + l_end binary_integer; + l_ml_end binary_integer; + begin + if a_in_ml_comment then + l_ml_end := instr(l_remaining, '*/'); + if l_ml_end > 0 then + a_in_ml_comment := false; + l_remaining := substr(l_remaining, l_ml_end + 2); + else + return null; + end if; + end if; + + loop + exit when l_remaining is null; + l_ml_start := instr(l_remaining, '/*'); + l_comment_start := instr(l_remaining, '--'); + l_text_start := instr(l_remaining, ''''); + -- q' always puts ' at l_text_start; just check the char immediately before it + l_eq_text_start := case + when l_text_start > 1 and substr(l_remaining, l_text_start - 1, 1) = 'q' + then l_text_start - 1 + else 0 + end; + -- Sentinel gc_max_plsql_source_len means "not present"; 32767 is beyond any VARCHAR2 position + l_pos := least( + case when l_ml_start > 0 then l_ml_start else gc_max_plsql_source_len end, + case when l_comment_start > 0 then l_comment_start else gc_max_plsql_source_len end, + case when l_text_start > 0 then l_text_start else gc_max_plsql_source_len end, + case when l_eq_text_start > 0 then l_eq_text_start else gc_max_plsql_source_len end + ); + + if l_pos = gc_max_plsql_source_len then + l_line := l_line || l_remaining; + exit; + end if; + + l_line := l_line || substr(l_remaining, 1, l_pos - 1); + l_remaining := substr(l_remaining, l_pos); + -- l_remaining now starts exactly at the token; all branch offsets below are relative to 1 + if l_pos = l_eq_text_start then + -- q-quoted string: l_remaining starts at 'q', delimiter is at position 3 + l_eq_end_char := translate(substr(l_remaining, 3, 1), gc_open_chars, gc_close_chars); + l_end := instr(l_remaining, l_eq_end_char || '''', 4); if l_end > 0 then - l_ml_comment := substr(a_source, l_ml_comment_start, l_end-l_ml_comment_start); - l_newlines_count := length( l_ml_comment ) - length( translate( l_ml_comment, 'a'||chr(10), 'a') ); - if l_newlines_count > 0 then - append_to_clob(l_result, lpad( chr(10), l_newlines_count, chr(10) ) ); - end if; - l_end := l_end + 2; + l_line := l_line || substr(l_remaining, 1, l_end + 1); + l_remaining := substr(l_remaining, l_end + 2); + else + l_line := l_line || l_remaining; + exit; end if; - else - if l_comment_start > 0 and (l_comment_start < l_ml_comment_start or l_ml_comment_start = 0) - and (l_comment_start < l_text_start or l_text_start = 0) and (l_comment_start < l_escaped_text_start or l_escaped_text_start = 0) - then - l_end := instr(a_source,chr(10),l_comment_start+2); - if l_end > 0 then - l_end := l_end + 1; - end if; - elsif l_text_start > 0 and (l_text_start < l_ml_comment_start or l_ml_comment_start = 0) - and (l_text_start < l_comment_start or l_comment_start = 0) and (l_text_start < l_escaped_text_start or l_escaped_text_start = 0) - then - l_end := instr(a_source,q'[']',l_text_start+1); - - --skip double quotes while searching for end of quoted text - while l_end > 0 and l_end = instr(a_source,q'['']',l_text_start+1) loop - l_end := instr(a_source,q'[']',l_end+1); - end loop; - if l_end > 0 then - l_end := l_end + 1; + elsif l_pos = l_ml_start then + -- Multi-line comment: l_remaining starts at '/*', so end search starts at 3 + l_ml_end := instr(l_remaining, '*/', 3); + if l_ml_end > 0 then + l_remaining := substr(l_remaining, l_ml_end + 2); + else + a_in_ml_comment := true; + -- preserve trailing newline if present β€” it belongs to this line, not the comment + if substr(l_remaining, -1) = chr(10) then + l_line := l_line || chr(10); end if; + return l_line; + end if; + + elsif l_pos = l_comment_start then + -- Single-line comment: everything from here is comment, keep and stop + l_line := l_line || l_remaining; + return l_line; - elsif l_escaped_text_start > 0 and (l_escaped_text_start < l_ml_comment_start or l_ml_comment_start = 0) - and (l_escaped_text_start < l_comment_start or l_comment_start = 0) and (l_escaped_text_start < l_text_start or l_text_start = 0) - then - --translate char "[" from the start of quoted text "q'[someting]'" into "]" - l_escaped_text_end_char := translate( substr(a_source, l_escaped_text_start + 2, 1), '[{(<', ']})>'); - l_end := instr(a_source,l_escaped_text_end_char||'''',l_escaped_text_start + 3 ); - if l_end > 0 then - l_end := l_end + 2; + else + -- Regular string literal: l_remaining starts at the opening quote + -- scan from position 2 to skip the opening quote + l_end := 2; + loop + l_end := instr(l_remaining, '''', l_end); + exit when l_end = 0; + if substr(l_remaining, l_end, 2) = '''''' then + l_end := l_end + 2; -- skip escaped quote pair + else + exit; -- real closing quote end if; - end if; + end loop; - if l_end = 0 then - append_to_clob(l_result, substr(a_source, l_offset, l_length-l_offset)); + if l_end > 0 then + l_line := l_line || substr(l_remaining, 1, l_end); + l_remaining := substr(l_remaining, l_end + 1); else - append_to_clob(l_result, substr(a_source, l_offset, l_end-l_offset)); + l_line := l_line || l_remaining; + exit; end if; + end if; - l_offset := l_end; - if l_offset >= l_ml_comment_start then - l_ml_comment_start := instr(a_source,'/*',l_offset); + end loop; + + return l_line; + end; + + function replace_multiline_comments(a_source dbms_preprocessor.source_lines_t) + return dbms_preprocessor.source_lines_t + is + l_result dbms_preprocessor.source_lines_t; + l_line varchar2(32767); + l_remaining varchar2(32767); + l_in_ml_comment boolean := false; + l_ml_end binary_integer; + l_has_ml_comment boolean := false; + begin + if a_source.count = 0 then + return a_source; + end if; + + -- Fast pre-scan to check for presence of multi-line comments; if none, return original source unmodified + for i in 1 .. a_source.count loop + if instr(a_source(i), '/*') > 0 then + l_has_ml_comment := true; + exit; end if; - if l_offset >= l_comment_start then - l_comment_start := instr(a_source,'--',l_offset); + end loop; + + if not l_has_ml_comment then + return a_source; + end if; + + for i in 1 .. a_source.count loop + l_line := a_source(i); + + -- Fast path: inside multi-line comment + if l_in_ml_comment then + l_ml_end := instr(l_line, '*/'); + if l_ml_end > 0 then + l_in_ml_comment := false; + l_line := substr(l_line, l_ml_end + 2); + -- fall through to normal scan + else + l_result(i) := ''; + continue; + end if; end if; - if l_offset >= l_text_start then - l_text_start := instr(a_source,'''',l_offset); + + -- Fast path: no special tokens on this line + if instr(l_line, '/') = 0 + and instr(l_line, '-') = 0 + and instr(l_line, '''') = 0 + then + l_result(i) := l_line; + continue; end if; - if l_offset >= l_escaped_text_start then - l_escaped_text_start := instr(a_source,q'[q']',l_offset); + + -- Normal scan + l_remaining := l_line; + l_line := scan_line(l_remaining, l_in_ml_comment); + if l_line is null then + l_line := ''; end if; + l_result(i) := l_line; end loop; - append_to_clob(l_result, substr(a_source, l_end)); + return l_result; - end; + end replace_multiline_comments; + + function strip_create_header_lines(a_source dbms_preprocessor.source_lines_t) + return dbms_preprocessor.source_lines_t + is + l_result dbms_preprocessor.source_lines_t := a_source; + l_rebased dbms_preprocessor.source_lines_t; + l_create_line pls_integer; + l_header_line pls_integer; + l_header_pos pls_integer := 0; + begin + if l_result.count = 0 then + return l_result; + end if; + + -- remove comment lines that contain "-- create or replace" and find first CREATE + for i in 1..l_result.count loop + l_result(i) := regexp_replace(l_result(i), '^.*[-]{2,}\s*create(\s+or\s+replace).*$', null, 1, 1, 'i'); + if l_create_line is null and regexp_like(l_result(i), '(^|[[:space:]])create([[:space:]]|$)', 'i') then + l_create_line := i; + end if; + end loop; + + -- find first occurrence of object keyword after CREATE (may be on later line) + if l_create_line is not null then + for i in l_create_line..l_result.count loop + l_header_pos := regexp_instr( + l_result(i), + '(^|[[:space:]])(package|type|procedure|function)([[:space:]]|$)', + 1, 1, 0, 'i', 2 + ); + if l_header_pos > 0 then + l_header_line := i; + exit; + end if; + end loop; + + if l_header_line is not null then + -- keep from keyword onward on the header line + l_result(l_header_line) := substr(l_result(l_header_line), l_header_pos); + -- remove "OWNER." from create or replace statement. + -- Owner is not supported along with AUTHID - see issue https://github.com/utPLSQL/utPLSQL/issues/1088 + l_result(l_header_line) := regexp_replace( + l_result(l_header_line), + '^(package|type|procedure|function)\s+("?[[:alpha:]][[:alnum:]$#_]*"?\.)(.*)', + '\1 \3', 1, 1, 'ni' + ); + + -- rebase so header line becomes line 1 (matches preprocessor expectations) + for i in l_header_line .. l_result.count loop + l_rebased(i - l_header_line + 1) := l_result(i); + end loop; + return l_rebased; + end if; + end if; + + return l_result; + end strip_create_header_lines; function get_child_reporters(a_for_reporters ut_reporters_info := null) return ut_reporters_info is l_for_reporters ut_reporters_info := a_for_reporters; diff --git a/source/core/ut_utils.pks b/source/core/ut_utils.pks index 463aa1604..6f9a3abfd 100644 --- a/source/core/ut_utils.pks +++ b/source/core/ut_utils.pks @@ -1,7 +1,7 @@ create or replace package ut_utils authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ create or replace package ut_utils authid definer is * */ - gc_version constant varchar2(50) := 'v3.1.14.4197-develop'; + gc_version constant varchar2(50) := 'v3.2.01.4375-develop'; subtype t_executable_type is varchar2(30); gc_before_all constant t_executable_type := 'beforeall'; @@ -405,7 +405,15 @@ create or replace package ut_utils authid definer is /** * Replaces multi-line comments in given source-code with empty lines */ - function replace_multiline_comments(a_source clob) return clob; + function replace_multiline_comments(a_source dbms_preprocessor.source_lines_t) + return dbms_preprocessor.source_lines_t; + + /** + * Strips the CREATE header (possibly split across lines) so source starts at + * package/type/procedure/function keyword, preserving line numbers. + */ + function strip_create_header_lines(a_source dbms_preprocessor.source_lines_t) + return dbms_preprocessor.source_lines_t; /** * Returns list of sub-type reporters for given list of super-type reporters diff --git a/source/create_grants.sql b/source/create_grants.sql index 0e9f46cc5..0656ec82f 100644 --- a/source/create_grants.sql +++ b/source/create_grants.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -104,6 +104,7 @@ grant execute on &&ut3_owner..ut_tfs_junit_reporter to &ut3_user; grant execute on &&ut3_owner..ut_documentation_reporter to &ut3_user; grant execute on &&ut3_owner..ut_sonar_test_reporter to &ut3_user; grant execute on &&ut3_owner..ut_realtime_reporter to &ut3_user; +grant execute on &&ut3_owner..ut_tap_reporter to &ut3_user; --reporters - coverage grant execute on &&ut3_owner..ut_coverage_html_reporter to &ut3_user; grant execute on &&ut3_owner..ut_coverage_sonar_reporter to &ut3_user; diff --git a/source/create_synonyms.sql b/source/create_synonyms.sql index fa1c1dc45..3cc642921 100644 --- a/source/create_synonyms.sql +++ b/source/create_synonyms.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -119,6 +119,7 @@ create &action_type. synonym &ut3_user.ut_tfs_junit_reporter for &&ut3_owner..ut create &action_type. synonym &ut3_user.ut_documentation_reporter for &&ut3_owner..ut_documentation_reporter; create &action_type. synonym &ut3_user.ut_sonar_test_reporter for &&ut3_owner..ut_sonar_test_reporter; create &action_type. synonym &ut3_user.ut_realtime_reporter for &&ut3_owner..ut_realtime_reporter; +create &action_type. synonym &ut3_user.ut_tap_reporter for &&ut3_owner..ut_tap_reporter; --reporters - coverage create &action_type. synonym &ut3_user.ut_coverage_html_reporter for &&ut3_owner..ut_coverage_html_reporter; create &action_type. synonym &ut3_user.ut_coverage_sonar_reporter for &&ut3_owner..ut_coverage_sonar_reporter; diff --git a/source/create_synonyms_and_grants_for_public.sql b/source/create_synonyms_and_grants_for_public.sql index 050162d72..25f14217e 100644 --- a/source/create_synonyms_and_grants_for_public.sql +++ b/source/create_synonyms_and_grants_for_public.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/create_user_grants.sql b/source/create_user_grants.sql index 83e594884..c1b81efa4 100644 --- a/source/create_user_grants.sql +++ b/source/create_user_grants.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/create_user_synonyms.sql b/source/create_user_synonyms.sql index a1e7a6acc..7b0e49553 100644 --- a/source/create_user_synonyms.sql +++ b/source/create_user_synonyms.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/create_utplsql_owner.sql b/source/create_utplsql_owner.sql index d7e4f3040..a5b70ffda 100644 --- a/source/create_utplsql_owner.sql +++ b/source/create_utplsql_owner.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/define_ut3_owner_param.sql b/source/define_ut3_owner_param.sql index 259b49712..192e810b7 100644 --- a/source/define_ut3_owner_param.sql +++ b/source/define_ut3_owner_param.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_compound_data_diff_tmp.sql b/source/expectations/data_values/ut_compound_data_diff_tmp.sql index c10e8d2e8..edd27f766 100644 --- a/source/expectations/data_values/ut_compound_data_diff_tmp.sql +++ b/source/expectations/data_values/ut_compound_data_diff_tmp.sql @@ -1,7 +1,7 @@ create global temporary table ut_compound_data_diff_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/expectations/data_values/ut_compound_data_helper.pkb b/source/expectations/data_values/ut_compound_data_helper.pkb index 4517cd43c..42feb2a47 100644 --- a/source/expectations/data_values/ut_compound_data_helper.pkb +++ b/source/expectations/data_values/ut_compound_data_helper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_compound_data_helper is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -300,8 +300,8 @@ create or replace package body ut_compound_data_helper is ut_utils.append_to_clob(a_partition_stmt,' row_number() over (partition by '||l_partition_tmp||' order by '||l_partition_tmp||' ) '); if a_pk_table.count > 0 then - -- If key defined do the join or these and where on diffrences - a_join_by_stmt := ut_utils.table_to_clob(l_join_by_list, ' and '); + -- If key defined do the join or these and where on diffrences as well as on duplicate number when rows are same. + a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_join_by_list, ' and '); elsif a_unordered then -- If no key defined do the join on all columns a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_equal_list, ' and '); diff --git a/source/expectations/data_values/ut_compound_data_helper.pks b/source/expectations/data_values/ut_compound_data_helper.pks index 451cd9bac..dd2e2ec3d 100644 --- a/source/expectations/data_values/ut_compound_data_helper.pks +++ b/source/expectations/data_values/ut_compound_data_helper.pks @@ -1,7 +1,7 @@ create or replace package ut_compound_data_helper authid definer is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_compound_data_tmp.sql b/source/expectations/data_values/ut_compound_data_tmp.sql index 1bfa77fca..01cedd97b 100644 --- a/source/expectations/data_values/ut_compound_data_tmp.sql +++ b/source/expectations/data_values/ut_compound_data_tmp.sql @@ -1,7 +1,7 @@ create global temporary table ut_compound_data_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/expectations/data_values/ut_compound_data_value.tpb b/source/expectations/data_values/ut_compound_data_value.tpb index 2c52ff8fa..5fd3154b1 100644 --- a/source/expectations/data_values/ut_compound_data_value.tpb +++ b/source/expectations/data_values/ut_compound_data_value.tpb @@ -1,7 +1,7 @@ create or replace type body ut_compound_data_value as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_compound_data_value.tps b/source/expectations/data_values/ut_compound_data_value.tps index c14dadceb..ca2206e2a 100644 --- a/source/expectations/data_values/ut_compound_data_value.tps +++ b/source/expectations/data_values/ut_compound_data_value.tps @@ -1,7 +1,7 @@ create or replace type ut_compound_data_value force under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_cursor_column.tpb b/source/expectations/data_values/ut_cursor_column.tpb index a9fb6b0f4..13fbb86b7 100644 --- a/source/expectations/data_values/ut_cursor_column.tpb +++ b/source/expectations/data_values/ut_cursor_column.tpb @@ -1,5 +1,21 @@ create or replace type body ut_cursor_column as - + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + member procedure init( self in out nocopy ut_cursor_column, a_col_name varchar2, a_col_schema_name varchar2, diff --git a/source/expectations/data_values/ut_cursor_column.tps b/source/expectations/data_values/ut_cursor_column.tps index 77bf78f01..98ca78b6e 100644 --- a/source/expectations/data_values/ut_cursor_column.tps +++ b/source/expectations/data_values/ut_cursor_column.tps @@ -1,7 +1,7 @@ create or replace type ut_cursor_column authid current_user as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_cursor_column_tab.tps b/source/expectations/data_values/ut_cursor_column_tab.tps index 106023d96..258624691 100644 --- a/source/expectations/data_values/ut_cursor_column_tab.tps +++ b/source/expectations/data_values/ut_cursor_column_tab.tps @@ -1,7 +1,7 @@ create or replace type ut_cursor_column_tab as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_cursor_details.tpb b/source/expectations/data_values/ut_cursor_details.tpb index b823ff944..cce0751d1 100644 --- a/source/expectations/data_values/ut_cursor_details.tpb +++ b/source/expectations/data_values/ut_cursor_details.tpb @@ -1,4 +1,21 @@ create or replace type body ut_cursor_details as + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + member function equals( a_other ut_cursor_details, a_match_options ut_matcher_options ) return boolean is l_diffs integer; diff --git a/source/expectations/data_values/ut_cursor_details.tps b/source/expectations/data_values/ut_cursor_details.tps index e7f9405eb..981fda8e5 100644 --- a/source/expectations/data_values/ut_cursor_details.tps +++ b/source/expectations/data_values/ut_cursor_details.tps @@ -1,7 +1,7 @@ create or replace type ut_cursor_details authid current_user as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value.tpb b/source/expectations/data_values/ut_data_value.tpb index 6b1763dd0..6eb352b77 100644 --- a/source/expectations/data_values/ut_data_value.tpb +++ b/source/expectations/data_values/ut_data_value.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value.tps b/source/expectations/data_values/ut_data_value.tps index beda3d911..91a07e463 100644 --- a/source/expectations/data_values/ut_data_value.tps +++ b/source/expectations/data_values/ut_data_value.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value force authid current_user as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_anydata.tpb b/source/expectations/data_values/ut_data_value_anydata.tpb index f6fbdc840..189d2e032 100644 --- a/source/expectations/data_values/ut_data_value_anydata.tpb +++ b/source/expectations/data_values/ut_data_value_anydata.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_anydata as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_anydata.tps b/source/expectations/data_values/ut_data_value_anydata.tps index 60dba5515..ee9725d58 100644 --- a/source/expectations/data_values/ut_data_value_anydata.tps +++ b/source/expectations/data_values/ut_data_value_anydata.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_anydata under ut_data_value_refcursor( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_blob.tpb b/source/expectations/data_values/ut_data_value_blob.tpb index e145a8d4f..42e35fc55 100644 --- a/source/expectations/data_values/ut_data_value_blob.tpb +++ b/source/expectations/data_values/ut_data_value_blob.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_blob as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_blob.tps b/source/expectations/data_values/ut_data_value_blob.tps index 6df3f3273..08813371e 100644 --- a/source/expectations/data_values/ut_data_value_blob.tps +++ b/source/expectations/data_values/ut_data_value_blob.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_blob under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_boolean.tpb b/source/expectations/data_values/ut_data_value_boolean.tpb index 867c3c19c..84af1c34c 100644 --- a/source/expectations/data_values/ut_data_value_boolean.tpb +++ b/source/expectations/data_values/ut_data_value_boolean.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_boolean as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_boolean.tps b/source/expectations/data_values/ut_data_value_boolean.tps index e25b6e0fd..4d7af837b 100644 --- a/source/expectations/data_values/ut_data_value_boolean.tps +++ b/source/expectations/data_values/ut_data_value_boolean.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_boolean under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_clob.tpb b/source/expectations/data_values/ut_data_value_clob.tpb index f8a53a035..2dd00c023 100644 --- a/source/expectations/data_values/ut_data_value_clob.tpb +++ b/source/expectations/data_values/ut_data_value_clob.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_clob as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_clob.tps b/source/expectations/data_values/ut_data_value_clob.tps index 6869798d1..abcc635c9 100644 --- a/source/expectations/data_values/ut_data_value_clob.tps +++ b/source/expectations/data_values/ut_data_value_clob.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_clob under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_date.tpb b/source/expectations/data_values/ut_data_value_date.tpb index 20424d193..dc1c4d22f 100644 --- a/source/expectations/data_values/ut_data_value_date.tpb +++ b/source/expectations/data_values/ut_data_value_date.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_date as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_date.tps b/source/expectations/data_values/ut_data_value_date.tps index f64a577e0..8db1850c2 100644 --- a/source/expectations/data_values/ut_data_value_date.tps +++ b/source/expectations/data_values/ut_data_value_date.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_date under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_dsinterval.tpb b/source/expectations/data_values/ut_data_value_dsinterval.tpb index 026d4970f..bcfb48a2b 100644 --- a/source/expectations/data_values/ut_data_value_dsinterval.tpb +++ b/source/expectations/data_values/ut_data_value_dsinterval.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_dsinterval as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_dsinterval.tps b/source/expectations/data_values/ut_data_value_dsinterval.tps index 6f5cb708c..5add4adf9 100644 --- a/source/expectations/data_values/ut_data_value_dsinterval.tps +++ b/source/expectations/data_values/ut_data_value_dsinterval.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_dsinterval under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_json.tpb b/source/expectations/data_values/ut_data_value_json.tpb index b703af181..9f65ef618 100644 --- a/source/expectations/data_values/ut_data_value_json.tpb +++ b/source/expectations/data_values/ut_data_value_json.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_json as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_json.tps b/source/expectations/data_values/ut_data_value_json.tps index 3b77e54eb..46a78e00e 100644 --- a/source/expectations/data_values/ut_data_value_json.tps +++ b/source/expectations/data_values/ut_data_value_json.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_json under ut_compound_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_number.tpb b/source/expectations/data_values/ut_data_value_number.tpb index 382e6e9aa..53b8ce413 100644 --- a/source/expectations/data_values/ut_data_value_number.tpb +++ b/source/expectations/data_values/ut_data_value_number.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_number as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_number.tps b/source/expectations/data_values/ut_data_value_number.tps index 86d68f356..914252b9f 100644 --- a/source/expectations/data_values/ut_data_value_number.tps +++ b/source/expectations/data_values/ut_data_value_number.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_number under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_refcursor.tpb b/source/expectations/data_values/ut_data_value_refcursor.tpb index a4f0cf7a0..ee1408b56 100644 --- a/source/expectations/data_values/ut_data_value_refcursor.tpb +++ b/source/expectations/data_values/ut_data_value_refcursor.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_refcursor as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_refcursor.tps b/source/expectations/data_values/ut_data_value_refcursor.tps index 594695e32..7d336bd78 100644 --- a/source/expectations/data_values/ut_data_value_refcursor.tps +++ b/source/expectations/data_values/ut_data_value_refcursor.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_refcursor under ut_compound_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_timestamp.tpb b/source/expectations/data_values/ut_data_value_timestamp.tpb index 318f799a3..bfb0ab734 100644 --- a/source/expectations/data_values/ut_data_value_timestamp.tpb +++ b/source/expectations/data_values/ut_data_value_timestamp.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_timestamp as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_timestamp.tps b/source/expectations/data_values/ut_data_value_timestamp.tps index c047e3c79..5c1f0b879 100644 --- a/source/expectations/data_values/ut_data_value_timestamp.tps +++ b/source/expectations/data_values/ut_data_value_timestamp.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_timestamp under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_timestamp_ltz.tpb b/source/expectations/data_values/ut_data_value_timestamp_ltz.tpb index 6127de5f1..ba1610d31 100644 --- a/source/expectations/data_values/ut_data_value_timestamp_ltz.tpb +++ b/source/expectations/data_values/ut_data_value_timestamp_ltz.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_timestamp_ltz as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_timestamp_ltz.tps b/source/expectations/data_values/ut_data_value_timestamp_ltz.tps index 7bb296bc9..51bf615af 100644 --- a/source/expectations/data_values/ut_data_value_timestamp_ltz.tps +++ b/source/expectations/data_values/ut_data_value_timestamp_ltz.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_timestamp_ltz under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_timestamp_tz.tpb b/source/expectations/data_values/ut_data_value_timestamp_tz.tpb index d5d5cdd13..ea0d28090 100644 --- a/source/expectations/data_values/ut_data_value_timestamp_tz.tpb +++ b/source/expectations/data_values/ut_data_value_timestamp_tz.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_timestamp_tz as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_timestamp_tz.tps b/source/expectations/data_values/ut_data_value_timestamp_tz.tps index 01cf11124..435dc8df0 100644 --- a/source/expectations/data_values/ut_data_value_timestamp_tz.tps +++ b/source/expectations/data_values/ut_data_value_timestamp_tz.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_timestamp_tz under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_varchar2.tpb b/source/expectations/data_values/ut_data_value_varchar2.tpb index d04398697..923ef7b9e 100644 --- a/source/expectations/data_values/ut_data_value_varchar2.tpb +++ b/source/expectations/data_values/ut_data_value_varchar2.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_varchar2 as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_varchar2.tps b/source/expectations/data_values/ut_data_value_varchar2.tps index 3fbeb378b..8db175d90 100644 --- a/source/expectations/data_values/ut_data_value_varchar2.tps +++ b/source/expectations/data_values/ut_data_value_varchar2.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_varchar2 under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_xmltype.tpb b/source/expectations/data_values/ut_data_value_xmltype.tpb index 4b21a8937..dc518da54 100644 --- a/source/expectations/data_values/ut_data_value_xmltype.tpb +++ b/source/expectations/data_values/ut_data_value_xmltype.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_xmltype as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_xmltype.tps b/source/expectations/data_values/ut_data_value_xmltype.tps index 9ba738b88..3929b4d7c 100644 --- a/source/expectations/data_values/ut_data_value_xmltype.tps +++ b/source/expectations/data_values/ut_data_value_xmltype.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_xmltype under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_yminterval.tpb b/source/expectations/data_values/ut_data_value_yminterval.tpb index a3a1e7a2f..abba0bc20 100644 --- a/source/expectations/data_values/ut_data_value_yminterval.tpb +++ b/source/expectations/data_values/ut_data_value_yminterval.tpb @@ -1,7 +1,7 @@ create or replace type body ut_data_value_yminterval as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_data_value_yminterval.tps b/source/expectations/data_values/ut_data_value_yminterval.tps index c9ad2e776..734ed545d 100644 --- a/source/expectations/data_values/ut_data_value_yminterval.tps +++ b/source/expectations/data_values/ut_data_value_yminterval.tps @@ -1,7 +1,7 @@ create or replace type ut_data_value_yminterval under ut_data_value( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_json_data_diff_tmp.sql b/source/expectations/data_values/ut_json_data_diff_tmp.sql index 5ff3440d8..4eda07d7c 100644 --- a/source/expectations/data_values/ut_json_data_diff_tmp.sql +++ b/source/expectations/data_values/ut_json_data_diff_tmp.sql @@ -1,7 +1,7 @@ create global temporary table ut_json_data_diff_tmp( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/source/expectations/data_values/ut_json_leaf.tpb b/source/expectations/data_values/ut_json_leaf.tpb index 83f1009ef..b7a20f11b 100644 --- a/source/expectations/data_values/ut_json_leaf.tpb +++ b/source/expectations/data_values/ut_json_leaf.tpb @@ -1,5 +1,21 @@ create or replace type body ut_json_leaf as - + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + member procedure init( self in out nocopy ut_json_leaf, a_element_name varchar2, a_element_value varchar2,a_parent_name varchar2, a_access_path varchar2, a_hierarchy_level integer, a_index_position integer, a_json_type in varchar2, diff --git a/source/expectations/data_values/ut_json_leaf.tps b/source/expectations/data_values/ut_json_leaf.tps index 8aa8afd6a..70d4df71d 100644 --- a/source/expectations/data_values/ut_json_leaf.tps +++ b/source/expectations/data_values/ut_json_leaf.tps @@ -1,7 +1,7 @@ create or replace type ut_json_leaf authid current_user as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_json_leaf_tab.tps b/source/expectations/data_values/ut_json_leaf_tab.tps index 395ab5d9e..10fd3eef6 100644 --- a/source/expectations/data_values/ut_json_leaf_tab.tps +++ b/source/expectations/data_values/ut_json_leaf_tab.tps @@ -1,7 +1,7 @@ create or replace type ut_json_leaf_tab as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_json_tree_details.tpb b/source/expectations/data_values/ut_json_tree_details.tpb index a333ea71c..f82aac5a0 100644 --- a/source/expectations/data_values/ut_json_tree_details.tpb +++ b/source/expectations/data_values/ut_json_tree_details.tpb @@ -1,4 +1,20 @@ create or replace type body ut_json_tree_details as + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ member function get_json_type(a_json_piece json_element_t) return varchar2 is begin diff --git a/source/expectations/data_values/ut_json_tree_details.tps b/source/expectations/data_values/ut_json_tree_details.tps index 20ac2fdcc..9c37f99ea 100644 --- a/source/expectations/data_values/ut_json_tree_details.tps +++ b/source/expectations/data_values/ut_json_tree_details.tps @@ -1,7 +1,7 @@ create or replace type ut_json_tree_details force as object ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_key_anyval_pair.tps b/source/expectations/data_values/ut_key_anyval_pair.tps index d1068f109..7935ffa09 100644 --- a/source/expectations/data_values/ut_key_anyval_pair.tps +++ b/source/expectations/data_values/ut_key_anyval_pair.tps @@ -1,7 +1,7 @@ create or replace type ut_key_anyval_pair force as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_key_anyval_pairs.tps b/source/expectations/data_values/ut_key_anyval_pairs.tps index 7e10bf50f..2cc1ff225 100644 --- a/source/expectations/data_values/ut_key_anyval_pairs.tps +++ b/source/expectations/data_values/ut_key_anyval_pairs.tps @@ -1,7 +1,7 @@ create or replace type ut_key_anyval_pairs as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_key_anyvalues.tpb b/source/expectations/data_values/ut_key_anyvalues.tpb index d30d8a841..67b877874 100644 --- a/source/expectations/data_values/ut_key_anyvalues.tpb +++ b/source/expectations/data_values/ut_key_anyvalues.tpb @@ -1,7 +1,7 @@ create or replace type body ut_key_anyvalues as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/data_values/ut_key_anyvalues.tps b/source/expectations/data_values/ut_key_anyvalues.tps index 8c672bd00..df14a8101 100644 --- a/source/expectations/data_values/ut_key_anyvalues.tps +++ b/source/expectations/data_values/ut_key_anyvalues.tps @@ -1,7 +1,7 @@ create or replace type ut_key_anyvalues under ut_event_item ( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_between.tpb b/source/expectations/matchers/ut_be_between.tpb index 6aea96f55..787be701b 100644 --- a/source/expectations/matchers/ut_be_between.tpb +++ b/source/expectations/matchers/ut_be_between.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_between is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_between.tps b/source/expectations/matchers/ut_be_between.tps index 9e984085b..a08d7a823 100644 --- a/source/expectations/matchers/ut_be_between.tps +++ b/source/expectations/matchers/ut_be_between.tps @@ -1,7 +1,7 @@ create or replace type ut_be_between under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_empty.tpb b/source/expectations/matchers/ut_be_empty.tpb index e5e02f6b2..bac77166a 100644 --- a/source/expectations/matchers/ut_be_empty.tpb +++ b/source/expectations/matchers/ut_be_empty.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_empty as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_empty.tps b/source/expectations/matchers/ut_be_empty.tps index 9e9f899d0..948e771a3 100644 --- a/source/expectations/matchers/ut_be_empty.tps +++ b/source/expectations/matchers/ut_be_empty.tps @@ -1,7 +1,7 @@ create or replace type ut_be_empty under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_false.tpb b/source/expectations/matchers/ut_be_false.tpb index 4cc88600a..5a5421e8b 100644 --- a/source/expectations/matchers/ut_be_false.tpb +++ b/source/expectations/matchers/ut_be_false.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_false as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_false.tps b/source/expectations/matchers/ut_be_false.tps index ede510719..b6906ece8 100644 --- a/source/expectations/matchers/ut_be_false.tps +++ b/source/expectations/matchers/ut_be_false.tps @@ -1,7 +1,7 @@ create or replace type ut_be_false under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_greater_or_equal.tpb b/source/expectations/matchers/ut_be_greater_or_equal.tpb index 1c2a19c09..fbd165b1d 100644 --- a/source/expectations/matchers/ut_be_greater_or_equal.tpb +++ b/source/expectations/matchers/ut_be_greater_or_equal.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_greater_or_equal AS /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_greater_or_equal.tps b/source/expectations/matchers/ut_be_greater_or_equal.tps index b3ab54ff1..e87740134 100644 --- a/source/expectations/matchers/ut_be_greater_or_equal.tps +++ b/source/expectations/matchers/ut_be_greater_or_equal.tps @@ -1,7 +1,7 @@ create or replace type ut_be_greater_or_equal under ut_comparison_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_greater_than.tpb b/source/expectations/matchers/ut_be_greater_than.tpb index 9cce79119..f59c2f0be 100644 --- a/source/expectations/matchers/ut_be_greater_than.tpb +++ b/source/expectations/matchers/ut_be_greater_than.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_greater_than AS /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_greater_than.tps b/source/expectations/matchers/ut_be_greater_than.tps index a5a44692d..b66009bab 100644 --- a/source/expectations/matchers/ut_be_greater_than.tps +++ b/source/expectations/matchers/ut_be_greater_than.tps @@ -1,7 +1,7 @@ create or replace type ut_be_greater_than under ut_comparison_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_less_or_equal.tpb b/source/expectations/matchers/ut_be_less_or_equal.tpb index 6acec1dda..24c1f9c96 100644 --- a/source/expectations/matchers/ut_be_less_or_equal.tpb +++ b/source/expectations/matchers/ut_be_less_or_equal.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_less_or_equal AS /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_less_or_equal.tps b/source/expectations/matchers/ut_be_less_or_equal.tps index 118611a41..5114644b0 100644 --- a/source/expectations/matchers/ut_be_less_or_equal.tps +++ b/source/expectations/matchers/ut_be_less_or_equal.tps @@ -1,7 +1,7 @@ create or replace type ut_be_less_or_equal under ut_comparison_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_less_than.tpb b/source/expectations/matchers/ut_be_less_than.tpb index 7608e4917..011ad392f 100644 --- a/source/expectations/matchers/ut_be_less_than.tpb +++ b/source/expectations/matchers/ut_be_less_than.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_less_than as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_less_than.tps b/source/expectations/matchers/ut_be_less_than.tps index b652de789..81a25144d 100644 --- a/source/expectations/matchers/ut_be_less_than.tps +++ b/source/expectations/matchers/ut_be_less_than.tps @@ -1,7 +1,7 @@ create or replace type ut_be_less_than under ut_comparison_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_like.tpb b/source/expectations/matchers/ut_be_like.tpb index 6865c2942..953adbe5b 100644 --- a/source/expectations/matchers/ut_be_like.tpb +++ b/source/expectations/matchers/ut_be_like.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_like as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_like.tps b/source/expectations/matchers/ut_be_like.tps index dae93a1d9..1d907ed03 100644 --- a/source/expectations/matchers/ut_be_like.tps +++ b/source/expectations/matchers/ut_be_like.tps @@ -1,7 +1,7 @@ create or replace type ut_be_like under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_not_null.tpb b/source/expectations/matchers/ut_be_not_null.tpb index 194e2ea32..df9366fa7 100644 --- a/source/expectations/matchers/ut_be_not_null.tpb +++ b/source/expectations/matchers/ut_be_not_null.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_not_null as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_not_null.tps b/source/expectations/matchers/ut_be_not_null.tps index 196aac9fb..6cd11fc64 100644 --- a/source/expectations/matchers/ut_be_not_null.tps +++ b/source/expectations/matchers/ut_be_not_null.tps @@ -1,7 +1,7 @@ create or replace type ut_be_not_null under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_null.tpb b/source/expectations/matchers/ut_be_null.tpb index 8c672791b..d806bba34 100644 --- a/source/expectations/matchers/ut_be_null.tpb +++ b/source/expectations/matchers/ut_be_null.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_null as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_null.tps b/source/expectations/matchers/ut_be_null.tps index 3b2d6ac84..28f3ac796 100644 --- a/source/expectations/matchers/ut_be_null.tps +++ b/source/expectations/matchers/ut_be_null.tps @@ -1,7 +1,7 @@ create or replace type ut_be_null under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_true.tpb b/source/expectations/matchers/ut_be_true.tpb index fe78b4e22..442e57d7f 100644 --- a/source/expectations/matchers/ut_be_true.tpb +++ b/source/expectations/matchers/ut_be_true.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_true as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_true.tps b/source/expectations/matchers/ut_be_true.tps index 8b5491e39..b55fa484d 100644 --- a/source/expectations/matchers/ut_be_true.tps +++ b/source/expectations/matchers/ut_be_true.tps @@ -1,7 +1,7 @@ create or replace type ut_be_true under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_within.tpb b/source/expectations/matchers/ut_be_within.tpb index e2aa792d0..f77e9feec 100644 --- a/source/expectations/matchers/ut_be_within.tpb +++ b/source/expectations/matchers/ut_be_within.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_within as /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_within.tps b/source/expectations/matchers/ut_be_within.tps index 576f9ff37..06a685832 100644 --- a/source/expectations/matchers/ut_be_within.tps +++ b/source/expectations/matchers/ut_be_within.tps @@ -1,7 +1,7 @@ create or replace type ut_be_within force under ut_be_within_pct( /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_within_helper.pkb b/source/expectations/matchers/ut_be_within_helper.pkb index 5dd82baa2..561bf230b 100644 --- a/source/expectations/matchers/ut_be_within_helper.pkb +++ b/source/expectations/matchers/ut_be_within_helper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_be_within_helper as /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_within_helper.pks b/source/expectations/matchers/ut_be_within_helper.pks index 41737cc8f..b8480e249 100644 --- a/source/expectations/matchers/ut_be_within_helper.pks +++ b/source/expectations/matchers/ut_be_within_helper.pks @@ -1,7 +1,7 @@ create or replace package ut_be_within_helper authid definer as /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_within_pct.tpb b/source/expectations/matchers/ut_be_within_pct.tpb index 8b280ffff..ad821d72c 100644 --- a/source/expectations/matchers/ut_be_within_pct.tpb +++ b/source/expectations/matchers/ut_be_within_pct.tpb @@ -1,7 +1,7 @@ create or replace type body ut_be_within_pct as /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_be_within_pct.tps b/source/expectations/matchers/ut_be_within_pct.tps index 499e9a2d8..645e9c485 100644 --- a/source/expectations/matchers/ut_be_within_pct.tps +++ b/source/expectations/matchers/ut_be_within_pct.tps @@ -1,7 +1,7 @@ create or replace type ut_be_within_pct force under ut_comparison_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ create or replace type ut_be_within_pct force under ut_comparison_matcher( limitations under the License. */ - /** * Holds information about mather options */ diff --git a/source/expectations/matchers/ut_comparison_matcher.tpb b/source/expectations/matchers/ut_comparison_matcher.tpb index 20ed35927..b7cef4f59 100644 --- a/source/expectations/matchers/ut_comparison_matcher.tpb +++ b/source/expectations/matchers/ut_comparison_matcher.tpb @@ -1,7 +1,7 @@ create or replace type body ut_comparison_matcher as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_comparison_matcher.tps b/source/expectations/matchers/ut_comparison_matcher.tps index 68ecb4462..11b46d47c 100644 --- a/source/expectations/matchers/ut_comparison_matcher.tps +++ b/source/expectations/matchers/ut_comparison_matcher.tps @@ -1,7 +1,7 @@ create or replace type ut_comparison_matcher under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_contain.tpb b/source/expectations/matchers/ut_contain.tpb index c9691f731..a8eb71ecd 100644 --- a/source/expectations/matchers/ut_contain.tpb +++ b/source/expectations/matchers/ut_contain.tpb @@ -1,7 +1,7 @@ create or replace type body ut_contain as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_contain.tps b/source/expectations/matchers/ut_contain.tps index e572edf62..6d7c525c6 100644 --- a/source/expectations/matchers/ut_contain.tps +++ b/source/expectations/matchers/ut_contain.tps @@ -1,7 +1,7 @@ create or replace type ut_contain under ut_equal( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_equal.tpb b/source/expectations/matchers/ut_equal.tpb index d514e34d0..f5932b2ad 100644 --- a/source/expectations/matchers/ut_equal.tpb +++ b/source/expectations/matchers/ut_equal.tpb @@ -1,7 +1,7 @@ create or replace type body ut_equal as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_equal.tps b/source/expectations/matchers/ut_equal.tps index e48b797ed..e23eaf23b 100644 --- a/source/expectations/matchers/ut_equal.tps +++ b/source/expectations/matchers/ut_equal.tps @@ -1,7 +1,7 @@ create or replace type ut_equal force under ut_comparison_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_have_count.tpb b/source/expectations/matchers/ut_have_count.tpb index 457cd6272..0d4cfbcc0 100644 --- a/source/expectations/matchers/ut_have_count.tpb +++ b/source/expectations/matchers/ut_have_count.tpb @@ -1,7 +1,7 @@ create or replace type body ut_have_count as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_have_count.tps b/source/expectations/matchers/ut_have_count.tps index d48dc44c8..bd075e8f4 100644 --- a/source/expectations/matchers/ut_have_count.tps +++ b/source/expectations/matchers/ut_have_count.tps @@ -1,7 +1,7 @@ create or replace type ut_have_count under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_match.tpb b/source/expectations/matchers/ut_match.tpb index 3c7a71402..de645a135 100644 --- a/source/expectations/matchers/ut_match.tpb +++ b/source/expectations/matchers/ut_match.tpb @@ -1,7 +1,7 @@ create or replace type body ut_match as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_match.tps b/source/expectations/matchers/ut_match.tps index ee51a4c28..ababff18f 100644 --- a/source/expectations/matchers/ut_match.tps +++ b/source/expectations/matchers/ut_match.tps @@ -1,7 +1,7 @@ create or replace type ut_match under ut_matcher( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_matcher.tpb b/source/expectations/matchers/ut_matcher.tpb index 6b5b98465..07e082a71 100644 --- a/source/expectations/matchers/ut_matcher.tpb +++ b/source/expectations/matchers/ut_matcher.tpb @@ -1,7 +1,7 @@ create or replace type body ut_matcher as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_matcher.tps b/source/expectations/matchers/ut_matcher.tps index a034e4ed2..2551ce003 100644 --- a/source/expectations/matchers/ut_matcher.tps +++ b/source/expectations/matchers/ut_matcher.tps @@ -1,7 +1,7 @@ create or replace type ut_matcher under ut_matcher_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_matcher_base.tps b/source/expectations/matchers/ut_matcher_base.tps index ef7fd98a2..c6d44468d 100644 --- a/source/expectations/matchers/ut_matcher_base.tps +++ b/source/expectations/matchers/ut_matcher_base.tps @@ -1,4 +1,21 @@ create or replace type ut_matcher_base force authid current_user as object( + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + self_type varchar2(250) ) not final not instantiable diff --git a/source/expectations/matchers/ut_matcher_options.tpb b/source/expectations/matchers/ut_matcher_options.tpb index 8730c204b..1acb4405b 100644 --- a/source/expectations/matchers/ut_matcher_options.tpb +++ b/source/expectations/matchers/ut_matcher_options.tpb @@ -1,7 +1,7 @@ create or replace type body ut_matcher_options as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_matcher_options.tps b/source/expectations/matchers/ut_matcher_options.tps index 276cad2ec..835316e7c 100644 --- a/source/expectations/matchers/ut_matcher_options.tps +++ b/source/expectations/matchers/ut_matcher_options.tps @@ -1,7 +1,7 @@ create or replace type ut_matcher_options authid current_user as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_matcher_options_items.tpb b/source/expectations/matchers/ut_matcher_options_items.tpb index 92da588ce..921d3ecd2 100644 --- a/source/expectations/matchers/ut_matcher_options_items.tpb +++ b/source/expectations/matchers/ut_matcher_options_items.tpb @@ -1,7 +1,7 @@ create or replace type body ut_matcher_options_items is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/matchers/ut_matcher_options_items.tps b/source/expectations/matchers/ut_matcher_options_items.tps index 53787070d..73c2bb92d 100644 --- a/source/expectations/matchers/ut_matcher_options_items.tps +++ b/source/expectations/matchers/ut_matcher_options_items.tps @@ -1,7 +1,7 @@ create or replace type ut_matcher_options_items authid current_user as object( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/ut_expectation.tpb b/source/expectations/ut_expectation.tpb index 309759d48..12aef603a 100644 --- a/source/expectations/ut_expectation.tpb +++ b/source/expectations/ut_expectation.tpb @@ -1,7 +1,7 @@ create or replace type body ut_expectation as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/ut_expectation.tps b/source/expectations/ut_expectation.tps index 30fe985d3..b015a95a7 100644 --- a/source/expectations/ut_expectation.tps +++ b/source/expectations/ut_expectation.tps @@ -1,7 +1,7 @@ create or replace type ut_expectation force under ut_expectation_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/ut_expectation_base.tpb b/source/expectations/ut_expectation_base.tpb index 20b3e7a95..3d6e9b469 100644 --- a/source/expectations/ut_expectation_base.tpb +++ b/source/expectations/ut_expectation_base.tpb @@ -1,7 +1,7 @@ create or replace type body ut_expectation_base as /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ create or replace type body ut_expectation_base as See the License for the specific language governing permissions and limitations under the License. */ + member procedure to_(self in ut_expectation_base, a_matcher ut_matcher_base) is l_expectation_result boolean; l_matcher ut_matcher := treat(a_matcher as ut_matcher); diff --git a/source/expectations/ut_expectation_base.tps b/source/expectations/ut_expectation_base.tps index a542d26ea..24e180b92 100644 --- a/source/expectations/ut_expectation_base.tps +++ b/source/expectations/ut_expectation_base.tps @@ -1,7 +1,7 @@ create or replace type ut_expectation_base authid current_user as object( /* utPLSQL - Version 3 - Copyright 2016 - 2019 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ create or replace type ut_expectation_base authid current_user as object( See the License for the specific language governing permissions and limitations under the License. */ + actual_data ut_data_value, description varchar2(4000 char), diff --git a/source/expectations/ut_expectation_compound.tpb b/source/expectations/ut_expectation_compound.tpb index 6fc2e2647..1131885b0 100644 --- a/source/expectations/ut_expectation_compound.tpb +++ b/source/expectations/ut_expectation_compound.tpb @@ -1,7 +1,7 @@ create or replace type body ut_expectation_compound as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/ut_expectation_compound.tps b/source/expectations/ut_expectation_compound.tps index 46da23fea..ebf534222 100644 --- a/source/expectations/ut_expectation_compound.tps +++ b/source/expectations/ut_expectation_compound.tps @@ -1,7 +1,7 @@ create or replace type ut_expectation_compound under ut_expectation( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/ut_expectation_json.tpb b/source/expectations/ut_expectation_json.tpb index b71e8ea83..90a3a3d31 100644 --- a/source/expectations/ut_expectation_json.tpb +++ b/source/expectations/ut_expectation_json.tpb @@ -1,7 +1,7 @@ create or replace type body ut_expectation_json as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/expectations/ut_expectation_json.tps b/source/expectations/ut_expectation_json.tps index 561c5d11f..d873cc99c 100644 --- a/source/expectations/ut_expectation_json.tps +++ b/source/expectations/ut_expectation_json.tps @@ -1,7 +1,7 @@ create or replace type ut_expectation_json under ut_expectation( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/install.sql b/source/install.sql index 827213e6c..a2c73ef17 100644 --- a/source/install.sql +++ b/source/install.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. @@ -346,6 +346,8 @@ prompt Installing DBMSPLSQL Tables objects into &&ut3_owner schema @@install_component.sql 'reporters/ut_xunit_reporter.tpb' @@install_component.sql 'reporters/ut_sonar_test_reporter.tps' @@install_component.sql 'reporters/ut_sonar_test_reporter.tpb' +@@install_component.sql 'reporters/ut_tap_reporter.tps' +@@install_component.sql 'reporters/ut_tap_reporter.tpb' @@install_component.sql 'reporters/ut_coverage_html_reporter.tps' @@install_component.sql 'reporters/ut_coverage_report_html_helper.pks' diff --git a/source/install_above_12_1.sql b/source/install_above_12_1.sql index 69e47ce9a..5a1943358 100644 --- a/source/install_above_12_1.sql +++ b/source/install_above_12_1.sql @@ -1,3 +1,20 @@ +/* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + def FILE_NAME = '&&1' column SCRIPT_NAME new_value SCRIPT_NAME noprint diff --git a/source/install_component.sql b/source/install_component.sql index 373c85c54..1189df496 100644 --- a/source/install_component.sql +++ b/source/install_component.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/install_ddl_trigger.sql b/source/install_ddl_trigger.sql index bc147c2be..b23b4bc63 100644 --- a/source/install_ddl_trigger.sql +++ b/source/install_ddl_trigger.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/install_headless.sql b/source/install_headless.sql index 183262675..be1e5becf 100644 --- a/source/install_headless.sql +++ b/source/install_headless.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/install_headless_with_trigger.sql b/source/install_headless_with_trigger.sql index 76ae48ccb..2c05403c5 100644 --- a/source/install_headless_with_trigger.sql +++ b/source/install_headless_with_trigger.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_ansiconsole_helper.pkb b/source/reporters/ut_ansiconsole_helper.pkb index 53e6bc6aa..46960cf5c 100644 --- a/source/reporters/ut_ansiconsole_helper.pkb +++ b/source/reporters/ut_ansiconsole_helper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_ansiconsole_helper as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_ansiconsole_helper.pks b/source/reporters/ut_ansiconsole_helper.pks index 217d36a49..fd4549965 100644 --- a/source/reporters/ut_ansiconsole_helper.pks +++ b/source/reporters/ut_ansiconsole_helper.pks @@ -1,7 +1,7 @@ create or replace package ut_ansiconsole_helper as /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_cobertura_reporter.tpb b/source/reporters/ut_coverage_cobertura_reporter.tpb index d833ac0aa..833ca09be 100644 --- a/source/reporters/ut_coverage_cobertura_reporter.tpb +++ b/source/reporters/ut_coverage_cobertura_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_coverage_cobertura_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_cobertura_reporter.tps b/source/reporters/ut_coverage_cobertura_reporter.tps index 1292e60fb..ee2d9b71d 100644 --- a/source/reporters/ut_coverage_cobertura_reporter.tps +++ b/source/reporters/ut_coverage_cobertura_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_coverage_cobertura_reporter under ut_coverage_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_html_reporter.tpb b/source/reporters/ut_coverage_html_reporter.tpb index b1f9f6651..253c067e5 100644 --- a/source/reporters/ut_coverage_html_reporter.tpb +++ b/source/reporters/ut_coverage_html_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_coverage_html_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_html_reporter.tps b/source/reporters/ut_coverage_html_reporter.tps index 42f2fd4e3..db65e1e00 100644 --- a/source/reporters/ut_coverage_html_reporter.tps +++ b/source/reporters/ut_coverage_html_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_report_html_helper.pkb b/source/reporters/ut_coverage_report_html_helper.pkb index f7e0b5ed0..7ebf891f9 100644 --- a/source/reporters/ut_coverage_report_html_helper.pkb +++ b/source/reporters/ut_coverage_report_html_helper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_coverage_report_html_helper is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_report_html_helper.pks b/source/reporters/ut_coverage_report_html_helper.pks index 42a59c123..c028168a8 100644 --- a/source/reporters/ut_coverage_report_html_helper.pks +++ b/source/reporters/ut_coverage_report_html_helper.pks @@ -1,7 +1,7 @@ create or replace package ut_coverage_report_html_helper authid current_user is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_sonar_reporter.tpb b/source/reporters/ut_coverage_sonar_reporter.tpb index 1861a9be3..8148fc7fc 100644 --- a/source/reporters/ut_coverage_sonar_reporter.tpb +++ b/source/reporters/ut_coverage_sonar_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_coverage_sonar_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coverage_sonar_reporter.tps b/source/reporters/ut_coverage_sonar_reporter.tps index 715bdefd2..b5e964a3a 100644 --- a/source/reporters/ut_coverage_sonar_reporter.tps +++ b/source/reporters/ut_coverage_sonar_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_coverage_sonar_reporter under ut_coverage_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coveralls_reporter.tpb b/source/reporters/ut_coveralls_reporter.tpb index 14672303e..fc459c906 100644 --- a/source/reporters/ut_coveralls_reporter.tpb +++ b/source/reporters/ut_coveralls_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_coveralls_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_coveralls_reporter.tps b/source/reporters/ut_coveralls_reporter.tps index 74363b751..e547793d1 100644 --- a/source/reporters/ut_coveralls_reporter.tps +++ b/source/reporters/ut_coveralls_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_coveralls_reporter under ut_coverage_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_debug_reporter.tpb b/source/reporters/ut_debug_reporter.tpb index 879725172..b17f039ea 100644 --- a/source/reporters/ut_debug_reporter.tpb +++ b/source/reporters/ut_debug_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_debug_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_debug_reporter.tps b/source/reporters/ut_debug_reporter.tps index 2123f19cc..85c0eeb54 100644 --- a/source/reporters/ut_debug_reporter.tps +++ b/source/reporters/ut_debug_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_debug_reporter under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_documentation_reporter.tpb b/source/reporters/ut_documentation_reporter.tpb index e8c0a4e31..489b6efd2 100644 --- a/source/reporters/ut_documentation_reporter.tpb +++ b/source/reporters/ut_documentation_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_documentation_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_documentation_reporter.tps b/source/reporters/ut_documentation_reporter.tps index 422225117..23b86226f 100644 --- a/source/reporters/ut_documentation_reporter.tps +++ b/source/reporters/ut_documentation_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_documentation_reporter under ut_console_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_junit_reporter.tpb b/source/reporters/ut_junit_reporter.tpb index 3bceb52a4..a2cffd287 100644 --- a/source/reporters/ut_junit_reporter.tpb +++ b/source/reporters/ut_junit_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_junit_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_junit_reporter.tps b/source/reporters/ut_junit_reporter.tps index 6cdaff1b9..5999c33f5 100644 --- a/source/reporters/ut_junit_reporter.tps +++ b/source/reporters/ut_junit_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_junit_reporter force under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_realtime_reporter.tpb b/source/reporters/ut_realtime_reporter.tpb index 9c2af57ec..fac7cd9b8 100644 --- a/source/reporters/ut_realtime_reporter.tpb +++ b/source/reporters/ut_realtime_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_realtime_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_realtime_reporter.tps b/source/reporters/ut_realtime_reporter.tps index 0501006e4..5ab350162 100644 --- a/source/reporters/ut_realtime_reporter.tps +++ b/source/reporters/ut_realtime_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_realtime_reporter force under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_sonar_test_reporter.tpb b/source/reporters/ut_sonar_test_reporter.tpb index 7c46879d2..dfa6a7421 100644 --- a/source/reporters/ut_sonar_test_reporter.tpb +++ b/source/reporters/ut_sonar_test_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_sonar_test_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_sonar_test_reporter.tps b/source/reporters/ut_sonar_test_reporter.tps index ac3b16bd1..d9f98071d 100644 --- a/source/reporters/ut_sonar_test_reporter.tps +++ b/source/reporters/ut_sonar_test_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_sonar_test_reporter under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_tap_reporter.tpb b/source/reporters/ut_tap_reporter.tpb new file mode 100644 index 000000000..02246b97e --- /dev/null +++ b/source/reporters/ut_tap_reporter.tpb @@ -0,0 +1,139 @@ +create or replace type body ut_tap_reporter is + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + constructor function ut_tap_reporter(self in out nocopy ut_tap_reporter) return self as result is + begin + self.init($$plsql_unit); + self.lvl := 0; + return; + end ut_tap_reporter; + + member procedure print_comment(self in out nocopy ut_tap_reporter, a_comment clob) as + begin + self.print_clob(regexp_replace(a_comment, '^', '# ', 1, 0, 'm')); + end print_comment; + + member function escape_special_chars(self in out nocopy ut_tap_reporter, a_string_to_escape clob) return clob as + begin + return regexp_replace(a_string_to_escape, '([\\#])', '\\\1'); + end escape_special_chars; + + overriding member procedure before_calling_suite(self in out nocopy ut_tap_reporter, a_suite ut_logical_suite) as + begin + self.print_text('# Subtest: ' || self.escape_special_chars(coalesce(a_suite.description, a_suite.name))); + lvl := lvl + 2; + self.print_text('1..' || a_suite.items.count); + end before_calling_suite; + + + overriding member procedure after_calling_test(self in out nocopy ut_tap_reporter, a_test ut_test) as + l_message varchar2(4000); + l_test_name varchar2(4000) := self.escape_special_chars(coalesce(a_test.description, a_test.name)); + + procedure print_failed_expectation(a_test ut_test) is + l_lines ut_varchar2_list; + l_failed boolean; + begin + if a_test.get_error_stack_traces().count = 0 then + -- If no error occurred, print failed expectation + l_lines := a_test.all_expectations(a_test.all_expectations.last).get_result_lines(); + l_failed := a_test.all_expectations(a_test.all_expectations.last).status >= ut_utils.gc_success; + if l_failed then + self.print_text('message: ''' || l_lines(1) || ''''); + self.print_text('severity: fail'); + end if; + else + -- Print multi-line YAML-String with implicit newline characters + self.print_text('message: |'); + self.lvl := self.lvl + 1; + self.print_text(ut_utils.table_to_clob(a_test.get_error_stack_traces())); + self.lvl := self.lvl - 1; + self.print_text('severity: error'); + end if; + end print_failed_expectation; + + begin + + if a_test.result = ut_utils.gc_disabled then + self.print_text('ok - ' || l_test_name || ' # SKIP'|| + case when a_test.disabled_reason is not null + then ': '|| self.escape_special_chars(a_test.disabled_reason) + else null + end ); + elsif a_test.result = ut_utils.gc_success then + self.print_text('ok - ' || l_test_name); + elsif a_test.result > ut_utils.gc_success then + if self.lvl = 0 then + self.print_text(ut_ansiconsole_helper.red('not ok') || ' - ' || l_test_name); + else + self.print_text('not ok - ' || l_test_name); + end if; + self.lvl := self.lvl + 1; + self.print_text('---'); + print_failed_expectation(a_test); + self.print_text('...'); + self.lvl := self.lvl - 1; + end if; + + self.print_comment(a_test.get_serveroutputs); + + end after_calling_test; + + overriding member procedure after_calling_before_all(self in out nocopy ut_tap_reporter, a_executable in ut_executable) is + begin + if a_executable.serveroutput is not null and a_executable.serveroutput != empty_clob() then + self.print_comment(a_executable.serveroutput); + end if; + end after_calling_before_all; + + overriding member procedure after_calling_after_all(self in out nocopy ut_tap_reporter, a_executable in ut_executable) is + begin + if a_executable.serveroutput is not null and a_executable.serveroutput != empty_clob() then + self.print_comment(a_executable.serveroutput); + end if; + end after_calling_after_all; + + overriding member procedure after_calling_suite(self in out nocopy ut_tap_reporter, a_suite ut_logical_suite) as + l_suite_name varchar2(4000) := coalesce(a_suite.description, a_suite.name); + begin + lvl := lvl - 2; + if lvl = 0 then + if a_suite.result = ut_utils.gc_success or a_suite.result = ut_utils.gc_disabled then + self.print_text('ok - ' || self.escape_special_chars(l_suite_name)); + elsif a_suite.result > ut_utils.gc_success then + self.print_text(ut_ansiconsole_helper.red('not ok') || ' - ' || self.escape_special_chars(l_suite_name)); + end if; + + self.print_text(' '); + end if; + + end after_calling_suite; + + overriding member procedure before_calling_run(self in out nocopy ut_tap_reporter, a_run in ut_run) as + begin + self.print_text('TAP version 14'); + self.print_text('1..' || a_run.items.count); + self.print_text(' '); + end before_calling_run; + + overriding member procedure after_calling_run(self in out nocopy ut_tap_reporter, a_run in ut_run) as + begin + self.lvl := 0; + end; +end; +/ diff --git a/source/reporters/ut_tap_reporter.tps b/source/reporters/ut_tap_reporter.tps new file mode 100644 index 000000000..94423b6fc --- /dev/null +++ b/source/reporters/ut_tap_reporter.tps @@ -0,0 +1,34 @@ +create or replace type ut_tap_reporter under ut_documentation_reporter( + /* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + constructor function ut_tap_reporter(self in out nocopy ut_tap_reporter) return self as result, + member procedure print_comment(self in out nocopy ut_tap_reporter, a_comment clob), + member function escape_special_chars(self in out nocopy ut_tap_reporter, a_string_to_escape clob) return clob, + overriding member procedure before_calling_suite(self in out nocopy ut_tap_reporter, a_suite ut_logical_suite), + + overriding member procedure after_calling_test(self in out nocopy ut_tap_reporter, a_test ut_test), + + overriding member procedure after_calling_before_all (self in out nocopy ut_tap_reporter, a_executable in ut_executable), + overriding member procedure after_calling_after_all (self in out nocopy ut_tap_reporter, a_executable in ut_executable), + overriding member procedure before_calling_run(self in out nocopy ut_tap_reporter, a_run in ut_run), + overriding member procedure after_calling_suite(self in out nocopy ut_tap_reporter, a_suite ut_logical_suite), + overriding member procedure after_calling_run(self in out nocopy ut_tap_reporter, a_run in ut_run) + +) +not final +/ diff --git a/source/reporters/ut_teamcity_reporter.tpb b/source/reporters/ut_teamcity_reporter.tpb index e05dc994f..2e09c7103 100644 --- a/source/reporters/ut_teamcity_reporter.tpb +++ b/source/reporters/ut_teamcity_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_teamcity_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_teamcity_reporter.tps b/source/reporters/ut_teamcity_reporter.tps index e03fa3643..e5c43b59e 100644 --- a/source/reporters/ut_teamcity_reporter.tps +++ b/source/reporters/ut_teamcity_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_teamcity_reporter under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_teamcity_reporter_helper.pkb b/source/reporters/ut_teamcity_reporter_helper.pkb index 1633d10aa..575af645d 100644 --- a/source/reporters/ut_teamcity_reporter_helper.pkb +++ b/source/reporters/ut_teamcity_reporter_helper.pkb @@ -1,7 +1,7 @@ create or replace package body ut_teamcity_reporter_helper is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_teamcity_reporter_helper.pks b/source/reporters/ut_teamcity_reporter_helper.pks index d7fa86cdc..727d02913 100644 --- a/source/reporters/ut_teamcity_reporter_helper.pks +++ b/source/reporters/ut_teamcity_reporter_helper.pks @@ -1,7 +1,7 @@ create or replace package ut_teamcity_reporter_helper is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_tfs_junit_reporter.tpb b/source/reporters/ut_tfs_junit_reporter.tpb index 5e36aad17..8c2bd6333 100644 --- a/source/reporters/ut_tfs_junit_reporter.tpb +++ b/source/reporters/ut_tfs_junit_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_tfs_junit_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_tfs_junit_reporter.tps b/source/reporters/ut_tfs_junit_reporter.tps index 61cbc3fd8..3af2226a5 100644 --- a/source/reporters/ut_tfs_junit_reporter.tps +++ b/source/reporters/ut_tfs_junit_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_tfs_junit_reporter under ut_output_reporter_base( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_xunit_reporter.tpb b/source/reporters/ut_xunit_reporter.tpb index 4612fb640..164703917 100644 --- a/source/reporters/ut_xunit_reporter.tpb +++ b/source/reporters/ut_xunit_reporter.tpb @@ -1,7 +1,7 @@ create or replace type body ut_xunit_reporter is /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/reporters/ut_xunit_reporter.tps b/source/reporters/ut_xunit_reporter.tps index 6c530fee4..970e4d162 100644 --- a/source/reporters/ut_xunit_reporter.tps +++ b/source/reporters/ut_xunit_reporter.tps @@ -1,7 +1,7 @@ create or replace type ut_xunit_reporter under ut_junit_reporter( /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/set_install_params.sql b/source/set_install_params.sql index 34a23dc93..b559b8023 100644 --- a/source/set_install_params.sql +++ b/source/set_install_params.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/uninstall.sql b/source/uninstall.sql index ced7b8dc4..712845fb7 100644 --- a/source/uninstall.sql +++ b/source/uninstall.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/uninstall_all.sql b/source/uninstall_all.sql index cfaaaa29f..d3d3f3fbe 100644 --- a/source/uninstall_all.sql +++ b/source/uninstall_all.sql @@ -1,6 +1,6 @@ /* utPLSQL - Version 3 - Copyright 2016 - 2021 utPLSQL Project + Copyright 2016 - 2026 utPLSQL Project Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. diff --git a/source/uninstall_coverage_tables.sql b/source/uninstall_coverage_tables.sql index 890aa7090..df3c19627 100644 --- a/source/uninstall_coverage_tables.sql +++ b/source/uninstall_coverage_tables.sql @@ -1,3 +1,20 @@ +/* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + set echo off set feedback off begin diff --git a/source/uninstall_objects.sql b/source/uninstall_objects.sql index dde9a824f..8ef644aa9 100644 --- a/source/uninstall_objects.sql +++ b/source/uninstall_objects.sql @@ -1,3 +1,20 @@ +/* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + set echo off declare procedure drop_if_exists(a_object_type varchar2, a_object_name varchar2) is @@ -273,6 +290,8 @@ drop type ut_stack force; drop sequence ut_savepoint_seq; +drop type ut_tap_reporter force; + drop type ut_documentation_reporter force; drop type ut_debug_reporter force; diff --git a/source/uninstall_synonyms.sql b/source/uninstall_synonyms.sql index 2c96c03a4..4a12340f6 100644 --- a/source/uninstall_synonyms.sql +++ b/source/uninstall_synonyms.sql @@ -1,3 +1,20 @@ +/* + utPLSQL - Version 3 + Copyright 2016 - 2026 utPLSQL Project + + Licensed under the Apache License, Version 2.0 (the "License"): + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + set echo off set feedback off declare diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 04f51fb3c..1719f137a 100755 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -1,9 +1,11 @@ #!/bin/bash set -ev +. ./development/env.sh + #goto git root directory git rev-parse && cd "$(git rev-parse --show-cdup)" cd test -time . ./${DIR}/install_tests.sh -time . ./${DIR}/run_tests.sh +time . ./install_tests.sh +time . ./run_tests.sh diff --git a/test/install_ut3_user_tests.sql b/test/install_ut3_user_tests.sql index ad7f014bc..518e07841 100644 --- a/test/install_ut3_user_tests.sql +++ b/test/install_ut3_user_tests.sql @@ -43,6 +43,7 @@ set define off @@ut3_user/reporters/test_documentation_reporter.pks @@ut3_user/reporters/test_debug_reporter.pks @@ut3_user/reporters/test_realtime_reporter.pks +@@ut3_user/reporters/test_tap_reporter.pks @@ut3_user/reporters/test_coverage.pks @@ut3_user/reporters/test_coverage/test_coverage_standalone.pks set define on @@ -86,6 +87,7 @@ set define off @@ut3_user/reporters/test_documentation_reporter.pkb @@ut3_user/reporters/test_debug_reporter.pkb @@ut3_user/reporters/test_realtime_reporter.pkb +@@ut3_user/reporters/test_tap_reporter.pkb @@ut3_user/reporters/test_coverage/test_coverage_standalone.pkb set define on @@ut3_user/reporters/test_coverage/test_extended_coverage.pkb diff --git a/test/run_tests.sh b/test/run_tests.sh index 118bab920..7d0431aec 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -4,7 +4,9 @@ set -ev #goto git root directory git rev-parse && cd "$(git rev-parse --show-cdup)" -time utPLSQL-cli/bin/utplsql run UT3_TESTER_HELPER/ut3@${CONNECTION_STR} \ +export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 + +time utPLSQL-cli/bin/utplsql run UT3_TESTER_HELPER/ut3@//${CONNECTION_STR} -D \ -source_path=source -owner=ut3_develop \ -p='ut3_tester,ut3_user' \ -test_path=test -c \ diff --git a/test/ut3_tester/core/annotations/test_annotation_parser.pkb b/test/ut3_tester/core/annotations/test_annotation_parser.pkb index bc789c377..beb526863 100644 --- a/test/ut3_tester/core/annotations/test_annotation_parser.pkb +++ b/test/ut3_tester/core/annotations/test_annotation_parser.pkb @@ -1,27 +1,28 @@ create or replace package body test_annotation_parser is procedure test_proc_comments is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; - begin - l_source := 'PACKAGE test_tt AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - -- %ann1(Name of suite) - -- wrong line - -- %ann2(some_value) - procedure foo; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' -- %ann1(Name of suite)' || chr(10), + ' -- wrong line' || chr(10), + ' -- %ann2(some_value)' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert - l_expected := ut3_develop.ut_annotations( ut3_develop.ut_annotation(2,'suite',null, null), ut3_develop.ut_annotation(3,'displayname','Name of suite',null), @@ -34,30 +35,33 @@ create or replace package body test_annotation_parser is end; procedure include_floating_annotations is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - -- %ann1(Name of suite) - -- %ann2(all.globaltests) - - --%test - procedure foo; - - -- %ann3(Name of suite) - -- %ann4(all.globaltests) - - --%test - procedure bar; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' -- %ann1(Name of suite)' || chr(10), + ' -- %ann2(all.globaltests)' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' procedure foo;' || chr(10), + '' || chr(10), + ' -- %ann3(Name of suite)' || chr(10), + ' -- %ann4(all.globaltests)' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' procedure bar;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -77,40 +81,41 @@ create or replace package body test_annotation_parser is end; procedure parse_complex_with_functions is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - --%test - procedure foo; - - - --%beforeeach - procedure foo2; - - --test comment - -- wrong comment - - - /* - describtion of the procedure - */ - --%beforeeach(key=testval) - PROCEDURE foo3(a_value number default null); - - --%all - function foo4(a_val number default null - , a_par varchar2 default := ''asdf''); - END;'; + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' procedure foo;' || chr(10), + '' || chr(10), + '' || chr(10), + ' --%beforeeach' || chr(10), + ' procedure foo2;' || chr(10), + '' || chr(10), + ' --test comment' || chr(10), + ' -- wrong comment' || chr(10), + '' || chr(10), + '' || chr(10), + '/*' || chr(10), + ' describtion of the procedure' || chr(10), + ' */' || chr(10), + ' --%beforeeach(key=testval)' || chr(10), + ' PROCEDURE foo3(a_value number default null);' || chr(10), + '' || chr(10), + ' --%all' || chr(10), + ' function foo4(a_val number default null' || chr(10), + ' , a_par varchar2 default := ''asdf'');' || chr(10), + 'END;')); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -128,21 +133,24 @@ create or replace package body test_annotation_parser is end; procedure no_procedure_annotation is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - procedure foo; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -156,21 +164,24 @@ create or replace package body test_annotation_parser is end; procedure parse_accessible_by is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt accessible by (foo) AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - procedure foo; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt accessible by (foo) AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -184,24 +195,27 @@ create or replace package body test_annotation_parser is end; procedure complex_package_declaration is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt - ACCESSIBLE BY (calling_proc) - authid current_user - AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - procedure foo; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt' || chr(10), + ' ACCESSIBLE BY (calling_proc)' || chr(10), + ' authid current_user' || chr(10), + ' AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -215,21 +229,24 @@ create or replace package body test_annotation_parser is end; procedure complex_text is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %suite - --%displayname(name = Name of suite) - -- %suitepath(key=all.globaltests,key2=foo,"--%some text") - - procedure foo; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' --%displayname(name = Name of suite)' || chr(10), + ' -- %suitepath(key=all.globaltests,key2=foo,"--%some text")' || chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -243,26 +260,29 @@ create or replace package body test_annotation_parser is end; procedure ignore_annotations_in_comments is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - /* - Some comment - -- inlined - -- %ignored - */ - -- %suite - --%displayname(Name of suite) - -- %suitepath(all.globaltests) - - procedure foo; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' /*' || chr(10), + ' Some comment' || chr(10), + ' -- inlined' || chr(10), + ' -- %ignored' || chr(10), + ' */' || chr(10), + ' -- %suite' || chr(10), + ' --%displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -311,17 +331,19 @@ v58yvbLAXLi9gYHwoIvAgccti+Cmpg0DKLY= end; procedure brackets_in_desc is - - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %suite(Name of suite (including some brackets) and some more text) -END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite(Name of suite (including some brackets) and some more text)' || chr(10), + 'END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -332,24 +354,27 @@ END;'; end; procedure test_space_before_annot_params is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; - l_expected ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - /* - Some comment - -- inlined - */ - -- %suite - -- %suitepath (all.globaltests) - - procedure foo; -END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' /*' || chr(10), + ' Some comment' || chr(10), + ' -- inlined' || chr(10), + ' */' || chr(10), + ' -- %suite' || chr(10), + ' -- %suitepath (all.globaltests)'|| chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + 'END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -362,18 +387,21 @@ END;'; procedure test_windows_newline as - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %suite - -- %displayname(Name of suite)' || chr(13) || chr(10) - || ' -- %suitepath(all.globaltests) - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(13) || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -387,21 +415,24 @@ END;'; procedure test_annot_very_long_name as - l_source clob; - l_actual ut3_develop.ut_annotations; - l_expected ut3_develop.ut_annotations; + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_did_it AS - -- %suite - -- %displayname(Name of suite) - -- %suitepath(all.globaltests) - - --%test - procedure very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_dit_it; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_did_it AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(Name of suite)' || chr(10), + ' -- %suitepath(all.globaltests)' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' procedure very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_dit_it;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -415,30 +446,33 @@ END;'; end; procedure test_upper_annot is - l_source clob; + l_source dbms_preprocessor.source_lines_t; l_actual ut3_develop.ut_annotations; l_expected ut3_develop.ut_annotations; begin - l_source := 'PACKAGE test_tt AS - -- %SUITE - -- %DISPLAYNAME(Name of suite) - -- %SUITEPATH(all.globaltests) - - -- %ANN1(Name of suite) - -- %ANN2(all.globaltests) - - --%TEST - procedure foo; - - -- %ANN3(Name of suite) - -- %ANN4(all.globaltests) - - --%TEST - procedure bar; - END;'; + --Arrange + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %SUITE' || chr(10), + ' -- %DISPLAYNAME(Name of suite)' || chr(10), + ' -- %SUITEPATH(all.globaltests)' || chr(10), + '' || chr(10), + ' -- %ANN1(Name of suite)' || chr(10), + ' -- %ANN2(all.globaltests)' || chr(10), + '' || chr(10), + ' --%TEST' || chr(10), + ' procedure foo;' || chr(10), + '' || chr(10), + ' -- %ANN3(Name of suite)' || chr(10), + ' -- %ANN4(all.globaltests)' || chr(10), + '' || chr(10), + ' --%TEST' || chr(10), + ' procedure bar;' || chr(10), + ' END;' || chr(10) + )); --Act - l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source); + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); --Assert l_expected := ut3_develop.ut_annotations( @@ -457,5 +491,414 @@ END;'; end; + ------------------------------------------------------------ + -- replace_multiline_comments coverage tests + ------------------------------------------------------------ + + procedure test_rmc_empty_source is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result.count).to_equal(0); + end; + + procedure test_rmc_no_ml_comment_marker is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'procedure foo is' || chr(10), + 'begin' || chr(10), + ' null;' || chr(10), + 'end;' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(ut3_tester_helper.main_helper.lines_to_str(l_result)).to_equal(ut3_tester_helper.main_helper.lines_to_str(l_input)); + end; + + procedure test_rmc_line_inside_ml_comment is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'x := 1; /* start' || chr(10), + 'this whole line is comment' || chr(10), + 'end comment */ x := 2;' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('x := 1; ' || chr(10)); + ut.expect(l_result(2)).to_equal(''); + ut.expect(l_result(3)).to_equal(' x := 2;' || chr(10)); + end; + + procedure test_rmc_ml_comment_closed_midline is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + '/* open' || chr(10), + 'still inside' || chr(10), + '*/ code /* remove this too */ kept' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(2)).to_equal(''); + ut.expect(l_result(3)).to_equal(' code kept' || chr(10)); + end; + + procedure test_rmc_fast_path_no_tokens is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + -- line 2 has none of / - ' so hits fast path B; line 1 needed to pass pre-scan + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + '/* comment */' || chr(10), + 'begin' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(2)).to_equal('begin' || chr(10)); + end; + + procedure test_rmc_ml_comment_single_line is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'x := /* inline comment */ 42;' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('x := 42;' || chr(10)); + end; + + procedure test_rmc_single_line_comment_preserved is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + '/* marker */' || chr(10), + ' -- %test annotation' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(2)).to_equal(' -- %test annotation' || chr(10)); + end; + + procedure test_rmc_string_literal_protects_markers is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'v := ''val /* not a comment */ here'';' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('v := ''val /* not a comment */ here'';' || chr(10)); + end; + + procedure test_rmc_string_literal_escaped_quotes is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'v := ''it''''s a /* test */'';' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('v := ''it''''s a /* test */'';' || chr(10)); + end; + + procedure test_rmc_q_quoted_string_literal is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'v := q''[/* not a comment */]'';' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('v := q''[/* not a comment */]'';' || chr(10)); + end; + + procedure test_rmc_unclosed_string_literal is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'v := ''hello /* inside unclosed' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('v := ''hello /* inside unclosed' || chr(10)); + end; + + procedure test_rmc_unclosed_q_string is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + c_line constant varchar2(100) := q'(v := q'[/* unclosed q-string)' || chr(10); + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list(c_line)); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal(c_line); + end; + + procedure test_rmc_multiple_ml_comments_one_line is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'a /* one */ := /* two */ 1;' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('a := 1;' || chr(10)); + end; + + procedure test_rmc_comment_after_string_with_slash is + l_input dbms_preprocessor.source_lines_t; + l_result dbms_preprocessor.source_lines_t; + begin + --Arrange + l_input := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'v := ''a/b''; -- this is /* not */ a ml comment' || chr(10) + )); + + --Act + l_result := ut3_develop.ut_utils.replace_multiline_comments(l_input); + + --Assert + ut.expect(l_result(1)).to_equal('v := ''a/b''; -- this is /* not */ a ml comment' || chr(10)); + end; + + procedure test_multiline_proc_header_lines is + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; + begin + --Arrange + -- procedure header spans multiple lines before terminating ; + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' procedure foo(' || chr(10), + ' a_param1 varchar2' || chr(10), + ' ,a_param2 number default null' || chr(10), + ' );' || chr(10), + ' END;' || chr(10) + )); + + --Act + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); + + --Assert + l_expected := ut3_develop.ut_annotations( + ut3_develop.ut_annotation( 2, 'suite', null, null ), + ut3_develop.ut_annotation( 4, 'test', null, 'foo' ) + ); + + ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected)); + end; + + procedure test_non_comment_line_resets_block_lines is + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; + begin + --Arrange + -- a non-comment non-proc line between annotation and procedure breaks the association + -- %test becomes a floating top-level annotation with no subobject + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' pragma serially_reusable;' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); + + --Act + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); + + --Assert + -- %test is NOT associated with foo β€” accumulator was reset by pragma line + -- it surfaces as a top-level annotation with no subobject_name + l_expected := ut3_develop.ut_annotations( + ut3_develop.ut_annotation( 2, 'suite', null, null ), + ut3_develop.ut_annotation( 4, 'test', null, null ) + ); + + ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected)); + end; + + procedure test_annotation_not_at_line_start_ignored_lines is + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; + begin + --Arrange + -- code before -- means it is not at start of line and must be ignored + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' x := 1; -- %not_an_annotation' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); + + --Act + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); + + --Assert + l_expected := ut3_develop.ut_annotations( + ut3_develop.ut_annotation( 2, 'suite', null, null ) + ); + + ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected)); + end; + + procedure test_whitespace_line_between_comment_and_proc_lines is + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; + begin + --Arrange + -- space-only line between annotation comment and procedure declaration is tolerated + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + '' || chr(10), + ' --%test' || chr(10), + ' ' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); + + --Act + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); + + --Assert + l_expected := ut3_develop.ut_annotations( + ut3_develop.ut_annotation( 2, 'suite', null, null ), + ut3_develop.ut_annotation( 4, 'test', null, 'foo' ) + ); + + ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected)); + end; + + procedure test_space_between_dashes_and_qualifier_lines is + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; + begin + --Arrange + -- spaces between -- and % are skipped and annotation is still recognised + -- annotations are not adjacent to a procedure so they are top-level + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- %displayname(my suite)' || chr(10), + '' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); + + --Act + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); + + --Assert + l_expected := ut3_develop.ut_annotations( + ut3_develop.ut_annotation( 2, 'suite', null, null ), + ut3_develop.ut_annotation( 3, 'displayname', 'my suite', null ) + ); + + ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected)); + end; + + procedure test_percent_not_after_dashes_ignored_lines is + l_source dbms_preprocessor.source_lines_t; + l_actual ut3_develop.ut_annotations; + l_expected ut3_develop.ut_annotations; + begin + --Arrange + -- -- present and % present on line but % is not immediately after -- + -- e.g. a regular comment that happens to mention 100% + l_source := ut3_tester_helper.main_helper.make_source(ut3_develop.ut_varchar2_list( + 'PACKAGE test_tt AS' || chr(10), + ' -- %suite' || chr(10), + ' -- coverage is 100% on this module' || chr(10), + ' procedure foo;' || chr(10), + ' END;' || chr(10) + )); + + --Act + l_actual := ut3_develop.ut_annotation_parser.parse_object_annotations(l_source, 'PACKAGE'); + + --Assert + l_expected := ut3_develop.ut_annotations( + ut3_develop.ut_annotation( 2, 'suite', null, null ) + ); + + ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected)); + end; + end test_annotation_parser; -/ +/ \ No newline at end of file diff --git a/test/ut3_tester/core/annotations/test_annotation_parser.pks b/test/ut3_tester/core/annotations/test_annotation_parser.pks index a4fe3ed70..c61c14d3a 100644 --- a/test/ut3_tester/core/annotations/test_annotation_parser.pks +++ b/test/ut3_tester/core/annotations/test_annotation_parser.pks @@ -19,24 +19,57 @@ create or replace package test_annotation_parser is procedure complex_text; --%test(Ignores content of multi-line comments) procedure ignore_annotations_in_comments; - - --%test(Ignores wrapped package and does not raise exception) + -- %test(ignore wrapped package source) procedure ignore_wrapped_package; - --%test(Parses package level annotations with annotation params containing brackets) procedure brackets_in_desc; - --%test(Parses annotation text even with spaces before brackets) procedure test_space_before_annot_params; - -- %test(Parses source-code with Windows-style newline) procedure test_windows_newline; - - -- %test(Parses annotations with very long object names) + -- %test(parse annotations with very long procedure name) procedure test_annot_very_long_name; - -- %test(Parses upper case annotations) procedure test_upper_annot; + -- %test(empty source returns immediately without processing) + procedure test_rmc_empty_source; + -- %test(source with no multiline comment markers returned unchanged) + procedure test_rmc_no_ml_comment_marker; + -- %test(line entirely inside multiline comment is blanked) + procedure test_rmc_line_inside_ml_comment; + -- %test(closing delimiter mid-line falls through to scan remainder) + procedure test_rmc_ml_comment_closed_midline; + -- %test(fast path line with no slash dash or quote copied unchanged) + procedure test_rmc_fast_path_no_tokens; + -- %test(single-line block comment removed on same line) + procedure test_rmc_ml_comment_single_line; + -- %test(single-line comment preserved intact) + procedure test_rmc_single_line_comment_preserved; + -- %test(string literal containing comment markers not stripped) + procedure test_rmc_string_literal_protects_markers; + -- %test(string literal with escaped quotes handled correctly) + procedure test_rmc_string_literal_escaped_quotes; + -- %test(q-quoted string literal protects interior comment markers) + procedure test_rmc_q_quoted_string_literal; + -- %test(unclosed string literal copies remainder and exits scan) + procedure test_rmc_unclosed_string_literal; + -- %test(unclosed q-quoted string copies remainder and exits scan) + procedure test_rmc_unclosed_q_string; + -- %test(multiple block comments on single line all removed) + procedure test_rmc_multiple_ml_comments_one_line; + -- %test(comment markers after string with slash handled correctly) + procedure test_rmc_comment_after_string_with_slash; + --%test(Procedure header spanning multiple lines is handled correctly) + procedure test_multiline_proc_header_lines; + --%test(Non-comment line between annotation and procedure resets association) + procedure test_non_comment_line_resets_block_lines; + --%test(Comment with non-whitespace before dashes is not treated as annotation) + procedure test_annotation_not_at_line_start_ignored_lines; + --%test(Spaces between dashes and annotation qualifier are skipped correctly) + procedure test_space_between_dashes_and_qualifier_lines; + --%test(Percent sign not immediately after dashes is not treated as annotation) + procedure test_percent_not_after_dashes_ignored_lines; + end test_annotation_parser; -/ +/ \ No newline at end of file diff --git a/test/ut3_tester/core/test_suite_manager.pks b/test/ut3_tester/core/test_suite_manager.pks index ac7818f4f..44f102716 100644 --- a/test/ut3_tester/core/test_suite_manager.pks +++ b/test/ut3_tester/core/test_suite_manager.pks @@ -163,7 +163,7 @@ create or replace package test_suite_manager is --%context(get_schema_ut_packages) - --%test(returns list of all unit test packages in given schema) + --%test(returns list of all unit test packages in given schema excluding packages that are not suites) --%beforetest(create_ut3_suite) --%aftertest(drop_ut3_suite) procedure test_get_schema_ut_packages; diff --git a/test/ut3_tester/core/test_ut_utils.pkb b/test/ut3_tester/core/test_ut_utils.pkb index 433987c01..4dc10492b 100644 --- a/test/ut3_tester/core/test_ut_utils.pkb +++ b/test/ut3_tester/core/test_ut_utils.pkb @@ -375,8 +375,8 @@ end;'; procedure replace_multiline_comments is l_source clob; - l_actual clob; - l_expected clob; + l_actual dbms_preprocessor.source_lines_t; + l_expected dbms_preprocessor.source_lines_t; begin --Arrange l_source := q'[ @@ -390,11 +390,11 @@ create or replace package dummy as gv_text2 varchar2(200) := '/* multi-line comment in a multi-line string*/'; - -- ignored start of multi-line comment with multi-byte text οΏ½ /* - -- ignored end of multi-line comment with multi-byte text οΏ½ */ + -- ignored start of multi-line comment with multi-byte text ☺ /* + -- ignored end of multi-line comment with multi-byte text ☺ */ /* multi-line comment with - multi-byte characters οΏ½οΏ½οΏ½ + multi-byte characters ☺☺☺ in it */ gv_text3 varchar2(200) := 'some text'; /* multiline comment*/ --followed by single-line comment /* multi-line comment in one line*/ @@ -403,7 +403,14 @@ create or replace package dummy as string*/}'; end; ]'; - l_expected := q'[ + + --Act + l_actual := ut3_develop.ut_utils.replace_multiline_comments( + ut3_tester_helper.main_helper.make_source( ut3_develop.ut_utils.clob_to_table(l_source) ) + ); + + --Assert + l_expected := ut3_tester_helper.main_helper.make_source( ut3_develop.ut_utils.clob_to_table( q'[ create or replace package dummy as -- single line comment with disabled /* multi-line comment */ @@ -414,8 +421,8 @@ create or replace package dummy as gv_text2 varchar2(200) := '/* multi-line comment in a multi-line string*/'; - -- ignored start of multi-line comment with multi-byte text οΏ½ /* - -- ignored end of multi-line comment with multi-byte text οΏ½ */ + -- ignored start of multi-line comment with multi-byte text ☺ /* + -- ignored end of multi-line comment with multi-byte text ☺ */ ]'||q'[ @@ -426,11 +433,9 @@ create or replace package dummy as in escaped q'multi-line string*/}'; end; -]'; +]' ) ); --Act - l_actual := ut3_develop.ut_utils.replace_multiline_comments(l_source); - --Assert - ut.expect(l_actual).to_equal(l_expected); + ut.expect(ut3_tester_helper.main_helper.lines_to_str(l_actual)).to_equal(ut3_tester_helper.main_helper.lines_to_str(l_expected)); end; procedure int_conv_ds_sec is diff --git a/test/ut3_tester_helper/main_helper.pkb b/test/ut3_tester_helper/main_helper.pkb index f1dadec66..f60ce796c 100644 --- a/test/ut3_tester_helper/main_helper.pkb +++ b/test/ut3_tester_helper/main_helper.pkb @@ -155,6 +155,24 @@ create or replace package body main_helper is begin ut3_develop.ut_session_context.clear_all_context; end; + + function lines_to_str(a_lines dbms_preprocessor.source_lines_t) return varchar2 is + l_result varchar2(32767); + begin + for i in 1 .. a_lines.count loop + l_result := l_result || a_lines(i); + end loop; + return l_result; + end; + + function make_source(a_lines ut3_develop.ut_varchar2_list) return dbms_preprocessor.source_lines_t is + l_result dbms_preprocessor.source_lines_t; + begin + for i in 1 .. a_lines.count loop + l_result(i) := a_lines(i); + end loop; + return l_result; + end; end; / diff --git a/test/ut3_tester_helper/main_helper.pks b/test/ut3_tester_helper/main_helper.pks index 7decad88d..71575e145 100644 --- a/test/ut3_tester_helper/main_helper.pks +++ b/test/ut3_tester_helper/main_helper.pks @@ -47,5 +47,9 @@ create or replace package main_helper is procedure clear_ut_run_context; + function lines_to_str(a_lines dbms_preprocessor.source_lines_t) return varchar2; + + function make_source(a_lines ut3_develop.ut_varchar2_list) return dbms_preprocessor.source_lines_t; + end; / diff --git a/test/ut3_tester_helper/run_helper.pkb b/test/ut3_tester_helper/run_helper.pkb index 6289b1642..9d65d6667 100644 --- a/test/ut3_tester_helper/run_helper.pkb +++ b/test/ut3_tester_helper/run_helper.pkb @@ -855,12 +855,23 @@ create or replace package body run_helper is --%test procedure some_test; + end;]'; + execute immediate q'[ + create or replace package ut3_develop.package_that_is_not_a_test + as + --%parameter(a comment inside) + --%parameters( description ) + + --%test + procedure some_test; + end;]'; end; procedure drop_ut3_suite is pragma autonomous_transaction; begin + execute immediate q'[drop package ut3_develop.package_that_is_not_a_test]'; execute immediate q'[drop package ut3_develop.some_test_package]'; end; diff --git a/test/ut3_user/api/test_ut_runner.pkb b/test/ut3_user/api/test_ut_runner.pkb index b6b7c67e7..d665718e1 100644 --- a/test/ut3_user/api/test_ut_runner.pkb +++ b/test/ut3_user/api/test_ut_runner.pkb @@ -393,7 +393,8 @@ end;'; select 'UT3_DEVELOP.UT_SONAR_TEST_REPORTER', 'Y' from dual union all select 'UT3_DEVELOP.UT_TEAMCITY_REPORTER', 'Y' from dual union all select 'UT3_DEVELOP.UT_TFS_JUNIT_REPORTER', 'Y' from dual union all - select 'UT3_DEVELOP.UT_XUNIT_REPORTER', 'Y' from dual + select 'UT3_DEVELOP.UT_XUNIT_REPORTER', 'Y' from dual union all + select 'UT3_DEVELOP.UT_TAP_REPORTER', 'Y' from dual order by 1; --Act open l_actual for select * from table(ut3_develop.ut_runner.GET_REPORTERS_LIST()) order by 1; diff --git a/test/ut3_user/expectations/test_expectations_cursor.pkb b/test/ut3_user/expectations/test_expectations_cursor.pkb index 847cce9a0..a4ef4e8f2 100644 --- a/test/ut3_user/expectations/test_expectations_cursor.pkb +++ b/test/ut3_user/expectations/test_expectations_cursor.pkb @@ -2950,5 +2950,47 @@ Rows: [ 2 differences ] ); end; + procedure cr_joinby_compare_issue_1293 is + l_actual sys_refcursor; + l_expected sys_refcursor; + begin + --Arrange + open l_expected for + select 'FOO' username, 12 from dual union all + select 'TEST' username, -600 user_id from dual + order by 1 desc; + open l_actual for + select 'FOO' username, 12 from dual union all + select 'TEST' username, -600 user_id from dual union all + -- DUPLICATE!!! + select 'TEST' username, -600 user_id from dual + order by 1 asc; + --Act + ut3_develop.ut.expect(l_actual).to_equal(l_expected).join_by('USERNAME'); + --Assert + ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0); + end; + + procedure cr_not_joinby_comp_issue_1293 is + l_actual sys_refcursor; + l_expected sys_refcursor; + begin + --Arrange + open l_expected for + select 'FOO' username, 12 from dual union all + select 'TEST' username, -600 user_id from dual + order by 1 desc; + open l_actual for + select 'FOO' username, 12 from dual union all + select 'TEST' username, -600 user_id from dual union all + -- DUPLICATE!!! + select 'TEST' username, -600 user_id from dual + order by 1 asc; + --Act + ut3_develop.ut.expect(l_actual).to_equal(l_expected); + --Assert + ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0); + end; + end; / diff --git a/test/ut3_user/expectations/test_expectations_cursor.pks b/test/ut3_user/expectations/test_expectations_cursor.pks index 0f34486a9..8cceb5e01 100644 --- a/test/ut3_user/expectations/test_expectations_cursor.pks +++ b/test/ut3_user/expectations/test_expectations_cursor.pks @@ -485,5 +485,11 @@ create or replace package test_expectations_cursor is --%test( Multiple failures reported correctly - Issue #998 ) procedure multiple_cursor_expectations; + --%test( Compares cursors with duplicate rows using join by - Issue #1293 ) + procedure cr_joinby_compare_issue_1293; + + --%test( Compares cursors with duplicate rows - Issue #1293 ) + procedure cr_not_joinby_comp_issue_1293; + end; / diff --git a/test/ut3_user/reporters/test_documentation_reporter.pkb b/test/ut3_user/reporters/test_documentation_reporter.pkb index 2a05679ff..016cec256 100644 --- a/test/ut3_user/reporters/test_documentation_reporter.pkb +++ b/test/ut3_user/reporters/test_documentation_reporter.pkb @@ -34,7 +34,6 @@ Failures: "Fails as values are different" Actual: 'number [1] ' (varchar2) was expected to equal: 'number [2] ' (varchar2)% at "UT3_USER.TEST_REPORTERS%", line 36 ut3_develop.ut.expect('number [1] ','Fails as values are different').to_equal('number [2] '); -% % 2) erroring_test ORA-06502: PL/SQL: %: character to number conversion error diff --git a/test/ut3_user/reporters/test_realtime_reporter.pkb b/test/ut3_user/reporters/test_realtime_reporter.pkb index 2dafa71d0..84053c3c9 100644 --- a/test/ut3_user/reporters/test_realtime_reporter.pkb +++ b/test/ut3_user/reporters/test_realtime_reporter.pkb @@ -408,7 +408,7 @@ create or replace package body test_realtime_reporter as from table(g_events) t where t.event_doc.extract('/event[@type="post-test"]/test/@id').getstringval() = 'realtime_reporting.check_realtime_reporting3.test_6_with_runtime_error'; - ut3_tester_helper.main_helper.append_to_list(l_expected_list, ''); l_expected := ut3_tester_helper.main_helper.table_to_clob(l_expected_list); diff --git a/test/ut3_user/reporters/test_tap_reporter.pkb b/test/ut3_user/reporters/test_tap_reporter.pkb new file mode 100644 index 000000000..786c53ee0 --- /dev/null +++ b/test/ut3_user/reporters/test_tap_reporter.pkb @@ -0,0 +1,254 @@ +create or replace package body test_tap_reporter as + + gc_boilerplate_suitepath_expression constant varchar2(300) := 'TAP version 14\s*1..1\s*# Subtest: org\s{5}1..1\s{5}# Subtest: utplsql\s{9}1..1\s{9}# Subtest: tests\s{13}1..1\s{13}# Subtest: helpers\s{17}1..1\s{17}# Subtest: A suite for testing different outcomes from reporters'; + + + procedure compile_tests as + pragma autonomous_transaction; + begin + + execute immediate q'[ + create or replace package test_tap_escaping as + --%suite(Some \ and # to be escaped) + + --%test(Even more \\ and multiple ###) + procedure more_escaping; + + --%test(Disabled test) + --%disabled(With \ and # in skip reason) + procedure not_skipping_escapes; + + --%test(Escaped Comments) + procedure escaped_comments; + + --%context(Some context) + + --%test(Another disabled test) + --%disabled + procedure another_disabled_test; + + --%endcontext + end test_tap_escaping; + ]'; + + execute immediate q'[ + create or replace package body test_tap_escaping as + + procedure more_escaping as + begin + ut.expect(1).to_equal(1); + end more_escaping; + + + procedure not_skipping_escapes as + begin + ut.expect(10).to_equal(1); + end not_skipping_escapes; + + procedure escaped_comments as + begin + dbms_output.put_line('This \ and # should not be escaped, and this not as well!!!'); + ut.expect(1).to_equal(1); + end escaped_comments; + + procedure another_disabled_test as + begin + ut.expect(10).to_equal(1); + end; + end test_tap_escaping; + ]'; + + end compile_tests; + + + procedure simple_succeeding_test as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := gc_boilerplate_suitepath_expression || '\s{21}1..1\s{21}# \s{21}# Subtest: A description of some context\s{25}1..1\s{25}ok - passing_test\s{25}# \s{25}# \s{25}# \s{25}# \s{25}# \s{21}# \sok - org\s*'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.passing_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected); + end simple_succeeding_test; + + procedure simple_failing_test as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# \s{21}not ok - a test with failing assertion\s{23}---\s{23}message: '"Fails as values are different"'\s{23}severity: fail\s{23}...\s{21}# \s{21}# \s{21}# \s{21}# \snot ok - org\s*]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.failing_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected); + end simple_failing_test; + + + procedure simple_erroring_test as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# \s{21}not ok - a test raising unhandled exception\s{23}---\s{23}message: |\s{25ORA-06502: .*\s{25}ORA-06512: at line [[:digit:]]+\s{23}severity: error\s{23}...\s{21}# \s{21}# \s{21}# \s{21}# \snot ok - org\s*]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.erroring_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected); + end simple_erroring_test; + + + procedure disabled_test as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# \s{21}ok - a disabled test # SKIP: Disabled for testing purpose\s{21}# \sok - org\s*]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.disabled_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected); + end disabled_test; + + + procedure disabled_test_no_description as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := gc_boilerplate_suitepath_expression || q'[\s{21}1..1\s{21}# \s{21}ok - a disabled test with no reason # SKIP\s{21}# \sok - org\s*]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.disabled_test_no_reason',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected); + end disabled_test_no_description; + + + procedure multiple_tests_different_outcome as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[TAP version 14\s*1..1\s*# Subtest: org.*# Subtest: A suite.*\s{21}1..5\s{21}# \s{21}# Subtest: A desc.*\s{25}1..1\s{25}ok - passing_test\s{25}# \s{25}# \s{21}not ok - a test w.*\s{23}---\s{23}message:.*\s{21}# .*\s{21}# not ok - a test rai.*\s{23}---\s{23}message: |.*ok - a disabled test # SKIP: Disabled for testing purpose.*ok - a dis.* # SKIP\s{21}# \snot ok - org\s*]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected, 'n'); + end multiple_tests_different_outcome; + + + procedure escape_suite_name as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[%# Subtest: Some \\ and \# to be escaped%ok - Some \\ and \# to be escaped%]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_tap_escaping.more_escaping',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected); + end escape_suite_name; + + + procedure escape_multiple_characters_test_name as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[%ok - Even more \\\\ and multiple \#\#\#%]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_tap_escaping.more_escaping',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected); + end escape_multiple_characters_test_name; + + + procedure special_characters_in_disabled_reason as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[%ok - Disabled test # SKIP: With \\ and \# in skip reason%]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_tap_escaping.not_skipping_escapes',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected); + end special_characters_in_disabled_reason; + + + procedure special_characters_in_comment as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[%ok - Escaped Comments%# This \ and # should not be escaped, and this not as well!!!%]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_tap_escaping.escaped_comments',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected); + end special_characters_in_comment; + + + procedure context_as_commented_subtests as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[%# Subtest: A suite for testing different outcomes from reporters%# Subtest: A description of some context%]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.passing_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected); + + end context_as_commented_subtests; + + + procedure suitepath_as_chopped_subtests as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[.*# Subtest: org.*1\s{5}# Subtest: utplsql.*1\s{9}# Subtest: tests.*1\s{13}# Subtest: helpers.*1\s{17}# Subtest: A suite for testing different outcomes from reporters.*]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_reporters.passing_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected, 'n'); + + end suitepath_as_chopped_subtests; + + + procedure include_context_with_skipped_tests as + l_output_data ut3_develop.ut_varchar2_list; + l_expected varchar2(32767); + begin + l_expected := q'[%# Subtest: Some context%]'; + + select * + bulk collect into l_output_data + from table(ut3_develop.ut.run('test_tap_escaping.another_disabled_test',ut3_develop.ut_tap_reporter())); + + ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected); + + end include_context_with_skipped_tests; + + + procedure drop_help_tests as + pragma autonomous_transaction; + begin + execute immediate 'drop package test_tap_escaping'; + end drop_help_tests; +end test_tap_reporter; +/ \ No newline at end of file diff --git a/test/ut3_user/reporters/test_tap_reporter.pks b/test/ut3_user/reporters/test_tap_reporter.pks new file mode 100644 index 000000000..27f9651bc --- /dev/null +++ b/test/ut3_user/reporters/test_tap_reporter.pks @@ -0,0 +1,53 @@ +create or replace package test_tap_reporter as + + --%suite(ut_tap_reporter) + --%suitepath(utplsql.test_user.reporters) + + --%beforeall + procedure compile_tests; + + --%test(Simple succeeding test) + procedure simple_succeeding_test; + + --%test(Simple failing test) + procedure simple_failing_test; + + --%test(Simple erroring test) + procedure simple_erroring_test; + + --%test(Skipped test) + procedure disabled_test; + + --%test(Skipped test without description) + procedure disabled_test_no_description; + + --%test(Multiple tests with different outcome) + procedure multiple_tests_different_outcome; + + --%test(Escape special characters in suite name) + procedure escape_suite_name; + + --%test(Escape multiple special characters in test name) + procedure escape_multiple_characters_test_name; + + --%test(Disabled Test with special characters in disable reason) + procedure special_characters_in_disabled_reason; + + --%test(Don't escape special characters in comment) + procedure special_characters_in_comment; + + --%test(Include context as commented subtests) + procedure context_as_commented_subtests; + + --%test(Suitepath as chopped subtests) + procedure suitepath_as_chopped_subtests; + + --%test(Include context with only skipped tests in output) + procedure include_context_with_skipped_tests; + + + --%afterall + procedure drop_help_tests; + +end test_tap_reporter; +/ \ No newline at end of file