diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..715e2f4aa --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,171 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# +name: Main build + +on: + workflow_dispatch: + inputs: + jacocoEnabled: + description: 'Enable Jacoco code coverage (set to "false" for release builds)' + required: true + default: 'true' + type: choice + options: + - 'true' + - 'false' + isMainOrRelease: + description: 'This build is for the main branch or a release (set to "false" for development branch builds)' + required: true + default: 'true' + type: choice + options: + - 'true' + - 'false' + push: + branches: [main] + +env: + REGISTRY: ghcr.io + NAMESPACE: galasa-dev + BRANCH: ${{ github.ref_name }} + +jobs: + log-github-ref: + name: Log the GitHub ref this workflow is running on (Branch or tag that received dispatch) + runs-on: ubuntu-latest + steps: + - name: Log GitHub ref of workflow + run: | + echo "This workflow is running on GitHub ref ${{ env.BRANCH }}" + + build-managers: + name: Build Managers source code and Docker image for development Maven registry + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'semeru' + + - name: Print githash + run: | + echo $GITHUB_SHA > ./managers.githash + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 8.9 + cache-disabled: true + + - name: Build Managers source code + if: github.event_name == 'push' + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} + run: | + set -o pipefail + gradle -b galasa-managers-parent/build.gradle check publish --info \ + --no-daemon --console plain \ + -Dorg.gradle.jvmargs=-Xmx4096M \ + -PsourceMaven=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/extensions \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=${{ github.workspace }}/repo \ + -PjacocoEnabled=true \ + -PisMainOrRelease=true 2>&1 | tee build.log + + - name: Build Managers source code + if: github.event_name == 'workflow_dispatch' # Use the input values provided by the workflow dispatch. + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} + run: | + set -o pipefail + gradle -b galasa-managers-parent/build.gradle check publish --info \ + --no-daemon --console plain \ + -Dorg.gradle.jvmargs=-Xmx4096M \ + -PsourceMaven=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/extensions \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=${{ github.workspace }}/repo \ + -PjacocoEnabled=${{ inputs.jacocoEnabled }} \ + -PisMainOrRelease=${{ inputs.isMainOrRelease }} 2>&1 | tee build.log + + - name: Upload Gradle Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: gradle-build-log + path: build.log + retention-days: 7 + + - name: Upload Jacoco Report + if: failure() + uses: actions/upload-artifact@v4 + with: + name: jacoco-report + path: ${{ github.workspace }}/galasa-managers-parent/**/**/build/reports/**/*.html + retention-days: 7 + if-no-files-found: ignore + + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Managers image + id: metadata + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/managers-maven-artefacts + + - name: Build Managers image for development Maven registry + id: build + uses: docker/build-push-action@v5 + with: + context: . + file: dockerfiles/dockerfile + push: true + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + build-args: | + dockerRepository=ghcr.io + tag=${{ env.BRANCH }} + + - name: Recycle application in ArgoCD + env: + ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }} + run: | + docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run ${{ env.BRANCH }}-maven-repos restart --kind Deployment --resource-name managers-${{ env.BRANCH }} --server argocd.galasa.dev + + - name: Wait for app health in ArgoCD + env: + ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }} + run: | + docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app wait ${{ env.BRANCH }}-maven-repos --resource apps:Deployment:managers-${{ env.BRANCH }} --health --server argocd.galasa.dev + + trigger-obr-workflow: + name: Trigger OBR workflow + runs-on: ubuntu-latest + needs: build-managers + + steps: + - name: Trigger OBR workflow dispatch event with GitHub CLI + env: + GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} + run: | + gh workflow run build.yaml --repo https://github.com/galasa-dev/obr --ref ${{ env.BRANCH }} \ No newline at end of file diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml new file mode 100644 index 000000000..27607feae --- /dev/null +++ b/.github/workflows/pr-build.yaml @@ -0,0 +1,74 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# +name: PR build + +on: + pull_request: + branches: [main] + +jobs: + build-managers: + name: Build Managers source code and Docker image + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'semeru' + + - name: Print githash + run: | + echo $GITHUB_SHA > ./managers.githash + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 8.9 + cache-disabled: true + + - name: Build Managers source code + run: | + set -o pipefail + gradle -b galasa-managers-parent/build.gradle check publish --info \ + --no-daemon --console plain \ + -Dorg.gradle.jvmargs=-Xmx4096M \ + -PsourceMaven=https://development.galasa.dev/main/maven-repo/extensions \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=${{ github.workspace }}/repo 2>&1 | tee build.log + + - name: Upload Gradle Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: gradle-build-log + path: build.log + retention-days: 7 + + - name: Upload Jacoco Report + if: failure() + uses: actions/upload-artifact@v4 + with: + name: jacoco-report + path: ${{ github.workspace }}/galasa-managers-parent/**/**/build/reports/**/*.html + retention-days: 7 + if-no-files-found: ignore + + - name: Build Managers image for testing + uses: docker/build-push-action@v5 + with: + context: . + file: dockerfiles/dockerfile + load: true + tags: managers:test + build-args: | + dockerRepository=ghcr.io + tag=main + \ No newline at end of file diff --git a/.gitignore b/.gitignore index e1b2dfdb3..f6463684d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ Snap*.trc **/build **/.gradle **/gradle/wrapper +local-builds/ +**/.idea +temp/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..3e262ed5d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/ibm/detect-secrets + rev: 0.13.1+ibm.62.dss + hooks: + - id: detect-secrets # pragma: whitelist secret + args: [--baseline, .secrets.baseline, --use-all-plugins, --fail-on-unaudited] \ No newline at end of file diff --git a/.secrets.baseline b/.secrets.baseline new file mode 100644 index 000000000..91932d663 --- /dev/null +++ b/.secrets.baseline @@ -0,0 +1,95 @@ +{ + "exclude": { + "files": "^.secrets.baseline$", + "lines": null + }, + "plugins_used": [ + { + "name": "AWSKeyDetector" + }, + { + "name": "ArtifactoryDetector" + }, + { + "name": "AzureStorageKeyDetector" + }, + { + "base64_limit": 4.5, + "name": "Base64HighEntropyString" + }, + { + "name": "BasicAuthDetector" + }, + { + "name": "BoxDetector" + }, + { + "name": "CloudantDetector" + }, + { + "ghe_instance": "github.ibm.com", + "name": "GheDetector" + }, + { + "name": "GitHubTokenDetector" + }, + { + "hex_limit": 3, + "name": "HexHighEntropyString" + }, + { + "name": "IbmCloudIamDetector" + }, + { + "name": "IbmCosHmacDetector" + }, + { + "name": "JwtTokenDetector" + }, + { + "keyword_exclude": null, + "name": "KeywordDetector" + }, + { + "name": "MailchimpDetector" + }, + { + "name": "NpmDetector" + }, + { + "name": "PrivateKeyDetector" + }, + { + "name": "SlackDetector" + }, + { + "name": "SoftlayerDetector" + }, + { + "name": "SquareOAuthDetector" + }, + { + "name": "StripeDetector" + }, + { + "name": "TwilioKeyDetector" + } + ], + "results": { + "galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/README.md": [ + { + "hashed_secret": "22199ec38c6bedb7616f8e42aa3ad6e9f196cd24", + "is_secret": false, + "is_verified": false, + "line_number": 114, + "type": "Secret Keyword", + "verified_result": null + } + ] + }, + "version": "0.13.1+ibm.62.dss", + "word_list": { + "file": null, + "hash": null + } +} diff --git a/Jenkinsfile.documentation b/Jenkinsfile.documentation deleted file mode 100644 index f0d1f278e..000000000 --- a/Jenkinsfile.documentation +++ /dev/null @@ -1,90 +0,0 @@ -def mvnProfile = 'dev,managerdocs' - -pipeline { -// Initially run on any agent - agent { - label 'github' - } - options { timestamps () } - environment { -//Configure Maven from the maven tooling in Jenkins - def mvnHome = tool 'Default' - PATH = "${mvnHome}/bin:${env.PATH}" - -//Set some defaults - def workspace = pwd() - def mvnGoal = 'install' - } - stages { -// for debugging purposes - stage('report') { - steps { - echo "Branch/Tag : ${env.GIT_BRANCH}" - echo "Commit Hash : ${env.GIT_COMMIT}" - echo "Workspace directory: ${workspace}" - echo "Maven profile : ${mvnProfile}" - echo "Doc Branch : ${env.DOC_BRANCH}" - echo "Doc Reviewers : ${env.DOC_REVIEWERS}" - echo "Doc User : ${env.DOC_USER}" - echo "Doc Email : ${env.DOC_EMAIL}" - } - } - -// Set up the workspace, clear the git directories and setup the maven settings.xml files - stage('prep-workspace') { - steps { - configFileProvider([configFile(fileId: '86dde059-684b-4300-b595-64e83c2dd217', targetLocation: 'settings.xml')]) { - } - dir('repository/dev.galasa') { - deleteDir() - } - dir('repository/dev/galasa') { - deleteDir() - } - } - } - - stage('Clone Docs') { - steps { - dir('galasa.dev') { - deleteDir() - } - sh 'mkdir galasa.dev' - dir('galasa.dev') { - git(url: 'git@github.com:galasa-dev/galasa.dev.git', branch: "next") - - sh "git checkout -b ${env.DOC_BRANCH}" - } - } - } - stage('Extract Javadoc') { - steps { - dir('galasa-managers-parent') { - sh "mvn --settings ${workspace}/settings.xml -Dmaven.repo.local=${workspace}/repository -P ${mvnProfile} -B -e -fae clean process-sources" - } - } - } - stage('Generate Markdown') { - steps { - dir('galasa-managers-parent') { - sh "mvn --settings ${workspace}/settings.xml -Dmaven.repo.local=${workspace}/repository -Dgalasa.manager.doc.directory=${workspace}/galasa.dev/src/markdown-pages/docs/managers -P ${mvnProfile} -B -e -fae dev.galasa:galasautils-maven-plugin:0.8.0:buildmanagerdoc" - } - } - } - stage('Create Pull Request') { - steps { - withCredentials([string(credentialsId: 'c4c96c90-6635-4813-ae7f-abfa889a96b6', variable: 'GITHUB_TOKEN')]) { - dir('galasa.dev') { - sh "${workspace}/githubdocs.sh" - } - } - } - } - } - post { - // triggered when red sign - failure { - slackSend (channel: '#project-galasa-devs', color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})") - } - } -} diff --git a/README.md b/README.md index 93b07c072..8aa72b276 100644 --- a/README.md +++ b/README.md @@ -5,27 +5,123 @@ Managers are grouped by type within the parent folder, for example, the "galasa- Each Manager comes with its own set of associated IVT tests and Javadoc. We're adding new Manager every month. Look at the [summary table of Managers](https://galasa.dev/docs/managers/) for a list of available and planned Managers and to find out what they do. -## Contributing +## Contributing If you are interested in the development of Galasa, take a look at the documentation and feel free to post a question on the Galasa Slack channel, or start sharing usage and development experiences with other Galasa users and the IBM team. You can also raise new ideas / features / bugs etc. as issues on [GitHub](https://github.com/galasa-dev/projectmanagement). Take a look at the [contribution guidelines](https://github.com/galasa-dev/projectmanagement/blob/main/contributing.md). ## Documentation - More information can be found on the [Galasa Homepage](https://galasa.dev). Questions related to the usage of Galasa can be posted on the [Galasa Slack channel](https://galasa.slack.com). -## Where can I get the latest release? +## Where can I get the latest release? Find out how to install the Galasa Eclipse plug-in from our [Installing the Galasa plug-in](https://galasa.dev/docs/getting-started/installing) documentation. Other Galasa repositories are available on [GitHub](https://github.com/galasa-dev). -## License +## License This code is under the [Eclipse Public License 2.0](https://github.com/galasa-dev/maven/blob/main/LICENSE). +## Building locally +Use the `./build-locally.sh` script to build locally. + + +## Updating the versions of things +Use the `./build-release-yaml.sh` script to scan the contents of the managers source code and populate the `release.yaml` file with version information taken from each manager source folder. + +## Manager testing and documentation levels +Below is a table with the currently available Galasa Managers as seen documented on galasa.dev or visible on Maven Central, the level at which they were tested/are being tested, and the readiness indicator as described on the Galasa website. + +**Manager readiness indicator:** + +- Alpha: This Manager is being actively developed. It is subject to change and has not been extensively tested. +- Beta: This Manager is almost ready. It has been tested and the TPI is stable, but there may be minor changes to come. +- Release: This Manager is feature complete, has passed all tests and is deemed release grade. + +**Manager testing levels:** + +- Local: This Manager has been tested in a local Galasa Ecosystem +- Isolated: This Manager has been tested in a Galasa Ecosystem with the Galasa Isolated configuration. +- MVP: This Manager has been tested in a Galasa Ecosystem with the Galasa MVP configuration as it is shipped as part of the MVP. +- IVT: This Manager has been tested locally during development. +- Other Managers: This Manager does not have its own test but is used for the provisioning of other tests. + + +**Managers documented on galasa.dev:** +| Manager | Level of testing | Documented | +| --- | --- | --- | +| CICSTS Managers || +| CICSTS CECI | CECIManagerIVT ran in a Local and Isolated Ecosystem | Release | +| CICSTS CEDA | CedaManagerIVT ran in a Local and Isolated Ecosystem | Alpha | +| CICSTS CEMT | CEMTManagerIVT ran in a Local and Isolated Ecosystem | Alpha | +| CICSTS | CICSTSManagerIVT ran in a ran in a Local and Isolated Ecosystem | Alpha | +| Cloud Managers || +| Docker | DockerManagerIVT ran in a Local Ecosystem | Release | +| Kubernetes | KubernetesManagerIVT ran locally during development | Alpha | +| OpenStack | Other Managers | Alpha | +| Communication Managers || +| HTTP | HttpManagerIVT ran in a Local Ecosystem | Release | +| IP Network | Other Managers | Alpha | +| MQ | MqManagerIVT ran locally during development | Alpha | +| Core Managers || +| Artifact | ArtifactManagerIVT ran in a Local, Isolated and MVP Ecosystem | Release | +| Core | CoreManagerIVT ran in a Local, Isolated and MVP Ecosystem | Release | +| Logging Managers || +| Elastic Log | - | Alpha | +| Ecosystem Managers || +| Galasa Ecosystem | Other Managers | Alpha | +| Test Tool Managers || +| JMeter | JMeterManagerIVT ran locally during development | Beta | +| Selenium | SeleniumManagerIVT ran locally during development | Beta | +| Unix Managers || +| Linux | LinuxManagerIVT ran locally during development / Other Managers | Alpha | +| Workflow Managers || +| GitHub Issue | Other Managers (Adhoc) | Release | +| z/OS Managers || +| RSE API | - | Alpha | +| z/OS 3270 | Zos3270IVT ran in a Local Ecosystem | Beta | +| z/OS Batch z/OS MF | ZosManagerBatchIVT ran in a Local, Isolated and MVP Ecosystem with overrides = "zos.bundle.extra.batch.manager": "dev.galasa.zosbatch.rseapi.manager" | Beta | +| z/OS Batch RSE API | ZosManagerBatchIVT ran in a Local, Isolated and MVP Ecosystem with overrides = "zos.bundle.extra.batch.manager": "dev.galasa.zosbatch.zosmf.manager" | Alpha | +| z/OS Console OE Console | - | Alpha | +| z/OS Console z/OS MF | - | Beta | +| z/OS File RSE API | ZosManagerFileIVT, ZosManagerFileDatasetIVT and ZosManagerFileVSAMIVT ran in a Local, Isolated and MVP Ecosystem with overrides = "zos.bundle.extra.file.manager": "dev.galasa.zosfile.rseapi.manager" | Alpha | +| z/OS File z/OS MF | ZosManagerFileIVT, ZosManagerFileDatasetIVT and ZosManagerFileVSAMIVT ran in a Local, Isolated and MVP Ecosystem with overrides = "zos.bundle.extra.file.manager": "dev.galasa.zosfile.zosmf.manager" | Beta | +| z/OS | ZosManagerIVT ran in a Local, Isolated and MVP Ecosystem | Beta | +| z/OS MF | Other Managers | Beta | +| z/OS Program | Other Managers (CECI) | Alpha | +| z/OS TSO Command SSH Manager | ZosManagerTSOCommandIVT ran in a Local, Isolated and MVP Ecosystem | Alpha | +| z/OS Unix Command SSH Manager | Other Managers | Alpha | + + +**Managers documented as 'Future Managers' on galasa.dev but already released on Maven Central:** +| Manager | Progress | +| --- | --- | +| Liberty v0.21.0 | Empty interfaces but nothing implemented | +| Windows v0.21.0 | Minimal implementation | + + +**Managers not documented on galasa.dev but already released on Maven Central:** +| Manager | Level of testing | +| --- | --- | +| CICSTS Resource | - | +| Cloud | - | +| DB2 | Db2ManagerIVT ran locally during development | +| Eclipse Runtime | - | +| Eclipse Runtime Ubuntu | - | +| Java | - | +| Java Ubuntu | Other Managers | +| Java Windows | - | +| Text Scan | Other Managers | +| z/OS Liberty Angel | - | +| z/OS Liberty | - | +| z/OS Security | - | +**Managers set to be removed from Open Source Galasa:** +* Phoenix +* SEM +* VTP diff --git a/build-locally.sh b/build-locally.sh new file mode 100755 index 000000000..c2508401d --- /dev/null +++ b/build-locally.sh @@ -0,0 +1,246 @@ +#! /usr/bin/env bash + +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# +#----------------------------------------------------------------------------------------- +# +# Objectives: Build this repository code locally. +# +# Environment variable over-rides: +# LOGS_DIR - Optional. Where logs are placed. Defaults to creating a temporary directory. +# SOURCE_MAVEN - Optional. Where a maven repository is from which the build will draw artifacts. +# DEBUG - Optional. Defaults to 0 (off) +# +#----------------------------------------------------------------------------------------- + +# Where is this script executing from ? +BASEDIR=$(dirname "$0");pushd $BASEDIR 2>&1 >> /dev/null ;BASEDIR=$(pwd);popd 2>&1 >> /dev/null +# echo "Running from directory ${BASEDIR}" +export ORIGINAL_DIR=$(pwd) +# cd "${BASEDIR}" + +cd "${BASEDIR}/.." +WORKSPACE_DIR=$(pwd) + + +#----------------------------------------------------------------------------------------- +# +# Set Colors +# +#----------------------------------------------------------------------------------------- +bold=$(tput bold) +underline=$(tput sgr 0 1) +reset=$(tput sgr0) +red=$(tput setaf 1) +green=$(tput setaf 76) +white=$(tput setaf 7) +tan=$(tput setaf 202) +blue=$(tput setaf 25) + +#----------------------------------------------------------------------------------------- +# +# Headers and Logging +# +#----------------------------------------------------------------------------------------- +underline() { printf "${underline}${bold}%s${reset}\n" "$@" +} +h1() { printf "\n${underline}${bold}${blue}%s${reset}\n" "$@" +} +h2() { printf "\n${underline}${bold}${white}%s${reset}\n" "$@" +} +debug() { printf "${white}%s${reset}\n" "$@" +} +info() { printf "${white}➜ %s${reset}\n" "$@" +} +success() { printf "${green}✔ %s${reset}\n" "$@" +} +error() { printf "${red}✖ %s${reset}\n" "$@" +} +warn() { printf "${tan}➜ %s${reset}\n" "$@" +} +bold() { printf "${bold}%s${reset}\n" "$@" +} +note() { printf "\n${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" +} + +#----------------------------------------------------------------------------------------- +# Functions +#----------------------------------------------------------------------------------------- +function usage { + info "Syntax: build-locally.sh [OPTIONS]" + cat << EOF +Options are: +-c | --clean : Do a clean build. One of the --clean or --delta flags are mandatory. +-d | --delta : Do a delta build. One of the --clean or --delta flags are mandatory. +EOF +} + +function check_exit_code () { + # This function takes 3 parameters in the form: + # $1 an integer value of the returned exit code + # $2 an error message to display if $1 is not equal to 0 + if [[ "$1" != "0" ]]; then + error "$2" + exit 1 + fi +} +#----------------------------------------------------------------------------------------- +# Process parameters +#----------------------------------------------------------------------------------------- +exportbuild_type="" + +while [ "$1" != "" ]; do + case $1 in + -c | --clean ) export build_type="clean" + ;; + -d | --delta ) export build_type="delta" + ;; + -h | --help ) usage + exit + ;; + * ) error "Unexpected argument $1" + usage + exit 1 + esac + shift +done + +if [[ "${build_type}" == "" ]]; then + error "Need to use either the --clean or --delta parameter." + usage + exit 1 +fi + +#----------------------------------------------------------------------------------------- +# Main logic. +#----------------------------------------------------------------------------------------- + +source_dir="galasa-managers-parent" + +project=$(basename ${BASEDIR}) + + +# Debug or not debug ? Override using the DEBUG flag. +if [[ -z ${DEBUG} ]]; then + export DEBUG=0 + # export DEBUG=1 + info "DEBUG defaulting to ${DEBUG}." + info "Over-ride this variable if you wish. Valid values are 0 and 1." +else + info "DEBUG set to ${DEBUG} by caller." +fi + +# Over-rode SOURCE_MAVEN if you want to build from a different maven repo... +if [[ -z ${SOURCE_MAVEN} ]]; then + export SOURCE_MAVEN=https://development.galasa.dev/main/maven-repo/extensions/ + info "SOURCE_MAVEN repo defaulting to ${SOURCE_MAVEN}." + info "Set this environment variable if you want to over-ride this value." +else + info "SOURCE_MAVEN set to ${SOURCE_MAVEN} by caller." +fi + +# Create a temporary dir. +# Note: This bash 'spell' works in OSX and Linux. +if [[ -z ${LOGS_DIR} ]]; then + export LOGS_DIR="${BASEDIR}/local-builds/logs" + info "Logs are stored in the ${LOGS_DIR} folder." + info "Over-ride this setting using the LOGS_DIR environment variable." +else + info "Logs are stored in the ${LOGS_DIR} folder." + info "Over-ridden by caller using the LOGS_DIR variable." +fi +mkdir -p ${LOGS_DIR} 2>&1 > /dev/null # Don't show output. We don't care if it already existed. + + +function build_code { + h1 "Building ${project}" + info "Using source code at ${source_dir}" + cd ${BASEDIR}/${source_dir} + if [[ "${DEBUG}" == "1" ]]; then + OPTIONAL_DEBUG_FLAG="-debug" + else + OPTIONAL_DEBUG_FLAG="-info" + fi + + # auto plain rich or verbose + CONSOLE_FLAG=--console=plain + + log_file=${LOGS_DIR}/logs.txt + info "Log will be placed at ${log_file}" + + if [[ "${build_type}" == "clean" ]]; then + goals="clean build buildReleaseYaml check publishToMavenLocal -no-build-cache --no-daemon --parallel" + else + goals="build buildReleaseYaml check publishToMavenLocal --parallel" + fi + + # The build process does this: + # gradle --no-daemon \ + # --console plain \ + # -PsourceMaven=https://development.galasa.dev/main/maven-repo/extensions \ + # -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + # -PtargetMaven=../repo check publish --info + + cmd="gradle \ + ${CONSOLE_FLAG} \ + -Dorg.gradle.java.home=${JAVA_HOME} \ + -PsourceMaven=${SOURCE_MAVEN} ${OPTIONAL_DEBUG_FLAG} \ + ${goals} + " + + info "Using command: ${cmd}" + $cmd 2>&1 > ${log_file} + + rc=$? + check_exit_code $rc "Failed to build ${project} see logs at ${log_file}" + success "Project ${project} built - OK - log is at ${log_file}" + +} + +function check_secrets { + h2 "updating secrets baseline" + cd ${BASEDIR} + detect-secrets scan --update .secrets.baseline + rc=$? + check_exit_code $rc "Failed to run detect-secrets. Please check it is installed properly" + success "updated secrets file" + + h2 "running audit for secrets" + detect-secrets audit .secrets.baseline + rc=$? + check_exit_code $rc "Failed to audit detect-secrets." + + #Check all secrets have been audited + secrets=$(grep -c hashed_secret .secrets.baseline) + audits=$(grep -c is_secret .secrets.baseline) + if [[ "$secrets" != "$audits" ]]; then + error "Not all secrets found have been audited" + exit 1 + fi + sed -i '' '/[ ]*"generated_at": ".*",/d' .secrets.baseline + success "secrets audit complete" +} + +function update_release_yaml { + h2 "Updating release.yaml" + + # After running 'gradle build', a release.yaml file should have been automatically generated + generated_release_yaml="${BASEDIR}/galasa-managers-parent/build/release.yaml" + current_release_yaml="${BASEDIR}/release.yaml" + + if [[ -f ${generated_release_yaml} ]]; then + cp ${generated_release_yaml} ${current_release_yaml} + success "Updated release.yaml OK" + else + warn "Failed to automatically generate release.yaml, please ensure any changed bundles have had their versions updated in ${current_release_yaml}" + fi +} + + +build_code +update_release_yaml + +check_secrets \ No newline at end of file diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index 7d37f1a59..000000000 --- a/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -repo/ diff --git a/docker/Dockerfile b/dockerfiles/dockerfile similarity index 59% rename from docker/Dockerfile rename to dockerfiles/dockerfile index 68cf25c62..2cc63736a 100644 --- a/docker/Dockerfile +++ b/dockerfiles/dockerfile @@ -1,6 +1,6 @@ -ARG dockerRepository -ARG branch -FROM ${dockerRepository}/galasadev/galasa-maven-extensions:${branch} - -COPY repo/ /usr/local/apache2/htdocs/ -COPY managers.githash /usr/local/apache2/htdocs/managers.githash +ARG dockerRepository +ARG tag +FROM ${dockerRepository}/galasa-dev/extensions-maven-artefacts:${tag} + +COPY repo/ /usr/local/apache2/htdocs/ +COPY managers.githash /usr/local/apache2/htdocs/managers.githash \ No newline at end of file diff --git a/galasa-managers-parent/build.gradle b/galasa-managers-parent/build.gradle index ee8764385..2b13c9bd2 100644 --- a/galasa-managers-parent/build.gradle +++ b/galasa-managers-parent/build.gradle @@ -1,22 +1,20 @@ plugins { id 'biz.aQute.bnd.builder' version '5.3.0' apply false - id 'jacoco' id 'maven-publish' + id 'signing' } -version = '0.15.0' - -task clean { - // make sure the build directory is gone - doFirst { - delete "${buildDir}" - } -} +// Note: The following version number is updated using the set-version.sh tool. +// It is used as the version number of the managers bundle, which contains a yaml +// file which is in a release.yaml, but published to maven, so that the OBR build +// can pick it up later. +version = "0.37.0" // A configuration to publish the merge exec into configurations { archives + release_metadata } // Get all the sub projects with jacoco plugin to add itself to the merge @@ -24,25 +22,54 @@ subprojects { plugins.withId('jacoco') { rootProject.tasks.named('jacocoMerge').get().executionData(tasks.named('test').get()) } + + // Uncomment the block below to get details about deprecations. + +// tasks.withType(JavaCompile) { +// options.compilerArgs << '-Xlint:unchecked' +// options.deprecation = true +// } + + // This task will suppress warnings (only in javadoc) about missing description for (@return, @throws etc..) + /* + Example warning: + + warning: no description for @throws + * @throws SeleniumManagerException + */ + // However, it will not suppress warnings / errors in the code itself + tasks.withType(Javadoc) { + options.addStringOption('Xdoclint:none', '-quiet') + } + } // Define the artifact -def execFile = layout.buildDirectory.file('jacoco/jacocoMerge.exec') -def execArtifact = artifacts.add('archives', execFile.get().asFile) { +def mergedReportFile = layout.buildDirectory.file('reports/jacoco/jacocoMerge/jacocoMerge.xml') +def mergedReportArtifact = artifacts.add('archives', mergedReportFile.get().asFile) { builtBy 'jacocoMerge' } +task jacocoMerge(type: JacocoReport) { + gradle.projectsEvaluated { + // Get the jacocoTestReport tasks in all subprojects + def searchRecursively = true + def reportTasks = project.getTasksByName('jacocoTestReport', searchRecursively) + dependsOn reportTasks -task jacocoMerge(type: JacocoMerge) { - doFirst { - // go through all the files and remove the ones that do not exist. some managers do not have unit tests yet - executionData = executionData.filter({f -> f.exists()}) + executionData.setFrom(executionData.filter({ it.exists() })) + sourceDirectories.setFrom(reportTasks.sourceDirectories) + classDirectories.setFrom(reportTasks.classDirectories) } - enabled = jacocoEnabled.toBoolean() + reports { + html.required = true + xml.required = true + } } repositories { + mavenLocal() maven { url "$sourceMaven" } @@ -51,27 +78,195 @@ repositories { } } +signing { + def signingKeyId = findProperty("signingKeyId") + def signingKey = findProperty("signingKey") + def signingPassword = findProperty("signingPassword") + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) + sign publishing.publications +} + +tasks.withType(Sign) { + onlyIf { isMainOrRelease.toBoolean() } +} + if (jacocoEnabled.toBoolean()) { + publishing { + publications { + maven(MavenPublication) { + artifact mergedReportArtifact + + groupId = 'codecoverage' + artifactId = 'manager-unit-tests' + } + } + repositories { + maven { + url = "$targetMaven" + + if ("$targetMaven".startsWith('http')) { + credentials { + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") + } + } + } + } + } +} + + +def manifestFile = layout.buildDirectory.file("release.yaml").get().asFile + +def header = """# +# Copyright contributors to the Galasa project +# + +# ----------------------------------------------------------- +# +# WARNING +# +# This file is periodically re-generated from the contents of +# the repository, so don't make changes here manually please. +# ----------------------------------------------------------- + + +apiVersion: galasa.dev/v1alpha +kind: Release +metadata: + name: galasa-release + +managers: + bundles: + +# +# Manager +# +""" + +// Build the release.yaml file +task buildReleaseYaml() { + println 'Building the release.yaml file...' + + // During execution phase, make sure the file exists. + doFirst{ + if ( !buildDir.exists() ) { + buildDir.mkdirs() + } + if (!manifestFile.exists()){ + manifestFile.createNewFile() + } else { + manifestFile.delete() + manifestFile.createNewFile() + } + manifestFile.append(header) + } + + + subprojects { + ext { + // the property that should be overridden in suproject's build.gradle + // Each sub-project will set the values... + projectName = '' + includeInOBR = '' + includeInMVP = '' + includeInBOM = '' + includeInJavadoc = '' + includeInIsolated = '' + includeInCodeCoverage = '' + } + + afterEvaluate { + doLast { + // Some projects don't have a version property... as they are parent projects mostly. + if (version != 'unspecified') { + def f = manifestFile + f.append("\n\n - artifact: $projectName") + f.append("\n version: $version") + if (includeInOBR != '') { + f.append("\n obr: $includeInOBR") + } + if (includeInMVP != '') { + f.append("\n mvp: $includeInMVP") + } + if (includeInBOM != '') { + f.append("\n bom: $includeInBOM") + } + if (includeInJavadoc != '') { + f.append("\n javadoc: $includeInJavadoc") + } + if (includeInIsolated != '') { + f.append("\n isolated: $includeInIsolated") + } + if (includeInCodeCoverage != '') { + f.append("\n codecoverage: $includeInCodeCoverage") + } + } + } + } + } +} + +def myReleaseYaml = artifacts.add('release_metadata', manifestFile) { + builtBy 'buildReleaseYaml' +} + +// Publish the release.yaml as a maven artifact. +// Note: The maven co-ordinates are versioned using the version for this bundle. publishing { publications { - maven(MavenPublication) { - artifact execArtifact - - groupId = 'codecoverage' - artifactId = 'manager-unit-tests' - } + + // Publish the component manifest/release.yaml + publishReleaseManifestYaml(MavenPublication) { + artifact myReleaseYaml + + pom { + name = "Manifest for managers bundle versions" + artifactId = "dev.galasa.managers.manifest" + groupId = 'dev.galasa' + version = "0.37.0" + description = "Conveys bundle version information to OBR builds." + licenses { + license { + name = 'Eclipse Public License - v 2.0' + url = 'https://www.eclipse.org/legal/epl-2.0/t' + } + } + url = 'https://galasa.dev' + developers { + developer { + name = 'Galasa Developer' + email = 'galasadelivery@ibm.com' + organization = 'IBM' + organizationUrl = 'https://www.ibm.com' + } + } + scm { + connection = 'scm:git:git:://github.com/galasa-dev/managers' + developerConnection = 'scm:git:git:://github.com/galasa-dev/managers' + url = 'https://github.com/galasa-dev/managers' + } + issueManagement { + system = 'GitHub' + url = 'https://github.com/galasa-dev/projectmanagement/issues' + } + } + + } } + repositories { maven { url = "$targetMaven" - + if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('MAVENUSERNAME') - password System.getenv('MAVENPASSWORD') + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") } } } } } -} \ No newline at end of file + + diff --git a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle index c775b6e96..8e8c39865 100644 --- a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle +++ b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle @@ -58,13 +58,17 @@ repositories { } signing { + def signingKeyId = findProperty("signingKeyId") + def signingKey = findProperty("signingKey") + def signingPassword = findProperty("signingPassword") + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) sign publishing.publications } tasks.withType(Sign) { - onlyIf { isRelease.toBoolean() } + onlyIf { isMainOrRelease.toBoolean() } } publishing { @@ -79,45 +83,15 @@ publishing { licenses { license { name = 'Eclipse Public License - v 2.0' - url = 'https://www.eclipse.org/legal/epl-2.0/t' + url = 'https://www.eclipse.org/legal/epl-2.0' } } developers { developer { - name = 'Michael Baylis' - email = 'Michael.Baylis@uk.ibm.com' - organization = 'IBM' - organizationUrl = 'https://www.ibm.com' - } - developer { - name = 'William Yates' - email = 'wyates@uk.ibm.com' - organization = 'IBM' - organizationUrl = 'https://www.ibm.com' - } - developer { - name = 'David Roberts' - email = 'david.roberts@uk.ibm.com' - organization = 'IBM' - organizationUrl = 'https://www.ibm.com' - } - developer { - name = 'James Davies' - email = 'james.davies@ibm.com' - organization = 'IBM' - organizationUrl = 'https://www.ibm.com' - } - developer { - name = 'Kees Jansen' - email = 'kees.jansen@ibm.com' - organization = 'IBM' - organizationUrl = 'https://www.ibm.com' - } - developer { - name = 'Jade Carino' - email = 'jade.carino@ibm.com' - organization = 'IBM' - organizationUrl = 'https://www.ibm.com' + name = 'Galasa Contributors' + email = 'galasadelivery@ibm.com' + organization = 'Linux Foundation' + organizationUrl = 'https://github.com/galasa-dev' } } scm { @@ -138,8 +112,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('MAVENUSERNAME') - password System.getenv('MAVENPASSWORD') + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") } } } diff --git a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.gradle b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.gradle index c92bf982a..9dfcd0d29 100644 --- a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.gradle +++ b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.gradle @@ -5,8 +5,8 @@ plugins { } dependencies { - api 'dev.galasa:dev.galasa:0.21.0' - implementation 'dev.galasa:dev.galasa.framework:0.25.0' + api 'dev.galasa:dev.galasa:0.34.0' + implementation 'dev.galasa:dev.galasa.framework:0.37.0' implementation 'commons-logging:commons-logging:1.2' implementation 'org.osgi:org.osgi.core:6.0.0' implementation 'org.osgi:org.osgi.service.component.annotations:1.3.0' @@ -21,11 +21,22 @@ dependencies { } jacoco { - toolVersion = "0.8.6" + toolVersion = "0.8.7" } test { jacoco { enabled = jacocoEnabled.toBoolean() } + finalizedBy jacocoTestReport +} + +jacocoTestReport { + enabled = jacocoEnabled.toBoolean() + dependsOn test + + reports { + html.required = true + xml.required = true + } } diff --git a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.ivt.gradle b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.ivt.gradle index 02fd96028..ec2915763 100644 --- a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.ivt.gradle +++ b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.ivt.gradle @@ -4,7 +4,7 @@ plugins { } dependencies { - implementation 'dev.galasa:dev.galasa:0.21.0' + implementation 'dev.galasa:dev.galasa:0.34.0' implementation 'commons-logging:commons-logging:1.2' diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/build.gradle index b02180935..590bff3ec 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa CECI Manager IVTs' -version = '0.23.0' +version = '0.25.0' dependencies { implementation project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.ceci.manager') @@ -15,3 +15,17 @@ dependencies { implementation project (':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zosprogram.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/settings.gradle index db2c96513..78abd2ddb 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.ceci.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.ceci.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/src/main/java/dev/galasa/cicsts/ceci/manager/ivt/CECIManagerIVT.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/src/main/java/dev/galasa/cicsts/ceci/manager/ivt/CECIManagerIVT.java index 4e9de8fc1..fdc09046a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/src/main/java/dev/galasa/cicsts/ceci/manager/ivt/CECIManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager.ivt/src/main/java/dev/galasa/cicsts/ceci/manager/ivt/CECIManagerIVT.java @@ -1,7 +1,8 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.cicsts.ceci.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; @@ -550,7 +551,7 @@ private int getExpectedEIBDate() throws TimeoutException, KeyboardLockedExceptio // EIBDATE is in packed decimal format String expectedEIBDate = (date.getYear() <= 1999 ? "0" : "1") + Integer.toString(date.getYear()).substring(2) - + (date.getDayOfYear() <= 99 ? "0" + date.getDayOfYear() : date.getDayOfYear()); + + (date.getDayOfYear() <= 99 ? date.getDayOfYear() <= 9 ? "00" + date.getDayOfYear() : "0" + date.getDayOfYear() : date.getDayOfYear()); return Integer.parseInt(expectedEIBDate); } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/bnd.bnd index 3eeacfa2d..6cd1df397 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/bnd.bnd @@ -1,5 +1,5 @@ -snapshot: ${tstamp} Bundle-Name: Galasa CICS/TS CECI Manager -Export-Package: dev.galasa.cicsts.ceci.spi.spi +Export-Package: dev.galasa.cicsts.ceci.spi Import-Package: !javax.validation.constraints, \ * diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/build.gradle index d4ebce2de..158a38a41 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/build.gradle @@ -4,9 +4,25 @@ plugins { description = 'Galasa CICS/TS CECI Manager' -version = '0.21.0' +version = '0.25.0' dependencies { api project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') } + + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/settings.gradle index cf41efba5..5251901e3 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.ceci.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.ceci.manager' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciExecInterfaceBlockImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciExecInterfaceBlockImpl.java index dc0341876..1416014b6 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciExecInterfaceBlockImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciExecInterfaceBlockImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import dev.galasa.cicsts.IExecInterfaceBlock; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciImpl.java index a4b2c9922..d9476c16a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceci.internal; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerField.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerField.java index e199f58f7..6e9690181 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerField.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceci.internal; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerImpl.java index 2e8ef8655..f892e2e24 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019, 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceci.internal; @@ -18,7 +18,7 @@ import dev.galasa.cicsts.ICeci; import dev.galasa.cicsts.ICicsRegion; import dev.galasa.cicsts.ceci.internal.properties.CeciPropertiesSingleton; -import dev.galasa.cicsts.ceci.spi.spi.ICeciManagerSpi; +import dev.galasa.cicsts.ceci.spi.ICeciManagerSpi; import dev.galasa.cicsts.spi.ICeciProvider; import dev.galasa.cicsts.spi.ICicstsManagerSpi; import dev.galasa.framework.spi.AbstractManager; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciResponseImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciResponseImpl.java index 947195c61..52365c06a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciResponseImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/CeciResponseImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/ResponseOutputValueImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/ResponseOutputValueImpl.java index 4fc040d6a..02a06b2d5 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/ResponseOutputValueImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/ResponseOutputValueImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import dev.galasa.cicsts.CeciException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/package-info.java index 1ad43fba0..e5e8ce84a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * CICS/TS CECI Manager - Internal Implementation */ diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/CeciPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/CeciPropertiesSingleton.java index 2d1f8c3bc..1c29f20fd 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/CeciPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/CeciPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceci.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/package-info.java index dd50075b1..c10137ec3 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/internal/properties/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * CICS/TS CECI Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/ICeciManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/ICeciManagerSpi.java new file mode 100644 index 000000000..9060537e6 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/ICeciManagerSpi.java @@ -0,0 +1,13 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.cicsts.ceci.spi; + +/** + * Provides the SPI access to the CICS/TS CECI Manager + */ +public interface ICeciManagerSpi { + +} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/codesnippet_01.md b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/codesnippet_01.md similarity index 100% rename from galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/codesnippet_01.md rename to galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/codesnippet_01.md diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/package-info.java new file mode 100644 index 000000000..3a8ab9141 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/package-info.java @@ -0,0 +1,9 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +/** + * zOSMF Batch Manager - Internal SPI + */ +package dev.galasa.cicsts.ceci.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/ICeciManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/ICeciManagerSpi.java deleted file mode 100644 index e1c33603a..000000000 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/ICeciManagerSpi.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ -package dev.galasa.cicsts.ceci.spi.spi; - -/** - * Provides the SPI access to the CICS/TS CECI Manager - */ -public interface ICeciManagerSpi { - -} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/package-info.java deleted file mode 100644 index aa574b9c5..000000000 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/main/java/dev/galasa/cicsts/ceci/spi/spi/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * zOSMF Batch Manager - Internal SPI - */ -package dev.galasa.cicsts.ceci.spi.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciExecInterfaceBlockImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciExecInterfaceBlockImpl.java index 66be21d96..136e657b1 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciExecInterfaceBlockImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciExecInterfaceBlockImpl.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciImpl.java index c910bb2b4..280cd8a31 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciImpl.java @@ -1,1569 +1,1549 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; -//import java.util.Arrays; -//import java.util.HashMap; -//import java.util.LinkedHashMap; -// -//import org.junit.Assert; -//import org.junit.Before; -//import org.junit.Test; -//import org.junit.runner.RunWith; -//import org.mockito.Mock; -//import org.mockito.Mockito; -//import org.powermock.api.mockito.PowerMockito; -//import org.powermock.modules.junit4.PowerMockRunner; -//import org.powermock.reflect.Whitebox; -// -//import dev.galasa.cicsts.CeciException; -//import dev.galasa.cicsts.CicstsManagerException; -//import dev.galasa.cicsts.ICeciResponse; -//import dev.galasa.cicsts.ICicsRegion; -//import dev.galasa.cicsts.ICicsTerminal; -//import dev.galasa.zos3270.FieldNotFoundException; -//import dev.galasa.zos3270.KeyboardLockedException; -//import dev.galasa.zos3270.TerminalInterruptedException; -//import dev.galasa.zos3270.TimeoutException; -//import dev.galasa.zos3270.spi.NetworkException; - -//@RunWith(PowerMockRunner.class) +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; + +import dev.galasa.cicsts.CeciException; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICeciResponse; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.zos3270.FieldNotFoundException; +import dev.galasa.zos3270.KeyboardLockedException; +import dev.galasa.zos3270.TerminalInterruptedException; +import dev.galasa.zos3270.TimeoutException; +import dev.galasa.zos3270.spi.NetworkException; +import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.verification.VerificationMode; + +@RunWith(MockitoJUnitRunner.class) public class TestCeciImpl { - - -// private CeciImpl ceci; -// -// private CeciImpl ceciSpy; -// -// // Static fields in CeciImpl -// private static final String INITIAL_SCREEN_ID = "STATUS: ENTER ONE OF THE FOLLOWING"; -// private static final String VAR_SCREEN_ID = "VARIABLES LENGTH DATA"; -// private static final String COMMAND_EXECUTION_COMPLETE = "STATUS: COMMAND EXECUTION COMPLETE"; -// private static final String MESSAGE_DFHAC2206 = "DFHAC2206"; -// private static final String NO_SYNTAX_MESSAGES = "THERE ARE NO MESSAGES"; -// private static final String WRONG_CICS_REGION = "Provided terminal does not belong to the correct CICS TS Region"; -// -// private static final String COMMAND_VALUE = "COMMAND"; -// private static final String TEXT_VARIABLE_NAME = "&VARIABLE"; -// private static final String TEXT_VARIABLE_VALUE = "VARIABLE"; -// private static final String PROGRAM_NAME = "MYPROG"; -// private static final String CHANNEL_NAME = "CHANNEL"; -// private static final String CONTAINER_NAME = "CONTAINER"; -// private static final String SPACES = " "; -// -// @Mock -// private ICicsTerminal ceciTerminalMock; -// -// @Mock -// private ICicsTerminal wrongCeciTerminalMock; -// -// @Mock -// private ICicsRegion cicsRegionMock; -// -// @Mock -// private ICicsRegion wrongCicsRegionMock; -// -// @Mock -// private ICeciResponse ceciResponseMock; -// -// @Before -// public void setup() throws FieldNotFoundException, KeyboardLockedException, NetworkException, TerminalInterruptedException, TimeoutException { -// ceci = new CeciImpl(null, cicsRegionMock); -// ceciSpy = Mockito.spy(ceci); -// -// // Mock all terminal function -// Mockito.when(ceciTerminalMock.type(Mockito.any())).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.enter()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf2()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf3()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf4()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf5()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf9()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf10()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.pf11()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.tab()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.home()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.newLine()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.cursorLeft()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.eraseEof()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.reportScreenWithCursor()).thenReturn(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.getCicsRegion()).thenReturn(cicsRegionMock); -// Mockito.when(wrongCeciTerminalMock.getCicsRegion()).thenReturn(wrongCicsRegionMock); -// } -// -// @Test -// public void teststartCECISession() throws Exception { -// setupTestIssueCommand(); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(INITIAL_SCREEN_ID); -// Mockito.when(ceciTerminalMock.isClearScreen()).thenReturn(true); -// ceciSpy.startCECISession(ceciTerminalMock); -// -// Mockito.when(ceciTerminalMock.isClearScreen()).thenReturn(false); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("NOT_INITIAL_SCREEN_ID"); -// String expectedMessage = "Not on CECI initial screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.startCECISession(ceciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// -// Mockito.when(ceciTerminalMock.resetAndClear()).thenThrow(new CicstsManagerException()); -// expectedMessage = "Problem starting CECI session"; -// expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.startCECISession(ceciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// -// expectedMessage = WRONG_CICS_REGION; -// expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.startCECISession(wrongCeciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testIssueCommand() throws Exception { -// setupTestIssueCommand(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(COMMAND_EXECUTION_COMPLETE); -// Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE)); -// -// PowerMockito.doReturn(COMMAND_VALUE).when(ceciSpy, "retrieveVariableText", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("USER SCREEN").thenReturn("USER SCREEN").thenReturn(COMMAND_EXECUTION_COMPLETE); -// Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE)); -// -// Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE, null)); -// -// HashMap options = new HashMap<>(); -// Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE, options)); -// -// options.put("KEY1", null); -// options.put("KEY2", ""); -// options.put("KEY3", "VALUE"); -// Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE, options)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.issueCommand(wrongCeciTerminalMock, COMMAND_VALUE, true); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testIssueCommandException1() throws Exception { -// setupTestIssueCommand(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(MESSAGE_DFHAC2206); -// String expectedMessage = "Command abended - see previous screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testIssueCommandException2() throws Exception { -// setupTestIssueCommand(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("USER SCREEN").thenReturn("USER SCREEN").thenReturn("USER SCREEN"); -// String expectedMessage = "Command failed - see previous screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// -// } -// -// @Test -// public void testIssueCommandException3() throws Exception { -// setupTestIssueCommand(); -// -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Error issuing CECI command"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// -// } -// -// @Test -// public void testIssueCommandException4() throws Exception { -// setupTestIssueCommand(); -// -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Error issuing CECI command"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// -// } -// -// private void setupTestIssueCommand() throws Exception { -// PowerMockito.doReturn(0).when(ceciSpy, "defineVariableText", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isCeciScreen"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "initialScreen"); -// PowerMockito.doNothing().when(ceciSpy, "checkForSyntaxMessages"); -// PowerMockito.doReturn(ceciResponseMock).when(ceciSpy, "newCeciResponse", Mockito.anyBoolean()); -// } -// -// @Test -// public void testDefineVariableText() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// -// Assert.assertEquals("Error in defineVariableText() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.defineVariableText(ceciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariableText(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDefineVariableBinary() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy, "setVariableHex", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in defineVariableBinary() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.defineVariableBinary(ceciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray())); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariableBinary(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDefineVariableDoubleWord() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(99).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in defineVariableDoubleWord() method", 99, ceciSpy.defineVariableDoubleWord(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariableDoubleWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDefineVariableFullWord() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(99).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in defineVariableFullWord() method", 99, ceciSpy.defineVariableFullWord(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariableFullWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDefineVariableHalfWord() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(99).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in defineVariableHalfWord() method", 99, ceciSpy.defineVariableHalfWord(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariableHalfWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDefineVariable4BytePacked() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(99).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in defineVariablePacked() method", 99, ceciSpy.defineVariable4BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariable4BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDefineVariable8BytePacked() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(99).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in defineVariablePacked() method", 99, ceciSpy.defineVariable8BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.defineVariable8BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariableText() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE).when(ceciSpy, "getVariable", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in retrieveVariableText() method", TEXT_VARIABLE_VALUE, ceciSpy.retrieveVariableText(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariableText(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariableBinary() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.toCharArray()).when(ceciSpy, "getVariableHex", Mockito.any()); -// Assert.assertTrue("Error in retrieveVariableBinary() method", Arrays.equals(TEXT_VARIABLE_VALUE.toCharArray(), ceciSpy.retrieveVariableBinary(ceciTerminalMock, TEXT_VARIABLE_NAME))); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariableBinary(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariableDoubleWord() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn("99").when(ceciSpy, "getVariable", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in retrieveVariableDoubleWord() method", 99L, ceciSpy.retrieveVariableDoubleWord(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariableDoubleWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariableFullWord() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn("99").when(ceciSpy, "getVariable", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in retrieveVariableFullWord() method", 99, ceciSpy.retrieveVariableFullWord(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariableFullWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariableHalfWord() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn("99").when(ceciSpy, "getVariable", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in retrieveVariableHalfWord() method", 99, ceciSpy.retrieveVariableHalfWord(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariableHalfWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariable4BytePacked() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn("99").when(ceciSpy, "getVariable", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in retrieveVariablePacked() method", 99, ceciSpy.retrieveVariable4BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariable4BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testRetrieveVariable8BytePacked() throws Exception { -// PowerMockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy, "validateVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// PowerMockito.doReturn("99").when(ceciSpy, "getVariable", Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in retrieveVariablePacked() method", 99, ceciSpy.retrieveVariable8BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.retrieveVariable8BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteVariable() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(SPACES); -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(1)).invoke("retrieveScreen"); -// -// Mockito.clearInvocations(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)) -// .thenReturn(SPACES); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(2)).invoke("retrieveScreen"); -// -// Mockito.clearInvocations(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)) -// .thenReturn(SPACES); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "XXXX")) -// .thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(2)).invoke("retrieveScreen"); -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME.substring(1)); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(3)).invoke("retrieveScreen"); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteVariable(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteVariableException1() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "XXXX")) -// .thenReturn("PF"); -// String expectedMessage = "Unable to find variable to delete"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteVariableException2() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "XXXX")) -// .thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); -// String expectedMessage = "Delete variable failed"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteVariableException3() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to delete variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteVariableException4() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to delete variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteAllVariables() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(""); -// ceciSpy.deleteAllVariables(ceciTerminalMock); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(55)).invoke("tab"); -// -// Mockito.clearInvocations(ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("PF"); -// ceciSpy.deleteAllVariables(ceciTerminalMock); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(1)).invoke("tab"); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteAllVariables(wrongCeciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteAllVariablesException1() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(""); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to delete all variables"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteAllVariables(ceciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testDeleteAllVariablesException2() throws Exception { -// setupTestDeleteVariable(); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(""); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to delete all variables"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.deleteAllVariables(ceciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// private void setupTestDeleteVariable() throws Exception { -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "hexOff"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "variableScreen"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// } -// -// @Test -// public void testGetEIB() throws Exception { -// setupTestGetEIB(); -// -// Assert.assertTrue("Error in getEIB() method", ceciSpy.getEIB(ceciTerminalMock) instanceof CeciExecInterfaceBlockImpl); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getEIB(wrongCeciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testGetEIBException1() throws Exception { -// setupTestGetEIB(); -// -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to navigate to EIB screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getEIB(ceciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetEIBException2() throws Exception { -// setupTestGetEIB(); -// -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to navigate to EIB screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getEIB(ceciTerminalMock); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// private void setupTestGetEIB() throws Exception { -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "hexOff"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "hexOn"); -// } -// -// @Test -// public void testLinkProgram() throws Exception { -// PowerMockito.doReturn(ceciResponseMock).when(ceciSpy, "issueCommand", Mockito.any(), Mockito.any()); -// -// Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, null, null, null, false)); -// -// Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, TEXT_VARIABLE_NAME, "SYSID", null, false)); -// -// Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, TEXT_VARIABLE_NAME, null, "TRAN", false)); -// -// Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, TEXT_VARIABLE_NAME, null, null, true)); -// -// PowerMockito.doReturn(0).when(ceciSpy, "defineVariableText", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, "COMMAREA", null, null, false)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.linkProgram(wrongCeciTerminalMock, PROGRAM_NAME, null, null, null, false); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testLinkProgramWithChannel() throws Exception { -// PowerMockito.doReturn(ceciResponseMock).when(ceciSpy, "issueCommand", Mockito.any(), Mockito.any()); -// -// Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, null, null, null, false)); -// -// Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, CHANNEL_NAME, "SYSID", null, false)); -// -// Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, CHANNEL_NAME, null, "TRAN", false)); -// -// Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, CHANNEL_NAME, null, null, true)); -// -// PowerMockito.doReturn(0).when(ceciSpy, "defineVariableText", Mockito.any(), Mockito.any(), Mockito.any()); -// Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, "CHANNEL_NAME", null, null, false)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.linkProgramWithChannel(wrongCeciTerminalMock, PROGRAM_NAME, null, null, null, false); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testPutContainer() throws Exception { -// PowerMockito.doReturn(ceciResponseMock).when(ceciSpy, "issueCommand", Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// -// Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_VALUE, null, null, null)); -// -// Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null, null)); -// -// Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, "CHAR", null, null)); -// -// Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, "CCID", null)); -// -// Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null, "CODEPAGE")); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.putContainer(wrongCeciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_VALUE, null, null, null); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testGetContainer() throws Exception { -// PowerMockito.doReturn(ceciResponseMock).when(ceciSpy, "issueCommand", Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy, "setVariable", Mockito.any(), Mockito.any(), Mockito.any()); -// -// Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null)); -// -// Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, "CCID", null)); -// -// Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, "CODEPAGE")); -// -// Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME.substring(1), null, null)); -// -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getContainer(wrongCeciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null); -// }); -// Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); -// } -// -// @Test -// public void testInitialScreen() throws Exception { -// setupTestInitialScreen(); -// -// PowerMockito.doReturn(true).when(ceciSpy, "isCeciScreen"); -// PowerMockito.doReturn(false).when(ceciSpy, "isHelpScreen", Mockito.any()); -// Assert.assertEquals("Error in initialScreen() method", ceciTerminalMock, ceciSpy.initialScreen()); -// -// PowerMockito.doReturn(true).when(ceciSpy, "isHelpScreen", Mockito.any()); -// Assert.assertEquals("Error in initialScreen() method", ceciTerminalMock, ceciSpy.initialScreen()); -// -// PowerMockito.when(ceciSpy, "isCeciScreen").thenReturn(false).thenReturn(true); -// Assert.assertEquals("Error in initialScreen() method", ceciTerminalMock, ceciSpy.initialScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isInitialScreen", Mockito.any()); -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.initialScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", "Unable to navigate to CECI initial screen", expectedException.getMessage()); -// } -// -// @Test -// public void testInitialScreenException1() throws Exception { -// setupTestInitialScreen(); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isCeciScreen"); -// String expectedMessage = "Cannot identify terminal as CECI session"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.initialScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testInitialScreenException2() throws Exception { -// setupTestInitialScreen(); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isCeciScreen"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to navigate to CECI initial screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.initialScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testInitialScreenException3() throws Exception { -// setupTestInitialScreen(); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isCeciScreen"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to navigate to CECI initial screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.initialScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// private void setupTestInitialScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(INITIAL_SCREEN_ID); -// } -// -// @Test -// public void testVariableScreen() throws Exception { -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "initialScreen"); -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("").thenReturn(VAR_SCREEN_ID); -// Assert.assertEquals("Error in variableScreen() method", ceciTerminalMock, ceciSpy.variableScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isVariablesScreen", Mockito.any()); -// String expectedMessage = "Unable to navigate to CECI variables screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.variableScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage , expectedException.getMessage()); -// } -// -// @Test -// public void testVariableScreenException1() throws Exception { -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "initialScreen"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to navigate to CECI variables screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.variableScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testVariableScreenException2() throws Exception { -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "initialScreen"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to navigate to CECI variables screen"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.variableScreen(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testisCeciScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(true).when(ceciSpy, "isInitialScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isHelpScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isCommandBeforeScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isCommandAfterScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isEibScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isVariablesScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isVariablesExpansionScreen", Mockito.any()); -// PowerMockito.doReturn(true).when(ceciSpy, "isMsgScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isInitialScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isHelpScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isCommandBeforeScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isCommandAfterScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isEibScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isVariablesScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isVariablesExpansionScreen", Mockito.any()); -// Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isMsgScreen", Mockito.any()); -// Assert.assertFalse("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); -// -// } -// -// @Test -// public void testIsInitialScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isInitialScreen() method", ceciSpy.isInitialScreen(SPACES)); -// } -// -// @Test -// public void testIsCommandBeforeScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isCommandBeforeScreen() method", ceciSpy.isCommandBeforeScreen(SPACES)); -// } -// -// @Test -// public void testIsCommandAfterScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isCommandAfterScreen() method", ceciSpy.isCommandAfterScreen(SPACES)); -// } -// -// @Test -// public void testIsHelpScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isHelpScreen() method", ceciSpy.isHelpScreen(SPACES)); -// } -// -// @Test -// public void testIsEibScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isEibScreen() method", ceciSpy.isEibScreen(SPACES)); -// } -// -// @Test -// public void testIsVariablesScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isVariablesScreen() method", ceciSpy.isVariablesScreen(SPACES)); -// } -// -// @Test -// public void testIsMsgScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isMsgScreen() method", ceciSpy.isMsgScreen(SPACES)); -// } -// -// @Test -// public void testIsVariablesExpansionScreen() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Assert.assertFalse("Error in isVariablesExpansionScreen() method", ceciSpy.isVariablesExpansionScreen(SPACES)); -// } -// -// @Test -// public void testMultipleTab() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// -// Assert.assertEquals("Error in multipleTab() method", ceciTerminalMock, ceciSpy.multipleTab(1)); -// } -// -// @Test -// public void testCheckForSyntaxMessages() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(NO_SYNTAX_MESSAGES); -// -// ceciSpy.checkForSyntaxMessages(); -// PowerMockito.verifyPrivate(ceciTerminalMock, Mockito.times(1)).invoke("enter"); -// } -// -// @Test -// public void testCheckForSyntaxMessagesException1() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Whitebox.setInternalState(ceciSpy, "command", COMMAND_VALUE); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(SPACES); -// String expectedMessage = "Command failed syntax check. \nCommand:\n " + COMMAND_VALUE + "\nSyntax Error Screen:\n" + SPACES; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.checkForSyntaxMessages(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testCheckForSyntaxMessagesException2() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(NO_SYNTAX_MESSAGES); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to check for syntax messages"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.checkForSyntaxMessages(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testCheckForSyntaxMessagesException3() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(NO_SYNTAX_MESSAGES); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to check for syntax messages"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.checkForSyntaxMessages(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testValidateVariable() throws Exception { -// Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray(), null)); -// -// Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME.substring(1), TEXT_VARIABLE_VALUE.toCharArray(), Integer.toString(TEXT_VARIABLE_VALUE.length()))); -// -// Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray(), null)); -// -// Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME, null, null)); -// -// String name = "&234567890"; -// Assert.assertEquals("Error in validateVariable() method", name, ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null)); -// -// name = "&azAZ09@#"; -// Assert.assertEquals("Error in validateVariable() method", name, ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null)); -// } -// -// @Test -// public void testValidateVariableException1() throws Exception { -// String name = "&2345678901"; -// String expectedMessage = "CECI variable name \"" + name + "\" greater than maximum length of 10 characters including the leading \"&\""; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testValidateVariableException2() throws Exception { -// String name = "&?"; -// String expectedMessage = "CECI variable name \"" + name + "\" invalid must. Must start with \"&\" and can contain one of more [a-zA-Z0-9@#]"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testValidateVariableException3() throws Exception { -// String value = "123456789"; -// String type = "H"; -// int maxLength = 6; -// String expectedMessage = "CECI variable value length " + value.length() + " greater than maximum of " + maxLength + " for type \"" + type + "\"" ; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.validateVariable(TEXT_VARIABLE_NAME, value.toCharArray(), type); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testValidateVariableException4() throws Exception { -// String value = new String(new char[32768]).replace("\0", "X"); -// String expectedMessage = "CECI variable value length " + value.length() + " greater than maximum 32767"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.validateVariable(TEXT_VARIABLE_NAME, value.toCharArray(), null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariable() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy, "setVariableOnPage", Mockito.any(), Mockito.anyInt(), Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "X")).thenReturn(String.format("%-10s", " ")); -// Assert.assertEquals("Error in setVariable() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null)); -// -// Assert.assertEquals("Error in setVariable() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariable(TEXT_VARIABLE_NAME + "X", TEXT_VARIABLE_VALUE, null)); -// -// Assert.assertEquals("Error in setVariable() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, "H")); -// -// int length = 1281; -// Mockito.when(ceciSpy.setVariableOnPage(Mockito.any(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(20).thenReturn(21); -// Assert.assertEquals("Error in setVariable() method", length, ceciSpy.setVariable(TEXT_VARIABLE_NAME, new String(new char[length]).replace("\0", "X"), null)); -// } -// -// @Test -// public void testSetVariableException1() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn("PF").when(ceciTerminalMock, "retrieveFieldAtCursor"); -// String expectedMessage = "No space on CECI variable screen for new variables"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariableException2() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock, "retrieveFieldAtCursor"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to set CECI variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariableException3() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock, "retrieveFieldAtCursor"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to set CECI variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// private void setupTestVariable() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doNothing().when(ceciSpy, "deleteVariable", Mockito.any(), Mockito.any()); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "hexOff"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "variableScreen"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "moveToVariable", Mockito.any()); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// } -// -// @Test -// public void testSetVariableOnPage() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// -// String[] chunks = new String[] {TEXT_VARIABLE_VALUE, TEXT_VARIABLE_VALUE}; -// int start = 0; -// int numberOfLines = 1; -// Assert.assertEquals("Error in setVariableOnPage() method", numberOfLines, ceciSpy.setVariableOnPage(chunks, start, numberOfLines)); -// -// numberOfLines = 2; -// Assert.assertEquals("Error in setVariableOnPage() method", numberOfLines, ceciSpy.setVariableOnPage(chunks, start, numberOfLines)); -// -// chunks = new String[] {String.format("%-65s", "X"), TEXT_VARIABLE_VALUE}; -// Assert.assertEquals("Error in setVariableOnPage() method", numberOfLines, ceciSpy.setVariableOnPage(chunks, start, numberOfLines)); -// } -// -// @Test -// public void testSetVariableOnPageException() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.type(Mockito.any())).thenThrow(new FieldNotFoundException()); -// String expectedMessage = "Unable enter variable data"; -// -// String[] chunks = new String[] {TEXT_VARIABLE_VALUE, TEXT_VARIABLE_VALUE}; -// int start = 0; -// int numberOfLines = 1; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariableOnPage(chunks, start, numberOfLines); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariableHex() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy, "setVariableHexOnPage", Mockito.any(), Mockito.anyInt(), Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "X")).thenReturn(String.format("%-10s", " ")); -// Assert.assertEquals("Error in setVariableHex() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray())); -// -// Assert.assertEquals("Error in setVariableHex() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariableHex(TEXT_VARIABLE_NAME + "X", TEXT_VARIABLE_VALUE.toCharArray())); -// -// int length = 21; -// char[] value = new String(new char[length]).replace("\0", "X").toCharArray(); -// Mockito.when(ceciSpy.setVariableHexOnPage(Mockito.any(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(20).thenReturn(21); -// Assert.assertEquals("Error in setVariableHex() method", length, ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, value)); -// } -// -// @Test -// public void testSetVariableHexException1() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn("PF").when(ceciTerminalMock, "retrieveFieldAtCursor"); -// String expectedMessage = "No space on CECI variable screen for new variables"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariableHexException2() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock, "retrieveFieldAtCursor"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to set CECI binary variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariableHexException3() throws Exception { -// setupTestVariable(); -// PowerMockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock, "retrieveFieldAtCursor"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to set CECI binary variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testSetVariableHexOnPage() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// -// char[] value = TEXT_VARIABLE_VALUE.toCharArray(); -// int start = 0; -// int numberOfLines = 1; -// Assert.assertEquals("Error in setVariableHexOnPage() method", value.length, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); -// -// value = new String(new char[32]).replace("\0", "X").toCharArray(); -// numberOfLines = 2; -// Assert.assertEquals("Error in setVariableHexOnPage() method", value.length, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); -// -// numberOfLines = -1; -// Assert.assertEquals("Error in setVariableHexOnPage() method", 0, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); -// -// value = new char[0]; -// numberOfLines = -1; -// Assert.assertEquals("Error in setVariableHexOnPage() method", value.length, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); -// } -// -// @Test -// public void testSetVariableHexOnPageException() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.type(Mockito.any())).thenThrow(new FieldNotFoundException()); -// String expectedMessage = "Unable enter variable data"; -// -// char[] value = TEXT_VARIABLE_VALUE.toCharArray(); -// int start = 0; -// int numberOfLines = 1; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.setVariableHexOnPage(value, start, numberOfLines); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariable() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length())); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE).when(ceciSpy, "getVariableFromPage", Mockito.anyInt(), Mockito.anyInt()); -// -// Assert.assertEquals("Error in getVariable() method", TEXT_VARIABLE_VALUE, ceciSpy.getVariable(TEXT_VARIABLE_NAME, null)); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length()*2)); -// Assert.assertEquals("Error in getVariable() method", TEXT_VARIABLE_VALUE + TEXT_VARIABLE_VALUE, ceciSpy.getVariable(TEXT_VARIABLE_NAME, null)); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("H"); -// String value = String.format("%012d", 0); -// PowerMockito.doReturn(value).when(ceciSpy, "getVariableFromPage", Mockito.anyInt(), Mockito.anyInt()); -// Assert.assertEquals("Error in getVariable() method", value, ceciSpy.getVariable(TEXT_VARIABLE_NAME, "H")); -// } -// -// @Test -// public void testGetVariableException1() throws Exception { -// setupTestGetVariable(); -// String lengthString = "XXXX"; -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(lengthString); -// String expectedMessage = "Unexpected variable type \"" + lengthString + "\" for \"" + TEXT_VARIABLE_NAME + "\""; -// String type = "H"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariable(TEXT_VARIABLE_NAME, type); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariableException2() throws Exception { -// setupTestGetVariable(); -// String lengthString = "XXXX"; -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(lengthString); -// String expectedMessage = "Unable to determine variable field length"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariable(TEXT_VARIABLE_NAME, null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariableException3() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to get CECI variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariable(TEXT_VARIABLE_NAME, null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariableException4() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to get CECI variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariable(TEXT_VARIABLE_NAME, null); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// private void setupTestGetVariable() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "moveToVariable", Mockito.any()); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// } -// -// @Test -// public void getVariableFromPage() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(TEXT_VARIABLE_VALUE); -// -// Assert.assertEquals("Error in getVariableFromPage() method", TEXT_VARIABLE_VALUE, ceciSpy.getVariableFromPage(TEXT_VARIABLE_VALUE.length(), 1)); -// -// Assert.assertEquals("Error in getVariableFromPage() method", TEXT_VARIABLE_VALUE, ceciSpy.getVariableFromPage(TEXT_VARIABLE_VALUE.length()*2, 1)); -// -// } -// -// @Test -// public void getVariableFromPageException1() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(TEXT_VARIABLE_VALUE); -// Mockito.when(ceciTerminalMock.tab()).thenThrow(new FieldNotFoundException()); -// String expectedMessage = "Unable to get variable from page"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariableFromPage(1, 1); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// -// } -// -// @Test -// public void testGetVariableHex() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length())).thenReturn(TEXT_VARIABLE_VALUE); -// PowerMockito.doReturn(TEXT_VARIABLE_VALUE).when(ceciSpy, "getVariableHexFromPage", Mockito.anyInt(), Mockito.anyInt()); -// -// Assert.assertTrue("Error in getVariableHex() method", Arrays.equals(TEXT_VARIABLE_VALUE.toCharArray(), ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE))); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length()*2)).thenReturn(TEXT_VARIABLE_VALUE); -// Assert.assertTrue("Error in getVariableHex() method", Arrays.equals((TEXT_VARIABLE_VALUE + TEXT_VARIABLE_VALUE).toCharArray(), ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE))); -// } -// -// @Test -// public void testGetVariableHexException1() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("XXXX"); -// String expectedMessage = "Unable to determine variable field length"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariableHexException2() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to get CECI binary variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariableHexException3() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to get CECI binary variable"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetVariableHexPage() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("5A5A5A5A"); -// -// Assert.assertEquals("Error in getVariableHexFromPage() method", "ZZZZ", ceciSpy.getVariableHexFromPage(4, 1)); -// -// Assert.assertEquals("Error in getVariableHexFromPage() method", "ZZZZZZZZZZZZZZZZ", ceciSpy.getVariableHexFromPage(20, 1)); -// } -// -// @Test -// public void testGetVariableHexPageException1() throws Exception { -// setupTestGetVariable(); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("5A5A5A5A"); -// Mockito.when(ceciTerminalMock.tab()).thenThrow(new FieldNotFoundException()); -// String expectedMessage = "Unable to get binary variable from page"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getVariableHexFromPage(4, 1); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testMoveToVariable() throws Exception { -// setupMoveToVariable(); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(TEXT_VARIABLE_NAME + " "); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "X")).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); -// -// Assert.assertEquals("Error in moveToVariable() method", ceciTerminalMock, ceciSpy.moveToVariable(TEXT_VARIABLE_NAME)); -// } -// -// @Test -// public void testMoveToVariableException1() throws Exception { -// setupMoveToVariable(); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" "); -// String expectedMessage = "Unable to find variable " + TEXT_VARIABLE_NAME; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.moveToVariable(TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testMoveToVariableException2() throws Exception { -// setupMoveToVariable(); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(TEXT_VARIABLE_NAME + " "); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("PF"); -// String expectedMessage = "Unable to find variable " + TEXT_VARIABLE_NAME; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.moveToVariable(TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testMoveToVariableException3() throws Exception { -// setupMoveToVariable(); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(TEXT_VARIABLE_NAME + " "); -// Mockito.when(ceciTerminalMock.newLine()).thenThrow(new FieldNotFoundException()); -// String expectedMessage = "Problem serching for variable " + TEXT_VARIABLE_NAME; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.moveToVariable(TEXT_VARIABLE_NAME); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// private void setupMoveToVariable() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "hexOff"); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "variableScreen"); -// } -// -// @Test -// public void testIsHexOn() throws CeciException { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" EIBTIME = X'00"); -// -// Assert.assertTrue("Error in isHexOn() method", ceciSpy.isHexOn()); -// } -// -// @Test -// public void testIsHexOnException1() throws CeciException, TimeoutException, KeyboardLockedException, TerminalInterruptedException { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" EIBTIME = X'00"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to determine if CECI is in HEX mode"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.isHexOn(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testIsHexOnException2() throws CeciException, TimeoutException, KeyboardLockedException, TerminalInterruptedException { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" EIBTIME = X'00"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to determine if CECI is in HEX mode"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.isHexOn(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testHexOn() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(true).when(ceciSpy, "isHexOn"); -// -// Assert.assertEquals("Error in hexOn() method", ceciTerminalMock, ceciSpy.hexOn()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isHexOn"); -// Assert.assertEquals("Error in hexOn() method", ceciTerminalMock, ceciSpy.hexOn()); -// } -// -// @Test -// public void testHexOnException1() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(false).when(ceciSpy, "isHexOn"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to set CECI HEX ON"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.hexOn(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testHexOnException2() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(false).when(ceciSpy, "isHexOn"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to set CECI HEX ON"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.hexOn(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testHexOff() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(true).when(ceciSpy, "isHexOn"); -// -// Assert.assertEquals("Error in hexOff() method", ceciTerminalMock, ceciSpy.hexOff()); -// -// PowerMockito.doReturn(false).when(ceciSpy, "isHexOn"); -// Assert.assertEquals("Error in hexOff() method", ceciTerminalMock, ceciSpy.hexOff()); -// } -// -// @Test -// public void testHexOffException1() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(true).when(ceciSpy, "isHexOn"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to set CECI HEX OFF"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.hexOff(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testHexOffException2() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(true).when(ceciSpy, "isHexOn"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to set CECI HEX OFF"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.hexOff(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testNewCeciResponse() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" RESPONSE: FILENOTFOUND EIBRESP=+0000000012 EIBRESP2=+0000000001 "); -// PowerMockito.doReturn(new LinkedHashMap<>()).when(ceciSpy, "parseResponseOutput"); -// -// ICeciResponse ceciResponse = ceciSpy.newCeciResponse(false); -// -// ceciSpy.newCeciResponse(true); -// Assert.assertEquals("Error in newCeciResponse() method", "FILENOTFOUND", ceciResponse.getResponse()); -// Assert.assertEquals("Error in newCeciResponse() method", 12, ceciResponse.getEIBRESP()); -// Assert.assertEquals("Error in newCeciResponse() method", 1, ceciResponse.getEIBRESP2()); -// } -// -// @Test -// public void testParseResponseOutput() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION1").thenReturn("OPTION2"); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("OPTION= OPTION1 LENGTH= +00008 ").thenReturn("OPTION= OPTION2 LENGTH= +00008 "); -// PowerMockito.doReturn(new ResponseOutputValueImpl("XXXXXXXX")).when(ceciSpy, "getOptionValue", Mockito.any()); -// -// Assert.assertTrue("Error in parseResponseOutput() method", ceciSpy.parseResponseOutput().containsKey("OPTION1")); -// -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION3").thenReturn("OPTION4").thenReturn("PF"); -// Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("OPTION= OPTION3 LENGTH= +00008 ").thenReturn("OPTION= OPTION4 LENGTH= +00008 "); -// Assert.assertTrue("Error in parseResponseOutput() method", ceciSpy.parseResponseOutput().containsKey("OPTION4")); -// } -// -// @Test -// public void testParseResponseOutputException1() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION1"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to parse command output"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.parseResponseOutput(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testParseResponseOutputException2() throws Exception { -// Whitebox.setInternalState(ceciSpy, "terminal", ceciTerminalMock); -// PowerMockito.doReturn(ceciTerminalMock).when(ceciSpy, "multipleTab", Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION1"); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to parse command output"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.parseResponseOutput(); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetOptionValue() throws Exception { -// setupTestGetVariable(); -// String value = "000000"; -// PowerMockito.doReturn(value).when(ceciSpy, "getVariableFromPage", Mockito.anyInt(), Mockito.anyInt()); -// String screen = "OPTION= LENGTH LENGTH= H "; -// -// Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValue(screen).getTextValue()); -// -// PowerMockito.doReturn("000").when(ceciSpy, "getVariableFromPage", Mockito.anyInt(), Mockito.anyInt()); -// Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValue(screen).getTextValue()); -// -// screen = "OPTION= FROM LENGTH= +00001 "; -// PowerMockito.doReturn("F1").when(ceciSpy, "getOptionValueInHex", Mockito.anyInt(), Mockito.anyInt()); -// Assert.assertTrue("Error in getOptionValue() method", Arrays.equals(new char[] {'F', '1'}, ceciSpy.getOptionValue(screen).getHexValue())); -// } -// -// @Test -// public void testGetOptionValueException1() throws Exception { -// setupTestGetVariable(); -// PowerMockito.doReturn("000").when(ceciSpy, "getVariableFromPage", Mockito.anyInt(), Mockito.anyInt()); -// String screen = "OPTION= LENGTH LENGTH= H "; -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to parse command output option value"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getOptionValue(screen); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetOptionValueException2() throws Exception { -// setupTestGetVariable(); -// PowerMockito.doReturn("000").when(ceciSpy, "getVariableFromPage", Mockito.anyInt(), Mockito.anyInt()); -// String screen = "OPTION= LENGTH LENGTH= H "; -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to parse command output option value"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getOptionValue(screen); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetOptionValueInHex() throws Exception { -// setupTestGetVariable(); -// String value = "F1F1"; -// PowerMockito.doReturn(value).when(ceciSpy, "getVariableHexFromPage", Mockito.anyInt(), Mockito.anyInt()); -// -// Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValueInHex(1, 0)); -// -// Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValueInHex(1, 1)); -// -// Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValueInHex(2, 0)); -// -// Assert.assertEquals("Error in getOptionValue() method", value + value, ceciSpy.getOptionValueInHex(5, 0)); -// } -// -// @Test -// public void testGetOptionValueInHexException1() throws Exception { -// setupTestGetVariable(); -// PowerMockito.doReturn("F1").when(ceciSpy, "getVariableHexFromPage", Mockito.anyInt(), Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); -// String expectedMessage = "Unable to parse command output binary option value"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getOptionValueInHex(1, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } -// -// @Test -// public void testGetOptionValueInHexException2() throws Exception { -// setupTestGetVariable(); -// PowerMockito.doReturn("F1").when(ceciSpy, "getVariableHexFromPage", Mockito.anyInt(), Mockito.anyInt()); -// Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); -// String expectedMessage = "Unable to parse command output binary option value"; -// CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ -// ceciSpy.getOptionValueInHex(1, 0); -// }); -// Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); -// } + private CeciImpl ceci; + + private CeciImpl ceciSpy; + + // Static fields in CeciImpl + private static final String INITIAL_SCREEN_ID = "STATUS: ENTER ONE OF THE FOLLOWING"; + private static final String VAR_SCREEN_ID = "VARIABLES LENGTH DATA"; + private static final String COMMAND_EXECUTION_COMPLETE = "STATUS: COMMAND EXECUTION COMPLETE"; + private static final String MESSAGE_DFHAC2206 = "DFHAC2206"; + private static final String NO_SYNTAX_MESSAGES = "THERE ARE NO MESSAGES"; + private static final String WRONG_CICS_REGION = "Provided terminal does not belong to the correct CICS TS Region"; + + private static final String COMMAND_VALUE = "COMMAND"; + private static final String TEXT_VARIABLE_NAME = "&VARIABLE"; + private static final String TEXT_VARIABLE_VALUE = "VARIABLE"; + private static final String PROGRAM_NAME = "MYPROG"; + private static final String CHANNEL_NAME = "CHANNEL"; + private static final String CONTAINER_NAME = "CONTAINER"; + private static final String SPACES = " "; + + @Mock + private ICicsTerminal ceciTerminalMock; + + @Mock + private ICicsTerminal wrongCeciTerminalMock; + + @Mock + private ICicsRegion cicsRegionMock; + + @Mock + private ICicsRegion wrongCicsRegionMock; + + @Mock + private ICeciResponse ceciResponseMock; + + @Before + public void setup() throws FieldNotFoundException, KeyboardLockedException, NetworkException, TerminalInterruptedException, TimeoutException { + ceci = new CeciImpl(null, cicsRegionMock); + ceciSpy = Mockito.spy(ceci); + + // Mock all terminal function + Mockito.when(ceciTerminalMock.type(Mockito.any())).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.enter()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf2()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf3()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf4()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf5()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf9()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf10()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.pf11()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.tab()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.home()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.newLine()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.eraseEof()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.reportScreenWithCursor()).thenReturn(ceciTerminalMock); + Mockito.when(ceciTerminalMock.getCicsRegion()).thenReturn(cicsRegionMock); + Mockito.when(wrongCeciTerminalMock.getCicsRegion()).thenReturn(wrongCicsRegionMock); + } + + @Test + public void teststartCECISession() throws Exception { + setupTestIssueCommand(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(INITIAL_SCREEN_ID); + Mockito.when(ceciTerminalMock.isClearScreen()).thenReturn(true); + ceciSpy.startCECISession(ceciTerminalMock); + + Mockito.when(ceciTerminalMock.isClearScreen()).thenReturn(false); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("NOT_INITIAL_SCREEN_ID"); + String expectedMessage = "Not on CECI initial screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.startCECISession(ceciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + + Mockito.when(ceciTerminalMock.resetAndClear()).thenThrow(new CicstsManagerException()); + expectedMessage = "Problem starting CECI session"; + expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.startCECISession(ceciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + + expectedMessage = WRONG_CICS_REGION; + expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.startCECISession(wrongCeciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testIssueCommand() throws Exception { + setupTestIssueCommand(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(COMMAND_EXECUTION_COMPLETE); + Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE)); + + Mockito.doReturn(COMMAND_VALUE).when(ceciSpy).retrieveVariableText(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("USER SCREEN").thenReturn("USER SCREEN").thenReturn(COMMAND_EXECUTION_COMPLETE); + Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE)); + + Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE, null)); + + HashMap options = new HashMap<>(); + Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE, options)); + + options.put("KEY1", null); + options.put("KEY2", ""); + options.put("KEY3", "VALUE"); + Assert.assertEquals("Error in issueCommand() method", ceciResponseMock, ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE, options)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.issueCommand(wrongCeciTerminalMock, COMMAND_VALUE, true); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testIssueCommandException1() throws Exception { + setupTestIssueCommand(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(MESSAGE_DFHAC2206); + String expectedMessage = "Command abended - see previous screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testIssueCommandException2() throws Exception { + setupTestIssueCommand(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("USER SCREEN").thenReturn("USER SCREEN").thenReturn("USER SCREEN"); + String expectedMessage = "Command failed - see previous screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + + } + + @Test + public void testIssueCommandException3() throws Exception { + setupTestIssueCommand(); + + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Error issuing CECI command"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + + } + + @Test + public void testIssueCommandException4() throws Exception { + setupTestIssueCommand(); + + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Error issuing CECI command"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.issueCommand(ceciTerminalMock, COMMAND_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + + } + + private void setupTestIssueCommand() throws Exception { + Mockito.doReturn(0).when(ceciSpy).defineVariableText(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).initialScreen(); + Mockito.doNothing().when(ceciSpy).checkForSyntaxMessages(); + Mockito.doReturn(ceciResponseMock).when(ceciSpy).newCeciResponse(Mockito.anyBoolean()); + } + + @Test + public void testDefineVariableText() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariableText() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.defineVariableText(ceciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariableText(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDefineVariableBinary() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy).setVariableHex(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariableBinary() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.defineVariableBinary(ceciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray())); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariableBinary(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDefineVariableDoubleWord() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(99).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariableDoubleWord() method", 99, ceciSpy.defineVariableDoubleWord(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariableDoubleWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDefineVariableFullWord() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(99).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariableFullWord() method", 99, ceciSpy.defineVariableFullWord(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariableFullWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDefineVariableHalfWord() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(99).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariableHalfWord() method", 99, ceciSpy.defineVariableHalfWord(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariableHalfWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDefineVariable4BytePacked() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(99).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariablePacked() method", 99, ceciSpy.defineVariable4BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariable4BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDefineVariable8BytePacked() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(99).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in defineVariablePacked() method", 99, ceciSpy.defineVariable8BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME, 0)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.defineVariable8BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME, 0); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariableText() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(TEXT_VARIABLE_VALUE).when(ceciSpy).getVariable(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in retrieveVariableText() method", TEXT_VARIABLE_VALUE, ceciSpy.retrieveVariableText(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariableText(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariableBinary() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn(TEXT_VARIABLE_VALUE.toCharArray()).when(ceciSpy).getVariableHex(Mockito.any()); + Assert.assertTrue("Error in retrieveVariableBinary() method", Arrays.equals(TEXT_VARIABLE_VALUE.toCharArray(), ceciSpy.retrieveVariableBinary(ceciTerminalMock, TEXT_VARIABLE_NAME))); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariableBinary(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariableDoubleWord() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn("99").when(ceciSpy).getVariable(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in retrieveVariableDoubleWord() method", 99L, ceciSpy.retrieveVariableDoubleWord(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariableDoubleWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariableFullWord() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn("99").when(ceciSpy).getVariable(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in retrieveVariableFullWord() method", 99, ceciSpy.retrieveVariableFullWord(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariableFullWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariableHalfWord() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn("99").when(ceciSpy).getVariable(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in retrieveVariableHalfWord() method", 99, ceciSpy.retrieveVariableHalfWord(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariableHalfWord(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariable4BytePacked() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn("99").when(ceciSpy).getVariable(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in retrieveVariablePacked() method", 99, ceciSpy.retrieveVariable4BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariable4BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testRetrieveVariable8BytePacked() throws Exception { + Mockito.doReturn(TEXT_VARIABLE_NAME).when(ceciSpy).validateVariable(Mockito.any(),Mockito.any(),Mockito.any()); + Mockito.doReturn("99").when(ceciSpy).getVariable(Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in retrieveVariablePacked() method", 99, ceciSpy.retrieveVariable8BytePacked(ceciTerminalMock, TEXT_VARIABLE_NAME)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.retrieveVariable8BytePacked(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDeleteVariable() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(SPACES); + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + Mockito.verify(ceciTerminalMock,Mockito.times(1)).retrieveScreen(); + + Mockito.clearInvocations(ceciTerminalMock); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)) + .thenReturn(SPACES); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + Mockito.verify(ceciTerminalMock,Mockito.times(2)).retrieveScreen(); + + Mockito.clearInvocations(ceciTerminalMock); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)) + .thenReturn(SPACES); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "XXXX")) + .thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + Mockito.verify(ceciTerminalMock,Mockito.times(2)).retrieveScreen(); + + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME.substring(1)); + Mockito.verify(ceciTerminalMock,Mockito.times(3)).retrieveScreen(); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteVariable(wrongCeciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDeleteVariableException1() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "XXXX")) + .thenReturn("PF"); + String expectedMessage = "Unable to find variable to delete"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testDeleteVariableException2() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "XXXX")) + .thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); + String expectedMessage = "Delete variable failed"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testDeleteVariableException3() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to delete variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testDeleteVariableException4() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(String.format(" %-10s %+06d %s", TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.length(), TEXT_VARIABLE_VALUE)); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to delete variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteVariable(ceciTerminalMock, TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testDeleteAllVariables() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(""); + ceciSpy.deleteAllVariables(ceciTerminalMock); + Mockito.verify(ceciTerminalMock,Mockito.times(55)).tab(); + + Mockito.clearInvocations(ceciTerminalMock); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("PF"); + ceciSpy.deleteAllVariables(ceciTerminalMock); + Mockito.verify(ceciTerminalMock,Mockito.times(1)).tab(); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteAllVariables(wrongCeciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testDeleteAllVariablesException1() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(""); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to delete all variables"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteAllVariables(ceciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testDeleteAllVariablesException2() throws Exception { + setupTestDeleteVariable(); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(""); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to delete all variables"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.deleteAllVariables(ceciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + private void setupTestDeleteVariable() throws Exception { + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).hexOff(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).variableScreen(); + } + + @Test + public void testGetEIB() throws Exception { + setupTestGetEIB(); + Assert.assertTrue("Error in getEIB() method", ceciSpy.getEIB(ceciTerminalMock) instanceof CeciExecInterfaceBlockImpl); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getEIB(wrongCeciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testGetEIBException1() throws Exception { + setupTestGetEIB(); + + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to navigate to EIB screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getEIB(ceciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetEIBException2() throws Exception { + setupTestGetEIB(); + + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to navigate to EIB screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getEIB(ceciTerminalMock); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + private void setupTestGetEIB() throws Exception { + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).hexOff(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).hexOn(); + } + + @Test + public void testLinkProgram() throws Exception { + Mockito.doReturn(ceciResponseMock).when(ceciSpy).issueCommand(Mockito.any(),Mockito.any()); + + Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, null, null, null, false)); + + Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, TEXT_VARIABLE_NAME, "SYSID", null, false)); + + Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, TEXT_VARIABLE_NAME, null, "TRAN", false)); + + Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, TEXT_VARIABLE_NAME, null, null, true)); + + Mockito.doReturn(0).when(ceciSpy).defineVariableText(Mockito.any(),Mockito.any(),Mockito.any()); + Assert.assertEquals("Error in linkProgram() method", ceciResponseMock, ceciSpy.linkProgram(ceciTerminalMock, PROGRAM_NAME, "COMMAREA", null, null, false)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.linkProgram(wrongCeciTerminalMock, PROGRAM_NAME, null, null, null, false); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testLinkProgramWithChannel() throws Exception { + Mockito.doReturn(ceciResponseMock).when(ceciSpy).issueCommand(Mockito.any(),Mockito.any()); + + Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, null, null, null, false)); + + Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, CHANNEL_NAME, "SYSID", null, false)); + + Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, CHANNEL_NAME, null, "TRAN", false)); + + Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, CHANNEL_NAME, null, null, true)); + + Assert.assertEquals("Error in linkProgramWithChannel() method", ceciResponseMock, ceciSpy.linkProgramWithChannel(ceciTerminalMock, PROGRAM_NAME, "CHANNEL_NAME", null, null, false)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.linkProgramWithChannel(wrongCeciTerminalMock, PROGRAM_NAME, null, null, null, false); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testPutContainer() throws Exception { + Mockito.doReturn(ceciResponseMock).when(ceciSpy).issueCommand(Mockito.any(),Mockito.any()); + Mockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy).setVariable(Mockito.any(),Mockito.any(),Mockito.any()); + + Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_VALUE, null, null, null)); + + Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null, null)); + + Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, "CHAR", null, null)); + + Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, "CCID", null)); + + Assert.assertEquals("Error in putContainer() method", ceciResponseMock, ceciSpy.putContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null, "CODEPAGE")); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.putContainer(wrongCeciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_VALUE, null, null, null); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testGetContainer() throws Exception { + Mockito.doReturn(ceciResponseMock).when(ceciSpy).issueCommand(Mockito.any(),Mockito.any()); + + Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null)); + Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, "CCID", null)); + Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, "CODEPAGE")); + Assert.assertEquals("Error in getContainer() method", ceciResponseMock, ceciSpy.getContainer(ceciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME.substring(1), null, null)); + + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getContainer(wrongCeciTerminalMock, CHANNEL_NAME, CONTAINER_NAME, TEXT_VARIABLE_NAME, null, null); + }); + Assert.assertEquals("exception should contain expected cause", WRONG_CICS_REGION, expectedException.getMessage()); + } + + @Test + public void testInitialScreen() throws Exception { + setupTestInitialScreen(); + + Mockito.doReturn(true).when(ceciSpy).isCeciScreen(); + Mockito.doReturn(false).when(ceciSpy).isHelpScreen(Mockito.any()); + Assert.assertEquals("Error in initialScreen() method", ceciTerminalMock, ceciSpy.initialScreen()); + + Mockito.doReturn(true).when(ceciSpy).isHelpScreen(Mockito.any()); + Assert.assertEquals("Error in initialScreen() method", ceciTerminalMock, ceciSpy.initialScreen()); + + Mockito.when(ceciSpy.isCeciScreen()).thenReturn(false).thenReturn(true); + Assert.assertEquals("Error in initialScreen() method", ceciTerminalMock, ceciSpy.initialScreen()); + + Mockito.doReturn(false).when(ceciSpy).isInitialScreen(Mockito.any()); + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.initialScreen(); + }); + Assert.assertEquals("exception should contain expected cause", "Unable to navigate to CECI initial screen", expectedException.getMessage()); + } + + @Test + public void testInitialScreenException1() throws Exception { + setupTestInitialScreen(); + + Mockito.doReturn(false).when(ceciSpy).isCeciScreen(); + String expectedMessage = "Cannot identify terminal as CECI session"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.initialScreen(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testInitialScreenException2() throws Exception { + setupTestInitialScreen(); + + Mockito.doReturn(false).when(ceciSpy).isCeciScreen(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to navigate to CECI initial screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.initialScreen(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testInitialScreenException3() throws Exception { + setupTestInitialScreen(); + + Mockito.doReturn(false).when(ceciSpy).isCeciScreen(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to navigate to CECI initial screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.initialScreen(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + private void setupTestInitialScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(INITIAL_SCREEN_ID); + } + + @Test + public void testVariableScreen() throws Exception { + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).initialScreen(); + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("").thenReturn(VAR_SCREEN_ID); + Assert.assertEquals("Error in variableScreen() method", ceciTerminalMock, ceciSpy.variableScreen()); + + Mockito.doReturn(false).when(ceciSpy).isVariablesScreen(Mockito.any()); + String expectedMessage = "Unable to navigate to CECI variables screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.variableScreen(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage , expectedException.getMessage()); + } + + @Test + public void testVariableScreenException1() throws Exception { + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).initialScreen(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to navigate to CECI variables screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.variableScreen(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testVariableScreenException2() throws Exception { + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).initialScreen(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to navigate to CECI variables screen"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.variableScreen(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testisCeciScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(true).when(ceciSpy).isInitialScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isHelpScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isCommandBeforeScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isCommandAfterScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isEibScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isVariablesScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isVariablesExpansionScreen(Mockito.any()); + Mockito.doReturn(true).when(ceciSpy).isMsgScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isInitialScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isHelpScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isCommandBeforeScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isCommandAfterScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isEibScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isVariablesScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isVariablesExpansionScreen(Mockito.any()); + Assert.assertTrue("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + + Mockito.doReturn(false).when(ceciSpy).isMsgScreen(Mockito.any()); + Assert.assertFalse("Error in isCeciScreen() method", ceciSpy.isCeciScreen()); + } + + @Test + public void testIsInitialScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isInitialScreen() method", ceciSpy.isInitialScreen(SPACES)); + } + + @Test + public void testIsCommandBeforeScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isCommandBeforeScreen() method", ceciSpy.isCommandBeforeScreen(SPACES)); + } + + @Test + public void testIsCommandAfterScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isCommandAfterScreen() method", ceciSpy.isCommandAfterScreen(SPACES)); + } + + @Test + public void testIsHelpScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isHelpScreen() method", ceciSpy.isHelpScreen(SPACES)); + } + + @Test + public void testIsEibScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isEibScreen() method", ceciSpy.isEibScreen(SPACES)); + } + + @Test + public void testIsVariablesScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isVariablesScreen() method", ceciSpy.isVariablesScreen(SPACES)); + } + + @Test + public void testIsMsgScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isMsgScreen() method", ceciSpy.isMsgScreen(SPACES)); + } + + @Test + public void testIsVariablesExpansionScreen() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertFalse("Error in isVariablesExpansionScreen() method", ceciSpy.isVariablesExpansionScreen(SPACES)); + } + + @Test + public void testMultipleTab() throws Exception { + setTerminalMockOnCeciSpy(); + Assert.assertEquals("Error in multipleTab() method", ceciTerminalMock, ceciSpy.multipleTab(1)); + } + + @Test + public void testCheckForSyntaxMessages() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(NO_SYNTAX_MESSAGES); + + ceciSpy.checkForSyntaxMessages(); + Mockito.verify(ceciTerminalMock,Mockito.times(1)).enter(); + } + + @Test + public void testCheckForSyntaxMessagesException1() throws Exception { + setTerminalMockOnCeciSpy(); + Field f1 = ceciSpy.getClass().getSuperclass().getDeclaredField("command"); + f1.setAccessible(true); + f1.set(ceciSpy,COMMAND_VALUE); + + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(SPACES); + String expectedMessage = "Command failed syntax check. \nCommand:\n " + COMMAND_VALUE + "\nSyntax Error Screen:\n" + SPACES; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.checkForSyntaxMessages(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testCheckForSyntaxMessagesException2() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to check for syntax messages"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.checkForSyntaxMessages(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testCheckForSyntaxMessagesException3() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to check for syntax messages"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.checkForSyntaxMessages(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testValidateVariable() throws Exception { + Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray(), null)); + Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME.substring(1), TEXT_VARIABLE_VALUE.toCharArray(), Integer.toString(TEXT_VARIABLE_VALUE.length()))); + Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray(), null)); + Assert.assertEquals("Error in validateVariable() method", TEXT_VARIABLE_NAME, ceciSpy.validateVariable(TEXT_VARIABLE_NAME, null, null)); + + String name = "&234567890"; + Assert.assertEquals("Error in validateVariable() method", name, ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null)); + + name = "&azAZ09@#"; + Assert.assertEquals("Error in validateVariable() method", name, ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null)); + } + + @Test + public void testValidateVariableException1() throws Exception { + String name = "&2345678901"; + String expectedMessage = "CECI variable name \"" + name + "\" greater than maximum length of 10 characters including the leading \"&\""; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testValidateVariableException2() throws Exception { + String name = "&?"; + String expectedMessage = "CECI variable name \"" + name + "\" invalid must. Must start with \"&\" and can contain one of more [a-zA-Z0-9@#]"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.validateVariable(name, TEXT_VARIABLE_VALUE.toCharArray(), null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testValidateVariableException3() throws Exception { + String value = "123456789"; + String type = "H"; + int maxLength = 6; + String expectedMessage = "CECI variable value length " + value.length() + " greater than maximum of " + maxLength + " for type \"" + type + "\"" ; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.validateVariable(TEXT_VARIABLE_NAME, value.toCharArray(), type); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testValidateVariableException4() throws Exception { + String value = new String(new char[32768]).replace("\0", "X"); + String expectedMessage = "CECI variable value length " + value.length() + " greater than maximum 32767"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.validateVariable(TEXT_VARIABLE_NAME, value.toCharArray(), null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariable() throws Exception { + setupTestVariable(); + Mockito.doReturn(TEXT_VARIABLE_VALUE.length()).when(ceciSpy).setVariableOnPage(Mockito.any(),Mockito.anyInt(),Mockito.anyInt()); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "X")).thenReturn(String.format("%-10s", " ")); + Assert.assertEquals("Error in setVariable() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null)); + + Assert.assertEquals("Error in setVariable() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariable(TEXT_VARIABLE_NAME + "X", TEXT_VARIABLE_VALUE, null)); + + Assert.assertEquals("Error in setVariable() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, "H")); + + int length = 1281; + Mockito.when(ceciSpy.setVariableOnPage(Mockito.any(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(20).thenReturn(21); + Assert.assertEquals("Error in setVariable() method", length, ceciSpy.setVariable(TEXT_VARIABLE_NAME, new String(new char[length]).replace("\0", "X"), null)); + } + + @Test + public void testSetVariableException1() throws Exception { + setupTestVariable(); + Mockito.doReturn("PF").when(ceciTerminalMock).retrieveFieldAtCursor(); + String expectedMessage = "No space on CECI variable screen for new variables"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariableException2() throws Exception { + setupTestVariable(); + Mockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock).retrieveFieldAtCursor(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to set CECI variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariableException3() throws Exception { + setupTestVariable(); + Mockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock).retrieveFieldAtCursor(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to set CECI variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariable(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE, null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + private void setupTestVariable() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doNothing().when(ceciSpy).deleteVariable(Mockito.any(),Mockito.any()); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).hexOff(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).variableScreen(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).moveToVariable(Mockito.any()); + } + + private void setTerminalMockOnCeciSpy() throws Exception{ + Field f1 = ceciSpy.getClass().getSuperclass().getDeclaredField("terminal"); + f1.setAccessible(true); + f1.set(ceciSpy,ceciTerminalMock); + } + + @Test + public void testSetVariableOnPage() throws Exception { + setTerminalMockOnCeciSpy(); + + String[] chunks = new String[] {TEXT_VARIABLE_VALUE, TEXT_VARIABLE_VALUE}; + int start = 0; + int numberOfLines = 1; + Assert.assertEquals("Error in setVariableOnPage() method", numberOfLines, ceciSpy.setVariableOnPage(chunks, start, numberOfLines)); + + numberOfLines = 2; + Assert.assertEquals("Error in setVariableOnPage() method", numberOfLines, ceciSpy.setVariableOnPage(chunks, start, numberOfLines)); + + chunks = new String[] {String.format("%-65s", "X"), TEXT_VARIABLE_VALUE}; + Assert.assertEquals("Error in setVariableOnPage() method", numberOfLines, ceciSpy.setVariableOnPage(chunks, start, numberOfLines)); + } + + @Test + public void testSetVariableOnPageException() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.type(Mockito.any())).thenThrow(new FieldNotFoundException()); + String expectedMessage = "Unable enter variable data"; + + String[] chunks = new String[] {TEXT_VARIABLE_VALUE, TEXT_VARIABLE_VALUE}; + int start = 0; + int numberOfLines = 1; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariableOnPage(chunks, start, numberOfLines); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariableHex() throws Exception { + setupTestVariable(); + Mockito.doReturn(TEXT_VARIABLE_NAME.length()).when(ceciSpy).setVariableHexOnPage(Mockito.any(),Mockito.anyInt(),Mockito.anyInt()); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "X")).thenReturn(String.format("%-10s", " ")); + Assert.assertEquals("Error in setVariableHex() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray())); + + Assert.assertEquals("Error in setVariableHex() method", TEXT_VARIABLE_VALUE.length(), ceciSpy.setVariableHex(TEXT_VARIABLE_NAME + "X", TEXT_VARIABLE_VALUE.toCharArray())); + + int length = 21; + char[] value = new String(new char[length]).replace("\0", "X").toCharArray(); + Mockito.when(ceciSpy.setVariableHexOnPage(Mockito.any(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(20).thenReturn(21); + Assert.assertEquals("Error in setVariableHex() method", length, ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, value)); + } + + @Test + public void testSetVariableHexException1() throws Exception { + setupTestVariable(); + Mockito.doReturn("PF").when(ceciTerminalMock).retrieveFieldAtCursor(); + String expectedMessage = "No space on CECI variable screen for new variables"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariableHexException2() throws Exception { + setupTestVariable(); + Mockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock).retrieveFieldAtCursor(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to set CECI binary variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariableHexException3() throws Exception { + setupTestVariable(); + Mockito.doReturn(String.format("%-10s", " ")).when(ceciTerminalMock).retrieveFieldAtCursor(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to set CECI binary variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariableHex(TEXT_VARIABLE_NAME, TEXT_VARIABLE_VALUE.toCharArray()); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testSetVariableHexOnPage() throws Exception { + setTerminalMockOnCeciSpy(); + + char[] value = TEXT_VARIABLE_VALUE.toCharArray(); + int start = 0; + int numberOfLines = 1; + Assert.assertEquals("Error in setVariableHexOnPage() method", value.length, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); + + value = new String(new char[32]).replace("\0", "X").toCharArray(); + numberOfLines = 2; + Assert.assertEquals("Error in setVariableHexOnPage() method", value.length, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); + + numberOfLines = -1; + Assert.assertEquals("Error in setVariableHexOnPage() method", 0, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); + + value = new char[0]; + numberOfLines = -1; + Assert.assertEquals("Error in setVariableHexOnPage() method", value.length, ceciSpy.setVariableHexOnPage(value, start, numberOfLines)); + } + + @Test + public void testSetVariableHexOnPageException() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.type(Mockito.any())).thenThrow(new FieldNotFoundException()); + String expectedMessage = "Unable enter variable data"; + + char[] value = TEXT_VARIABLE_VALUE.toCharArray(); + int start = 0; + int numberOfLines = 1; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.setVariableHexOnPage(value, start, numberOfLines); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariable() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length())); + Mockito.doReturn(TEXT_VARIABLE_VALUE).when(ceciSpy).getVariableFromPage(Mockito.anyInt(),Mockito.anyInt()); + + Assert.assertEquals("Error in getVariable() method", TEXT_VARIABLE_VALUE, ceciSpy.getVariable(TEXT_VARIABLE_NAME, null)); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length()*2)); + Assert.assertEquals("Error in getVariable() method", TEXT_VARIABLE_VALUE + TEXT_VARIABLE_VALUE, ceciSpy.getVariable(TEXT_VARIABLE_NAME, null)); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("H"); + String value = String.format("%012d", 0); + Mockito.doReturn(value).when(ceciSpy).getVariableFromPage(Mockito.anyInt(),Mockito.anyInt()); + Assert.assertEquals("Error in getVariable() method", value, ceciSpy.getVariable(TEXT_VARIABLE_NAME, "H")); + } + + @Test + public void testGetVariableException1() throws Exception { + setupTestGetVariable(); + String lengthString = "XXXX"; + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(lengthString); + String expectedMessage = "Unexpected variable type \"" + lengthString + "\" for \"" + TEXT_VARIABLE_NAME + "\""; + String type = "H"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariable(TEXT_VARIABLE_NAME, type); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariableException2() throws Exception { + setupTestGetVariable(); + String lengthString = "XXXX"; + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(lengthString); + String expectedMessage = "Unable to determine variable field length"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariable(TEXT_VARIABLE_NAME, null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariableException3() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to get CECI variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariable(TEXT_VARIABLE_NAME, null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariableException4() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to get CECI variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariable(TEXT_VARIABLE_NAME, null); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + private void setupTestGetVariable() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).moveToVariable(Mockito.any()); + } + + @Test + public void getVariableFromPage() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(TEXT_VARIABLE_VALUE); + + Assert.assertEquals("Error in getVariableFromPage() method", TEXT_VARIABLE_VALUE, ceciSpy.getVariableFromPage(TEXT_VARIABLE_VALUE.length(), 1)); + Assert.assertEquals("Error in getVariableFromPage() method", TEXT_VARIABLE_VALUE, ceciSpy.getVariableFromPage(TEXT_VARIABLE_VALUE.length()*2, 1)); + + } + + @Test + public void getVariableFromPageException1() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(TEXT_VARIABLE_VALUE); + Mockito.when(ceciTerminalMock.tab()).thenThrow(new FieldNotFoundException()); + String expectedMessage = "Unable to get variable from page"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariableFromPage(1, 1); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + + } + + @Test + public void testGetVariableHex() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length())).thenReturn(TEXT_VARIABLE_VALUE); + Mockito.doReturn(TEXT_VARIABLE_VALUE).when(ceciSpy).getVariableHexFromPage(Mockito.anyInt(),Mockito.anyInt()); + + Assert.assertTrue("Error in getVariableHex() method", Arrays.equals(TEXT_VARIABLE_VALUE.toCharArray(), ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE))); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%+06d", TEXT_VARIABLE_VALUE.length()*2)).thenReturn(TEXT_VARIABLE_VALUE); + Assert.assertTrue("Error in getVariableHex() method", Arrays.equals((TEXT_VARIABLE_VALUE + TEXT_VARIABLE_VALUE).toCharArray(), ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE))); + } + + @Test + public void testGetVariableHexException1() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("XXXX"); + String expectedMessage = "Unable to determine variable field length"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariableHexException2() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to get CECI binary variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariableHexException3() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to get CECI binary variable"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariableHex(TEXT_VARIABLE_VALUE); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetVariableHexPage() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("5A5A5A5A"); + + Assert.assertEquals("Error in getVariableHexFromPage() method", "ZZZZ", ceciSpy.getVariableHexFromPage(4, 1)); + Assert.assertEquals("Error in getVariableHexFromPage() method", "ZZZZZZZZZZZZZZZZ", ceciSpy.getVariableHexFromPage(20, 1)); + } + + @Test + public void testGetVariableHexPageException1() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("5A5A5A5A"); + Mockito.when(ceciTerminalMock.tab()).thenThrow(new FieldNotFoundException()); + String expectedMessage = "Unable to get binary variable from page"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getVariableHexFromPage(4, 1); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testMoveToVariable() throws Exception { + setupMoveToVariable(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(TEXT_VARIABLE_NAME + " "); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn(String.format("%-10s", "X")).thenReturn(String.format("%-10s", TEXT_VARIABLE_NAME)); + + Assert.assertEquals("Error in moveToVariable() method", ceciTerminalMock, ceciSpy.moveToVariable(TEXT_VARIABLE_NAME)); + } + + @Test + public void testMoveToVariableException1() throws Exception { + setupMoveToVariable(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" "); + String expectedMessage = "Unable to find variable " + TEXT_VARIABLE_NAME; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.moveToVariable(TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testMoveToVariableException2() throws Exception { + setupMoveToVariable(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(TEXT_VARIABLE_NAME + " "); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("PF"); + String expectedMessage = "Unable to find variable " + TEXT_VARIABLE_NAME; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.moveToVariable(TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testMoveToVariableException3() throws Exception { + setupMoveToVariable(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(TEXT_VARIABLE_NAME + " "); + Mockito.when(ceciTerminalMock.newLine()).thenThrow(new FieldNotFoundException()); + String expectedMessage = "Problem serching for variable " + TEXT_VARIABLE_NAME; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.moveToVariable(TEXT_VARIABLE_NAME); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + private void setupMoveToVariable() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).hexOff(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).variableScreen(); + } + + @Test + public void testIsHexOn() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" EIBTIME = X'00"); + Assert.assertTrue("Error in isHexOn() method", ceciSpy.isHexOn()); + } + + @Test + public void testIsHexOnException1() throws Exception, CeciException, TimeoutException, KeyboardLockedException, TerminalInterruptedException { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to determine if CECI is in HEX mode"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.isHexOn(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testIsHexOnException2() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to determine if CECI is in HEX mode"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.isHexOn(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testHexOn() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(true).when(ceciSpy).isHexOn(); + + Assert.assertEquals("Error in hexOn() method", ceciTerminalMock, ceciSpy.hexOn()); + + Mockito.doReturn(false).when(ceciSpy).isHexOn(); + Assert.assertEquals("Error in hexOn() method", ceciTerminalMock, ceciSpy.hexOn()); + } + + @Test + public void testHexOnException1() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(false).when(ceciSpy).isHexOn(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to set CECI HEX ON"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.hexOn(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testHexOnException2() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(false).when(ceciSpy).isHexOn(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to set CECI HEX ON"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.hexOn(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testHexOff() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(true).when(ceciSpy).isHexOn(); + + Assert.assertEquals("Error in hexOff() method", ceciTerminalMock, ceciSpy.hexOff()); + + Mockito.doReturn(false).when(ceciSpy).isHexOn(); + Assert.assertEquals("Error in hexOff() method", ceciTerminalMock, ceciSpy.hexOff()); + } + + @Test + public void testHexOffException1() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(true).when(ceciSpy).isHexOn(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to set CECI HEX OFF"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.hexOff(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testHexOffException2() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(true).when(ceciSpy).isHexOn(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to set CECI HEX OFF"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.hexOff(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testNewCeciResponse() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn(" RESPONSE: FILENOTFOUND EIBRESP=+0000000012 EIBRESP2=+0000000001 "); + Mockito.doReturn(new LinkedHashMap<>()).when(ceciSpy).parseResponseOutput(); + + ICeciResponse ceciResponse = ceciSpy.newCeciResponse(false); + + ceciSpy.newCeciResponse(true); + Assert.assertEquals("Error in newCeciResponse() method", "FILENOTFOUND", ceciResponse.getResponse()); + Assert.assertEquals("Error in newCeciResponse() method", 12, ceciResponse.getEIBRESP()); + Assert.assertEquals("Error in newCeciResponse() method", 1, ceciResponse.getEIBRESP2()); + } + + @Test + public void testParseResponseOutput() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.doReturn(ceciTerminalMock).when(ceciSpy).multipleTab(Mockito.anyInt()); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION1").thenReturn("OPTION2"); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("OPTION= OPTION1 LENGTH= +00008 ").thenReturn("OPTION= OPTION2 LENGTH= +00008 "); + Mockito.doReturn(new ResponseOutputValueImpl("XXXXXXXX")).when(ceciSpy).getOptionValue(Mockito.any()); + + Assert.assertTrue("Error in parseResponseOutput() method", ceciSpy.parseResponseOutput().containsKey("OPTION1")); + + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION3").thenReturn("OPTION4").thenReturn("PF"); + Mockito.when(ceciTerminalMock.retrieveScreen()).thenReturn("OPTION= OPTION3 LENGTH= +00008 ").thenReturn("OPTION= OPTION4 LENGTH= +00008 "); + Assert.assertTrue("Error in parseResponseOutput() method", ceciSpy.parseResponseOutput().containsKey("OPTION4")); + } + + @Test + public void testParseResponseOutputException1() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION1"); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to parse command output"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.parseResponseOutput(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testParseResponseOutputException2() throws Exception { + setTerminalMockOnCeciSpy(); + Mockito.when(ceciTerminalMock.retrieveFieldAtCursor()).thenReturn("OPTION1"); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to parse command output"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.parseResponseOutput(); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetOptionValue() throws Exception { + setupTestGetVariable(); + String value = "000000"; + Mockito.doReturn(value).when(ceciSpy).getVariableFromPage(Mockito.anyInt(),Mockito.anyInt()); + String screen = "OPTION= LENGTH LENGTH= H "; + Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValue(screen).getTextValue()); + + Mockito.doReturn("000").when(ceciSpy).getVariableFromPage(Mockito.anyInt(),Mockito.anyInt()); + Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValue(screen).getTextValue()); + + screen = "OPTION= FROM LENGTH= +00001 "; + Mockito.doReturn("F1").when(ceciSpy).getOptionValueInHex(Mockito.anyInt(),Mockito.anyInt()); + Assert.assertTrue("Error in getOptionValue() method", Arrays.equals(new char[] {'F', '1'}, ceciSpy.getOptionValue(screen).getHexValue())); + } + + @Test + public void testGetOptionValueException1() throws Exception { + setupTestGetVariable(); + Mockito.doReturn("000").when(ceciSpy).getVariableFromPage(Mockito.anyInt(),Mockito.anyInt()); + String screen = "OPTION= LENGTH LENGTH= H "; + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to parse command output option value"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getOptionValue(screen); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetOptionValueException2() throws Exception { + setupTestGetVariable(); + Mockito.doReturn("000").when(ceciSpy).getVariableFromPage(Mockito.anyInt(),Mockito.anyInt()); + String screen = "OPTION= LENGTH LENGTH= H "; + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to parse command output option value"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getOptionValue(screen); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetOptionValueInHex() throws Exception { + setupTestGetVariable(); + String value = "F1F1"; + Mockito.doReturn(value).when(ceciSpy).getVariableHexFromPage(Mockito.anyInt(),Mockito.anyInt()); + + Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValueInHex(1, 0)); + + Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValueInHex(1, 1)); + + Assert.assertEquals("Error in getOptionValue() method", value, ceciSpy.getOptionValueInHex(2, 0)); + + Assert.assertEquals("Error in getOptionValue() method", value + value, ceciSpy.getOptionValueInHex(5, 0)); + } + + @Test + public void testGetOptionValueInHexException1() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TerminalInterruptedException()); + String expectedMessage = "Unable to parse command output binary option value"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getOptionValueInHex(1, 0); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } + + @Test + public void testGetOptionValueInHexException2() throws Exception { + setupTestGetVariable(); + Mockito.when(ceciTerminalMock.waitForKeyboard()).thenThrow(new TimeoutException()); + String expectedMessage = "Unable to parse command output binary option value"; + CeciException expectedException = Assert.assertThrows("expected exception should be thrown", CeciException.class, ()->{ + ceciSpy.getOptionValueInHex(1, 0); + }); + Assert.assertEquals("exception should contain expected cause", expectedMessage, expectedException.getMessage()); + } } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciManagerImpl.java index 6ddf7f4e3..00be975ec 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciResponseImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciResponseImpl.java index b943b3640..37c2d52b3 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciResponseImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestCeciResponseImpl.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import java.util.LinkedHashMap; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestResponseOutputValueImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestResponseOutputValueImpl.java index b54f74f82..fa6af08f9 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestResponseOutputValueImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/TestResponseOutputValueImpl.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/properties/TestCeciPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/properties/TestCeciPropertiesSingleton.java index cb80140b4..88d0f83cb 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/properties/TestCeciPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceci.manager/src/test/java/dev/galasa/cicsts/ceci/internal/properties/TestCeciPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceci.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/build.gradle index 876e80ba1..0803187c7 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/build.gradle @@ -11,3 +11,17 @@ dependencies { implementation project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.ceda.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') } + + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/settings.gradle index 3d23092ff..76d2e3e9a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.ceda.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.ceda.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/src/main/java/dev/galasa/cicsts/ceda/manager/ivt/CedaManagerIVT.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/src/main/java/dev/galasa/cicsts/ceda/manager/ivt/CedaManagerIVT.java index 5c1367724..01ecb4213 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/src/main/java/dev/galasa/cicsts/ceda/manager/ivt/CedaManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager.ivt/src/main/java/dev/galasa/cicsts/ceda/manager/ivt/CedaManagerIVT.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceda.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/build.gradle index 37ff0f423..d1cea9b3a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/build.gradle @@ -4,10 +4,24 @@ plugins { description = 'Galasa CICS/TS CEDA Manager' -version = '0.21.0' +version = '0.29.0' dependencies { api project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') api project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.cemt.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/settings.gradle index bc30891ba..288e41424 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.ceda.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.ceda.manager' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaImpl.java index 323b6f93a..3a64fb4c5 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceda.internal; import javax.validation.constraints.NotNull; @@ -46,11 +46,11 @@ public void createResource(@NotNull ICicsTerminal terminal, @NotNull String reso try { if(resourceParameters==null){ terminal.type("CEDA DEFINE " + resourceType + "(" + resourceName + - ") GROUP(" + groupName + ") ").enter().waitForKeyboard(); + ") GROUP(" + groupName + ") ").enter().wfk(); }else{ terminal.type("CEDA DEFINE " + resourceType + "(" + resourceName + - ") GROUP(" + groupName + ") " + resourceParameters).enter().waitForKeyboard(); + ") GROUP(" + groupName + ") " + resourceParameters).enter().wfk(); } }catch(TimeoutException | KeyboardLockedException | NetworkException | TerminalInterruptedException | FieldNotFoundException e) { throw new CedaException("Problem with starting the CEDA transaction", e); @@ -59,7 +59,7 @@ public void createResource(@NotNull ICicsTerminal terminal, @NotNull String reso try { if(terminal.retrieveScreen().contains("DEFINE SUCCESSFUL")){ if(terminal.retrieveScreen().contains("MESSAGES:")) { - terminal.pf9(); + terminal.pf9().wfk(); } } }catch (Exception e) { @@ -67,10 +67,8 @@ public void createResource(@NotNull ICicsTerminal terminal, @NotNull String reso } try { - terminal.pf3(); - terminal.waitForKeyboard(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf3().wfk(); + terminal.clear().wfk(); }catch(Exception e) { throw new CedaException("Unable to return terminal back into reset state", e); } @@ -92,7 +90,7 @@ public void installGroup(@NotNull ICicsTerminal terminal, @NotNull String groupN } try { - terminal.type("CEDA INSTALL GROUP(" + groupName + ")").enter().waitForKeyboard(); + terminal.type("CEDA INSTALL GROUP(" + groupName + ")").enter().wfk(); }catch(Exception e) { throw new CedaException("Problem with starting the CEDA transaction"); @@ -100,10 +98,9 @@ public void installGroup(@NotNull ICicsTerminal terminal, @NotNull String groupN try { if(!terminal.retrieveScreen().contains("INSTALL SUCCESSFUL")) { - terminal.pf9(); - terminal.pf3(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf9().wfk(); + terminal.pf3().wfk(); + terminal.clear().wfk(); throw new CedaException("Errors detected whilst installing group"); } }catch(Exception e) { @@ -111,10 +108,8 @@ public void installGroup(@NotNull ICicsTerminal terminal, @NotNull String groupN } try { - terminal.pf3(); - terminal.waitForKeyboard(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf3().wfk(); + terminal.clear().wfk(); }catch(Exception e) { throw new CedaException("Unable to return terminal back into reset state", e); } @@ -140,7 +135,7 @@ public void installResource(@NotNull ICicsTerminal terminal, @NotNull String res try { terminal.type("CEDA INSTALL " + resourceType + "(" + resourceName + ") GROUP(" + - cedaGroup + ")").enter().waitForKeyboard(); + cedaGroup + ")").enter().wfk(); }catch(Exception e) { throw new CedaException("Problem with starting the CEDA transaction", e); @@ -159,8 +154,7 @@ public void installResource(@NotNull ICicsTerminal terminal, @NotNull String res } if(error) { - terminal.pf9(); - terminal.waitForKeyboard(); + terminal.pf9().wfk(); throw new CedaException("Errors detected whilst installing group"); } }catch(Exception e) { @@ -171,10 +165,8 @@ public void installResource(@NotNull ICicsTerminal terminal, @NotNull String res } try { - terminal.pf3(); - terminal.waitForKeyboard(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf3().wfk(); + terminal.clear().wfk(); }catch(Exception e) { throw new CedaException("Unable to return terminal back into reset state", e); } @@ -196,17 +188,16 @@ public void deleteGroup(@NotNull ICicsTerminal terminal, @NotNull String groupNa } try { - terminal.type("CEDA DELETE GROUP(" + groupName + ") ALL").enter().waitForKeyboard(); + terminal.type("CEDA DELETE GROUP(" + groupName + ") ALL").enter().wfk(); }catch(Exception e) { throw new CedaException("Problem with starting the CEDA transaction"); } try { if(!terminal.retrieveScreen().contains("DELETE SUCCESSFUL")) { - terminal.pf9(); - terminal.pf3(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf9().wfk(); + terminal.pf3().wfk(); + terminal.clear().wfk(); throw new CedaException("Errors detected whilst discarding group"); } @@ -215,10 +206,8 @@ public void deleteGroup(@NotNull ICicsTerminal terminal, @NotNull String groupNa } try { - terminal.pf3(); - terminal.waitForKeyboard(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf3().wfk(); + terminal.clear().wfk(); }catch(Exception e) { throw new CedaException("Unable to return terminal back into reset state", e); } @@ -244,30 +233,27 @@ public void deleteResource(@NotNull ICicsTerminal terminal, @NotNull String reso try { - terminal.waitForKeyboard(); + terminal.wfk(); terminal.type("CEDA DELETE " + resourceType + "(" - + resourceName + ") GROUP(" + groupName + ")").enter(); - terminal.waitForKeyboard(); + + resourceName + ") GROUP(" + groupName + ")").enter().wfk(); }catch(Exception e) { throw new CedaException("Problem with starting the CEDA transaction", e); } try { if(!terminal.retrieveScreen().contains("DELETE SUCCESSFUL")) { - terminal.pf9() - .pf3().clear() - .waitForKeyboard(); + terminal.pf9().wfk(); + terminal.pf3().wfk(); + terminal.clear().wfk(); throw new CedaException("Errors detected whilst discarding group"); } }catch(Exception e) { - throw new CedaException("Problem determinign the result from the CEDA command)", e); + throw new CedaException("Problem determining the result from the CEDA command)", e); } try { - terminal.pf3(); - terminal.waitForKeyboard(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf3().wfk(); + terminal.clear().wfk(); }catch(Exception e) { throw new CedaException("Unable to return terminal back into reset state", e); } @@ -291,9 +277,8 @@ public boolean resourceExists(@NotNull ICicsTerminal terminal, @NotNull String r try { - terminal.waitForKeyboard(); - terminal.type("CEDA DISPLAY " + resourceType + "(" + resourceName + ") GROUP(" + groupName + ")").enter(); - terminal.waitForKeyboard(); + terminal.wfk(); + terminal.type("CEDA DISPLAY " + resourceType + "(" + resourceName + ") GROUP(" + groupName + ")").enter().wfk(); } catch(Exception e) { throw new CedaException("Problem with starting the CEDA transaction", e); } @@ -303,18 +288,18 @@ public boolean resourceExists(@NotNull ICicsTerminal terminal, @NotNull String r if (terminal.retrieveScreen().contains("RESULTS: 1 TO 1 OF 1")) { exists = true; } else if (!terminal.retrieveScreen().contains("DISPLAY UNSUCCESSFUL")) { - terminal.pf9().pf3().clear().waitForKeyboard(); + terminal.pf9().wfk(); + terminal.pf3().wfk(); + terminal.clear().wfk(); throw new CedaException("Errors detected whilst displaying resource"); } } catch(Exception e) { - throw new CedaException("Problem determinign the result from the CEDA command)", e); + throw new CedaException("Problem determining the result from the CEDA command)", e); } try { - terminal.pf3(); - terminal.waitForKeyboard(); - terminal.clear(); - terminal.waitForKeyboard(); + terminal.pf3().wfk(); + terminal.clear().wfk(); } catch(Exception e) { throw new CedaException("Unable to return terminal back into reset state", e); } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaManagerImpl.java index 9c2e62df6..d33448314 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/CedaManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.ceda.internal; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/properties/CedaPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/properties/CedaPropertiesSingleton.java index d9c2fe90b..945d598da 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/properties/CedaPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/internal/properties/CedaPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceda.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/package-info.java index b5b372686..d99912756 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/package-info.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceda; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/spi/ICedaManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/spi/ICedaManagerSpi.java index 1635e3332..a0ff149da 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/spi/ICedaManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.ceda.manager/src/main/java/dev/galasa/cicsts/ceda/spi/ICedaManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.ceda.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/build.gradle index f16078782..4f5e4a0d4 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/build.gradle @@ -13,3 +13,16 @@ dependencies { implementation project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInIsolated = true +ext.includeInBOM = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/settings.gradle index f8d73d1fe..11ee6fb33 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.cicsts.cemt.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.cemt.manager.ivt' diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/CEMTManagerIVT.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/CEMTManagerIVT.java index c04df0b62..13b6992ed 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/CEMTManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/CEMTManagerIVT.java @@ -1,7 +1,8 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.cicsts.cemt.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/IVTException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/IVTException.java index 57c8cea90..5bf4eaf58 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/IVTException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager.ivt/src/main/java/dev/galasa/cicsts/cemt/manager/ivt/IVTException.java @@ -1,10 +1,8 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - - package dev.galasa.cicsts.cemt.manager.ivt; public class IVTException extends Exception { diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/bnd.bnd index a56a758fa..6f5e6af99 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/bnd.bnd @@ -1,5 +1,5 @@ -snapshot: ${tstamp} Bundle-Name: Galasa CICS/TS CEMT Manager -Export-Package: dev.galasa.cicsts.cemt.spi.spi +Export-Package: dev.galasa.cicsts.cemt.spi Import-Package: !javax.validation.constraints, \ * diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/build.gradle index f8390a2a5..88e3c3793 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'Galasa CICS/TS CEMT Manager' -version = '0.21.0' +version = '0.25.0' dependencies { api project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/settings.gradle index 7000a4527..7c63b6c38 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.cemt.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.cemt.manager' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtImpl.java index 5df288fc7..25d990725 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.cemt.internal; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtManagerImpl.java index e8fa6b526..e0c10d7a7 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/CemtManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.cemt.internal; @@ -25,7 +25,7 @@ import dev.galasa.cicsts.ICemt; import dev.galasa.cicsts.ICicsRegion; import dev.galasa.cicsts.cemt.internal.properties.CemtPropertiesSingleton; -import dev.galasa.cicsts.cemt.spi.spi.ICemtManagerSpi; +import dev.galasa.cicsts.cemt.spi.ICemtManagerSpi; import dev.galasa.cicsts.spi.ICemtProvider; import dev.galasa.cicsts.spi.ICicstsManagerSpi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/properties/CemtPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/properties/CemtPropertiesSingleton.java index f48fcf53c..3a5e91740 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/properties/CemtPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/internal/properties/CemtPropertiesSingleton.java @@ -1,9 +1,8 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.cicsts.cemt.internal.properties; import org.osgi.service.component.annotations.Activate; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/ICemtManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/ICemtManagerSpi.java new file mode 100644 index 000000000..75bca1ad2 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/ICemtManagerSpi.java @@ -0,0 +1,11 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.cicsts.cemt.spi; + + +public interface ICemtManagerSpi { + +} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/package-info.java new file mode 100644 index 000000000..926a30ba6 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/package-info.java @@ -0,0 +1,6 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.cicsts.cemt.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/spi/ICemtManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/spi/ICemtManagerSpi.java deleted file mode 100644 index e4adcd1a8..000000000 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/spi/ICemtManagerSpi.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ - -package dev.galasa.cicsts.cemt.spi.spi; - - -public interface ICemtManagerSpi { - -} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/spi/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/spi/package-info.java deleted file mode 100644 index 6a5f44b85..000000000 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.cemt.manager/src/main/java/dev/galasa/cicsts/cemt/spi/spi/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ - - -package dev.galasa.cicsts.cemt.spi.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/build.gradle index be9649c5e..10b74f89a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/build.gradle @@ -14,3 +14,19 @@ dependencies { implementation project (':galasa-managers-workflow-parent:dev.galasa.githubissue.manager') implementation project (':galasa-managers-internal-parent:dev.galasa.sem.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + + + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/settings.gradle index 3b0143115..bc3b862cb 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/src/main/java/dev/galasa/cicsts/manager/ivt/CICSTSManagerIVT.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/src/main/java/dev/galasa/cicsts/manager/ivt/CICSTSManagerIVT.java index d3f6a08e3..e91be9568 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/src/main/java/dev/galasa/cicsts/manager/ivt/CICSTSManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager.ivt/src/main/java/dev/galasa/cicsts/manager/ivt/CICSTSManagerIVT.java @@ -1,7 +1,8 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.cicsts.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/build.gradle index 072701f27..4027a488e 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa CICS/TS Manager' -version = '0.24.0' +version = '0.36.0' dependencies { api project (':galasa-managers-zos-parent:dev.galasa.zos.manager') @@ -13,3 +13,17 @@ dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.textscan.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInIsolated = true +ext.includeInBOM = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/settings.gradle index e83755535..8f9669b2c 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.manager' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciException.java index d5acc8ff2..a5ec84c80 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciManagerException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciManagerException.java index b2f1f2084..6cb47ace5 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciManagerException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CeciManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaException.java index 613519c40..77443fac4 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaManagerException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaManagerException.java index 0ec1d9026..fdbf12f09 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaManagerException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CedaManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtException.java index 1826f7d9c..cd24c97b1 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtException.java @@ -1,10 +1,8 @@ - /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.cicsts; public class CemtException extends CemtManagerException { diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtManagerException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtManagerException.java index 3c3d0ed79..0aabbccd7 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtManagerException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CemtManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsRegion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsRegion.java index 44a510eb4..c2bf418a8 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsRegion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsRegion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -20,7 +20,7 @@ * Used to populate a {@link ICicsRegion} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsTerminal.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsTerminal.java index c32fb4d82..3f6a46eab 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsTerminal.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicsTerminal.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -19,7 +19,7 @@ * Used to populate a {@link ICicsTerminal} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) @@ -38,4 +38,9 @@ */ boolean connectAtStartup() default true; + /** + * The CICS TS Manager will automatically log into the CICS TS region via CESL using the terminal with + * the specified secure credentials when it connects + */ + String loginCredentialsTag() default ""; } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsHashMap.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsHashMap.java index 3d9b502d5..ce85f1531 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsHashMap.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsHashMap.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerException.java index a6b772bfb..c2a2dd65f 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerField.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerField.java index 2912c5711..651caf725 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerField.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/CicstsManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeci.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeci.java index d2ec2b5c3..5eb2643a6 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeci.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeci.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -38,12 +38,15 @@ public interface ICeci { * @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session. * If mixed case is required, the terminal should be presented with no upper case translate status. * For example, the test could first issue CEOT TRANIDONLY + * * @param command a {@link String} containing the CECI command * @param parseOutput parse the command output and store in {@link ICeciResponse}. Setting to false can improve performance on commands - * that contain a lot of output fields, e.g. ASSIGN.

- * The following examples shows how to retrieve a specific returned value:
- * issueCommand(ICicsTerminal, "ASSIGN USERID(&VAR)", false)
- * retrieveVariableText(ICicsTerminal, "&VAR") + * that contain a lot of output fields, e.g. ASSIGN. + * + * The following examples shows how to retrieve a specific returned value:
+ * + * issueCommand(ICicsTerminal, "ASSIGN USERID(&VAR)", false)
+ * retrieveVariableText(ICicsTerminal, "&VAR") *
* @return an {@link ICeciResponse} object containing the command's response. * @throws CeciException @@ -72,8 +75,8 @@ public interface ICeci { * @param parseOutput parse the command output and store in {@link ICeciResponse}. Setting to false can improve performance on commands * that contain a lot of output fields, e.g. ASSIGN.

* The following examples shows how to retrieve a specific returned value:
- * issueCommand(ICicsTerminal, "ASSIGN USERID(&VAR)", false)
- * retrieveVariableText(ICicsTerminal, "ASSIGN USERID(&VAR)", false) + * issueCommand(ICicsTerminal, "ASSIGN USERID(&VAR)", false)
+ * retrieveVariableText(ICicsTerminal, "ASSIGN USERID(&VAR)", false) *
* @return an {@link ICeciResponse} object containing the command's response. * @throws CeciException @@ -236,7 +239,7 @@ public interface ICeci { /** * Retrieve the content of the current EXEC Interface Block (EIB) - * @param terminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session. + * @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session. * @return the {@link IExecInterfaceBlock} * @throws CeciException */ @@ -249,7 +252,7 @@ public interface ICeci { * For example, the test could first issue CEOT TRANIDONLY * @param programName the name of the PROGRAM * @param commarea a string representing the COMMAREA. If null, COMMAREA will be omitted from the command. Can be CECI variable name populated with - * (&name set via {@link #defineVariableText(ICicsTerminal, String, String)}) or the actual data. The value of DATALENGTH in the command will be + * (&)name set via {@link #defineVariableText(ICicsTerminal, String, String)}) or the actual data. The value of DATALENGTH in the command will be * be allowed to default. * @param sysid the system name where the CICS region where the link request is to be routed. If null, SYSID will be omitted from the command. * @param transid the name of the mirror transaction on the remote region. If null, TRANSID will be omitted from the command. @@ -260,8 +263,8 @@ public interface ICeci { public ICeciResponse linkProgram(@NotNull ICicsTerminal ceciTerminal, @NotNull String programName, String commarea, String sysid, String transid, boolean synconreturn) throws CeciException; /** - * EXEC CICS LINK to a PROGRAM with a CHANNEL. Use {@link #putContainer(ICicsTerminal, String, String, String)} to create the container(s) on the CHANNEL - * and {@link #getContainer(ICicsTerminal, String, String, String)} to retrieve the content after the LINK. + * EXEC CICS LINK to a PROGRAM with a CHANNEL. Use {@link #putContainer(ICicsTerminal, String, String, String, String, String, String)} to create the container(s) on the CHANNEL + * and {@link #getContainer(ICicsTerminal, String, String, String, String, String)} to retrieve the content after the LINK. * @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session. * If mixed case is required, the terminal should be presented with no upper case translate status. * For example, the test could first issue CEOT TRANIDONLY @@ -276,7 +279,7 @@ public interface ICeci { * @param ceciTerminal an {@link ICicsTerminal} object logged on to the CICS region and in an active CECI session. * @param channelName the CHANNELNAME * @param containerName the COTAINER name - * @param content a string representing the container contents. Can be CECI variable name populated with (&name set via {@link #defineVariableText(ICicsTerminal, String, String)}) + * @param content a string representing the container contents. Can be CECI variable name populated with (&)name set via {@link #defineVariableText(ICicsTerminal, String, String)}) * or the actual data. The value of FLENGTH in the command will be set to the data length. * @param dataType BIT or CHAR. If null, DATATYPE will be omitted from the command. * @param fromCcsid provides a value for FROMCCSID. If null, will be omitted from the command. @@ -293,8 +296,7 @@ public interface ICeci { * For example, the test could first issue CEOT TRANIDONLY * @param channelName the CHANNELNAME * @param containerName the CONTAINER name - * @param variableName the CECI variable name. Data can be retrieved using {@link #retrieveVariableText(ICicsTerminal, String)} or {@link #retrieveVariableHex(ICicsTerminal, String)} - * @param dataType BIT or CHAR. If null, DATATYPE will be omitted from the command. + * @param variableName the CECI variable name. Data can be retrieved using {@link #retrieveVariableText(ICicsTerminal, String)} * @param intoCcsid provides a value for INTOCCSID. If null, will be omitted from the command. * @param intoCodepage provides a value for INTOCODEPAGE. If null, will be omitted from the command. * @return an {@link ICeciResponse} object containing the command's response. diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponse.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponse.java index edc29fb43..194afbfad 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponse.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponse.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponseOutputValue.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponseOutputValue.java index 8ab556ab2..f08704bb1 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponseOutputValue.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeciResponseOutputValue.java @@ -1,8 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ + package dev.galasa.cicsts; /** @@ -12,8 +13,8 @@ * e.g. the request output screen might * show:
* INTO('A.....')
- * and in Hex:<
- * INTO(X'C13456789ABC')
+ * and in Hex:
+ * INTO(X'C13456789ABC')
example hex in javadoc comment //pragma: allowlist secret * Both representations are available using the {@link #getTextValue()} and {@link #getHexValue()} methods respectively */ public interface ICeciResponseOutputValue { diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeda.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeda.java index 331b28bfa..d682b8b6a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeda.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICeda.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICemt.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICemt.java index 1180a625f..2dbf3646d 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICemt.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICemt.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -14,7 +16,7 @@ public interface ICemt { /** * Inquire a CEMT resource using the resource type and name. * This does not support inquiries of multiple resources at once. - * Will return {@link null} if the resource is not found. + * @return null if the resource is not found. * @param cemtTerminal an {@link ITerminal} object logged on to the CICS region and in an active CEMT session. * If mixed case is required, the terminal should be presented with no upper case translate status. * For example, the test could first issue CEOT TRANIDONLY diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java index 6275f7859..dc7b2ccc9 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -102,6 +104,7 @@ public interface ICicsRegion { * @throws CicstsManagerException */ public void removeSit(@NotNull String sitParam) throws CicstsManagerException; + /** * This method adds a method to the DFHRPL concatenation in the CICS @@ -111,4 +114,28 @@ public interface ICicsRegion { * @throws CicstsManagerException */ public void addToDfhRpl(@NotNull String library) throws CicstsManagerException; + + + /** + * Allows a testcase to get a specific property about the region. + * + * The list of properties supported will depend upon how the region was + * deployed/provisioned. + * + * By default, no properties are supported, but each implementation of this + * interface is free to provide tests with whatever values they wish to + * reflect this particular CICS region. + * + * @param propertyName The name of the property for which the caller wishes to + * get a value. + * + * @return A string value for the requested property, or null if that property + * value is not available. + * + * @throws CicstsManagerException + */ + public default String getRegionProperty( String propertyName ) throws CicstsManagerException { + return null; + } + } \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsTerminal.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsTerminal.java index 881a3b7b7..e48c63ba7 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsTerminal.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsTerminal.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -28,4 +30,6 @@ public interface ICicsTerminal extends ITerminal { */ public boolean isUppercaseTranslation() throws CicstsManagerException; -} \ No newline at end of file + String getLoginCredentialsTag(); + +} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/IExecInterfaceBlock.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/IExecInterfaceBlock.java index 8527380d4..6be5e8910 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/IExecInterfaceBlock.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/IExecInterfaceBlock.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; @@ -12,188 +12,186 @@ public interface IExecInterfaceBlock { /** - * Returns a {@link String} representation of the EIBRESP field if available - * @return + * @return a {@link String} representation of the EIBRESP field if available */ public String getResponse(); /** - * Returns the value of the EIBTIME field in the EIB. - * @return + * @return the value of the EIBTIME field in the EIB. + * */ public int getEIBTIME(); /** - * Returns the value of the EIBDATE field in the EIB. - * @return + * @return the value of the EIBDATE field in the EIB. + * */ public int getEIBDATE(); /** - * Returns the value of the EIBTRNID field in the EIB. + * @return the value of the EIBTRNID field in the EIB. * @param hex return a char array containing the hex values of the field - * @return + * */ public String getEIBTRNID(boolean hex); /** - * Returns the value of the EIBTASKN field in the EIB. - * @return + * @return the value of the EIBTASKN field in the EIB. + * */ public int getEIBTASKN(); /** - * Returns the value of the EIBTRMID field in the EIB. + * @return the value of the EIBTRMID field in the EIB. * @param hex return a char array containing the hex values of the field - * @return + * */ public String getEIBTRMID(boolean hex); /** - * Returns the value of the EIBCPOSN field in the EIB. - * @param hex return a char array containing the hex values of the field - * @return + * @return the value of the EIBCPOSN field in the EIB. + * */ public int getEIBCPOSN(); /** - * Returns the value of the EIBCALEN field in the EIB. - * @return + * @return the value of the EIBCALEN field in the EIB. + * */ public int getEIBCALEN(); /** - * Returns the value of the EIBAID field in the EIB. - * @return + * @return the value of the EIBAID field in the EIB. + * */ public char getEIBAID(); /** - * Returns the value of the EIBFN field in the EIB. - * @return + * @return the value of the EIBFN field in the EIB. + * */ public char[] getEIBFN(); /** - * Returns the value of the EIBRCODE field in the EIB. - * @return + * @return the value of the EIBRCODE field in the EIB. + * */ public char[] getEIBRCODE(); /** - * Returns the value of the EIBDS field in the EIB. + * @return the value of the EIBDS field in the EIB. * @param hex return a char array containing the hex values of the field - * @return + * */ public String getEIBDS(boolean hex); /** - * Returns the value of the EIBREQID field in the EIB. + * @return the value of the EIBREQID field in the EIB. * @param hex return a char array containing the hex values of the field - * @return + * */ public String getEIBREQID(boolean hex); /** - * Returns the value of the EIBRSRCE field in the EIB. + * @return the value of the EIBRSRCE field in the EIB. * @param hex return a char array containing the hex values of the field - * @return + * */ public String getEIBRSRCE(boolean hex); /** - * Returns the value of the EIBSYNC field in the EIB. - * @return + * @return the value of the EIBSYNC field in the EIB. + * */ public char getEIBSYNC(); /** - * Returns the value of the EIBFREE field in the EIB. - * @return + * @return the value of the EIBFREE field in the EIB. + * */ public char getEIBFREE(); /** - * Returns the value of the EIBRECV field in the EIB. - * @return + * @return the value of the EIBRECV field in the EIB. + * */ public char getEIBRECV(); /** - * Returns the value of the EIBATT field in the EIB. - * @return + * @return the value of the EIBATT field in the EIB. + * */ public char getEIBATT(); /** - * Returns the value of the EIBEOC field in the EIB. - * @return + * @return the value of the EIBEOC field in the EIB. + * */ public char getEIBEOC(); /** - * Returns the value of the field in the EIB. - * @return + * @return the value of the field in the EIB. + * */ public char getEIBFMH(); /** - * Returns the value of the EIBCOMPL field in the EIB. - * @return + * @return the value of the EIBCOMPL field in the EIB. + * */ public char getEIBCOMPL(); /** - * Returns the value of the EIBSIG field in the EIB. - * @return + * @return the value of the EIBSIG field in the EIB. + * */ public char getEIBSIG(); /** - * Returns the value of the EIBCONF field in the EIB. - * @return + * @return the value of the EIBCONF field in the EIB. + * */ public char getEIBCONF(); /** - * Returns the value of the EIBERR field in the EIB. - * @return + * @return the value of the EIBERR field in the EIB. + * */ public char getEIBERR(); /** - * Returns the value of the EIBERRCD field in the EIB. - * @return + * @return the value of the EIBERRCD field in the EIB. + * */ public char[] getEIBERRCD(); /** - * Returns the value of the EIBSYNRB field in the EIB. - * @return + * @return the value of the EIBSYNRB field in the EIB. + * */ public char getEIBSYNRB(); /** - * Returns the value of the EIBNODAT field in the EIB. - * @return + * @return the value of the EIBNODAT field in the EIB. + * */ public char getEIBNODAT(); /** - * Returns the value of the EIBRESP field in the EIB. - * @return + * @return the value of the EIBRESP field in the EIB. + * */ public int getEIBRESP(); /** - * Returns the value of the EIBRESP2 field in the EIB. - * @return + * @return the value of the EIBRESP2 field in the EIB. + * */ public int getEIBRESP2(); /** - * Returns the value of the EIBRLDBK field in the EIB. - * @return + * @return the value of the EIBRLDBK field in the EIB. + * */ public char getEIBRLDBK(); } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/MasType.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/MasType.java index 3365b5d1c..42b67830c 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/MasType.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/MasType.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsBundleResourceException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsBundleResourceException.java index 164042635..2e18fbae4 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsBundleResourceException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsBundleResourceException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.cicsresource; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmprofileResourceException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmprofileResourceException.java index c128274e9..6a0faf49a 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmprofileResourceException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmprofileResourceException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.cicsresource; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmserverResourceException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmserverResourceException.java index cbeee423d..c586ee05c 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmserverResourceException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsJvmserverResourceException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.cicsresource; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceManagerException.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceManagerException.java index ece29e4ca..929de3f64 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceManagerException.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.cicsresource; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceStatus.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceStatus.java index e6539b4bc..9d461f7b3 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceStatus.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/CicsResourceStatus.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.cicsresource; public enum CicsResourceStatus { diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsBundle.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsBundle.java index fcf8f71f1..3c7fb5094 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsBundle.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsBundle.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.cicsresource; /** @@ -84,12 +86,14 @@ public interface ICicsBundle { /** * Check if the CICS BUNDLE resource definition exist via CEDA DISPLAY + * @return true if the resource definition exists, false otherwise * @throws CicsBundleResourceException */ public boolean resourceDefined() throws CicsBundleResourceException; /** * Check if the CICS BUNDLE resource has been installed via CEMT INQUIRE + * @return true if it has been installed, false otherwise. * @throws CicsBundleResourceException */ public boolean resourceInstalled() throws CicsBundleResourceException; @@ -140,7 +144,7 @@ public interface ICicsBundle { * Wait for the CICS BUNDLE resource to be disabled with specified timeout. Does NOT issue the disable command * @param timeout timeout in seconds * @return true if disabled, false if not disabled - * @throws CicsJvmserverResourceException + * @throws CicsBundleResourceException */ public boolean waitForDisable(int timeout) throws CicsBundleResourceException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsResource.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsResource.java index d88abb5aa..f67382d69 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsResource.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/ICicsResource.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.cicsresource; import java.util.Map; @@ -16,28 +18,31 @@ public interface ICicsResource { /** - * Create a CICS BUNDLE resource object supplying the CICS bundle content. The source bundle should have the same file structure as it exists + * Create a CICS BUNDLE resource object supplying the CICS bundle content. + * + * The source bundle should have the same file structure as it exists * on the zOS UNIX file system and will be transferred to the host in binary mode. + * * @param cicsTerminal a ICicsTerminal object for CEDA and CEMT transactions - * @param testClass a {@link class} in the same bundle containing the application archive file, use this.getClass() + * @param testClass a class in the same bundle containing the application archive file, use this.getClass() * @param name the CICS BUNDLE RDO name * @param group the CICS BUNDLE RDO group name * @param bundlePath the path to the directory in the test class bundle containing the CICS bundle * @param parameters substitution parameters to replace variables in the META-INF/cics.xml. Can be null * @return the CICS Bundle object - * @throws CicsJvmserverResourceException + * @throws CicsBundleResourceException */ public ICicsBundle newCicsBundle(ICicsTerminal cicsTerminal, Class testClass, String name, String group, String bundlePath, Map parameters) throws CicsBundleResourceException; /** * Create a CICS BUNDLE resource object without supplying the CICS bundle content, i.e. the bundle already exists on the zOS UNIX file system * @param cicsTerminal a ICicsTerminal object for CEDA and CEMT transactions - * @param testClass a {@link class} in the same bundle containing the application archive file, use this.getClass() + * @param testClass a class in the same bundle containing the application archive file, use this.getClass() * @param name the CICS BUNDLE RDO name * @param group the CICS BUNDLE RDO group name * @param bundleDir the CICS BUNDLE RDO BUNDLEDIR value, i.e. the location of the existing CICS bundle * @return the CICS Bundle object - * @throws CicsJvmserverResourceException + * @throws CicsBundleResourceException */ public ICicsBundle newCicsBundle(ICicsTerminal cicsTerminal, Class testClass, String name, String group, String bundleDir) throws CicsBundleResourceException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmprofile.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmprofile.java index e9c42cff9..44a960cf1 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmprofile.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmprofile.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.cicsresource; import java.util.Map; @@ -160,7 +162,9 @@ public interface IJvmprofile { public void saveToResultsArchive(String rasPath) throws CicsJvmserverResourceException; /** - * Set the value of the WLP_INSTALL_DIR environment variable in the JVM profile
Galasa sets the default value of&USSHOME;/wlp + * Set the value of the WLP_INSTALL_DIR environment variable in the JVM profile + * + * Galasa sets the default value ofUSSHOME/wlp * @param wlpInstallDir the value of WLP_INSTALL_DIR * @throws CicsJvmserverResourceException */ @@ -183,7 +187,6 @@ public interface IJvmprofile { /** * Set the value of the ZCEE_INSTALL_DIR environment variable in the JVM profile using the value supplied * in the Galasa Configuration Property Service - * @param zOSConnectInstallDir the value of ZCEE_INSTALL_DIR * @throws CicsJvmserverResourceException */ void setZosConnectInstallDir() throws CicsJvmserverResourceException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserver.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserver.java index 85b807c19..974c5b35b 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserver.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserver.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.cicsresource; @@ -260,7 +262,7 @@ public enum PurgeType { /** * Set the JVMSERVER Threadlimit value in CEMT - * @param the Threadlimit value + * @param threadlimit max number of threads used by the JVM server * @throws CicsJvmserverResourceException */ public void setThreadLimit(int threadlimit) throws CicsJvmserverResourceException; @@ -371,7 +373,7 @@ public enum PurgeType { public void checkpointLogs() throws CicsJvmserverResourceException; /** - * Get a <@link List} of Java log files, i.e Snap.*.trc, javacore.*.txt etc. + * Get a {@link List} of Java log files, i.e Snap.*.trc, javacore.*.txt etc. * @return * @throws CicsJvmserverResourceException */ @@ -392,7 +394,6 @@ public enum PurgeType { /** * Delete the JVM server logs - * @param rasPath path in Results Archive Store * @throws CicsJvmserverResourceException */ public void clearJvmLogs() throws CicsJvmserverResourceException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserverLog.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserverLog.java index f145c0b71..64b971a03 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserverLog.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/cicsresource/IJvmserverLog.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.cicsresource; import java.io.OutputStream; @@ -52,8 +54,9 @@ public interface IJvmserverLog { public OutputStream retrieve() throws CicsJvmserverResourceException; /** - * Delete the {@link IZosUNIXFile} if it exists. Will throw {@link CicsJvmserverResourceException} if the log is a {@link IZosBatchJobOutputSpoolFile} - * @throws CicsJvmserverResourceException + * Delete the {@link IZosUNIXFile} if it exists. + * + * @throws CicsJvmserverResourceException the log is a {@link IZosBatchJobOutputSpoolFile} */ public void delete() throws CicsJvmserverResourceException; @@ -86,6 +89,7 @@ public interface IJvmserverLog { /** * Searches contents of log for specified search text + * * @param searchText the text to search * @return true if text found * @throws CicsJvmserverResourceException @@ -94,6 +98,7 @@ public interface IJvmserverLog { /** * Searches contents of log for specified search or fail String + * * @param searchText the text to search * @return true if text found * @throws CicsJvmserverResourceException @@ -110,6 +115,7 @@ public interface IJvmserverLog { /** * Searches contents of log for specified search or fail String since the last checkpoint + * * @param searchText the text to search * @return the string found or null * @throws CicsJvmserverResourceException @@ -118,6 +124,7 @@ public interface IJvmserverLog { /** * Searches contents of log for specified search Pattern + * * @param searchPattern the Pattern to search * @return the string found or null * @throws CicsJvmserverResourceException @@ -126,6 +133,7 @@ public interface IJvmserverLog { /** * Searches contents of log for specified search or fail Pattern + * * @param searchPattern the Pattern to search * @return the string found or null * @throws CicsJvmserverResourceException @@ -143,19 +151,23 @@ public interface IJvmserverLog { /** * Searches contents of log for specified search or fail Pattern since the last checkpoint * @param searchPattern the Pattern to search + * @param failPattern the failure pattern to search * @return the string found or null * @throws CicsJvmserverResourceException */ public String searchForPatternSinceCheckpoint(Pattern searchPattern, Pattern failPattern) throws CicsJvmserverResourceException; /** - * Wait for a search search String to appear in specified log. Will check every 3 seconds until one of: + * Wait for a search String to appear in specified log. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchText is found;
  • - *
  • the failText is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchText is found
  • + *
  • the failText is found
  • + *
  • the specified timeout is reached
  • *
- * @param searchString the text to search + * + * @param searchText the text to search * @param timeout timeout in seconds * @return the string found or null * @throws CicsJvmserverResourceException @@ -163,14 +175,17 @@ public interface IJvmserverLog { public String waitForText(String searchText, long timeout) throws CicsJvmserverResourceException; /** - * Wait for a search String or fail text to appear in specified log. Will check every 3 seconds until one of: + * Wait for a search String or fail text to appear in specified log. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchText is found;
  • - *
  • the failText is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchText is found
  • + *
  • the failText is found
  • + *
  • the specified timeout is reached
  • *
- * @param searchString the text to search - * @param failString the failure text to search + * + * @param searchText the text to search + * @param failText the failure text to search * @param timeout timeout in seconds * @return the string found or null * @throws CicsJvmserverResourceException @@ -178,11 +193,13 @@ public interface IJvmserverLog { public String waitForText(String searchText, String failText, long timeout) throws CicsJvmserverResourceException; /** - * Wait for a search String to appear in specified log since the last checkpoint. Will check every 3 seconds until one of: + * Wait for a search String to appear in specified log since the last checkpoint. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchText is found;
  • - *
  • the failText is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchText is found
  • + *
  • the failText is found
  • + *
  • the specified timeout is reached
  • *
* @param searchText the text to search * @param timeout timeout in seconds @@ -192,12 +209,15 @@ public interface IJvmserverLog { public String waitForTextSinceCheckpoint(String searchText, long timeout) throws CicsJvmserverResourceException; /** - * Wait for a search or fail String to appear in specified log since the last checkpoint. Will check every 3 seconds until one of: + * Wait for a search or fail String to appear in specified log since the last checkpoint. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchText is found;
  • - *
  • the failText is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchText is found
  • + *
  • the failText is found
  • + *
  • the specified timeout is reached
  • *
+ * * @param searchText the text to search * @param failText the failure text to search * @param timeout timeout in seconds @@ -221,12 +241,15 @@ public interface IJvmserverLog { public String waitForPattern(Pattern searchPattern, long timeout) throws CicsJvmserverResourceException; /** - * Wait for a search or fail Pattern or fail Pattern to appear in specified log. Will check every 3 seconds until one of: + * Wait for a search or fail Pattern or fail Pattern to appear in specified log. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchPattern is found;
  • - *
  • the failPattern is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchPattern is found
  • + *
  • the failPattern is found
  • + *
  • the specified timeout is reached
  • *
+ * * @param searchPattern the Pattern to search * @param failPattern the failure pattern to search * @param timeout timeout in seconds @@ -236,12 +259,15 @@ public interface IJvmserverLog { public String waitForPattern(Pattern searchPattern, Pattern failPattern, long timeout) throws CicsJvmserverResourceException; /** - * Wait for a search Pattern to appear in specified log since the last checkpoint. Will check every 3 seconds until one of: + * Wait for a search Pattern to appear in specified log since the last checkpoint. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchPattern is found;
  • - *
  • the failPattern is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchPattern is found
  • + *
  • the failPattern is found
  • + *
  • the specified timeout is reached
  • *
+ * * @param searchPattern the Pattern to search * @param timeout timeout in seconds * @return the string found or null @@ -250,12 +276,15 @@ public interface IJvmserverLog { public String waitForPatternSinceCheckpoint(Pattern searchPattern, long timeout) throws CicsJvmserverResourceException; /** - * Wait for a search or fail Pattern or fail Pattern to appear in specified log since the last checkpoint. Will check every 3 seconds until one of: + * Wait for a search or fail Pattern or fail Pattern to appear in specified log since the last checkpoint. + * + * Will check every 3 seconds until one of: *
    - *
  • the searchPattern is found;
  • - *
  • the failPattern is found;
  • - *
  • the specified timeout is reached.
  • + *
  • the searchPattern is found
  • + *
  • the failPattern is found
  • + *
  • the specified timeout is reached
  • *
+ * * @param searchPattern the Pattern to search * @param failPattern the failure pattern to search * @param timeout timeout in seconds diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsDefaultLogonProvider.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsDefaultLogonProvider.java index 421693fe4..c27456111 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsDefaultLogonProvider.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsDefaultLogonProvider.java @@ -1,28 +1,43 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import dev.galasa.ICredentialsUsernamePassword; import dev.galasa.cicsts.CicstsManagerException; import dev.galasa.cicsts.ICicsTerminal; import dev.galasa.cicsts.internal.properties.DefaultLogonGmText; import dev.galasa.cicsts.internal.properties.DefaultLogonInitialText; import dev.galasa.cicsts.spi.ICicsRegionLogonProvider; +import dev.galasa.framework.spi.IConfidentialTextService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.creds.CredentialsException; +import dev.galasa.framework.spi.creds.ICredentialsService; import dev.galasa.zos3270.Zos3270Exception; public class CicstsDefaultLogonProvider implements ICicsRegionLogonProvider { private static final Log logger = LogFactory.getLog(CicstsDefaultLogonProvider.class); + private final ICredentialsService cs; + private final IConfidentialTextService cts; private final String initialText; private final String gmText; - public CicstsDefaultLogonProvider() throws CicstsManagerException { + public CicstsDefaultLogonProvider(IFramework framework) throws CicstsManagerException { + + try { + this.cs = framework.getCredentialsService(); + } catch (CredentialsException e) { + throw new CicstsManagerException("Could not obtain the Credentials service.", e); + } + + this.cts = framework.getConfidentialTextService(); try { initialText = DefaultLogonInitialText.get(); @@ -48,14 +63,40 @@ public boolean logonToCicsRegion(ICicsTerminal cicsTerminal) throws CicstsManage checkForInitialText(cicsTerminal); } - cicsTerminal.type("LOGON APPLID(" + cicsTerminal.getCicsRegion().getApplid() + ")").enter(); + cicsTerminal.type("LOGON APPLID(" + cicsTerminal.getCicsRegion().getApplid() + ")").enter().wfk(); waitForGmText(cicsTerminal); - cicsTerminal.clear(); - logger.debug("Logged onto " + cicsTerminal.getCicsRegion()); - } catch (Zos3270Exception e) { + + // If loginCredentialsTag is provided, attempt to sign-in + // via CESL + if (!cicsTerminal.getLoginCredentialsTag().isEmpty()) { + ICredentialsUsernamePassword creds = (ICredentialsUsernamePassword)this.cs.getCredentials(cicsTerminal.getLoginCredentialsTag()); + cts.registerText(creds.getPassword(), "Password for credential tag: " + cicsTerminal.getLoginCredentialsTag()); + + // Are we already on CESL/N? If not go to it + long timeout = 0; + if (!cicsTerminal.searchText("Signon to CICS", timeout)) { + cicsTerminal.clear().wfk(); + + cicsTerminal.type("CESL").enter().wfk(); + } + + cicsTerminal.waitForTextInField(new String[]{"Userid"}, new String[]{"Security is not active"}); + cicsTerminal.type(creds.getUsername()); + cicsTerminal.positionCursorToFieldContaining("Password"); + cicsTerminal.tab(); + cicsTerminal.type(creds.getPassword()); + cicsTerminal.enter().wfk(); + + waitForLoggedOnText(cicsTerminal); + logger.debug("Logged into CICS TS as user: " + creds.getUsername()); + } + + cicsTerminal.clear().wfk(); + + } catch (Zos3270Exception | CredentialsException e) { throw new CicstsManagerException("Problem logging onto the CICS region"); } @@ -80,4 +121,21 @@ private void waitForGmText(ICicsTerminal cicsTerminal) throws CicstsManagerExcep } } -} \ No newline at end of file + private void waitForLoggedOnText(ICicsTerminal cicsTerminal) throws CicstsManagerException { + + String[] pass = { "Sign-on is complete" }; + String[] fail = { + "Your password has expired. Please type your new password.", + "Invalid credentials entered", + "userid has been revoked" + }; + + try { + cicsTerminal.waitForTextInField(pass, fail); + } catch (Exception e) { + throw new CicstsManagerException("Unable to wait for the initial CICS screen, looking for '" + String.join("', '", pass) + "'", + e); + } + } + +} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsManagerImpl.java index 2cf1a2f5c..a91823646 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/CicstsManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal; @@ -46,11 +48,9 @@ import dev.galasa.framework.spi.IManager; import dev.galasa.framework.spi.ResourceUnavailableException; import dev.galasa.framework.spi.language.GalasaTest; -import dev.galasa.ipnetwork.IpNetworkManagerException; import dev.galasa.textscan.spi.ITextScannerManagerSpi; import dev.galasa.zos.spi.IZosManagerSpi; import dev.galasa.zos3270.TerminalInterruptedException; -import dev.galasa.zos3270.Zos3270ManagerException; import dev.galasa.zosbatch.IZosBatch; import dev.galasa.zosbatch.spi.IZosBatchSpi; import dev.galasa.zosfile.IZosFileHandler; @@ -65,9 +65,9 @@ public class CicstsManagerImpl extends AbstractManager implements ICicstsManager private boolean required; private IZosManagerSpi zosManager; - private IZosBatchSpi zosBatchManager; - private IZosFileSpi zosFileManager; - private ITextScannerManagerSpi textScanner; + private IZosBatchSpi zosBatchManager; + private IZosFileSpi zosFileManager; + private ITextScannerManagerSpi textScanner; private final HashMap provisionedCicsRegions = new HashMap<>(); @@ -208,15 +208,16 @@ public ICicsTerminal generateCicsTerminal(Field field, List annotati CicsTerminal annotation = field.getAnnotation(CicsTerminal.class); String tag = defaultString(annotation.cicsTag(), "PRIMARY").toUpperCase(); + String loginCredentialsTag = defaultString(annotation.loginCredentialsTag(), "").toUpperCase(); ICicsRegionProvisioned region = this.provisionedCicsRegions.get(tag); if (region == null) { - throw new CicstsManagerException("Unable to setup CICS Terminal for field " + field.getName() - + ", tagged region " + tag + " was not provisioned"); + throw new CicstsManagerException("Unable to setup CICS Terminal for field '" + field.getName() + "', for region with tag '" + + tag + "' as a region with a matching 'cicsTag' tag was not found, or the region was not provisioned."); } try { - CicsTerminalImpl newTerminal = new CicsTerminalImpl(this, getFramework(), region, annotation.connectAtStartup(), this.textScanner); + CicsTerminalImpl newTerminal = new CicsTerminalImpl(this, getFramework(), region, annotation.connectAtStartup(), this.textScanner, loginCredentialsTag); this.terminals.add(newTerminal); return newTerminal; } catch (TerminalInterruptedException e) { @@ -237,7 +238,7 @@ public ICicsTerminal generateCicsTerminal(String tag) throws CicstsManagerExcept CicsTerminalImpl newTerminal = new CicsTerminalImpl(this, getFramework(), region, true, this.textScanner); this.terminals.add(newTerminal); return newTerminal; - } catch (TerminalInterruptedException | IpNetworkManagerException | Zos3270ManagerException e) { + } catch (TerminalInterruptedException | ManagerException e) { throw new CicstsManagerException( "Unable to setup CICS Terminal for tagged region " + tag, e); } @@ -264,7 +265,7 @@ public void provisionBuild() throws ManagerException, ResourceUnavailableExcepti @Override public void provisionStart() throws ManagerException, ResourceUnavailableException { // Add the default Logon Provider incase one isn't supplied - this.logonProviders.add(new CicstsDefaultLogonProvider()); + this.logonProviders.add(new CicstsDefaultLogonProvider(getFramework())); // First, give the provisioners the opportunity to start CICS regions for (ICicsRegionProvisioner provisioner : provisioners) { @@ -300,6 +301,7 @@ public void provisionStart() throws ManagerException, ResourceUnavailableExcepti public void provisionStop() { for (CicsTerminalImpl terminal : this.terminals) { try { + terminal.writeRasOutput(); terminal.flushTerminalCache(); terminal.disconnect(); } catch (TerminalInterruptedException e) { // NOSONAR - wish to hide disconnect errors @@ -447,4 +449,9 @@ public Map getTaggedCicsRegions() { } return clonedTaggedCicsRegions; } + + @Override + public List getCicsTerminals() { + return new ArrayList<>(this.terminals); + } } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java index f4e8911a8..1275b38e0 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.dse; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseProvisioningImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseProvisioningImpl.java index 84051b7fc..56e7466af 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseProvisioningImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseProvisioningImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.dse; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/CicstsPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/CicstsPropertiesSingleton.java index b6d457cad..675b90200 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/CicstsPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/CicstsPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonGmText.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonGmText.java index 458e94a2e..66b30e563 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonGmText.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonGmText.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonInitialText.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonInitialText.java index cd3531b61..05d1b66f8 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonInitialText.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultLogonInitialText.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultVersion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultVersion.java index 08bd6cb42..e60644bc3 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultVersion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DefaultVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseApplid.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseApplid.java index 4912c160e..bf46735a4 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseApplid.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseApplid.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJavaHome.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJavaHome.java index 77a827d77..2bd9cc7b6 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJavaHome.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJavaHome.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJvmProfileDir.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJvmProfileDir.java index 7f18616b5..6a700bba8 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJvmProfileDir.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseJvmProfileDir.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseUssHome.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseUssHome.java index f13172f65..27499a116 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseUssHome.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseUssHome.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseVersion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseVersion.java index bc89a730f..b86875e8c 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseVersion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/DseVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ExtraBundles.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ExtraBundles.java index 4382e6eb2..80212006f 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ExtraBundles.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ExtraBundles.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.internal.properties; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ProvisionType.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ProvisionType.java index 3d738eaf9..f0c504dd8 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ProvisionType.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/properties/ProvisionType.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/package-info.java index 76a77d9a2..f0c325937 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/package-info.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * CICS/TS Manager * diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/BaseCicsImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/BaseCicsImpl.java index cea2a4d33..b94673d6f 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/BaseCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/BaseCicsImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.spi; import dev.galasa.cicsts.CicstsManagerException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/CicsTerminalImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/CicsTerminalImpl.java index a40fee506..123018b39 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/CicsTerminalImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/CicsTerminalImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.spi; import org.apache.commons.logging.Log; @@ -13,11 +15,13 @@ import dev.galasa.ipnetwork.IIpHost; import dev.galasa.ipnetwork.IpNetworkManagerException; import dev.galasa.textscan.spi.ITextScannerManagerSpi; +import dev.galasa.zos.ZosManagerException; import dev.galasa.zos3270.FieldNotFoundException; import dev.galasa.zos3270.KeyboardLockedException; import dev.galasa.zos3270.TerminalInterruptedException; import dev.galasa.zos3270.TimeoutException; import dev.galasa.zos3270.Zos3270ManagerException; +import dev.galasa.zos3270.common.screens.TerminalSize; import dev.galasa.zos3270.spi.NetworkException; import dev.galasa.zos3270.spi.Zos3270TerminalImpl; @@ -29,26 +33,33 @@ public class CicsTerminalImpl extends Zos3270TerminalImpl implements ICicsTermin public final ICicstsManagerSpi cicstsManager; public final boolean connectAtStartup; + public final String loginCredentialsTag; - public CicsTerminalImpl(ICicstsManagerSpi cicstsManager, IFramework framework, ICicsRegionProvisioned cicsRegion, String host, int port, boolean ssl, boolean connectAtStartup, ITextScannerManagerSpi textScanner) - throws TerminalInterruptedException, Zos3270ManagerException { - super(cicsRegion.getNextTerminalId(), host, port, ssl, framework, false, cicsRegion.getZosImage(), 80, 24, 0, 0, textScanner); + public CicsTerminalImpl(ICicstsManagerSpi cicstsManager, IFramework framework, ICicsRegionProvisioned cicsRegion, String host, int port, boolean ssl, boolean connectAtStartup, ITextScannerManagerSpi textScanner, String loginCredentialsTag) + throws TerminalInterruptedException, Zos3270ManagerException, ZosManagerException { + super(cicsRegion.getNextTerminalId(), host, port, ssl, framework, false, cicsRegion.getZosImage(), new TerminalSize(80, 24), new TerminalSize(0, 0), textScanner); this.cicsRegion = cicsRegion; this.cicstsManager = cicstsManager; this.connectAtStartup = connectAtStartup; + this.loginCredentialsTag = loginCredentialsTag; setAutoReconnect(connectAtStartup); } - public CicsTerminalImpl(ICicstsManagerSpi cicstsManager, IFramework framework, ICicsRegionProvisioned cicsRegion, IIpHost ipHost, boolean connectAtStartup, ITextScannerManagerSpi textScanner) - throws TerminalInterruptedException, IpNetworkManagerException, Zos3270ManagerException { - this(cicstsManager, framework, cicsRegion, ipHost.getHostname(), ipHost.getTelnetPort(), ipHost.isTelnetPortTls(), connectAtStartup, textScanner); + public CicsTerminalImpl(ICicstsManagerSpi cicstsManager, IFramework framework, ICicsRegionProvisioned cicsRegion, IIpHost ipHost, boolean connectAtStartup, ITextScannerManagerSpi textScanner, String loginCredentialsTag) + throws TerminalInterruptedException, IpNetworkManagerException, Zos3270ManagerException, ZosManagerException { + this(cicstsManager, framework, cicsRegion, ipHost.getHostname(), ipHost.getTelnetPort(), ipHost.isTelnetPortTls(), connectAtStartup, textScanner, loginCredentialsTag); + } + + public CicsTerminalImpl(ICicstsManagerSpi cicstsManager, IFramework framework, ICicsRegionProvisioned cicsRegion, boolean connectAtStartup, ITextScannerManagerSpi textScanner, String loginCredentialsTag) throws TerminalInterruptedException, IpNetworkManagerException, + Zos3270ManagerException, ZosManagerException { + this(cicstsManager, framework, cicsRegion, cicsRegion.getZosImage().getIpHost(), connectAtStartup, textScanner, loginCredentialsTag); } public CicsTerminalImpl(ICicstsManagerSpi cicstsManager, IFramework framework, ICicsRegionProvisioned cicsRegion, boolean connectAtStartup, ITextScannerManagerSpi textScanner) throws TerminalInterruptedException, IpNetworkManagerException, - Zos3270ManagerException { - this(cicstsManager, framework, cicsRegion, cicsRegion.getZosImage().getIpHost(), connectAtStartup, textScanner); + Zos3270ManagerException, ZosManagerException { + this(cicstsManager, framework, cicsRegion, cicsRegion.getZosImage().getIpHost(), connectAtStartup, textScanner, ""); } @Override @@ -146,4 +157,9 @@ public boolean isUppercaseTranslation() throws CicstsManagerException { } } -} \ No newline at end of file + @Override + public String getLoginCredentialsTag() { + return this.loginCredentialsTag; + } + +} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICeciProvider.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICeciProvider.java index 91a32e5bb..61d78ee56 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICeciProvider.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICeciProvider.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICedaProvider.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICedaProvider.java index 08c6d1c28..dcc5d9f2b 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICedaProvider.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICedaProvider.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICemtProvider.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICemtProvider.java index 2d50ca0d3..611112126 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICemtProvider.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICemtProvider.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionLogonProvider.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionLogonProvider.java index 0f941b3b8..4adc1ef83 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionLogonProvider.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionLogonProvider.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioned.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioned.java index 616664be7..9e1d6e681 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioned.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioned.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioner.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioner.java index 450a8c103..5a44ecf71 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioner.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsRegionProvisioner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsResourceProvider.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsResourceProvider.java index 9334990d4..e00ba6c00 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsResourceProvider.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicsResourceProvider.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicstsManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicstsManagerSpi.java index 42199f3c9..3b6c79737 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicstsManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/spi/ICicstsManagerSpi.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.spi; import java.util.List; @@ -97,4 +99,6 @@ public interface ICicstsManagerSpi { public Map getTaggedCicsRegions(); public ICicsRegion locateCicsRegion(String tag) throws CicstsManagerException; + + public List getCicsTerminals(); } diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/cicsts/internal/TestCicstsManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/cicsts/internal/TestCicstsManagerImpl.java new file mode 100644 index 000000000..2f75441e9 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/cicsts/internal/TestCicstsManagerImpl.java @@ -0,0 +1,84 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.cicsts.internal; + +import static org.assertj.core.api.Assertions.*; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +import dev.galasa.cicsts.CicsRegion; +import dev.galasa.cicsts.CicsTerminal; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.framework.Framework; +import dev.galasa.framework.spi.IManager; +import dev.galasa.framework.spi.language.GalasaTest; +import dev.galasa.framework.spi.language.gherkin.GherkinTest; + +public class TestCicstsManagerImpl { + + private class MockGalasaTest extends GalasaTest{ + + public MockGalasaTest(GherkinTest test) { + super(test); + } + } + + private class DummyTestBad{ + + @CicsTerminal(cicsTag = "TERM01") + public ICicsTerminal terminal; + + @CicsRegion(cicsTag = "REGN01") + public ICicsRegion cicsRegion; + + } + + private class mockCicstsManagerImpl extends CicstsManagerImpl{ + public mockCicstsManagerImpl() { + super(); + } + } + + @Test + public void TestGenerateCicsTerminalBadReturnsError() throws Exception{ + // Given... + DummyTestBad dummyTest = new DummyTestBad(); + List managersList = new ArrayList(); + managersList.add(new CicstsManagerImpl()); + + GalasaTest test = new MockGalasaTest(null); + + Framework framework = new Framework(); + CicstsManagerImpl cicsTsManager = new mockCicstsManagerImpl(); + cicsTsManager.initialise(framework, managersList, managersList, test); + + Field terminal = dummyTest.getClass().getField("terminal"); + Field region = dummyTest.getClass().getField("cicsRegion"); + List annotations = new ArrayList<>(); + annotations.add(terminal.getAnnotation(CicsTerminal.class)); + annotations.add(region.getAnnotation(CicsRegion.class)); + + // When... + Throwable thrown = catchThrowable(() -> { + cicsTsManager.generateCicsTerminal(terminal, annotations); + }); + + // Then... + assertThat(thrown).isNotNull(); + String error = thrown.getMessage(); + String expectedError = "Unable to setup CICS Terminal for field 'terminal', for region with tag 'TERM01'"+ + " as a region with a matching 'cicsTag' tag was not found, or the region was not provisioned."; + assertThat(error).isEqualTo(expectedError); + + } + +} diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/SampleGalasaTst.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/SampleGalasaTst.java index 46e9ffdfd..d8a7975e8 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/SampleGalasaTst.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/SampleGalasaTst.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.tests; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/TestGoldenPath.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/TestGoldenPath.java index 1113e27a6..ab5259ea1 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/TestGoldenPath.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/test/java/dev/galasa/tests/TestGoldenPath.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.tests; import static org.assertj.core.api.Assertions.assertThat; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/build.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/build.gradle index 66b340dec..d10733d27 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa CICS/TS Resource Manager' -version = '0.25.0' +version = '0.37.0' dependencies { api project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') @@ -12,6 +12,19 @@ dependencies { implementation project (':galasa-managers-core-parent:dev.galasa.textscan.manager') implementation project (':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'commons-io:commons-io:2.9.0' + implementation 'org.apache.commons:commons-lang3:3.14.0' + implementation 'commons-io:commons-io:2.16.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/settings.gradle index 0ae497a5c..3a6ce964d 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.cicsts.resource.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.cicsts.resource.manager' + diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleImpl.java index 51bad5670..a51bc5010 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleResourceType.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleResourceType.java index b0ad7b621..5bf89100d 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleResourceType.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsBundleResourceType.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal; /** diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceImpl.java index 6a4f5e983..622ba57d7 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceManagerImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceManagerImpl.java index 22b44f2e5..7e9d98d8c 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/CicsResourceManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.resource.internal; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmprofileImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmprofileImpl.java index 50a611b3e..440a227f9 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmprofileImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmprofileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal; import java.nio.file.attribute.PosixFilePermissions; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverImpl.java index 96a58126e..9ec0e9f7e 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.resource.internal; @@ -47,13 +49,13 @@ import dev.galasa.zosliberty.ZosLibertyServerException; public class JvmserverImpl implements IJvmserver { - + private static final Log logger = LogFactory.getLog(JvmserverImpl.class); private CicsResourceManagerImpl cicsResourceManager; private IZosFileHandler zosFileHandler; private IZosLiberty zosLiberty; - + private boolean shouldArchive = true; private boolean shouldCleanup = true; @@ -70,7 +72,7 @@ public class JvmserverImpl implements IJvmserver { private String cicsRegionHomeDirectory; private String cicsRegionJobname; private String cicsRegionUserid; - + private String resourceDefinitionName; private String resourceDefinitionGroup; private String resourceDefinitionDescription; @@ -79,7 +81,7 @@ public class JvmserverImpl implements IJvmserver { private JvmserverType jvmserverType = JvmserverType.UNKNOWN; private String resourceDefinitionLerunopts; private int resourceDefinitionThreadlimit = 15; - + private IJvmprofile jvmprofile; private String defaultWorkingDirectoryValue; @@ -92,20 +94,20 @@ public class JvmserverImpl implements IJvmserver { private IZosUNIXFile workingDirectory; private IZosUNIXFile diagnosticsDirectory; private IZosUNIXFile javaHome; - private IZosUNIXFile logsDirectory; - private IJvmserverLog jvmLogLog; - private IJvmserverLog stdOutLog; - private IJvmserverLog stdErrLog; + private IZosUNIXFile logsDirectory; + private IJvmserverLog jvmLogLog; + private IJvmserverLog stdOutLog; + private IJvmserverLog stdErrLog; private IJvmserverLog jvmTraceLog; - + private IZosLibertyServer zosLibertyServer; private String wlpInstallDir; private String wlpUserDir; private String wlpOutputDir; - + private int defaultTimeout = -1; - private static final String SLASH_SYBMOL = "/"; + private static final String SLASH_SYBMOL = "/"; private static final String SYMBOL_APPLID = "&APPLID;"; private static final String SYMBOL_CONFIGROOT = "&CONFIGROOT;"; private static final String SYMBOL_JVMSERVER = "&JVMSERVER;"; @@ -115,9 +117,9 @@ public class JvmserverImpl implements IJvmserver { private static final String OPTION_JAVA_HOME = "JAVA_HOME"; private static final String OPTION_WORK_DIR = "WORK_DIR"; - + private static final String RESOURCE_TYPE_JVMSERVER = "JVMSERVER"; - + private static final String LOG_CEMT_PARAMETER = "Log"; private static final String LOG_PROFILE_OPTION = "JVMLOG"; private static final String LOG_FILE_SUFFIX = "dfhjvmlog"; @@ -131,29 +133,38 @@ public class JvmserverImpl implements IJvmserver { private static final String TRACE_PROFILE_OPTION = "JVMTRACE"; private static final String TRACE_FILE_SUFFIX = "dfhjvmtrc"; - public JvmserverImpl(CicsResourceManagerImpl cicsResourceManager, ICicsRegion cicsRegion, ICicsTerminal cicsTerminal, String name, String group, String jvmprofileName, JvmserverType jvmserverType) throws CicsJvmserverResourceException { - this.cicsResourceManager = cicsResourceManager; + public JvmserverImpl(CicsResourceManagerImpl cicsResourceManagerImpl, ICicsRegion cicsRegion, ICicsTerminal cicsTerminal, String name, String group) throws CicsJvmserverResourceException { + this.cicsResourceManager = cicsResourceManagerImpl; this.cicsResourceManager.registerJvmserver(this); + this.cicsRegion = cicsRegion; + this.cicsZosImage = cicsRegion.getZosImage(); + try { this.zosFileHandler = this.cicsResourceManager.getZosFileHandler(); } catch (CicsResourceManagerException e) { throw new CicsJvmserverResourceException("Unable to get zOS File Handler", e); } - this.cicsRegion = cicsRegion; - this.cicsZosImage = cicsRegion.getZosImage(); + setRunTemporaryUNIXPath(); this.cicsTerminal = cicsTerminal; this.resourceDefinitionName = name; this.resourceDefinitionGroup = group; + } + + public JvmserverImpl(CicsResourceManagerImpl cicsResourceManagerImpl, ICicsRegion cicsRegion, ICicsTerminal cicsTerminal, String name, String group, String jvmprofileName, JvmserverType jvmserverType) throws CicsJvmserverResourceException { + this(cicsResourceManagerImpl, cicsRegion, cicsTerminal, name, group); this.resourceDefinitionJvmprofile = jvmprofileName; this.jvmserverType = jvmserverType; this.jvmprofile = newJvmprofileFromCicsSuppliedProfile(jvmprofileName); + try { this.javaHome = this.zosFileHandler.newUNIXFile(getDefaultJavaHomeValue(), cicsZosImage); } catch (ZosUNIXFileException e) { throw new CicsJvmserverResourceException("Unable to set JAVA_HOME", e); } + this.jvmprofile.setProfileValue(OPTION_JAVA_HOME, this.javaHome.getUnixPath()); + try { this.workingDirectory = this.zosFileHandler.newUNIXFile(getDefaultWorkingDirectoryValue(), cicsZosImage); } catch (ZosUNIXFileException e) { @@ -174,28 +185,18 @@ public JvmserverImpl(CicsResourceManagerImpl cicsResourceManager, ICicsRegion ci } } + + public JvmserverImpl(CicsResourceManagerImpl cicsResourceManagerImpl, ICicsRegion cicsRegion, ICicsTerminal cicsTerminal, String name, String group, IJvmprofile jvmprofile) throws CicsJvmserverResourceException { - this.cicsResourceManager = cicsResourceManagerImpl; - this.cicsResourceManager.registerJvmserver(this); - this.cicsRegion = cicsRegion; - this.cicsZosImage = cicsRegion.getZosImage(); - setRunTemporaryUNIXPath(); - this.cicsTerminal = cicsTerminal; - this.resourceDefinitionName = name; - this.resourceDefinitionGroup = group; + this(cicsResourceManagerImpl, cicsRegion, cicsTerminal, name, group); + this.jvmprofile = jvmprofile; this.resourceDefinitionJvmprofile = jvmprofile.getProfileName(); this.jvmserverType = determineJvmserverType(); } public JvmserverImpl(CicsResourceManagerImpl cicsResourceManagerImpl, ICicsRegion cicsRegion, ICicsTerminal cicsTerminal, String name, String group, IJvmprofile jvmprofile, IZosLibertyServer libertyServer) throws CicsJvmserverResourceException { - this.cicsResourceManager = cicsResourceManagerImpl; - this.cicsResourceManager.registerJvmserver(this); - this.cicsRegion = cicsRegion; - this.cicsZosImage = cicsRegion.getZosImage(); - setRunTemporaryUNIXPath(); - this.cicsTerminal = cicsTerminal; - this.resourceDefinitionName = name; - this.resourceDefinitionGroup = group; + this(cicsResourceManagerImpl, cicsRegion, cicsTerminal, name, group); + this.jvmprofile = jvmprofile; this.resourceDefinitionJvmprofile = jvmprofile.getProfileName(); this.jvmserverType = JvmserverType.LIBERTY; this.zosLibertyServer = libertyServer; @@ -250,7 +251,7 @@ protected IZosLibertyServer newZosLibertyServerFromCicsSuppliedServerXml() throw } protected IZosLiberty getLiberty() throws CicsJvmserverResourceException { - if (this.zosLiberty == null) { + if (this.zosLiberty == null) { try { this.zosLiberty = cicsResourceManager.getZosLiberty(); } catch (CicsResourceManagerException e) { @@ -292,7 +293,7 @@ protected NavigableMap decendingDirectoryList(IZosUNIXFile SortedMap directoryList = new TreeMap<>(); try { if (directory.exists()) { - + } directoryList = directory.directoryList(); } catch (ZosUNIXFileException e) { @@ -467,7 +468,7 @@ public void buildResourceDefinition() throws CicsJvmserverResourceException { //TODO: Messages??? if (!resourceDefined()) { throw new CicsJvmserverResourceException("Failed to define " + RESOURCE_TYPE_JVMSERVER + " resource definition"); - } + } } catch (CicstsManagerException e) { throw new CicsJvmserverResourceException("Unable to build " + RESOURCE_TYPE_JVMSERVER + " resource definition", e); } @@ -530,10 +531,10 @@ private void resetSavedValues() { this.workingDirectory = null; this.diagnosticsDirectory = null; this.javaHome = null; - this.logsDirectory = null; - this.jvmLogLog = null; - this.stdOutLog = null; - this.stdErrLog = null; + this.logsDirectory = null; + this.jvmLogLog = null; + this.stdOutLog = null; + this.stdErrLog = null; this.jvmTraceLog = null; this.wlpInstallDir = null; this.wlpUserDir = null; @@ -619,7 +620,7 @@ public PurgeType disableWithEscalate(int steptimeout) throws CicsJvmserverResour } } } - + return purgeType; } @@ -817,7 +818,7 @@ public IZosUNIXFile getJavaHome() throws CicsJvmserverResourceException { String javaHomeValue = this.jvmprofile.getProfileValue(OPTION_JAVA_HOME); if (javaHomeValue == null) { javaHomeValue = getDefaultJavaHomeValue(); - this.jvmprofile.setProfileValue(OPTION_JAVA_HOME, javaHomeValue); + this.jvmprofile.setProfileValue(OPTION_JAVA_HOME, javaHomeValue); } try { this.javaHome = this.zosFileHandler.newUNIXFile(javaHomeValue, this.cicsZosImage); @@ -834,7 +835,7 @@ public IZosUNIXFile getWorkingDirectory() throws CicsJvmserverResourceException String workDirValue = this.jvmprofile.getProfileValue(OPTION_WORK_DIR); if (workDirValue == null) { workDirValue = getDefaultWorkingDirectoryValue(); - this.jvmprofile.setProfileValue(OPTION_WORK_DIR, workDirValue); + this.jvmprofile.setProfileValue(OPTION_WORK_DIR, workDirValue); } if (!workDirValue.startsWith(SLASH_SYBMOL)) { workDirValue = getHomeDirectory() + workDirValue; @@ -881,7 +882,7 @@ public IJvmserverLog getJvmTrace() throws CicsJvmserverResourceException { } @Override - public void checkpointLogs() throws CicsJvmserverResourceException { + public void checkpointLogs() throws CicsJvmserverResourceException { getJvmLog().checkpoint(); getStdOut().checkpoint(); getStdErr().checkpoint(); @@ -895,7 +896,7 @@ public List getJavaLogs() throws CicsJvmserverResourceException { if (getWorkingDirectory().exists()) { SortedMap directoryList = getWorkingDirectory().directoryList(); for (Entry entry : directoryList.entrySet()) { - if (entry.getKey().matches(".*/Snap.*\\.trc$") || + if (entry.getKey().matches(".*/Snap.*\\.trc$") || entry.getKey().matches(".*/javacore.*\\.txt$")) { javaLogs.add(entry.getValue()); } else if(entry.getKey().matches(".*/jitdump.*\\.dmp$")) { @@ -916,22 +917,14 @@ public void saveToResultsArchive() throws CicsJvmserverResourceException { } @Override - public void saveToResultsArchive(String rasPath) throws CicsJvmserverResourceException { - if (this.jvmprofile != null) { - this.jvmprofile.saveToResultsArchive(rasPath); - } - if (this.jvmLogLog != null) { - this.jvmLogLog.saveToResultsArchive(rasPath); - } - if (this.stdOutLog != null) { - this.stdOutLog.saveToResultsArchive(rasPath); - } - if (this.stdErrLog != null) { - this.stdErrLog.saveToResultsArchive(rasPath); - } - if (this.jvmTraceLog != null) { - this.jvmTraceLog.saveToResultsArchive(rasPath); - } + public void saveToResultsArchive(String rasPath) throws CicsJvmserverResourceException { + getJvmprofile().saveToResultsArchive(rasPath); + + getJvmLog().saveToResultsArchive(rasPath); + getStdOut().saveToResultsArchive(rasPath); + getStdErr().saveToResultsArchive(rasPath); + getJvmTrace().saveToResultsArchive(rasPath); + saveDiagnosticsToResultsArchive(rasPath); saveJavaLogsToResultsArchive(rasPath); if (isLiberty()) { @@ -944,7 +937,7 @@ public void saveToResultsArchive(String rasPath) throws CicsJvmserverResourceExc } @Override - public void clearJvmLogs() throws CicsJvmserverResourceException { + public void clearJvmLogs() throws CicsJvmserverResourceException { if (this.jvmLogLog != null) { this.jvmLogLog.delete(); } @@ -967,7 +960,7 @@ public void clearJvmLogs() throws CicsJvmserverResourceException { } } } - + @Override public String toString() { return "[JVM server] " + getName(); @@ -999,7 +992,7 @@ protected IJvmserverLog getLog(String cemtParameter, String jvmprofileOption, St } catch (ZosBatchException | ZosUNIXFileException | CicstsManagerException e) { throw new CicsJvmserverResourceException("Problem creating IJvmserverLog object for " + cemtParameter, e); } - + } protected String getDdname(String logName) { @@ -1014,7 +1007,7 @@ protected String getLogName(String cemtParameter, String jvmprofileOption, Strin return cemtMap.get(cemtParameter); } } - + // Try jvmprofile if (this.jvmprofile.containsOption(jvmprofileOption)) { String value = this.jvmprofile.getProfileValue(jvmprofileOption); @@ -1025,18 +1018,18 @@ protected String getLogName(String cemtParameter, String jvmprofileOption, Strin } } } - + // Look on the file system for(Map.Entry entry : decendingDirectoryList(getDefaultLogsDiretory()).entrySet()) { if (entry.getKey().endsWith("." + fileSuffix)) { return entry.getValue().getUnixPath(); } } - + throw new CicsJvmserverResourceException("Unable to establish JVM server " + cemtParameter + " log file"); - + } - + protected boolean isDdname(String logName) { return logName.startsWith("//DD:"); } @@ -1099,7 +1092,7 @@ protected CicstsHashMap cemtInquire() throws CicsJvmserverResourceException { } return cemtMap; } - + protected String parseJvmprofileSymbols(String value) throws CicsJvmserverResourceException { if (value.contains(SYMBOL_DATE) || value.contains(SYMBOL_TIME)) { throw new CicsJvmserverResourceException("JVM profile options \"" + SYMBOL_DATE + "\" and \"" + SYMBOL_TIME + "\" not supported by JVM server Manager"); @@ -1109,10 +1102,10 @@ protected String parseJvmprofileSymbols(String value) throws CicsJvmserverResour parsedValue = StringUtils.replace(parsedValue, SYMBOL_CONFIGROOT, getUsshome()); parsedValue = StringUtils.replace(parsedValue, SYMBOL_JVMSERVER, getName()); parsedValue = StringUtils.replace(parsedValue, SYMBOL_USSHOME, getUsshome()); - + return parsedValue; } - + protected String getUsshome() throws CicsJvmserverResourceException { if (this.cicsUsshome == null) { try { @@ -1123,14 +1116,14 @@ protected String getUsshome() throws CicsJvmserverResourceException { } return this.cicsUsshome; } - + protected String getApplid() { if (this.cicsApplid == null) { this.cicsApplid = this.cicsRegion.getApplid(); } return this.cicsApplid; } - + protected String getJvmProfileDir() throws CicsJvmserverResourceException { if (this.cicsJvmprofileDir == null) { try { @@ -1141,7 +1134,7 @@ protected String getJvmProfileDir() throws CicsJvmserverResourceException { } return this.cicsJvmprofileDir; } - + protected String getConfigRoot() throws CicsJvmserverResourceException { if (this.cicsConfigroot == null) { //TOODO: get CONFIGROOT @@ -1149,7 +1142,7 @@ protected String getConfigRoot() throws CicsJvmserverResourceException { } return this.cicsConfigroot; } - + protected IZosUNIXFile getDiagnosticsDirectory() throws CicsJvmserverResourceException { if (this.diagnosticsDirectory == null) { try { @@ -1202,7 +1195,7 @@ protected void deleteJavaLogs() throws CicsJvmserverResourceException { } } } - + protected void cleanup() { if (shouldArchive()) { try { diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverLogImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverLogImpl.java index fa53643c7..c543c8cb3 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverLogImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/JvmserverLogImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/package-info.java index 771621da5..601ff3b2b 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/CicstsResourcePropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/CicstsResourcePropertiesSingleton.java index 13d38b443..1f617e1f7 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/CicstsResourcePropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/CicstsResourcePropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.resource.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/DefaultResourceTimeout.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/DefaultResourceTimeout.java index fad58577f..4508f45fe 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/DefaultResourceTimeout.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/internal/properties/DefaultResourceTimeout.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cicsts.resource.internal.properties; import dev.galasa.cicsts.cicsresource.CicsResourceManagerException; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/ICicsResourceManagerSpi.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/ICicsResourceManagerSpi.java index 78bbde1c1..7bc5ee90b 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/ICicsResourceManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/ICicsResourceManagerSpi.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.resource.spi; diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/package-info.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/package-info.java index aa37a32c4..abc898288 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.resource.manager/src/main/java/dev/galasa/cicsts/resource/spi/package-info.java @@ -1,4 +1,6 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cicsts.resource.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/build.gradle index 4eaf47929..a1618c1c8 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/build.gradle @@ -8,3 +8,16 @@ version = '0.22.0' dependencies { } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/settings.gradle index eef9af599..d1c9f8599 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/settings.gradle @@ -1 +1,2 @@ rootProject.name = 'dev.galasa.cloud.manager' + diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainer.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainer.java index 7ca02c3b7..9fbd5f436 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainer.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainer.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerEnvProp.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerEnvProp.java index d01d56c2c..46853a5ce 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerEnvProp.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerEnvProp.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerPort.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerPort.java index 0a57a377e..055937b1f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerPort.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudContainerPort.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerException.java index 4dd8ac000..51b8191b9 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerField.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerField.java index b008d1565..dedf4e78c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerField.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/CloudManagerField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud; @@ -11,7 +13,7 @@ /** * Annotation to capture the other cloud related annotations from the test class * - * @author Michael Baylis + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/ICloudContainer.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/ICloudContainer.java index ccd15ce56..dbb1e6d5b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/ICloudContainer.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/ICloudContainer.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cloud; import java.net.InetSocketAddress; @@ -8,7 +10,7 @@ /** * Cloud Container * - * @author Michael Baylis + * * */ public interface ICloudContainer { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudContainerPortImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudContainerPortImpl.java index 6a605a039..f283577ac 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudContainerPortImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudContainerPortImpl.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudManagerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudManagerImpl.java index 8356dd6d7..2d12a55dd 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/CloudManagerImpl.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud.internal; @@ -47,7 +49,7 @@ /** * The Cloud Manager * - * @author Michael Baylis + * * */ @Component(service = { IManager.class }) @@ -166,7 +168,7 @@ public void provisionGenerate() throws ManagerException, ResourceUnavailableExce * * @param field The test field * @param annotations any annotations with the ecosystem - * @return a {@link IKubernetesEcosystem} ecosystem + * @return a {@link dev.galasa.galasaecosystem.IKubernetesEcosystem} ecosystem * @throws InsufficientResourcesAvailableException * @throws KubernetesManagerException if there is a problem generating a ecosystem */ diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/CloudPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/CloudPropertiesSingleton.java index 111172ea3..277e75b5d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/CloudPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/CloudPropertiesSingleton.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cloud.internal.properties; import org.osgi.service.component.annotations.Activate; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverrideImage.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverrideImage.java index bf0a24673..e3bac14bb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverrideImage.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverrideImage.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverridePlatform.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverridePlatform.java index 3d5d3e81b..0aa1e98d6 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverridePlatform.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/ContainerOverridePlatform.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/DefaultPlatform.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/DefaultPlatform.java index 563023aa6..6df32695f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/DefaultPlatform.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/internal/properties/DefaultPlatform.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.cloud.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerPort.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerPort.java index 74306558f..c285ba085 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerPort.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerPort.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cloud.spi; public interface ICloudContainerPort { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerProvider.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerProvider.java index aa8e5fb0b..815b0bb37 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerProvider.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudContainerProvider.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cloud.spi; import java.util.Properties; @@ -15,7 +17,7 @@ /** * Interface from the Cloud Manager to Cloud Container Providers * - * @author Michael Baylis + * * */ public interface ICloudContainerProvider { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudManagerSpi.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudManagerSpi.java index 7c350f8fe..faf3e4851 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.cloud.manager/src/main/java/dev/galasa/cloud/spi/ICloudManagerSpi.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.cloud.spi; import java.util.Properties; @@ -13,7 +15,7 @@ /** * SPI for the Cloud Manager * - * @author Michael Baylis + * * */ public interface ICloudManagerSpi { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/build.gradle index dbcdfbf7b..936c4aeb6 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa Docker Manager IVTs' -version = '0.21.0' +version = '0.25.0' dependencies { implementation project(':galasa-managers-cloud-parent:dev.galasa.docker.manager') @@ -12,3 +12,17 @@ dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/settings.gradle index ca8b77c14..5a01d8d01 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.docker.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.docker.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/DockerManagerIVT.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/DockerManagerIVT.java index e6bca5c20..963f4f8eb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/DockerManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/DockerManagerIVT.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; @@ -53,7 +55,7 @@ * 8) Change config and start with ENV's and ensure they are set * 9) Mounts a non created volume to the container and ensure all is created and mounted * - * @author Michael Baylis + * * */ @Test @@ -259,7 +261,7 @@ public void twoContainersShareVolume() throws DockerManagerException { @Test public void preLoadVolumeWithConfig() throws DockerManagerException, TestBundleResourceException, InterruptedException { IDockerVolume volume = config2.getVolumeByTag("testVolume"); - InputStream in = resources.retrieveFile("resources/SampleConfig.cfg"); + InputStream in = resources.retrieveFile("SampleConfig.cfg"); volume.LoadFile("TestConfigFile.cfg", in); container.startWithConfig(config2); IDockerExec cmd = container.exec("/bin/cat", "/tmp/testvol/TestConfigFile.cfg"); diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/IvtException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/IvtException.java index 16b446613..db58d1d71 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/IvtException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/java/dev/galasa/docker/manager/ivt/IvtException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/resources/SampleConfig.cfg b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/SampleConfig.cfg similarity index 100% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/resources/SampleConfig.cfg rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/SampleConfig.cfg diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/resources/test1.html b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/test1.html similarity index 100% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/resources/test1.html rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager.ivt/src/main/resources/test1.html diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/bnd.bnd index d08eb78ed..87225772a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/bnd.bnd @@ -8,6 +8,7 @@ Import-Package: com.google.gson,\ dev.galasa.framework.spi.cps,\ dev.galasa.framework.spi.creds,\ dev.galasa.framework.spi.language,\ + dev.galasa.framework.spi.utils,\ dev.galasa.http,\ dev.galasa.http.spi,\ javax.validation.constraints;resolution:=optional,\ diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/build.gradle index 70df14f51..4d618fa2a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/build.gradle @@ -4,12 +4,25 @@ plugins { description = 'Galasa Docker Manager' -version = '0.23.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') - implementation 'com.google.code.gson:gson:2.8.5' - implementation 'commons-io:commons-io:2.9.0' - implementation 'org.apache.commons:commons-compress:1.21' + implementation 'com.google.code.gson:gson:2.10.1' + implementation 'commons-io:commons-io:2.16.1' + implementation 'org.apache.commons:commons-compress:1.26.0' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/settings.gradle index c3aa7a668..f8d922be0 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.docker.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.docker.manager' diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainer.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainer.java index b1ceade41..1ab18f38a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainer.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainer.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; @@ -46,6 +46,7 @@ * The dockerContainerTag is used to identify the Docker Container to other Managers or Shared Environments. If a test is using multiple * Docker Containers, each separate Docker Container must have a unique tag. If two Docker Containers use the same tag, they will refer to the * same Docker Container. + * @return The tag for this container. */ public String dockerContainerTag() default "PRIMARY"; @@ -54,6 +55,7 @@ * include the Docker Registry as this is provided in the CPS. If using a public official image from DockerHub, then the * image name must be prefixed with library/, for example library/httpd:latest, the Docker Manager will * not default to the library namespace like the Docker commands do. + * @return the name of the image. */ public String image(); @@ -61,12 +63,14 @@ * The start attribute indicates whether the Docker Container should be started automatically. If the * test needs to perform some work before the container is started, then start=false should be used, after which * IDockerContainer.start() can be called to start the container. + * @return true if the docker container should be started automatically. false otherwise. */ public boolean start() default true; /** * The dockerEngineTag will be used in the future so that a container can be run on a specific Docker Engine type. * You would not normally need to provide a Docker Engine tag. + * @return The docker engine tag associate with this container. */ public String dockerEngineTag() default "PRIMARY"; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainerConfig.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainerConfig.java index fd3532a21..35c771396 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainerConfig.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerContainerConfig.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; @@ -16,22 +18,21 @@ * * @galasa.annotation * - * @galasa.description The code>{@literal @}DockerContainerConfig
annotation provides an object to manually configure certain aspects + * @galasa.description The {@literal @}DockerContainerConfig annotation provides an object to manually configure certain aspects * of a containers run. Within the annotation, volumes can be requests, for both binding and provisioning. Look at the Docker volume annotation * description for more details. The IDockerContainerConfig object it self allows for non provisioing configurations to be set at test time and * ammended between container startups. The IDockerContainer object needs to use the startWithConfig() method to take use of the customised * startup config * * @galasa.examples - * {@literal @}DockerContainerConfig( - * dockerVolumes = { - @DockerVolume(mountPath = "/tmp/testvol"), + *
+   {@literal @}DockerContainerConfig(
+        dockerVolumes =  {
+            {@literal @}DockerVolume(mountPath = "/tmp/testvol"),
         }
     )
     public IDockerContainerConfig config;
- * 
- * 
- * @author James Davies
+   
*/ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD }) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerEngine.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerEngine.java index 91e3e2ab8..c516d79f9 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerEngine.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerEngine.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerManagerException.java index 74ff1d642..66113eaec 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerNotFoundException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerNotFoundException.java index 44bcb49ea..a333e91f0 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerNotFoundException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerNotFoundException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerProvisionException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerProvisionException.java index 555f42eff..528c9b642 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerProvisionException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerProvisionException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerVolume.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerVolume.java index aed601dc2..3c1ee611c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerVolume.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/DockerVolume.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; @@ -18,34 +18,35 @@ * * @galasa.annotation * - * @galasa.description The code>{@literal @}DockerVolume annotation provides the capability to bind or provision docker volumes. The + * @galasa.description The {@literal @}DockerVolume annotation provides the capability to bind or provision docker volumes. The * volumes were desgined with three Docker volume use cases in mind: - * 1. Mounting configuration - in this usecase any volume to be mounted contains configuration data and must not be edited by the running + * + *
    + *
  1. Mounting configuration - in this usecase any volume to be mounted contains configuration data and must not be edited by the running * container, as this could affect parallelization of test running. Therefore, in the DockerVolume annotation, if a volume name is provided - * (aka already exists), the mount will be read only. - * 2. Sharing volumes - when a volume is required for multiple containers to use to share data. This shoult not be a provided volume, so it + * (aka already exists), the mount will be read only.
  2. + *
  3. Sharing volumes - when a volume is required for multiple containers to use to share data. This shoult not be a provided volume, so it * is expected that a volume name will not be passed to the DockerVolume annotation, and the docker engine will generate a name. This * volume will be tagged for later reference. Current limitation is that the config used to provision the volume must be used for all - * containers wanting to mount the same volume. This results in the path having to be the same in all containers. - * 3. Persisting data - There may be a use case for a volume to exsist outside the life span of the test. For this I have encorparated a + * containers wanting to mount the same volume. This results in the path having to be the same in all containers.
  4. + *
  5. Persisting data - There may be a use case for a volume to exsist outside the life span of the test. For this I have encorparated a * boolean called persist on the DockerVolume annotation. This is not indefinate, but controlled by resource management. A good default - * would probably be 24 hours, but can utimately be set by the user with a CPS property. + * would probably be 24 hours, but can utimately be set by the user with a CPS property.
  6. + *
* * @galasa.examples * {@literal @}DockerContainerConfig( * dockerVolumes = { * // A read only mount, as a specific volume was requested. - * @DockerVolume(volumeName = config, mountPath = "/configs"), + * {@literal @}DockerVolume(volumeName = config, mountPath = "/configs"), * // A data volume that will persist past the life of the test - * @DockerVolume(mountPath = "/data", persist = true), + * {@literal @}DockerVolume(mountPath = "/data", persist = true), * // A sharing volume that will be cleanup post test. - * @DockerVolume(mountPath = "/mnt/appShare"), + * {@literal @}DockerVolume(mountPath = "/mnt/appShare"), * } * ) * public IDockerContainerConfig config; * - * - * @author James Davies */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD }) @@ -62,16 +63,14 @@ public String existingVolumeName() default ""; /** - * Where to mount the volume on the container. - * - * @return + * @return Where to mount the volume on the container. */ public String mountPath(); /** - * When wanting to reference a mount that is going to be provisioned, this tage will be used. + * When wanting to reference a mount that is going to be provisioned, this tag will be used. * - * @return + * @return The tag for this volume */ public String volumeTag(); @@ -87,7 +86,7 @@ * This field is used to protect this volume. If this volume is intended to be mounted to multiple containers, which you do not want * editing the contents, set this to be true * - * @return + * @return true if the volume is read-only, false otherwise. */ public boolean readOnly() default false; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainer.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainer.java index 3b2a3e91a..a277fb4ab 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainer.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainer.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker; import java.util.List; @@ -10,15 +12,13 @@ /** * Docker Container Resource Object - *

+ * * Provides a resource object representing a Docker Container on a Docker * Engine. The normal method of obtaining a Docker Container resource object is * by using a field:-
* @DockerContainer(dockerContainerTag="a", image="galasadocker/ivp:1.0.0")
* private IDockerContainer containerA;

- * You can also retrieve a Docker Container using the - * {@link IDockerManager#getDockerContainer(String)} method. - *

+ * * The following are DSE Environment properties:-
* docker.container.TAG.name=BOB to define the name the container * is to use.
@@ -29,9 +29,6 @@ * container is to run on.
* docker.registries=http://localhost:5000 a list of Docker * registries to search for an image
- * - * @author Michael Baylis - * */ public interface IDockerContainer { /** @@ -82,6 +79,7 @@ public interface IDockerContainer { * Start the Docker Container with a provided galasa DockerContainerConfig. This will stop and remove * any previous containers. * + * @param config * @throws DockerManagerException */ public void startWithConfig(IDockerContainerConfig config) throws DockerManagerException; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainerConfig.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainerConfig.java index a89f69951..7a214621c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainerConfig.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerContainerConfig.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; @@ -9,7 +11,7 @@ /** * An interface for the annotation object that represents the configurations for a container. * - * @author James Davies + * */ public interface IDockerContainerConfig { @@ -34,9 +36,9 @@ public interface IDockerContainerConfig { public List getVolumes(); /** - * Return a volume from the configuration of a specfic tag. - * - * @return + * Get the volume by the tag it is known as. + * @param volumeTag + * @return a volume from the configuration of a specfic tag. */ public IDockerVolume getVolumeByTag(String volumeTag); diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerEngine.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerEngine.java index 2727eacd7..de7b20d17 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerEngine.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerEngine.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerExec.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerExec.java index 0632154bb..4899546d9 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerExec.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerExec.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; @@ -12,7 +12,7 @@ * container. *

* - * @author James Davies + * * */ public interface IDockerExec { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerImage.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerImage.java index 3185ef622..3540ce7fb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerImage.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerManager.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerManager.java index a4315a2e4..a973fe65c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerManager.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerVolume.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerVolume.java index fb5767e62..fc9636bdd 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerVolume.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/IDockerVolume.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker; import java.io.InputStream; @@ -8,41 +10,31 @@ /** * A Galasa object to track, bind and provision Docker volumes with. * - * @author James Davies -*/ + */ public interface IDockerVolume { /** - * Returns the volume names, specified or provisioned. - * - * @return String volumeName + * @return the volume names, specified or provisioned. */ public String getVolumeName(); - /** - * Return the volume tag - * - * @return String volumeName + /** + * @return the volume tag */ public String getVolumeTag(); /** - * Returns the specified mount path. - * @return String mountPath + * @return the specified mount path. */ public String getMountPath(); /** - * Returns the read state of the volume. - * - * @return boolean readOnly + * @return the read state of the volume. */ public boolean readOnly(); /** - * Get the Tag of the engine used to host the volume. - * - * @return + * @return the Tag of the engine used to host the volume. */ public String getEngineTag(); @@ -52,6 +44,7 @@ public interface IDockerVolume { * * @param fileName * @param data + * @throws DockerManagerException */ public void LoadFile(String fileName, InputStream data) throws DockerManagerException; @@ -60,6 +53,7 @@ public interface IDockerVolume { * * @param fileName * @param data + * @throws DockerManagerException */ public void LoadFileAsString(String fileName, String data) throws DockerManagerException; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerConfigImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerConfigImpl.java index fa9504302..a76703aa1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerConfigImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerConfigImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -13,7 +15,7 @@ /** * Implementation for the object that represents the container configurations that can be edited for container startup * - * @author James Davies + * */ public class DockerContainerConfigImpl implements IDockerContainerConfig { private List volumes = new ArrayList<>(); diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerImpl.java index fb2f96955..5084b1056 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.io.BufferedInputStream; @@ -48,7 +50,7 @@ /** * Docker Container implementation used to contain all container configurations. * - * @author James Davies + * */ public class DockerContainerImpl implements IDockerContainer { @@ -415,7 +417,7 @@ public Map> getExposedPorts() throws DockerManag /** * Retrieves the first open socket ` * - * @param exposed port + * @param exposedPort * @return InetSocketAddress */ @Override @@ -430,7 +432,7 @@ public InetSocketAddress getFirstSocketForExposedPort(String exposedPort) { /** * Retrieves a random open socket * - * @param exposed port + * @param exposedPort * @return InetSocketAddress */ @Override @@ -445,7 +447,7 @@ public InetSocketAddress getRandomSocketForExposedPort(String exposedPort) { /** * Submit exec commands to be executed on the docker container. * - * @param String... commands + * @param command * @return IDockerExec */ @Override @@ -458,7 +460,7 @@ public IDockerExec exec(String... command) throws DockerManagerException { * timeout. * * @param timeout - * @param String... commands + * @param command * @return IDockerExec */ @Override @@ -641,7 +643,7 @@ public DockerEngineImpl getDockerEngineImpl() { } /** - * Retrieves the docker running ID + * @return the docker running ID */ public String getContainerId() { return containerID; @@ -676,8 +678,8 @@ public void discard() throws DockerManagerException { /** * Allows a file to be stored on a running docker container * - * @param path - * @param InputStream + * @param absolutePath + * @param file */ @Override public void storeFile(String absolutePath, InputStream file) throws DockerManagerException { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerResourceMonitor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerResourceMonitor.java index 4bed38a19..9a115a8ac 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerContainerResourceMonitor.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -10,8 +12,6 @@ import java.util.List; import java.util.Map; -import com.google.gson.Gson; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -22,6 +22,7 @@ import dev.galasa.framework.spi.IDynamicStatusStoreService; import dev.galasa.framework.spi.IFramework; import dev.galasa.framework.spi.IResourceManagement; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.http.HttpClientException; import dev.galasa.http.HttpClientResponse; import dev.galasa.http.IHttpClient; @@ -30,7 +31,7 @@ /** * Resource monitor for cleaning up orphaned containers. * - * @author James Davies + * */ public class DockerContainerResourceMonitor implements Runnable { private final IFramework framework; @@ -40,7 +41,7 @@ public class DockerContainerResourceMonitor implements Runnable { private final Log logger = LogFactory.getLog(DockerContainerResourceMonitor.class); - private Gson gson = new Gson(); + private GalasaGson gson = new GalasaGson(); private Map dockerEngines = new HashMap<>(); diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEngineImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEngineImpl.java index 583f83095..5555aa703 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEngineImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEngineImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -58,6 +60,8 @@ public class DockerEngineImpl implements IDockerEngine { * * @param framework * @param dockerManager + * @param dockerEngineTag + * @param dss * @throws DockerProvisionException */ public DockerEngineImpl(IFramework framework, DockerManagerImpl dockerManager, String dockerEngineTag, @@ -299,7 +303,7 @@ public JsonObject getContainer(@NotNull String containerId) throws DockerManager /** * Creates a container from a image name * - * @param containerName + * @param imageName * @param imageData * @return JsonObject * @throws DockerManagerException diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEnvironment.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEnvironment.java index ea5d49586..fb5f03c1f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEnvironment.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerEnvironment.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.time.Instant; @@ -29,7 +31,7 @@ * Docker Environment. Manages the flow of both docker containers and slots to a * specified docker engine * - * @author James Davies + * */ public class DockerEnvironment implements IDockerEnvironment { private IFramework framework; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerExecImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerExecImpl.java index 777fabe5c..24067f4a7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerExecImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerExecImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.io.IOException; @@ -11,9 +13,8 @@ import java.util.Arrays; import java.util.List; -import com.google.gson.Gson; + import com.google.gson.JsonObject; -import com.google.gson.JsonParser; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -21,11 +22,12 @@ import dev.galasa.docker.DockerManagerException; import dev.galasa.docker.IDockerExec; import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.utils.GalasaGson; /** * DockerExecImpl. An object passed back used to monitor and control the exec process on a container. * - * @author James Davies + * */ public class DockerExecImpl implements IDockerExec { @@ -42,7 +44,7 @@ public class DockerExecImpl implements IDockerExec { private boolean finished; private final StringBuffer outputBuffer = new StringBuffer(); private long exitCode = -1; - private Gson gson = new Gson(); + private GalasaGson gson = new GalasaGson(); private static final Log logger = LogFactory.getLog(DockerExecImpl.class); @@ -68,10 +70,9 @@ public DockerExecImpl(IFramework framework, DockerManagerImpl dockerManager, Doc try{ ExecJson eJson = new ExecJson(false, true, true, true, this.commands); - JsonParser parser = new JsonParser(); String json = gson.toJson(eJson); - JsonObject cmd = (JsonObject)parser.parse(json); + JsonObject cmd = gson.fromJson(json, JsonObject.class); JsonObject response = dockerEngine.sendExecCommands(dockerContainer.getContainerId(), cmd); if(response == null){ diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageBuilderImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageBuilderImpl.java index 279200ce7..afb75c5a6 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageBuilderImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageBuilderImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.io.BufferedOutputStream; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageImpl.java index f4b785a73..9e7aee41d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerImageImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -17,7 +19,7 @@ /** * DockerImageImpl. Allows for the checking of images on registries and pulling of images to the docker engine. * - * @author James Davies + * */ public class DockerImageImpl implements IDockerImage { private final IFramework framework; @@ -41,7 +43,7 @@ public class DockerImageImpl implements IDockerImage { * @param framework * @param dockerManager * @param dockerEngine - * @param imageName + * @param fullImageName */ public DockerImageImpl(IFramework framework, DockerManagerImpl dockerManager, DockerEngineImpl dockerEngine, String fullImageName) { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerField.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerField.java index 2327aea97..b08555619 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerField.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -13,7 +13,7 @@ /** * Annotation to capture the other docker realted annotations from the test class * - * @author James Davies + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerImpl.java index ee455dd99..84aa89ddd 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerManagerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.lang.annotation.Annotation; @@ -51,7 +53,7 @@ * @DockerEngine - where the containers will be running, set value in CPS (see properties) * @DockerContainer - define what container is to be run, image names mus be defined, tag can be set * - * @author James Davies + * */ @Component(service = { IManager.class }) public class DockerManagerImpl extends AbstractManager implements IDockerManagerSpi { @@ -69,10 +71,10 @@ public class DockerManagerImpl extends AbstractManager implements IDockerManager * * Docker Environment is generated at this stage * - * @param IFramework - the galasa framework - * @param List - list of all the managers - * @param List - list of all the active managers - * @param Class - the test class + * @param framework - the galasa framework + * @param allManagers - list of all the managers + * @param activeManagers - list of all the active managers + * @throws ManagerException */ @Override @@ -102,8 +104,8 @@ public void initialise(@NotNull IFramework framework, @NotNull List al /** * Makes sure that the docker manager is added to the list of active managers, and adds the dependency on http manager. * - * @param List - list of all the managers - * @param List - list of the active managers + * @param allManagers - list of all the managers + * @param activeManagers - list of the active managers * @throws ManagerException */ @Override diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerRegistryImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerRegistryImpl.java index 573dd795e..076a43c2c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerRegistryImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerRegistryImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -37,7 +39,7 @@ * Docker RegistryImpl. Controls the location of where docker images can be * pulled from * - * @author James Davies + * */ public class DockerRegistryImpl { private IFramework framework; @@ -63,7 +65,7 @@ public class DockerRegistryImpl { * * @param framework * @param dockerManager - * @param registryUrl + * @param registryId * @throws DockerManagerException */ public DockerRegistryImpl(IFramework framework, DockerManagerImpl dockerManager, String registryId) @@ -93,9 +95,7 @@ public DockerRegistryImpl(IFramework framework, DockerManagerImpl dockerManager, /** * Checks the registry for and image. * - * @param namespace - * @param repository - * @param tag + * @param image * @return true/false */ public boolean doYouHave(DockerImageImpl image) { @@ -128,8 +128,7 @@ public boolean doYouHave(DockerImageImpl image) { /** * Registry authentication * - * @param namespace - * @param repository + * @param image * @throws DockerManagerException */ public void registryAuthenticate(DockerImageImpl image) throws DockerManagerException { @@ -153,7 +152,6 @@ public void registryAuthenticate(DockerImageImpl image) throws DockerManagerExce * Attempts to gain a bearer token from realm, if unauthorized tries basic credentials login * retreive token * - * @param client * @return String token * @throws DockerManagerException */ @@ -189,7 +187,6 @@ public String retrieveBearerToken() throws DockerManagerException { /** * Uses basic crednetials to gain a basic auth token. * - * @param client * @return String token * @throws DockerManagerException */ diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerResourceManagement.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerResourceManagement.java index ef88717ed..efa6b7266 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerResourceManagement.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -19,7 +21,7 @@ /** * Resource management for the docker slots used to run docker containers * - * @author James Davies + * */ @Component(service = { IResourceManagementProvider.class }) public class DockerResourceManagement implements IResourceManagementProvider { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotImpl.java index 4d9dfea9c..d364cedbf 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -11,7 +11,7 @@ /** * Docker slot implemtnation to limit the number of concurrently running docker containers. * - * @author James Davies + * */ public class DockerSlotImpl { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotResourceMonitor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotResourceMonitor.java index 33be01846..6b03780aa 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerSlotResourceMonitor.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; @@ -19,7 +21,7 @@ /** * Docker resource monitor * - * @author James Davies + * */ public class DockerSlotResourceMonitor implements Runnable { private final IFramework framework; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeImpl.java index dacdc2272..df893934f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.io.ByteArrayInputStream; @@ -23,7 +25,7 @@ /** * A implementation of the docker volumes that will be brought up on the engine * - * @author James Davies + * */ public class DockerVolumeImpl implements IDockerVolume { private DockerManagerImpl dockerManager; @@ -204,7 +206,7 @@ private InputStream createDockerfile(String dockerfile, Map subs) try { String dockerfileTemplate = this.dockerManager.getArtifactManager() .getBundleResources(this.getClass()) - .retrieveSkeletonFileAsString("resources/" + dockerfile, subs); + .retrieveSkeletonFileAsString(dockerfile, subs); return new ByteArrayInputStream(dockerfileTemplate.getBytes()); } catch (IOException | TestBundleResourceException e) { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeResourceMonitor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeResourceMonitor.java index da26c3fe4..16e38bf74 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/DockerVolumeResourceMonitor.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerEnvironment.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerEnvironment.java index de302bfdc..31eca75e7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerEnvironment.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerEnvironment.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.util.Collection; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerImageBuilder.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerImageBuilder.java index b8ab0cbcf..cce6b4e87 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerImageBuilder.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/IDockerImageBuilder.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import java.io.InputStream; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerJSON.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerJSON.java index 957c0b8ca..6671c5c42 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerJSON.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerJSON.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal.json; /** diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerLabels.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerLabels.java index d0879c8c9..cfd303cd8 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerLabels.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/json/DockerContainerLabels.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal.json; public class DockerContainerLabels { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerDSEEngine.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerDSEEngine.java index b3457a5f7..241cd4d01 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerDSEEngine.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerDSEEngine.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngine.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngine.java index 15832e6be..5f1100f23 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngine.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngine.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEnginePort.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEnginePort.java index 56ceeb3e4..e890d1320 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEnginePort.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEnginePort.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngines.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngines.java index 80178baf3..a9080c8ba 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngines.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerEngines.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerImagePrefix.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerImagePrefix.java index a1f53a368..3a041bb60 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerImagePrefix.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerImagePrefix.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerLeaveRunning.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerLeaveRunning.java index 354228853..ca1338fb7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerLeaveRunning.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerLeaveRunning.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal.properties; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerPropertiesSingleton.java index 671697592..89975ef6e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistry.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistry.java index cce92c2d4..385c690ec 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistry.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistry.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryCredentials.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryCredentials.java index 034b933cc..553e4819b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryCredentials.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryCredentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryURL.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryURL.java index f2363459e..e508bdf26 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryURL.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerRegistryURL.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerSlots.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerSlots.java index 7face0cf9..24e19bd2d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerSlots.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/internal/properties/DockerSlots.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/package-info.java index b9ce7810b..03b282d04 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * Docker Manager diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/spi/IDockerManagerSpi.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/spi/IDockerManagerSpi.java index 208f91446..c850659ef 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/spi/IDockerManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/java/dev/galasa/docker/spi/IDockerManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.docker.spi; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/resources/CommandBusyboxDockerfile b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/CommandBusyboxDockerfile similarity index 100% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/resources/CommandBusyboxDockerfile rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/CommandBusyboxDockerfile diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/resources/VolumeBusyboxDockerfile b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/VolumeBusyboxDockerfile similarity index 100% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/resources/VolumeBusyboxDockerfile rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/main/resources/VolumeBusyboxDockerfile diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/test/java/dev/galasa/docker/internal/TestDockerRegistryImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/test/java/dev/galasa/docker/internal/TestDockerRegistryImpl.java index 8fe2207ff..fe2e06a9e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/test/java/dev/galasa/docker/internal/TestDockerRegistryImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.docker.manager/src/test/java/dev/galasa/docker/internal/TestDockerRegistryImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.docker.internal; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.times; @@ -113,7 +115,7 @@ public void retrieveBearerTokenUnauthorised() throws DockerManagerException, Mal when(credentialsMock.getUsername()).thenReturn("testUsername"); when(credentialsMock.getPassword()).thenReturn("testPassword"); String user = "testUsername"; - String password = "testPassword"; + String password = "testPassword"; //unit test mock password //pragma: allowlist secret when(clientMock.setAuthorisation(user, password)).thenReturn(clientMock); when(clientMock.build()).thenReturn(clientMock); // Base64 encoding credentials to replicate private encoding method (generateDockerRegistryAuthStructure) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/build.gradle index 9a2516cb6..764190c14 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/build.gradle @@ -12,3 +12,16 @@ dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/settings.gradle index dd06fe350..3607b52c9 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.kubernetes.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.kubernetes.manager.ivt' diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/IvtException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/IvtException.java index 5a5d4412b..b436df124 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/IvtException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/IvtException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/KubernetesManagerIVT.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/KubernetesManagerIVT.java index dfbef5d19..fdc852cb1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/KubernetesManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/java/dev/galasa/kubernetes/manager/ivt/KubernetesManagerIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testSecret.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testSecret.yaml deleted file mode 100644 index 1f7ff0098..000000000 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testSecret.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: testsecret -data: - test_password: dGVzdHBhc3N3b3Jk \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testConfigMap.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testConfigMap.yaml similarity index 58% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testConfigMap.yaml rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testConfigMap.yaml index 15bed58a6..cdb2e1fc8 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testConfigMap.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testConfigMap.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: ConfigMap metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testDeployment.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testDeployment.yaml similarity index 80% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testDeployment.yaml rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testDeployment.yaml index eb2f31fa9..ae8c6da4a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testDeployment.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testDeployment.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testPvc.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testPvc.yaml similarity index 63% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testPvc.yaml rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testPvc.yaml index c40874588..b8b492dfe 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testPvc.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testPvc.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testSecret.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testSecret.yaml new file mode 100644 index 000000000..b4fcb1faa --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testSecret.yaml @@ -0,0 +1,12 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + +apiVersion: v1 +kind: Secret +metadata: + name: testsecret +data: + test_password: dGVzdHBhc3N3b3Jk #This is used in in the IVT test only #pragma: allowlist secret \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testService.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testService.yaml similarity index 64% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testService.yaml rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testService.yaml index f31ea0c86..1e08e9776 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testService.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testService.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Service metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testStatefulSet.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testStatefulSet.yaml similarity index 81% rename from galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testStatefulSet.yaml rename to galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testStatefulSet.yaml index 6aa18fa4b..8abf701c0 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/resources/testStatefulSet.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager.ivt/src/main/resources/testStatefulSet.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/bnd.bnd index b16ce386f..8cdd99309 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/bnd.bnd @@ -1,15 +1,13 @@ -snapshot: ${tstamp} Bundle-Name: Galasa Kubernetes Manager Export-Package: dev.galasa.kubernetes,dev.galasa.kubernetes.spi -Import-Package: com.google.gson,\ - com.google.gson.reflect,\ - com.google.gson.stream,\ - dev.galasa,\ +Import-Package: dev.galasa,\ dev.galasa.framework,\ dev.galasa.framework.spi,\ dev.galasa.framework.spi.cps,\ dev.galasa.framework.spi.creds,\ dev.galasa.framework.spi.language,\ + dev.galasa.framework.spi.utils,\ dev.galasa.kubernetes,\ dev.galasa.cloud,\ dev.galasa.cloud.spi,\ @@ -24,29 +22,29 @@ Import-Package: com.google.gson,\ org.xml.sax.helpers Embed-Transitive: true Embed-Dependency: *;scope=compile --includeresource: bcpkix-jdk15on-1.69.jar; lib:=true,\ - bcprov-ext-jdk15on-1.69.jar; lib:=true,\ - bcprov-jdk15on-1.69.jar; lib:=true,\ - client-java-14.0.0.jar; lib:=true,\ - client-java-api-14.0.0.jar; lib:=true,\ - client-java-proto-14.0.0.jar; lib:=true,\ +-includeresource: bcpkix-jdk18on-1.75.jar; lib:=true,\ + bcprov-jdk18on-1.75.jar; lib:=true,\ + bcutil-jdk18on-1.75.jar; lib:=true,\ + client-java-17.0.0.jar; lib:=true,\ + client-java-api-17.0.0.jar; lib:=true,\ + client-java-proto-17.0.0.jar; lib:=true,\ commons-codec-1.15.jar; lib:=true,\ commons-collections4-4.4.jar; lib:=true,\ - commons-lang3-3.1.jar; lib:=true,\ - error_prone_annotations-2.5.1.jar; lib:=true,\ - gson-2.7.jar; lib:=true,\ + commons-lang3-3.14.0.jar; lib:=true,\ + commons-compress-1.26.0.jar; lib:=true,\ + gson-2.10.jar; lib:=true,\ gson-fire-1.8.5.jar; lib:=true,\ - guava-30.1.1-jre.jar; lib:=true,\ - j2objc-annotations-1.3.jar; lib:=true,\ javax.annotation-api-1.3.2.jar; lib:=true,\ jsr305-3.0.2.jar; lib:=true,\ - kotlin-stdlib-1.4.10.jar; lib:=true,\ - kotlin-stdlib-common-1.4.10.jar; lib:=true,\ - logging-interceptor-4.9.1.jar; lib:=true,\ - okhttp-4.9.1.jar; lib:=true,\ - okio-jvm-2.8.0.jar; lib:=true,\ - protobuf-java-3.19.1.jar; lib:=true,\ - slf4j-api-1.7.32.jar; lib:=true,\ - snakeyaml-1.29.jar; lib:=true,\ - swagger-annotations-1.6.3.jar; lib:=true + kotlin-osgi-bundle-1.7.22.jar; lib:=true,\ + logging-interceptor-4.10.0.jar; lib:=true,\ + okhttp-4.10.0.jar; lib:=true,\ + okio-jvm-3.0.0.jar; lib:=true,\ + protobuf-java-3.21.10.jar; lib:=true,\ + slf4j-api-2.0.5.jar; lib:=true,\ + jose4j-0.9.2.jar; lib:=true,\ + simpleclient-0.15.0.jar; lib:=true,\ + simpleclient_httpserver-0.15.0.jar; lib:=true,\ + snakeyaml-2.0.jar; lib:=true,\ + swagger-annotations-1.6.9.jar; lib:=true -fixupmessages "Classes found in the wrong directory"; restrict:=error; is:=warning diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/build.gradle index d6d25476c..58723d23e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/build.gradle @@ -4,25 +4,15 @@ plugins { description = 'Galasa Kubernetes Manager' -version = '0.22.0' +version = '0.34.0' dependencies { api project(':galasa-managers-cloud-parent:dev.galasa.cloud.manager') - implementation ('org.bouncycastle:bcpkix-jdk15on') { + implementation ('org.bouncycastle:bcpkix-jdk18on') { version { - strictly '1.69' - } - } - implementation ('org.bouncycastle:bcprov-ext-jdk15on') { - version { - strictly '1.69' - } - } - implementation ('com.google.guava:guava') { - version { - strictly '30.1.1-jre' + strictly '1.75' } } implementation ('com.google.code.findbugs:jsr305') { @@ -32,12 +22,12 @@ dependencies { } implementation ('com.google.code.gson:gson'){ version { - strictly '2.7' + strictly '2.10' } } implementation ('org.apache.commons:commons-lang3'){ version { - strictly '3.1' + strictly '3.14.0' } } implementation ('commons-codec:commons-codec'){ @@ -47,14 +37,33 @@ dependencies { } implementation ('org.yaml:snakeyaml'){ version { - strictly '1.29' + strictly '2.0' } } implementation ('org.apache.commons:commons-compress') { version { - strictly '1.21' + strictly '1.26.0' } } - implementation 'io.kubernetes:client-java:14.0.0' - implementation 'commons-io:commons-io:2.9.0' + implementation 'io.prometheus:simpleclient:0.15.0' + implementation 'io.prometheus:simpleclient_httpserver:0.15.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okio:okio-jvm:3.0.0' + implementation 'org.jetbrains.kotlin:kotlin-osgi-bundle:1.7.22' + implementation 'io.kubernetes:client-java:17.0.0' + implementation 'commons-io:commons-io:2.16.1' } + + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/account.sh b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/account.sh index f7f03a083..41ae931d0 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/account.sh +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/account.sh @@ -1,5 +1,11 @@ #!/bin/sh +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + kubectl -n galasa1 create serviceaccount galasa kubectl -n galasa1 get serviceaccounts galasa -o yaml diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/namespaces.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/namespaces.yaml index 9a46bfde3..1b5a13b6e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/namespaces.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/namespaces.yaml @@ -1,4 +1,9 @@ -#Create a number of namespaces to be used by Galasa +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Namespace metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/rbac.yaml b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/rbac.yaml index 760a7659e..8069cf64b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/rbac.yaml +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/examples/rbac.yaml @@ -1,3 +1,8 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/settings.gradle index 7c972a99f..56b66953c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.kubernetes.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.kubernetes.manager' + diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IConfigMap.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IConfigMap.java index a50661e33..5fce0ede2 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IConfigMap.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IConfigMap.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; /** * Represents a ConfigMap resource * - * @author Michael Baylis + * * */ public interface IConfigMap extends IResource { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IDeployment.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IDeployment.java index 02a66986c..773d0c7c7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IDeployment.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IDeployment.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; /** * Represent a Deployment resource * - * @author Michael Baylis + * * */ public interface IDeployment extends IReplicaSet { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IKubernetesNamespace.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IKubernetesNamespace.java index 4d13b5ff3..b92672414 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IKubernetesNamespace.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IKubernetesNamespace.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; @@ -11,7 +11,7 @@ * This is the main interface to a provisioned Kubernetes namespace on an infrastructure cluster. * Access to the Object is via the {@link KubernetesNamespace} annotation or the SPI. * - * @author Michael Baylis + * * */ public interface IKubernetesNamespace { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPersistentVolumeClaim.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPersistentVolumeClaim.java index 4368873d6..5e3c08e0e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPersistentVolumeClaim.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPersistentVolumeClaim.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; /** * Represents a PersistentVolumeClaim * - * @author Michael Baylis + * * */ public interface IPersistentVolumeClaim extends IResource { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPodLog.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPodLog.java index 69237df02..6a107f9bf 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPodLog.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IPodLog.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; @@ -9,7 +9,7 @@ /** * Holder for a Pod Log * - * @author Michael Baylis + * * */ public interface IPodLog { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IReplicaSet.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IReplicaSet.java index 120a38ac1..6ee846ee4 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IReplicaSet.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IReplicaSet.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; @@ -10,7 +10,7 @@ /** * Represents a resource that utilises ReplicatSets, ie Deployment and StatefulSet * - * @author mikebyls + * * */ public interface IReplicaSet extends IResource { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IResource.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IResource.java index 3cf7e00a9..039bf8915 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IResource.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IResource.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; @@ -9,7 +9,7 @@ * Abstracts a Kubernetes Resource, so that the test is not dependent of whatever Kubernetes client the * Kubernetes Manager decides to use. * - * @author Michael Baylis + * * */ public interface IResource { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/ISecret.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/ISecret.java index 246f83448..40ff3cdc7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/ISecret.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/ISecret.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; /** * Represents a Secret resource * - * @author Michael Baylis + * * */ public interface ISecret extends IResource { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IService.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IService.java index 771f45d81..0e175047b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IService.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IService.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; @@ -12,7 +12,7 @@ /** * Represents a Service resource * - * @author Michael Baylis + * * */ public interface IService extends IResource { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IStatefulSet.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IStatefulSet.java index 8d58423a7..82b13dbcb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IStatefulSet.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/IStatefulSet.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; /** * Represents a StatefulSet resource * - * @author Michael Baylis + * * */ public interface IStatefulSet extends IReplicaSet { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesManagerException.java index 29cbe65d8..34439aee1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesNamespace.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesNamespace.java index 27e7aa014..fac8bf3ec 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesNamespace.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/KubernetesNamespace.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesClusterImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesClusterImpl.java index 3eb4135db..bd31c0d6f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesClusterImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesClusterImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal; @@ -17,7 +19,6 @@ import org.apache.commons.logging.LogFactory; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import dev.galasa.ICredentials; import dev.galasa.ICredentialsToken; @@ -27,6 +28,7 @@ import dev.galasa.framework.spi.InsufficientResourcesAvailableException; import dev.galasa.framework.spi.creds.CredentialsException; import dev.galasa.framework.spi.creds.ICredentialsService; +import dev.galasa.framework.spi.utils.GalasaGsonBuilder; import dev.galasa.kubernetes.KubernetesManagerException; import dev.galasa.kubernetes.internal.properties.KubernetesCredentials; import dev.galasa.kubernetes.internal.properties.KubernetesMaxSlots; @@ -43,7 +45,7 @@ /** * Represents a Kubernetes Cluster * - * @author Michael Baylis + * * */ public class KubernetesClusterImpl { @@ -226,18 +228,20 @@ public synchronized ApiClient getApi() throws KubernetesManagerException { private static void applyNewGson(ApiClient apiClient) { JSON json = apiClient.getJSON(); - Gson gson = json.getGson(); + Gson existingGson = json.getGson(); - GsonBuilder newGsonBuilder = JSON.createGson(); - newGsonBuilder.registerTypeAdapter(OffsetDateTime.class, gson.getAdapter(OffsetDateTime.class)); - newGsonBuilder.registerTypeAdapter(Date.class, gson.getAdapter(Date.class)); - newGsonBuilder.registerTypeAdapter(java.sql.Date.class, gson.getAdapter(java.sql.Date.class)); - newGsonBuilder.registerTypeAdapter(byte[].class, gson.getAdapter(byte[].class)); - newGsonBuilder.registerTypeAdapter(Quantity.class, new Quantity.QuantityAdapter()); - newGsonBuilder.registerTypeAdapter(IntOrString.class, new IntOrString.IntOrStringAdapter()); - Gson newGson = newGsonBuilder.create(); + /* This section has not been incorporated into the GalasaGsonWrapper as it involves kubernetes packages + * and would result in a circullar refernce. + */ + GalasaGsonBuilder newGsonBuilder = new GalasaGsonBuilder() + .registerTypeAdapter(OffsetDateTime.class, existingGson.getAdapter(OffsetDateTime.class)) + .registerTypeAdapter(Date.class, existingGson.getAdapter(Date.class)) + .registerTypeAdapter(java.sql.Date.class, existingGson.getAdapter(java.sql.Date.class)) + .registerTypeAdapter(byte[].class, existingGson.getAdapter(byte[].class)) + .registerTypeAdapter(Quantity.class, new Quantity.QuantityAdapter()) + .registerTypeAdapter(IntOrString.class, new IntOrString.IntOrStringAdapter()); - json.setGson(newGson); + json.setGson(newGsonBuilder.getGson()); } /** diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerField.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerField.java index 4016f1ebb..6401563c6 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerField.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal; @@ -13,7 +13,7 @@ /** * Annotation to identify manager controlled annotated fields * - * @author Michael Baylis + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerImpl.java index 8371ffb54..d07055be7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal; @@ -53,7 +55,7 @@ /** * The Kubernetes Manager implementation * - * @author Michael Baylis + * * */ @Component(service = { IManager.class }) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceImpl.java index 99894fb2f..315941ce5 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal; @@ -78,7 +80,7 @@ * * See example scripts in examples/ to see how to create a name space with the necessary rbac. * - * @author Michael Baylis + * * */ public class KubernetesNamespaceImpl implements IKubernetesNamespace { @@ -140,7 +142,7 @@ public void initialiseNamespace() throws KubernetesManagerException { addRunLabel(metadata); try { - api.createNamespacedConfigMap(this.namespaceId, configMap, null, null, null); + api.createNamespacedConfigMap(this.namespaceId, configMap, null, null, null, null); } catch(ApiException e) { if (e.getCode() == 409) { throw new KubernetesManagerException("The allocated namespace " + this.namespaceId + " on cluster " + this.cluster.getId() + " is dirty, the configmap galasa still exists", e); @@ -422,7 +424,7 @@ public IResource createResource(@NotNull String yaml) throws KubernetesManagerEx spec.setStorageClassName(storageClass); } - V1PersistentVolumeClaim actualPvc = api.createNamespacedPersistentVolumeClaim(this.namespaceId, persistentVolumeClaim, null, null, null); + V1PersistentVolumeClaim actualPvc = api.createNamespacedPersistentVolumeClaim(this.namespaceId, persistentVolumeClaim, null, null, null, null); logger.debug("PersistentVolumeClaim " + actualPvc.getMetadata().getName() + " created in namespace " + this.namespaceId + " on cluster " + this.cluster.getId()); @@ -443,7 +445,7 @@ private void addRunLabel(V1ObjectMeta metadata) { addRunLabel(configMap.getMetadata()); CoreV1Api api = new CoreV1Api(cluster.getApi()); - V1ConfigMap actualConfig = api.createNamespacedConfigMap(namespaceId, configMap, null, null, null); + V1ConfigMap actualConfig = api.createNamespacedConfigMap(namespaceId, configMap, null, null, null, null); logger.debug("ConfigMap " + actualConfig.getMetadata().getName() + " created in namespace " + this.namespaceId + " on cluster " + this.cluster.getId()); @@ -458,7 +460,7 @@ private void addRunLabel(V1ObjectMeta metadata) { addRunLabel(secret.getMetadata()); CoreV1Api api = new CoreV1Api(cluster.getApi()); - V1Secret actualSecret = api.createNamespacedSecret(namespaceId, secret, null, null, null); + V1Secret actualSecret = api.createNamespacedSecret(namespaceId, secret, null, null, null, null); logger.debug("Secret " + actualSecret.getMetadata().getName() + " created in namespace " + this.namespaceId + " on cluster " + this.cluster.getId()); @@ -472,7 +474,7 @@ private void addRunLabel(V1ObjectMeta metadata) { addRunLabel(service.getMetadata()); CoreV1Api api = new CoreV1Api(cluster.getApi()); - V1Service actualService = api.createNamespacedService(namespaceId, service, null, null, null); + V1Service actualService = api.createNamespacedService(namespaceId, service, null, null, null, null); logger.debug("Service " + actualService.getMetadata().getName() + " created in namespace " + this.namespaceId + " on cluster " + this.cluster.getId()); @@ -495,7 +497,7 @@ private void addRunLabel(V1ObjectMeta metadata) { AppsV1Api api = new AppsV1Api(cluster.getApi()); - V1Deployment actualDeployment = api.createNamespacedDeployment(namespaceId, deployment, null, null, null); + V1Deployment actualDeployment = api.createNamespacedDeployment(namespaceId, deployment, null, null, null, null); logger.debug("Deployment " + actualDeployment.getMetadata().getName() + " created in namespace " + this.namespaceId + " on cluster " + this.cluster.getId()); @@ -550,7 +552,7 @@ private void addRunLabel(V1ObjectMeta metadata) { - V1StatefulSet actualStatefulSet = api.createNamespacedStatefulSet(namespaceId, statefulSet, null, null, null); + V1StatefulSet actualStatefulSet = api.createNamespacedStatefulSet(namespaceId, statefulSet, null, null, null, null); logger.debug("StatefulSet " + actualStatefulSet.getMetadata().getName() + " created in namespace " + this.namespaceId + " on cluster " + this.cluster.getId()); diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceResourceMonitor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceResourceMonitor.java index 051e3ac60..2fac88e36 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesNamespaceResourceMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal; @@ -21,7 +21,7 @@ /** * Clean up namespaces when a run is finished with it. * - * @author Michael Baylis + * * */ public class KubernetesNamespaceResourceMonitor implements Runnable { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesResourceManagement.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesResourceManagement.java index b175c9bb6..8d5b051d2 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/KubernetesResourceManagement.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal; @@ -20,7 +20,7 @@ /** * Initialise the Resource Management routines for the Kubernetes Manager * - * @author Michael Baylis + * * */ @Component(service= {IResourceManagementProvider.class}) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesClusters.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesClusters.java index b6f74ac14..b6b0fa0c2 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesClusters.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesClusters.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesCredentials.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesCredentials.java index c6cc87c5b..b08193ab5 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesCredentials.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesCredentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesMaxSlots.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesMaxSlots.java index 6c8453757..748931be7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesMaxSlots.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesMaxSlots.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaceTagSharedEnvironment.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaceTagSharedEnvironment.java index c52ad3646..8bfcbc29c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaceTagSharedEnvironment.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaceTagSharedEnvironment.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaces.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaces.java index 76f1867cd..65d774566 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaces.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNamespaces.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNodePortProxy.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNodePortProxy.java index b506846c5..8738f4f8a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNodePortProxy.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesNodePortProxy.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesPropertiesSingleton.java index cb06105da..2d2a0abbc 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; @@ -15,7 +15,7 @@ /** * Kubernetes Manager CPS singleton * - * @author Michael Baylis + * * */ @Component(service = KubernetesPropertiesSingleton.class, immediate = true) diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesStorageClass.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesStorageClass.java index 34e2484f8..0b6dae0b1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesStorageClass.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesStorageClass.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesUrl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesUrl.java index 850d8abcf..597f9c4f9 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesUrl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesUrl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesValidateCertificate.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesValidateCertificate.java index 27cd6835c..93e98200c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesValidateCertificate.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/properties/KubernetesValidateCertificate.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ConfigMapImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ConfigMapImpl.java index fd4c4238a..2f02cf20c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ConfigMapImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ConfigMapImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -14,7 +14,7 @@ /** * ConfigMap implementation * - * @author Michael Baylis + * * */ public class ConfigMapImpl implements IConfigMap { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/DeploymentImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/DeploymentImpl.java index 9cbef09b7..4951f1c78 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/DeploymentImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/DeploymentImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -17,7 +17,7 @@ /** * Deployment Implementation * - * @author Michael Baylis + * * */ public class DeploymentImpl extends ReplicaSetHolder implements IDeployment { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PersistentVolumeClaimImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PersistentVolumeClaimImpl.java index 10146fbff..649862a8d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PersistentVolumeClaimImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PersistentVolumeClaimImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -14,7 +14,7 @@ /** * PersistentVolumeClaim implementation * - * @author Michael Baylis + * * */ public class PersistentVolumeClaimImpl implements IPersistentVolumeClaim { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PodLogImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PodLogImpl.java index 256ec2a11..7921c71ac 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PodLogImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/PodLogImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -10,7 +10,7 @@ /** * A holder for the Pod Log * - * @author Michael Baylis + * * */ public class PodLogImpl implements IPodLog { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ReplicaSetHolder.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ReplicaSetHolder.java index d66117775..ac4c196a8 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ReplicaSetHolder.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ReplicaSetHolder.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -20,7 +22,7 @@ /** * ReplicaSet type resource implementation, ie Deployment/StatefulSet * - * @author Michael Baylis + * * */ public abstract class ReplicaSetHolder { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/SecretImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/SecretImpl.java index f76dce47c..013d9075d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/SecretImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/SecretImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -14,7 +14,7 @@ /** * Secret implementation * - * @author Michael Baylis + * * */ public class SecretImpl implements ISecret { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ServiceImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ServiceImpl.java index d5ee2c5c0..e62e01339 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ServiceImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/ServiceImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -19,7 +19,7 @@ /** * Service implementations * - * @author Michael Baylis + * * */ public class ServiceImpl implements IService { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/StatefulSetImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/StatefulSetImpl.java index b4c745904..5e1ec14c2 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/StatefulSetImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/StatefulSetImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -16,7 +18,7 @@ /** * StatefulSet implementation * - * @author Michael Baylis + * * */ public class StatefulSetImpl extends ReplicaSetHolder implements IStatefulSet { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/Utility.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/Utility.java index fab9b6e3a..0c7090223 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/Utility.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/internal/resources/Utility.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.internal.resources; @@ -16,7 +16,7 @@ /** * Utility class for routines that are missing the kubernetes client * - * @author Michael Baylis + * * */ public class Utility { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/package-info.java index bafad6750..e62a98738 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Kubernetes Manager * diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/spi/IKubernetesManagerSpi.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/spi/IKubernetesManagerSpi.java index e59c0fb11..c7c00ac07 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/spi/IKubernetesManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.kubernetes.manager/src/main/java/dev/galasa/kubernetes/spi/IKubernetesManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.kubernetes.spi; @@ -13,7 +13,7 @@ * Provides the SPI for the Kubernetes Manager for Manager to Manager communication. * Should not be used by Test code * - * @author Michael Baylis + * * */ public interface IKubernetesManagerSpi { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/build.gradle index 85156086d..40e1514aa 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/build.gradle @@ -8,3 +8,16 @@ version = '0.21.0' dependencies { } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/settings.gradle index c1d966552..9b1e91a3e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.liberty.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.liberty.manager' + diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServer.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServer.java index 11ecf0f0a..77f809da1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServer.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServer.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.liberty; public interface ILibertyServer { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServerXml.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServerXml.java index eaa9fc043..227107ff4 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServerXml.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/ILibertyServerXml.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.liberty; public interface ILibertyServerXml { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyManagerException.java index d541e2d2d..5835f2151 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.liberty; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyServerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyServerException.java index d2b308fe0..c4b085a31 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyServerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/LibertyServerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.liberty; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/package-info.java index fb6cb951b..3ccfdc221 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/package-info.java @@ -1,6 +1,6 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.liberty; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/ILibertyServerSpi.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/ILibertyServerSpi.java index 1ad9e3d78..6d011bd49 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/ILibertyServerSpi.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/ILibertyServerSpi.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.liberty.spi; public interface ILibertyServerSpi { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/package-info.java index 2b60015ad..6e10b8f91 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.liberty.manager/src/main/java/dev/galasa/liberty/spi/package-info.java @@ -1,6 +1,6 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.liberty.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/build.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/build.gradle index 19f142723..367e5c145 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/build.gradle @@ -4,13 +4,27 @@ plugins { description = 'Galasa Openstack Manager' -version = '0.21.0' +version = '0.36.0' dependencies { api project(':galasa-managers-comms-parent:dev.galasa.ipnetwork.manager') implementation project(':galasa-managers-unix-parent:dev.galasa.linux.manager') implementation project(':galasa-managers-windows-parent:dev.galasa.windows.manager') implementation 'org.apache.httpcomponents:httpclient-osgi:4.5.13' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'io.prometheus:simpleclient:0.6.0' } + + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/settings.gradle b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/settings.gradle index 8b59c21ce..8909e3a50 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.openstack.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.openstack.manager' + diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackLinuxManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackLinuxManagerException.java index 2ebd97dbe..cca46253d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackLinuxManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackLinuxManagerException.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.openstack.manager; import dev.galasa.linux.LinuxManagerException; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackManagerException.java index e5dc0ff91..31d86e364 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackWindowsManagerException.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackWindowsManagerException.java index 18899b423..512776c2f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackWindowsManagerException.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/OpenstackWindowsManagerException.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.openstack.manager; import dev.galasa.windows.WindowsManagerException; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/FloatingIpResourceMonitor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/FloatingIpResourceMonitor.java index 209116ab0..a0f77cf22 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/FloatingIpResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/FloatingIpResourceMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java index 2bdbbff08..333a1e9df 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; @@ -26,13 +26,11 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import dev.galasa.ICredentials; import dev.galasa.ICredentialsUsernamePassword; import dev.galasa.framework.spi.ConfigurationPropertyStoreException; import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.openstack.manager.OpenstackManagerException; import dev.galasa.openstack.manager.internal.json.Api; import dev.galasa.openstack.manager.internal.json.Auth; @@ -78,7 +76,7 @@ public class OpenstackHttpClient { private String openstackComputeUri; private String openstackNetworkUri; - private Gson gson = new GsonBuilder().setPrettyPrinting().create(); + private GalasaGson gson = new GalasaGson(); protected OpenstackHttpClient(IFramework framework) throws ConfigurationPropertyStoreException { this.framework = framework; @@ -241,7 +239,7 @@ public Server findServerByName(@NotNull String serverName) throws OpenstackManag try { checkToken(); - // *** Retrieve a list of the networks available and select one + // *** Retrieve a list of the servers available and select one HttpGet get = new HttpGet(this.openstackComputeUri + "/servers"); get.addHeader(this.openstackToken.getHeader()); @@ -540,9 +538,10 @@ protected String getImageId(@NotNull String image) throws OpenstackManagerExcept try { checkToken(); - // *** Retrieve a list of the images - - HttpGet get = new HttpGet(this.openstackImageUri + "/v2.5/images"); + /* Attempt to retrieve the image ID we want from Openstack using the image name */ + String uri = this.openstackImageUri + "/v2/images?name=" + image; + logger.trace("Attempting to get the image " + image + " from " + uri); + HttpGet get = new HttpGet(uri); get.addHeader(this.openstackToken.getHeader()); try (CloseableHttpResponse response = httpClient.execute(get)) { @@ -553,17 +552,20 @@ protected String getImageId(@NotNull String image) throws OpenstackManagerExcept throw new OpenstackManagerException("OpenStack list image failed - " + status); } + /* Even though we are searching by image name, the JSON returned is still an array of images */ Images images = gson.fromJson(entity, Images.class); - if (images != null && images.images != null) { - for (Image i : images.images) { - if (i.name != null) { + if (images != null & images.images != null) { + for (Image i :images.images){ + if (i.name != null && i.name != ""){ if (image.equals(i.name)) { + logger.trace("Image " + image + " found"); return i.id; } } } - } + } } + logger.trace("Image " + image + " wasn't found in Openstack"); return null; } catch (OpenstackManagerException e) { throw e; @@ -576,7 +578,7 @@ protected String getFlavourId(@NotNull String flavour) throws OpenstackManagerEx try { checkToken(); - // *** Retrieve a list of the images + // *** Retrieve a list of the flavours HttpGet get = new HttpGet(this.openstackComputeUri + "/flavors"); get.addHeader(this.openstackToken.getHeader()); @@ -586,7 +588,7 @@ protected String getFlavourId(@NotNull String flavour) throws OpenstackManagerEx String entity = EntityUtils.toString(response.getEntity()); if (status.getStatusCode() != HttpStatus.SC_OK) { - throw new OpenstackManagerException("OpenStack list image failed - " + status); + throw new OpenstackManagerException("OpenStack list flavour failed - " + status); } Flavors flavours = gson.fromJson(entity, Flavors.class); @@ -631,7 +633,7 @@ public Floatingip allocateFloatingip(Port port, Network network) throws Openstac String entity = EntityUtils.toString(response.getEntity()); if (status.getStatusCode() != HttpStatus.SC_CREATED) { - throw new OpenstackManagerException("OpenStack list image failed - " + status); + throw new OpenstackManagerException("OpenStack create floating ip failed - " + status); } FloatingipRequestResponse fipResponse = this.gson.fromJson(entity, FloatingipRequestResponse.class); @@ -648,6 +650,7 @@ public Floatingip allocateFloatingip(Port port, Network network) throws Openstac } public Network findExternalNetwork(String externalNetwork) throws OpenstackManagerException { + try { checkToken(); @@ -669,10 +672,6 @@ public Network findExternalNetwork(String externalNetwork) throws OpenstackManag for (Network network : networks.networks) { if (externalNetwork != null && externalNetwork.equals(network.name)) { return network; - } else { - if (network.route_external) { - return network; - } } } } @@ -682,7 +681,7 @@ public Network findExternalNetwork(String externalNetwork) throws OpenstackManag } catch (OpenstackManagerException e) { throw e; } catch (Exception e) { - throw new OpenstackManagerException("Unable to list floating ips ", e); + throw new OpenstackManagerException("Unable to list networks ", e); } } diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackIpHost.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackIpHost.java index e1be1dfea..225cd50ab 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackIpHost.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackIpHost.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackLinuxImageImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackLinuxImageImpl.java index 5e7ace757..b4f735753 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackLinuxImageImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackLinuxImageImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.openstack.manager.internal; import java.nio.file.FileSystem; @@ -81,10 +83,14 @@ public void build() throws OpenstackManagerException, ConfigurationPropertyStore + this.tag); String flavor = LinuxFlavor.get(this.image); + logger.trace("The Linux flavor is " + flavor); + + String imageName = LinuxName.get(this.image); + logger.trace("The image name is " + imageName); Server server = new Server(); server.name = this.instanceName; - server.imageRef = getOpenstackHttpClient().getImageId(LinuxName.get(this.image)); + server.imageRef = getOpenstackHttpClient().getImageId(imageName); server.flavorRef = getOpenstackHttpClient().getFlavourId(flavor); server.availability_zone = LinuxAvailablityZone.get(this.image); server.metadata = new GalasaMetadata(); diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackManagerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackManagerImpl.java index e2e7f94f1..472596e15 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackManagerImpl.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; @@ -18,7 +20,6 @@ import org.osgi.service.component.annotations.Component; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import dev.galasa.ManagerException; import dev.galasa.framework.spi.AbstractManager; @@ -35,6 +36,7 @@ import dev.galasa.framework.spi.InsufficientResourcesAvailableException; import dev.galasa.framework.spi.ResourceUnavailableException; import dev.galasa.framework.spi.language.GalasaTest; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.ipnetwork.spi.IIpNetworkManagerSpi; import dev.galasa.linux.LinuxManagerException; import dev.galasa.linux.OperatingSystem; @@ -71,7 +73,7 @@ public class OpenstackManagerImpl extends AbstractManager implements ILinuxProvi private CloseableHttpClient httpClient; private OpenstackHttpClient openstackHttpClient; - private Gson gson = new GsonBuilder().setPrettyPrinting().create(); + private GalasaGson gson = new GalasaGson(); /* * (non-Javadoc) @@ -157,16 +159,18 @@ public ILinuxProvisionedImage provisionLinux(String tag, OperatingSystem operati // check we are enabled if (!OpenStackEnabled.get()) { + logger.trace("OpenStack not enabled"); return null; } // *** Check that we can connect to openstack before we attempt to provision, if // we can't end gracefully and give someone else a chance if (!openstackHttpClient.connectToOpenstack()) { + logger.trace("Unable to connect to OpenStack"); return null; } - // *** Locate the possible images that are available for selection + logger.trace("Locating possible images that are available for selection"); try { List possibleImages = LinuxImages.get(operatingSystem, null); @@ -174,21 +178,27 @@ public ILinuxProvisionedImage provisionLinux(String tag, OperatingSystem operati nextImage: while(possibleImagesIterator.hasNext()) { String image = possibleImagesIterator.next(); + logger.trace("Checking if image " + image + " is correct for this test"); // First check to see the the tests MUST request a capability this server provides List availableCapabilities = LinuxImageCapabilities.get(image); if (!availableCapabilities.isEmpty()) { for(String availableCapability : availableCapabilities) { + logger.trace(availableCapability + " is an available capability of this image"); if (availableCapability.startsWith("+")) { String actualAvailableCapability = availableCapability.substring(1); boolean requestedCapability = false; for(String choosenCapability : capabilities) { if (choosenCapability.equalsIgnoreCase(actualAvailableCapability)) { + logger.trace("This image has an available capability " + actualAvailableCapability + " that matches a chosen capability " + choosenCapability); requestedCapability = true; break; + } else { + logger.trace("This image's available capability " + availableCapability + " is not required"); } } if (!requestedCapability) { + logger.trace("This image had no availabilie capabilities that were chosen for this test"); possibleImagesIterator.remove(); continue nextImage; } @@ -209,12 +219,16 @@ public ILinuxProvisionedImage provisionLinux(String tag, OperatingSystem operati availableCapability = availableCapability.substring(1); } if (availableCapability.equalsIgnoreCase(choosenCapability)) { + logger.trace("This image has an available capability " + availableCapability + " that matches a required capability " + choosenCapability); found = true; break; + } else { + logger.trace("This image's available capability " + availableCapability + " is not required"); } } if (!found) { + logger.trace("This image had no available capabilities that we need so it is not possible to use"); possibleImagesIterator.remove(); continue nextImage; } @@ -231,6 +245,7 @@ public ILinuxProvisionedImage provisionLinux(String tag, OperatingSystem operati // *** Select the first image as they will be listed in preference order String selectedImage = possibleImages.get(0); + logger.trace("The selected image for this test is " + selectedImage); // *** See if we have capacity for a new Instance on Openstack String instanceName = reserveInstance(); @@ -393,7 +408,7 @@ public IDynamicStatusStoreService getDSS() { } protected Gson getGson() { - return this.gson; + return this.gson.getGson(); } protected IIpNetworkManagerSpi getIpNetworkManager() { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackResourceManagement.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackResourceManagement.java index 74c515fd5..52899b9da 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackResourceManagement.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java index c3e340980..9434937c2 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.openstack.manager.internal; import java.security.SecureRandom; @@ -30,6 +32,7 @@ import dev.galasa.openstack.manager.internal.json.Server; import dev.galasa.openstack.manager.internal.json.ServerRequest; import dev.galasa.openstack.manager.internal.properties.BuildTimeout; +import dev.galasa.openstack.manager.internal.properties.OpenStackNetworkName; public abstract class OpenstackServerImpl { @@ -313,9 +316,11 @@ protected void createServer(ServerRequest serverRequest) throws OpenstackManager } // *** Locate the external network - Network network = this.openstackHttpClient.findExternalNetwork(null); // TODO provide means to specify - // network - + String networkName = OpenStackNetworkName.get(); + if (networkName == null) { + throw new OpenstackManagerException("The external network name to allocate a floatingip on was not provided in the CPS"); + } + Network network = this.openstackHttpClient.findExternalNetwork(networkName); if (network == null) { throw new OpenstackManagerException("Unable to select an external network to allocate a floatingip on"); } diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackToken.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackToken.java index 04d98545c..4e76ce220 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackToken.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackToken.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackUsernamePasswordCredentials.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackUsernamePasswordCredentials.java index 86781ccff..2ef03dffa 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackUsernamePasswordCredentials.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackUsernamePasswordCredentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackWindowsImageImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackWindowsImageImpl.java index 003e42a2d..62de4ff67 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackWindowsImageImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackWindowsImageImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.openstack.manager.internal; import java.nio.file.FileSystem; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/ServerResourceMonitor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/ServerResourceMonitor.java index 0ff7eb021..6021a0a25 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/ServerResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/ServerResourceMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Api.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Api.java index 91e15ff89..bdabefa0a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Api.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Api.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Auth.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Auth.java index 4ec13dd53..853ca2f62 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Auth.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Auth.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokenResponse.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokenResponse.java index 0afe76399..3195122c3 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokenResponse.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokenResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokens.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokens.java index 052a8889c..365ffab1d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokens.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/AuthTokens.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/DnsAssignment.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/DnsAssignment.java index 352c8a87b..d50dc8818 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/DnsAssignment.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/DnsAssignment.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Domain.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Domain.java index 29b4d1858..0d7e92f4f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Domain.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Domain.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Endpoint.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Endpoint.java index d418ce919..f26c8ca87 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Endpoint.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Endpoint.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavor.java index b7c6bc886..8d876ee0d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavors.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavors.java index d057d8542..afca90b93 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavors.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Flavors.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingip.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingip.java index ccde3eb14..5b5c691fb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingip.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingip.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/FloatingipRequestResponse.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/FloatingipRequestResponse.java index 7a8e7d08c..a188e33c1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/FloatingipRequestResponse.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/FloatingipRequestResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingips.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingips.java index dffe233b7..6edc60758 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingips.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Floatingips.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/GalasaMetadata.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/GalasaMetadata.java index 1a42f1ee5..49ebb6167 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/GalasaMetadata.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/GalasaMetadata.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Identity.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Identity.java index 5582ba13a..c3e2a32cd 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Identity.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Identity.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Image.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Image.java index b44152bb4..6ff9e0af1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Image.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Image.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Images.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Images.java index d230be4c3..e4f011428 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Images.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Images.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Network.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Network.java index da2d0816e..b8afc1289 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Network.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Network.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Networks.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Networks.java index 3e3c26969..aeafd7b43 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Networks.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Networks.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Password.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Password.java index 7d044962c..e08e4df1f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Password.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Password.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Port.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Port.java index 24293d50c..b7c45ffab 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Port.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Port.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/PortsResponse.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/PortsResponse.java index b998ae4bd..140bfa21a 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/PortsResponse.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/PortsResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Project.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Project.java index 0f87c776c..3182ac79c 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Project.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Project.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Scope.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Scope.java index fdb67351e..0a1ccf7ef 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Scope.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Scope.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/SecurityGroup.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/SecurityGroup.java index 6c9e0474a..b18d15359 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/SecurityGroup.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/SecurityGroup.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Server.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Server.java index 74150f394..51fd5114e 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Server.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Server.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerRequest.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerRequest.java index 4134037bc..002c04961 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerRequest.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerRequest.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerResponse.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerResponse.java index c5adbe86d..2a5b2a1f4 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerResponse.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServerResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServersResponse.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServersResponse.java index 27e5269cf..312aa906f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServersResponse.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/ServersResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Token.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Token.java index 9578abc78..511645f7b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Token.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/Token.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/User.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/User.java index e573db28e..60dbf52cd 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/User.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/User.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.json; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/package-info.java index 7003c1960..b478ac325 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/json/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * OpenStack Manager - OpenStack API JSON POJOs */ diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/package-info.java index 02a5cd87c..55fef2ae7 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * OpenStack Manager - Internal */ diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/BuildTimeout.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/BuildTimeout.java index f14889f4d..6066c4878 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/BuildTimeout.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/BuildTimeout.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -22,8 +22,6 @@ *

* default value is 10 minutes *

- * - * @author Michael Baylis * */ public class BuildTimeout extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxArchivesDirectory.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxArchivesDirectory.java index 120eb1279..4c02be8aa 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxArchivesDirectory.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxArchivesDirectory.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -21,8 +23,6 @@ *

* Default is /opt/archives *

- * - * @author Michael Baylis * */ public class LinuxArchivesDirectory extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxAvailablityZone.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxAvailablityZone.java index 9320d0f1d..f557c65af 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxAvailablityZone.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxAvailablityZone.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* The default is nova *

- * - * @author Michael Baylis * */ public class LinuxAvailablityZone extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxCredentials.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxCredentials.java index 9b138d104..a7ccd9928 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxCredentials.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxCredentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -27,8 +27,6 @@ *

* The default is OPENSTACKSSH *

- * - * @author Michael Baylis * */ public class LinuxCredentials extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxFlavor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxFlavor.java index ed305d811..4765e4fdb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxFlavor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxFlavor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* The default is m1.medium *

- * - * @author Michael Baylis * */ public class LinuxFlavor extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImageCapabilities.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImageCapabilities.java index 943b9723a..5e4034b52 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImageCapabilities.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImageCapabilities.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -32,8 +32,6 @@ *

* The default is no capabilities *

- * - * @author Michael Baylis * */ public class LinuxImageCapabilities extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImages.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImages.java index e56fb5445..75ccc4eac 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImages.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxImages.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -32,8 +32,6 @@ *

* There are no defaults *

- * - * @author Michael Baylis * */ public class LinuxImages extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxKeyPair.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxKeyPair.java index 2c4d98edf..5d15e2b06 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxKeyPair.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxKeyPair.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* There is no default *

- * - * @author Michael Baylis * */ public class LinuxKeyPair extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxName.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxName.java index 7f6515bcd..c039dabeb 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxName.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxName.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* The default is the same as the imagename *

- * - * @author Michael Baylis * */ public class LinuxName extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxSecurityGroups.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxSecurityGroups.java index 2e599f9ae..0c25da035 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxSecurityGroups.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/LinuxSecurityGroups.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -29,8 +29,6 @@ *

* There is no default *

- * - * @author James Davies * */ public class LinuxSecurityGroups extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/MaximumInstances.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/MaximumInstances.java index 9d89fd910..477e8f684 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/MaximumInstances.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/MaximumInstances.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -22,8 +22,6 @@ *

* default value is 2 instaces *

- * - * @author Michael Baylis * */ public class MaximumInstances extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/NamePool.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/NamePool.java index 6fd1536a2..44dee1efc 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/NamePool.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/NamePool.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -30,8 +30,6 @@ *

* default value is GALASA{0-9}{0-9} *

- * - * @author Michael Baylis * */ public class NamePool extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackCredentialsId.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackCredentialsId.java index 9813a8643..7ca8c8f3f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackCredentialsId.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackCredentialsId.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -23,8 +23,6 @@ *

* default value is openstack *

- * - * @author Michael Baylis * */ public class OpenStackCredentialsId extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackDomainName.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackDomainName.java index ce2a1ad1f..090a18085 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackDomainName.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackDomainName.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* There is no default *

- * - * @author Michael Baylis * */ public class OpenStackDomainName extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackEnabled.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackEnabled.java index faf9e5304..80a27ac28 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackEnabled.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackEnabled.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -21,8 +23,6 @@ *

* default value is true *

- * - * @author Michael Baylis * */ public class OpenStackEnabled extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackIdentityUri.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackIdentityUri.java index 4994fd715..6af2dda1b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackIdentityUri.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackIdentityUri.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -25,8 +25,6 @@ *

* There is no default *

- * - * @author Michael Baylis * */ public class OpenStackIdentityUri extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackLinuxPriority.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackLinuxPriority.java index 8df76cc80..53a5a704b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackLinuxPriority.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackLinuxPriority.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -21,8 +23,6 @@ *

* default value is 1 *

- * - * @author Michael Baylis * */ public class OpenStackLinuxPriority extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackNetworkName.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackNetworkName.java new file mode 100644 index 000000000..f5da67b6d --- /dev/null +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackNetworkName.java @@ -0,0 +1,32 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.openstack.manager.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.openstack.manager.OpenstackManagerException; + +/** + * OpenStack Network name + * + * The Openstack Network name that the OpenStack Manager will use + * to create a Floating IP address within. The Network name is used + * to get the Network ID. + * + * The property is: + * openstack.network.name=my_network_name + * + * There is no default + * + */ +public class OpenStackNetworkName extends CpsProperties { + + public static String get() + throws ConfigurationPropertyStoreException, OpenstackManagerException { + return getStringNulled(OpenstackPropertiesSingleton.cps(), "network", "name"); + } + +} diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackProjectName.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackProjectName.java index 20cb21f5e..bbf036d24 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackProjectName.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenStackProjectName.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* There is no default *

- * - * @author Michael Baylis * */ public class OpenStackProjectName extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenstackPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenstackPropertiesSingleton.java index a20413d3b..674ac3923 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenstackPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/OpenstackPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsAvailablityZone.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsAvailablityZone.java index c049d85bc..41e6e9a39 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsAvailablityZone.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsAvailablityZone.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* The default is nova *

- * - * @author Michael Baylis * */ public class WindowsAvailablityZone extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsCredentials.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsCredentials.java index a2979af57..2d4087e38 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsCredentials.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsCredentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -27,8 +27,6 @@ *

* The default is OPENSTACKSSH *

- * - * @author Michael Baylis * */ public class WindowsCredentials extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsFlavor.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsFlavor.java index 2abc0a9e1..694c1f6a9 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsFlavor.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsFlavor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* The default is m1.medium *

- * - * @author Michael Baylis * */ public class WindowsFlavor extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImageCapabilities.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImageCapabilities.java index 3925211d7..ed036510b 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImageCapabilities.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImageCapabilities.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -32,8 +32,6 @@ *

* The default is no capabilities *

- * - * @author Michael Baylis * */ public class WindowsImageCapabilities extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImages.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImages.java index 6a6869d2d..e24626470 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImages.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsImages.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -30,8 +30,6 @@ *

* There are no defaults *

- * - * @author Michael Baylis * */ public class WindowsImages extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsKeyPair.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsKeyPair.java index be5909c13..a79b38db1 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsKeyPair.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsKeyPair.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* There is no default *

- * - * @author Michael Baylis * */ public class WindowsKeyPair extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsName.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsName.java index 8ec78144f..d8e1a1624 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsName.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsName.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -26,8 +26,6 @@ *

* The default is the same as the imagename *

- * - * @author Michael Baylis * */ public class WindowsName extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsSecurityGroups.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsSecurityGroups.java index 24e9ead69..838ea878f 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsSecurityGroups.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/WindowsSecurityGroups.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.openstack.manager.internal.properties; @@ -28,8 +28,6 @@ *

* There is no default *

- * - * @author James Davies * */ public class WindowsSecurityGroups extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/package-info.java index 4627305fe..24668df1d 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * OpenStack Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/package-info.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/package-info.java index 6e7de7cc0..5ada464c0 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/package-info.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * Open Stack Manager diff --git a/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/.gitignore b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/.gitignore new file mode 100644 index 000000000..29df26c1a --- /dev/null +++ b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/.gitignore @@ -0,0 +1,4 @@ +/.apt_generated/ +/.apt_generated_tests/ +/target/ +bin/ diff --git a/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/bnd.bnd b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/bnd.bnd new file mode 100644 index 000000000..a76c2c889 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/bnd.bnd @@ -0,0 +1,8 @@ +-snapshot: ${tstamp} +Bundle-Name: Manager Common +Export-Package: dev.galasa.common +Import-Package: dev.galasa,\ + dev.galasa.framework.spi,\ + dev.galasa.framework.spi.language, + + diff --git a/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/build.gradle b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/build.gradle new file mode 100644 index 000000000..78db7f04c --- /dev/null +++ b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'galasa.manager' +} + +description = 'Manager Common' + +version = '0.25.0' + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/settings.gradle b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/settings.gradle new file mode 100644 index 000000000..276e9f05b --- /dev/null +++ b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'dev.galasa.common' + diff --git a/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/src/main/java/dev/galasa/common/SSLTLSContextNameSelector.java b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/src/main/java/dev/galasa/common/SSLTLSContextNameSelector.java new file mode 100644 index 000000000..e4fa05850 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/src/main/java/dev/galasa/common/SSLTLSContextNameSelector.java @@ -0,0 +1,33 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.common; + +import java.util.Properties; + +public class SSLTLSContextNameSelector { + + public static final String JAVA_VENDOR_PROPERTY = "java.vendor"; + public static final String JAVA_VERSION_PROPERTY = "java.version"; + + public String getSelectedSSLContextName() { + return getSelectedSSLContextName(System.getProperties()); + } + public String getSelectedSSLContextName( Properties props ) { + boolean ibmJdk = props.getProperty(JAVA_VENDOR_PROPERTY).contains("IBM"); + String name ; + if (ibmJdk) { + if (props.getProperty(JAVA_VERSION_PROPERTY).startsWith("8.")) { + name="SSL_TLSv2"; + }else { + name ="TLSv1.2"; + } + } else { + name = "TLSv1.2"; + } + return name ; + } + +} diff --git a/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/src/test/java/dev/galasa/common/SSLTLSContextNameSelectorTest.java b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/src/test/java/dev/galasa/common/SSLTLSContextNameSelectorTest.java new file mode 100644 index 000000000..e0f7f2482 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-common-parent/dev.galasa.common/src/test/java/dev/galasa/common/SSLTLSContextNameSelectorTest.java @@ -0,0 +1,49 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.common; + +import org.junit.Test; + +import static org.junit.Assert.* ; +import java.util.Properties; + +public class SSLTLSContextNameSelectorTest { + @Test + public void testNonIBMJVMGivesTLS12Context() throws Exception { + Properties testProps = new Properties(); + testProps.setProperty(SSLTLSContextNameSelector.JAVA_VENDOR_PROPERTY,"FakeJavaRuntimeVendorName" ); + // When... + String contextName = new SSLTLSContextNameSelector().getSelectedSSLContextName(testProps); + // Then... + String expected = "TLSv1.2"; + assertEquals(expected,contextName); + } + @Test + public void testIBMJVM8GivesSSL_TLSv2Context() throws Exception { + // Given... + Properties testProps = new Properties(); + testProps.setProperty(SSLTLSContextNameSelector.JAVA_VENDOR_PROPERTY,"IBMJavaRuntimeVendorName" ); + testProps.setProperty(SSLTLSContextNameSelector.JAVA_VERSION_PROPERTY, "8.0.16"); + // When... + String contextName = new SSLTLSContextNameSelector().getSelectedSSLContextName(testProps); + // Then... + String expected = "SSL_TLSv2"; + assertEquals(expected,contextName); + } + + @Test + public void testIBMJVM11GivesTLSv12Context() throws Exception { + // Given... + Properties testProps = new Properties(); + testProps.setProperty(SSLTLSContextNameSelector.JAVA_VENDOR_PROPERTY,"IBMJavaRuntimeVendorName" ); + testProps.setProperty(SSLTLSContextNameSelector.JAVA_VERSION_PROPERTY, "11.0.16.1+1"); + // When... + String contextName = new SSLTLSContextNameSelector().getSelectedSSLContextName(testProps); + // Then... + String expected = "TLSv1.2"; + assertEquals(expected,contextName); + } +} \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/build.gradle index f8454734f..767e98ac9 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/build.gradle @@ -4,10 +4,24 @@ plugins { description = 'Galasa HTTP Manager IVTs' -version = '0.21.0' +version = '0.31.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/settings.gradle index b0ee74b2b..cf0f28824 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.http.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.http.manager.ivt' diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/src/main/java/dev/galasa/http/manager/ivt/HttpManagerIVT.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/src/main/java/dev/galasa/http/manager/ivt/HttpManagerIVT.java index d414d8c30..d42842c8b 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/src/main/java/dev/galasa/http/manager/ivt/HttpManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager.ivt/src/main/java/dev/galasa/http/manager/ivt/HttpManagerIVT.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.http.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; @@ -158,7 +163,7 @@ public void testBinary() throws HttpClientException { assertThat(response.getContent().length).isEqualTo(8); assertThat(response.getHeader("Content-Type")).isEqualTo("application/octet-stream"); } - + @Test public void downloadFileTest() throws Exception { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/bnd.bnd index f194b003e..5ffc885ff 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/bnd.bnd @@ -5,7 +5,9 @@ Import-Package: com.google.gson,\ dev.galasa,\ dev.galasa.framework.spi,\ dev.galasa.framework.spi.language,\ + dev.galasa.framework.spi.utils,\ dev.galasa.http.spi,\ + dev.galasa.common,\ javax.net.ssl,\ javax.validation.constraints;resolution:=optional,\ jakarta.xml.bind,\ diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/build.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/build.gradle index 3a4397b5c..87667a94c 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/build.gradle @@ -4,18 +4,32 @@ plugins { description = 'HTTP Manager' -version = '0.25.0' +version = '0.36.0' dependencies { api 'org.apache.httpcomponents:httpclient-osgi:4.5.13' implementation 'org.apache.httpcomponents:httpcore-osgi:4.4.14' implementation 'org.apache.httpcomponents:httpmime:4.5.8' - implementation 'commons-io:commons-io:2.9.0' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'commons-io:commons-io:2.16.1' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0' implementation (group: 'commons-codec', name: 'commons-codec'){ version{ strictly "[1.15]" } } + implementation project (':galasa-managers-common-parent:dev.galasa.common') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/settings.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/settings.gradle index 85c6d3475..456648a74 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.http.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.http.manager' + diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/ContentType.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/ContentType.java index 30cd84426..e5e2b17a0 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/ContentType.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/ContentType.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClient.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClient.java index 58afae708..2a623fbef 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClient.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClient.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http; @@ -17,7 +17,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author William Yates + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientException.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientException.java index 0aed6b1a9..8367b98fc 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientException.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientResponse.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientResponse.java index 7c35bf650..a6ae2421f 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientResponse.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpClientResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http; @@ -24,7 +24,6 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; @@ -32,12 +31,13 @@ import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException; +import dev.galasa.framework.spi.utils.GalasaGson; /** * Parametrisable representation of a response to an HTTP request. The parameter * describes the content type of the response. Use the static methods to create * instances from an {@link HttpResponse}. * - * @author James Bartlett + * * * @param Class describing the content type of the response */ @@ -240,11 +240,11 @@ public static HttpClientResponse textResponse(CloseableHttpResponse http } /** - * Create an {@link HttpClientResponse} with a {@link JSONObject} content type + * Create an {@link HttpClientResponse} with a com.google.gson.JsonObject content type * from an {@link HttpResponse}. * * @param httpResponse - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ public static HttpClientResponse jsonResponse(CloseableHttpResponse httpResponse) @@ -253,14 +253,14 @@ public static HttpClientResponse jsonResponse(CloseableHttpResponse } /** - * Create an {@link HttpClientResponse} with a {@link JSONObject} content type + * Create an {@link HttpClientResponse} with a com.google.gson.JsonObject content type * from an {@link HttpResponse}. If contentOnBadResponse is true, an attempt * will be made to retrieve the content even on a non 200 status code, otherwise * the content will be null in such an instance. * * @param httpResponse * @param contentOnBadResponse - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ public static HttpClientResponse jsonResponse(CloseableHttpResponse httpResponse, @@ -274,17 +274,21 @@ public static HttpClientResponse jsonResponse(CloseableHttpResponse if (response.getStatusCode() == HttpStatus.SC_OK || contentOnBadResponse) { String sResponse = EntityUtils.toString(httpResponse.getEntity()); -// JsonReader reader = new JsonReader(new InputStreamReader(httpResponse.getEntity().getContent())); - JsonElement jsonElement = null; - try{ - jsonElement = new Gson().fromJson(sResponse, JsonElement.class); - }catch(JsonSyntaxException jse){ - System.err.println("Unable to parse JSON from the following: " + sResponse); - throw jse; - } - if (jsonElement != null) { - JsonObject json = jsonElement.getAsJsonObject(); - response.setContent(json); + if (sResponse.trim().startsWith("{")) { +// JsonReader reader = new JsonReader(new InputStreamReader(httpResponse.getEntity().getContent())); + JsonElement jsonElement = null; + try{ + jsonElement = new GalasaGson().fromJson(sResponse, JsonElement.class); + }catch(JsonSyntaxException jse){ + System.err.println("Unable to parse JSON from the following: " + sResponse); + throw jse; + } + if (jsonElement != null) { + JsonObject json = jsonElement.getAsJsonObject(); + response.setContent(json); + } + } else { + System.err.println("Did not attempt to parse JSON from the following: " + sResponse); } } else { EntityUtils.consume(httpResponse.getEntity()); diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpDelete.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpDelete.java new file mode 100644 index 000000000..bb271c731 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/HttpDelete.java @@ -0,0 +1,40 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.http; + +import java.net.URI; + +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; + +/** + * HTTP DELETE method. + *

+ * The apache provided HttpDelete does not allow the inclusion + * of a body, which goes against HTTP specs, which allows it. + * This simple class now provides the capability. + */ +public class HttpDelete extends HttpEntityEnclosingRequestBase { + + public static final String METHOD_NAME = "DELETE"; + + public HttpDelete() { + super(); + } + + public HttpDelete(final URI uri) { + super(); + setURI(uri); + } + + public HttpDelete(final String uri) { + super(); + setURI(URI.create(uri)); + } + + public String getMethod() { + return METHOD_NAME; + } +} diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpClient.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpClient.java index f08e00c9f..efcc129ab 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpClient.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpClient.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http; @@ -122,47 +122,70 @@ HttpClientResponse postXML(String url, String xml) throws HttpClientException; /** - * Issue an HTTP GET to the provided URL, receiving a {@link JSONObject} in the + * Issue an HTTP GET to the provided URL, receiving a com.google.gson.JsonObject in the * response. * * @param url - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse getJson(String url) throws HttpClientException; /** * Issue an HTTP POST to the provided URL, sending the provided - * {@link JSONObject} and receiving a {@link JSONObject} in the response. + * com.google.gson.JsonObject and receiving a com.google.gson.JsonObject in the response. * * @param url * @param json - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse postJson(String url, JsonObject json) throws HttpClientException; - /** + /** + * Issue an HTTP PATCH to the provided URL, sending the provided + * com.google.gson.JsonObject and receiving a com.google.gson.JsonObject in the response. + * + * @param url + * @param json + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type + * @throws HttpClientException + */ + HttpClientResponse patchJson(String url, JsonObject json) throws HttpClientException; + + + /** * Issue an HTTP PUT to the provided URL, sending the provided - * {@link JSONObject} and receiving a {@link JSONObject} in the response. + * com.google.gson.JsonObject and receiving a com.google.gson.JsonObject in the response. * * @param url * @param json - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse putJson(String url, JsonObject json) throws HttpClientException; /** - * Issue an HTTP DELETE to the provided URL, receiving a {@link JSONObject} in + * Issue an HTTP DELETE to the provided URL, receiving a com.google.gson.JsonObject in * the response. * * @param url - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse deleteJson(String url) throws HttpClientException; + /** + * Issue an HTTP DELETE to the provided URL, receiving a com.google.gson.JsonObject in + * the response. + * + * @param url + * @param json + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type + * @throws HttpClientException + */ + HttpClientResponse deleteJson(String url, JsonObject json) throws HttpClientException; + /** * Issue an HTTP GET to the provided URL, receiving a {@link String} in the * response. @@ -211,7 +234,7 @@ HttpClientResponse postXML(String url, String xml) * * @param url * @param binary - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse putBinary(String url, byte[] binary) throws HttpClientException; @@ -222,7 +245,7 @@ HttpClientResponse postXML(String url, String xml) * * @param url * @param binary - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse getBinary(String url, byte[] binary) throws HttpClientException; @@ -233,7 +256,7 @@ HttpClientResponse postXML(String url, String xml) * * @param url * @param binary - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse postBinary(String url, byte[] binary) throws HttpClientException; @@ -244,7 +267,7 @@ HttpClientResponse postXML(String url, String xml) * * @param url * @param binary - * @return - {@link HttpClientResponse} with a {@link JSONObject} content type + * @return - {@link HttpClientResponse} with a com.google.gson.JsonObject content type * @throws HttpClientException */ HttpClientResponse deleteBinary(String url, byte[] binary) throws HttpClientException; @@ -252,25 +275,23 @@ HttpClientResponse postXML(String url, String xml) /** * Download a file from a specified location to a specified destination on local host. * - * @param Path destination - local location - * @param String path = URL path + * @param path = URL path */ CloseableHttpResponse getFile(String path) throws HttpClientException; /** * Download a file from a specified location to a specified destination on local host. * - * @param Path destination - local location - * @Param Content Types - * @param String path = URL path + * @param acceptTypes + * @param path - URL path */ CloseableHttpResponse getFile(String path, ContentType... acceptTypes) throws HttpClientException; /** * Send a compressed (tar) file from a local location to a specified destination on a host. * - * @param Sting path - URL path - * @param File file - tar archive file + * @param path - URL path + * @param file - tar archive file */ void putFile(String path, InputStream file); diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpManager.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpManager.java index 5302db515..28eed51c6 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpManager.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/IHttpManager.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http; /** * Provides test code access to HTTP Manager to execute HTTP requests * - * @author Will Yates + * */ public interface IHttpManager { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/StandAloneHttpClient.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/StandAloneHttpClient.java index 48bd2584b..56efbe277 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/StandAloneHttpClient.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/StandAloneHttpClient.java @@ -1,9 +1,15 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.http; import org.apache.commons.logging.Log; import dev.galasa.http.internal.HttpClientImpl; + /** * This is a class to allow the HTTP manager implementations be used without the need for the manager to be active */ diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/ClientAuthTrustManager.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/ClientAuthTrustManager.java index 6848cc7e5..e966a13f9 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/ClientAuthTrustManager.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/ClientAuthTrustManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; @@ -15,7 +15,7 @@ /** * Client Authentication Trust Manager * - * @author James Bartlett + * * */ public class ClientAuthTrustManager implements X509TrustManager { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientImpl.java index c3227d4c8..bf249d304 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; @@ -68,6 +70,7 @@ import com.google.gson.JsonObject; +import dev.galasa.common.SSLTLSContextNameSelector; import dev.galasa.http.ContentType; import dev.galasa.http.HttpClientException; import dev.galasa.http.HttpClientResponse; @@ -78,7 +81,7 @@ public class HttpClientImpl implements IHttpClient { - private static final String JAVA_VENDOR_PROPERTY = "java.vendor"; + private CloseableHttpClient httpClient; protected URI host = null; @@ -96,6 +99,8 @@ public class HttpClientImpl implements IHttpClient { private Log logger; + private SSLTLSContextNameSelector nameSelector = new SSLTLSContextNameSelector(); + public HttpClientImpl(int timeout, Log log) { this.timeout = timeout; this.logger = log; @@ -175,6 +180,16 @@ public HttpClientResponse postJson(String url, JsonObject json) thro return executeJsonRequest(request); } + @Override + public HttpClientResponse patchJson(String url, JsonObject json) throws HttpClientException { + + HttpClientRequest request = HttpClientRequest.newPatchRequest(buildUri(url, null).toString(), + new ContentType[] { ContentType.APPLICATION_JSON }, ContentType.APPLICATION_JSON); + request.setJSONBody(json); + + return executeJsonRequest(request); + } + @Override public HttpClientResponse deleteJson(String url) throws HttpClientException { @@ -184,6 +199,16 @@ public HttpClientResponse deleteJson(String url) throws HttpClientEx return executeJsonRequest(request); } + @Override + public HttpClientResponse deleteJson(String url, JsonObject json) throws HttpClientException { + + HttpClientRequest request = HttpClientRequest.newDeleteRequest(buildUri(url, null).toString(), + new ContentType[] { ContentType.APPLICATION_JSON }, ContentType.APPLICATION_JSON); + request.setJSONBody(json); + + return executeJsonRequest(request); + } + private HttpClientResponse executeJsonRequest(HttpClientRequest request) throws HttpClientException { return HttpClientResponse.jsonResponse(execute(request.buildRequest())); @@ -356,26 +381,21 @@ public void addOkResponseCode(int responseCode) { * @throws HttpClientException */ public IHttpClient setTrustingSSLContext() throws HttpClientException { - try { - boolean ibmJdk = System.getProperty(JAVA_VENDOR_PROPERTY).contains("IBM"); - SSLContext sslContext; - if (ibmJdk) - sslContext = SSLContext.getInstance("SSL_TLSv2"); // NOSONAR - else - sslContext = SSLContext.getInstance("TLSv1.2"); + String contextName = nameSelector.getSelectedSSLContextName(); + SSLContext sslContext = SSLContext.getInstance(contextName); sslContext.init(null, new TrustManager[] { new VeryTrustingTrustManager() }, new SecureRandom()); setSSLContext(sslContext); } catch (GeneralSecurityException e) { throw new HttpClientException("Error attempting to create SSL context", e); } - return this; } + /** * Set up Client Authentication SSL Context and install - * + * * @param clientKeyStore * @param serverKeyStore * @param alias @@ -385,29 +405,20 @@ public IHttpClient setTrustingSSLContext() throws HttpClientException { */ public IHttpClient setupClientAuth(KeyStore clientKeyStore, KeyStore serverKeyStore, String alias, String password) throws HttpClientException { - try { // Create the Key Manager Factory KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); kmf.init(clientKeyStore, password.toCharArray()); - // Create the Trust Managers TrustManager[] trustManagers = { new ClientAuthTrustManager(serverKeyStore, alias) }; - // Create the SSL Context - boolean ibmJdk = System.getProperty(JAVA_VENDOR_PROPERTY).contains("IBM"); - SSLContext sslContext; - if (ibmJdk) - sslContext = SSLContext.getInstance("SSL_TLSv2"); // NOSONAR - else - sslContext = SSLContext.getInstance("TLSv1.2"); + String contextName = nameSelector.getSelectedSSLContextName(); + SSLContext sslContext = SSLContext.getInstance(contextName); sslContext.init(kmf.getKeyManagers(), trustManagers, null); - setSSLContext(sslContext); } catch (GeneralSecurityException e) { throw new HttpClientException("Error attempting to create SSL context", e); } - return this; } diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientRequest.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientRequest.java index 81c8f7fbf..976727572 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientRequest.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpClientRequest.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; @@ -16,12 +16,12 @@ import org.apache.http.HttpEntity; import org.apache.http.HttpHeaders; -import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpPatch; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.utils.URIBuilder; import org.apache.http.entity.ByteArrayEntity; @@ -32,6 +32,7 @@ import com.google.gson.JsonObject; import dev.galasa.http.ContentType; +import dev.galasa.http.HttpDelete; import dev.galasa.http.HttpClientException; import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException; @@ -42,7 +43,7 @@ * {@link #setUrl(String)} must be called before use, as well as one of the * setBody(...) methods if this is a PUT or POST request * - * @author Will Yates + * * */ public class HttpClientRequest { @@ -53,6 +54,7 @@ private enum RequestType { DELETE, PUT, POST, + PATCH, HEAD; } @@ -275,6 +277,9 @@ HttpUriRequest buildRequest() throws HttpClientException { case HEAD: request = new HttpHead(uri); break; + case PATCH: + request = new HttpPatch(uri); + break; case GET: default: request = new HttpGet(uri); @@ -324,6 +329,24 @@ public static HttpClientRequest newDeleteRequest(String url, ContentType[] accep return request; } + /** + * Create a new DELETE request + * + * @param url + * @param acceptTypes + * @param contentType + * @return new DELETE request + */ + public static HttpClientRequest newDeleteRequest(String url, ContentType[] acceptTypes, ContentType contentType) { + + HttpClientRequest request = new HttpClientRequest(RequestType.DELETE); + request.setUrl(url); + request.setAcceptTypes(acceptTypes); + request.setContentType(contentType); + + return request; + } + /** * Create a new PUT request * @@ -359,6 +382,23 @@ public static HttpClientRequest newPostRequest(String url, ContentType[] acceptT return request; } + /** + * Create a new PATCH request + * + * @param url + * @param acceptTypes + * @param contentType + * @return new POST request + */ + public static HttpClientRequest newPatchRequest(String url, ContentType[] acceptTypes, ContentType contentType) { + + HttpClientRequest request = new HttpClientRequest(RequestType.PATCH); + request.setUrl(url); + request.setAcceptTypes(acceptTypes); + request.setContentType(contentType); + + return request; + } /** * Create a new HEAD request diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerField.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerField.java index 02755aa57..85221329c 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerField.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author William Yates + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerImpl.java index 87633c5fe..550050246 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/HttpManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/RequestPart.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/RequestPart.java index 3fe4f60f5..b3bff83f2 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/RequestPart.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/RequestPart.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/VeryTrustingTrustManager.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/VeryTrustingTrustManager.java index 89774ea76..da37ba933 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/VeryTrustingTrustManager.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/internal/VeryTrustingTrustManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/package-info.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/package-info.java index 31b4b4b8d..eb8d41c99 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/package-info.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * HTTP Client Manager diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/spi/IHttpManagerSpi.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/spi/IHttpManagerSpi.java index bee59d266..35ef71be4 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/spi/IHttpManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/main/java/dev/galasa/http/spi/IHttpManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.http.spi; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/test/java/test/force/codecoverage/ExceptionsTest.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/test/java/test/force/codecoverage/ExceptionsTest.java index bf6f44386..7590164c8 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/test/java/test/force/codecoverage/ExceptionsTest.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.http.manager/src/test/java/test/force/codecoverage/ExceptionsTest.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package test.force.codecoverage; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/build.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/build.gradle index 361cadb36..f328fb953 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'IP Network Manager' -version = '0.21.0' +version = '0.25.0' dependencies { implementation 'dev.galasa:com.jcraft.jsch:0.1.55' implementation 'commons-codec:commons-codec:1.15' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/settings.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/settings.gradle index 446762548..7e23153bf 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.ipnetwork.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.ipnetwork.manager' diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/ICommandShell.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/ICommandShell.java index 0d6d32bfa..b3c442d8d 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/ICommandShell.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/ICommandShell.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; @@ -10,8 +10,8 @@ public interface ICommandShell { public String issueCommand(String command) throws IpNetworkManagerException; /** - * Issue a command using SSH. Equivalent to {@link #issueCommand(String, false, - * long)} + * Issue a command using SSH. Equivalent to {@link #issueCommand(String, boolean, long)} + * * @param command - command to issue * @param timeout - time (in milliseconds) to wait with no new output appearing @@ -23,7 +23,7 @@ public interface ICommandShell { /** * Issue a command using SSH. Equivalent to - * {@link #issueCommand(String, boolean, defaultTimeout)} + * {@link #issueCommand(String, boolean, long)} * * @param command - command to issue * @param newShell - if true will start a new @@ -58,10 +58,12 @@ public interface ICommandShell { public void setChangePromptCommand(String command); /** - * Issue a command using SSH shell. Equivalent to - * {@link #issueCommandToShell(String, false, defaultTimeout)} - not valid for + * Issue a command using SSH shell. + * + * Equivalent to + * {@link #issueCommandToShell(String, boolean, long)} - not valid for * Rexec implementation - equivalent to - * {@link #issueCommand(String, boolean, long)} for Telnet implementation + * {@link #issueCommand(String, long)} for Telnet implementation * * @param command - command to issue * @return the output of the command (stdout and stderr) @@ -71,8 +73,8 @@ public interface ICommandShell { /** * Issue a command using SSH shell. Equivalent to - * {@link #issueCommandToShell(String, false, long)} - not valid for Rexec - * implementation - equivalent to {@link #issueCommand(String, boolean, long)} + * {@link #issueCommandToShell(String, boolean, long)} - not valid for Rexec + * implementation - equivalent to {@link #issueCommand(String, long)} * for Telnet implementation * * @param command - command to issue - if true will start a new @@ -83,9 +85,9 @@ public interface ICommandShell { /** * Issue a command using SSH shell. Equivalent to - * {@link #issueCommandToShell(String, boolean, defaultTimeout)} - not valid for + * {@link #issueCommandToShell(String, boolean, long)} - not valid for * Rexec implementation - equivalent to - * {@link #issueCommand(String, boolean, long)} for Telnet implementation + * {@link #issueCommand(String, long)} for Telnet implementation * * @param command - command to issue * @param newShell - if true will start a new @@ -96,7 +98,7 @@ public interface ICommandShell { /** * Issue a command using SSH shell - not valid for Rexec implementation - - * equivalent to {@link #issueCommand(String, boolean, long)} for Telnet + * equivalent to {@link #issueCommand(String, long)} for Telnet * implementation * * @param command - command to issue diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IFileProcessor.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IFileProcessor.java index 3c6573376..301354555 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IFileProcessor.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IFileProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpHost.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpHost.java index d27a0b6cf..807aee8d3 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpHost.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpHost.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; @@ -18,7 +18,7 @@ * Use the appropriate host manager annotation to obtain an object *

* - * @author Michael Baylis + * * */ public interface IIpHost { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpPort.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpPort.java index 79fc0d54d..761106e95 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpPort.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IIpPort.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; @@ -14,7 +14,7 @@ * Use the appropriate host manager annotation to obtain an object *

* - * @author Michael Baylis + * * */ public interface IIpPort { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IpNetworkManagerException.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IpNetworkManagerException.java index d4b1f013c..3c38d4295 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IpNetworkManagerException.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/IpNetworkManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHAuthFailException.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHAuthFailException.java index 8bab7b76c..4fd3663ea 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHAuthFailException.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHAuthFailException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHException.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHException.java index 1f86c30c1..cbe3af4f6 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHException.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/SSHException.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork; /** * zOS Command exception indicating an error in SSH * - * @author James Bartlett + * * */ public class SSHException extends IpNetworkManagerException { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkManagerImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkManagerImpl.java index ea3442963..2607e6532 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkResourceManagement.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkResourceManagement.java index a781355c6..2f35082cc 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpNetworkResourceManagement.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpPortImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpPortImpl.java index 8bc9ff139..3332f93f4 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpPortImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/IpPortImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/PortResourceMonitor.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/PortResourceMonitor.java index a88adec36..8dce94c36 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/PortResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/PortResourceMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributes.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributes.java index 267eb7bd6..b77376bd0 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributes.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributes.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; @@ -11,7 +11,7 @@ /** * For use with the dummy RAS file system * - * @author Michael Baylis + * * */ public class SSHBasicAttributes implements BasicFileAttributes { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributesView.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributesView.java index e8f120537..adc93c2dc 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributesView.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHBasicAttributesView.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; @@ -13,7 +13,7 @@ /** * For use with the dummy RAS file system * - * @author Michael Baylis + * * */ public class SSHBasicAttributesView implements BasicFileAttributeView { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHByteChannel.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHByteChannel.java index 354ebe110..5cb9ed0c8 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHByteChannel.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHByteChannel.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; @@ -25,7 +25,7 @@ /** * Dummy Byte Channel for a null Result Archive Store * - * @author Michael Baylis + * * */ public class SSHByteChannel implements SeekableByteChannel { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHDirectoryStream.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHDirectoryStream.java index 6e49e6eba..0a54ea904 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHDirectoryStream.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHDirectoryStream.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileStore.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileStore.java index 0c378c99c..449f252c2 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileStore.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileStore.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystem.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystem.java index eb4ee2bdf..1aa404da9 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystem.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystem.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystemProvider.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystemProvider.java index 9aca54b94..745c33919 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystemProvider.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHFileSystemProvider.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; @@ -43,7 +43,7 @@ /** * SSH FileStore for Galasa * - * @author Michael Baylis + * * */ public class SSHFileSystemProvider extends FileSystemProvider { diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHPath.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHPath.java index 118f42d8c..ead811d4d 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHPath.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/internal/ssh/filesystem/SSHPath.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.internal.ssh.filesystem; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/package-info.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/package-info.java index caf2b03dc..5bd1a06e6 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/package-info.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * IP Network Manager diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AbstractGenericIpHost.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AbstractGenericIpHost.java index a87f0e3f8..c0f9a1775 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AbstractGenericIpHost.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AbstractGenericIpHost.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.ipnetwork.spi; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AnsiEscapeSequences.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AnsiEscapeSequences.java index 05a899f08..462bc6d54 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AnsiEscapeSequences.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/AnsiEscapeSequences.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.spi; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpHostSpi.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpHostSpi.java index 24e983150..5162a8594 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpHostSpi.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpHostSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.spi; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpNetworkManagerSpi.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpNetworkManagerSpi.java index 1d97a8494..6e8a058b0 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpNetworkManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/IIpNetworkManagerSpi.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.spi; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/SSHClient.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/SSHClient.java index da9c51001..17526cb47 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/SSHClient.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.ipnetwork.manager/src/main/java/dev/galasa/ipnetwork/spi/SSHClient.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.ipnetwork.spi; @@ -37,7 +39,7 @@ /** * SSH client for Galasa * - * @author James Bartlett + * * */ public class SSHClient implements ICommandShell { @@ -68,11 +70,11 @@ public class SSHClient implements ICommandShell { // Default value: Linux command private String changePromptCommand = "PS1=" + specialPrompt; - public SSHClient(String hostname, int port, ICredentials credentials, long defaultTimeout) throws SSHException { + public SSHClient(String hostname, int port, ICredentials credentials, long defaultTimeoutInMillis) throws SSHException { this.hostname = hostname; this.port = port; - this.defaultTimeout = defaultTimeout; + this.defaultTimeout = defaultTimeoutInMillis; this.sshClient = new JSch(); this.session = null; @@ -99,8 +101,7 @@ public SSHClient(String hostname, int port, ICredentials credentials, long defau } /** - * Issue a command using SSH. Equivalent to {@link #issueCommand(String, false, - * defaultTimeout)} + * Issue a command using SSH. Equivalent to {@link #issueCommand(String, boolean, long)} * * @param command - command to issue * @return the output of the command (stdout and stderr) @@ -113,23 +114,23 @@ public String issueCommand(String command) throws SSHException { } /** - * Issue a command using SSH. Equivalent to {@link #issueCommand(String, false, + * Issue a command using SSH. Equivalent to {@link #issueCommand(String, boolean, * long)} * * @param command - command to issue - * @param timeout - time (in milliseconds) to wait with no new output appearing + * @param timeoutInMillis - time (in milliseconds) to wait with no new output appearing * before timing out * @return the output of the command (stdout and stderr) * @throws SSHException */ @Override - public String issueCommand(String command, long timeout) throws SSHException { - return issueCommand(command, false, timeout); + public String issueCommand(String command, long timeoutInMillis) throws SSHException { + return issueCommand(command, false, timeoutInMillis); } /** * Issue a command using SSH. Equivalent to - * {@link #issueCommand(String, boolean, defaultTimeout)} + * {@link #issueCommand(String, boolean, long)} * * @param command - command to issue * @param newShell - if true will start a new @@ -146,13 +147,13 @@ public String issueCommand(String command, boolean newShell) throws SSHException * * @param command - command to issue * @param newShell - if true will start a new - * @param timeout - time (in milliseconds) to wait with no new output appearing + * @param timeoutInMillis - time (in milliseconds) to wait with no new output appearing * before timing out * @return the output of the command (stdout and stderr) * @throws SSHException */ @Override - public synchronized String issueCommand(String command, boolean newShell, long timeout) throws SSHException { + public synchronized String issueCommand(String command, boolean newShell, long timeoutInMillis) throws SSHException { // Connect if we are not already connected connect(); @@ -167,7 +168,7 @@ public synchronized String issueCommand(String command, boolean newShell, long t // Issue the desired command and retrieve the response to a // string - String response = retrieveOutput(command, timeout); + String response = retrieveOutput(command, timeoutInMillis); if (logShellResults) { logger.trace("Received '" + response); @@ -201,12 +202,11 @@ public void setChangePromptCommand(String command) { /** * Issue a command using SSH shell. Equivalent to - * {@link #issueCommandToShell(String, false, defaultTimeout)} + * {@link #issueCommandToShell(String, boolean, long)} * * @param command - command to issue * @return the output of the command * @throws SSHException - * @throws JSchException */ @Override public String issueCommandToShell(String command) throws SSHException { @@ -216,29 +216,27 @@ public String issueCommandToShell(String command) throws SSHException { /** * Issue a command using SSH shell. Equivalent to - * {@link #issueCommandToShell(String, false, long)} + * {@link #issueCommandToShell(String, boolean, long)} * * @param command - command to issue - * @param timeout - time (in milliseconds) to wait with no new output appearing + * @param timeoutInMillis - time (in milliseconds) to wait with no new output appearing * before timing out * @return the output of the command * @throws SSHException - * @throws JSchException */ @Override - public String issueCommandToShell(String command, long timeout) throws SSHException { - return issueCommandToShell(command, false, timeout); + public String issueCommandToShell(String command, long timeoutInMillis) throws SSHException { + return issueCommandToShell(command, false, timeoutInMillis); } /** * Issue a command using SSH shell. Equivalent to - * {@link #issueCommandToShell(String, boolean, defaultTimeout)} + * {@link #issueCommandToShell(String, boolean, long)} * * @param command - command to issue * @param newShell - if true will start a new * @return the output of the command * @throws SSHException - * @throws JSchException */ @Override public String issueCommandToShell(String command, boolean newShell) throws SSHException { @@ -250,14 +248,13 @@ public String issueCommandToShell(String command, boolean newShell) throws SSHEx * * @param command - command to issue * @param newShell - if true will start a new - * @param timeout - time (in milliseconds) to wait with no new output appearing + * @param timeoutInMillis - time (in milliseconds) to wait with no new output appearing * before timing out * @return the output of the command * @throws SSHException - * @throws JSchException */ @Override - public synchronized String issueCommandToShell(String command, boolean newShell, long timeout) throws SSHException { + public synchronized String issueCommandToShell(String command, boolean newShell, long timeoutInMillis) throws SSHException { connect(); @@ -279,12 +276,12 @@ public synchronized String issueCommandToShell(String command, boolean newShell, lastCommandTimestamp = System.currentTimeMillis(); // Set a special prompt so we can easily identify responses to our commands logger.trace("Setting special prompt '" + specialPrompt + "'"); - retrieveOutputFromShell(channel, changePromptCommand, timeout); + retrieveOutputFromShell(channel, changePromptCommand, timeoutInMillis); Thread.sleep(500); // NOSONAR - Sleep is sufficent // Issue the desired command and retrieve the response to a string lastCommandTimestamp = System.currentTimeMillis(); - String response = retrieveOutputFromShell(channel, command, timeout); + String response = retrieveOutputFromShell(channel, command, timeoutInMillis); lastCommandTimestamp = System.currentTimeMillis(); return response; @@ -406,17 +403,16 @@ public synchronized void disconnect() throws SSHException { * Retrieve all output from the shell, returning only that which is found * between the command issued and the next occurrence of the special prompt we * defined in {@link #issueCommand(String)} - * - * @param session + * * @param command - * @param timeout + * @param timeoutInMillis * @return * @throws IOException * @throws InterruptedException * @throws ExecutionException * @throws SSHException */ - private String retrieveOutput(String command, long timeout) + private String retrieveOutput(String command, long timeoutInMillis) throws IOException, InterruptedException, ExecutionException, SSHException { StringBuilder sb = new StringBuilder(); @@ -432,7 +428,7 @@ private String retrieveOutput(String command, long timeout) InputStream err = channel.getErrStream(); channel.connect(); - long whenTimeout = Calendar.getInstance().getTimeInMillis() + timeout; + long whenTimeout = Calendar.getInstance().getTimeInMillis() + timeoutInMillis; byte[] tmp = new byte[1024]; while (true) { @@ -498,14 +494,14 @@ private byte[] removeAnsiEscapeCodes(byte[] bytes) throws IOException { * * @param channel * @param command - * @param timeout + * @param timeoutInMillis * @return * @throws IOException * @throws InterruptedException * @throws ExecutionException * @throws SSHException */ - private String retrieveOutputFromShell(Channel channel, String command, long timeout) + private String retrieveOutputFromShell(Channel channel, String command, long timeoutInMillis) throws IOException, InterruptedException, ExecutionException, SSHException { // Get the input stream from the current session @@ -537,7 +533,7 @@ private String retrieveOutputFromShell(Channel channel, String command, long tim // Create an executor and a callable which will allow us to read continuously // from - // the input stream with a timeout + // the input stream with a timeoutInMillis ExecutorService executor = Executors.newFixedThreadPool(2); Callable reader = new Callable() { @@ -557,7 +553,7 @@ public Integer call() throws Exception { Future future = executor.submit(reader); int read = 0; try { - read = future.get(timeout, TimeUnit.MILLISECONDS); + read = future.get(timeoutInMillis, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { executor.shutdown(); throw new SSHException("Timed out waiting for response from ssh. Response so far: " + responseBuilder); @@ -581,7 +577,10 @@ public Integer call() throws Exception { private class KeepAliveThread extends Thread { private final Session monitorSession; - private long idleTimeout = 60000; + + // Some commands we run download the isolated build zip which takes ages... + // Timeout increased from 60secs to 120secs to allow the download to complete. + private long idleTimeout = 120000; public KeepAliveThread(Session session) { this.monitorSession = session; @@ -598,8 +597,6 @@ public KeepAliveThread(Session session) { // } // // } - - return; } @Override @@ -613,7 +610,7 @@ public void run() { long timeout = System.currentTimeMillis() - idleTimeout; if (timeout >= lastCommandTimestamp) { - logger.debug("No command issued after " + idleTimeout + " milliseconds, closing SSH session"); + logger.debug("SSH Client unused after " + idleTimeout + " milliseconds, freeing session"); this.monitorSession.disconnect(); } } @@ -624,8 +621,6 @@ public void run() { return; } } - - return; } } diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/build.gradle index 7029bf5df..0c1e2b9a6 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/build.gradle @@ -10,3 +10,16 @@ dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.mq.manager') implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/settings.gradle index 34aafed5e..65e6bd684 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.mq.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.mq.manager.ivt' + + diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/src/main/java/dev/galasa/mq/manager/ivt/MqManagerIVT.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/src/main/java/dev/galasa/mq/manager/ivt/MqManagerIVT.java index a404ff20e..e261d0017 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/src/main/java/dev/galasa/mq/manager/ivt/MqManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager.ivt/src/main/java/dev/galasa/mq/manager/ivt/MqManagerIVT.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/build.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/build.gradle index 13f87c0f8..b66dc26fb 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/build.gradle @@ -15,3 +15,16 @@ dependencies { implementation 'commons-codec:commons-codec:1.11' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/settings.gradle b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/settings.gradle index 1aac5ba35..1dedfd9a8 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.mq.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.mq.manager' + diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueue.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueue.java index 4ab00ff40..c03cc06aa 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueue.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueue.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueueManager.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueueManager.java index 427f066f9..153977c83 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueueManager.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/IMessageQueueManager.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerException.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerException.java index 31cc80717..110c397d8 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerException.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq; import dev.galasa.ManagerException; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerField.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerField.java index 6a161c005..400449f6b 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerField.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/MqManagerField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq; @@ -12,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author William Yates + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/Queue.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/Queue.java index 5769e2b35..d9f45d4d8 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/Queue.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/Queue.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/QueueManager.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/QueueManager.java index 3dd071dda..d9488572b 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/QueueManager.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/QueueManager.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MQManagerImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MQManagerImpl.java index e88c73ee1..f0008ac31 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MQManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MQManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageDirection.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageDirection.java index b6b656466..e9c5615b6 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageDirection.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageDirection.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueImpl.java index 92e232020..7b59a4f4a 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueManagerImpl.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueManagerImpl.java index a56f21a9d..28f184ef2 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/MessageQueueManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceChannelName.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceChannelName.java index 7316a102d..29700a389 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceChannelName.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceChannelName.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceCredentials.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceCredentials.java index 7c334e613..60d6e72fc 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceCredentials.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceCredentials.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceForTag.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceForTag.java index 51ecd4ae4..422d2ecae 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceForTag.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceForTag.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceHost.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceHost.java index 6a6473ee1..c0969c099 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceHost.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceHost.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceName.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceName.java index 5373bf762..e5c558628 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceName.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstanceName.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstancePort.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstancePort.java index b2aeb0fa6..75d7d5ca4 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstancePort.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/InstancePort.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/MqPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/MqPropertiesSingleton.java index d111ac4b3..52fdaead5 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/MqPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/MqPropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/QueueNameForTag.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/QueueNameForTag.java index c5f749421..b2c39091b 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/QueueNameForTag.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/internal/properties/QueueNameForTag.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.mq.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/package-info.java b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/package-info.java index da92690ff..a7aba53a3 100644 --- a/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/package-info.java +++ b/galasa-managers-parent/galasa-managers-comms-parent/dev.galasa.mq.manager/src/main/java/dev/galasa/mq/package-info.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * Message Queueing Manager diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/build.gradle index 6bcd57faf..ea33ba5c3 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/build.gradle @@ -4,9 +4,22 @@ plugins { description = 'Galasa Artifact Manager IVTs' -version = '0.21.0' +version = '0.25.0' dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/settings.gradle index e7a324369..8cbc70bff 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.artifact.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.artifact.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/java/dev/galasa/artifact/manager/ivt/ArtifactManagerIVT.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/java/dev/galasa/artifact/manager/ivt/ArtifactManagerIVT.java index a8634946c..a2878bd79 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/java/dev/galasa/artifact/manager/ivt/ArtifactManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/java/dev/galasa/artifact/manager/ivt/ArtifactManagerIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact.manager.ivt; @@ -45,14 +45,14 @@ public void checkManagerNotNull() throws Exception { @Test public void testRetrieveFileAsStringMethod() throws Exception { - String textContent = resources.retrieveFileAsString("/resources/textFiles/test1.txt"); + String textContent = resources.retrieveFileAsString("/textFiles/test1.txt"); logger.debug("Read the following from the file test1.txt: " + textContent); assertThat(textContent.trim()).isEqualTo("Hello from Galasa"); } @Test public void testRetrieveSkeletonFileAsStringMethod() throws Exception { - String textContent = resources.retrieveSkeletonFileAsString("/resources/skeletons/test1.skel", buildHashMap()); + String textContent = resources.retrieveSkeletonFileAsString("/skeletons/test1.skel", buildHashMap()); logger.info("Received the following from the skeleton file: " + textContent); assertThat(textContent.trim()).isEqualTo("The third parameter is ITEM NUMBER THREE"); } @@ -60,7 +60,7 @@ public void testRetrieveSkeletonFileAsStringMethod() throws Exception { @Test public void readTextFileArtifactManager() throws Exception, TestBundleResourceException, IOException { - InputStream file = resources.retrieveFile("/resources/textFiles/test1.txt"); + InputStream file = resources.retrieveFile("/textFiles/test1.txt"); String textContent = artifacts.getBundleResources(this.getClass()).streamAsString(file); logger.debug("Read the following from the file test1.txt: " + textContent); assertThat(textContent.trim()).isEqualTo("Hello from Galasa"); @@ -68,7 +68,7 @@ public void readTextFileArtifactManager() throws Exception, TestBundleResourceEx @Test public void readTextFileBundleResources() throws Exception, TestBundleResourceException, IOException { - String textContent = resources.streamAsString(resources.retrieveFile("/resources/textFiles/test1.txt")); + String textContent = resources.streamAsString(resources.retrieveFile("/textFiles/test1.txt")); logger.debug("Read the following from the file test1.txt: " + textContent); assertThat(textContent.trim()).isEqualTo("Hello from Galasa"); } @@ -83,21 +83,21 @@ private HashMap buildHashMap(){ @Test public void readSkeletonBundleResources() throws TestBundleResourceException, Exception, IOException { - String textContent = resources.streamAsString(resources.retrieveSkeletonFile("/resources/skeletons/test1.skel", buildHashMap())); + String textContent = resources.streamAsString(resources.retrieveSkeletonFile("/skeletons/test1.skel", buildHashMap())); logger.info("Received the following from the skeleton file: " + textContent); assertThat(textContent.trim()).isEqualTo("The third parameter is ITEM NUMBER THREE"); } @Test public void readSkeletonBundleResourcesVelocity() throws TestBundleResourceException, Exception, IOException { - String textContent = resources.streamAsString(resources.retrieveSkeletonFile("/resources/velocity/velocityTest.skel", buildHashMap(), SkeletonType.VELOCITY)); + String textContent = resources.streamAsString(resources.retrieveSkeletonFile("/velocity/velocityTest.skel", buildHashMap(), SkeletonType.VELOCITY)); logger.info("Received the following from the skeleton file: " + textContent); assertThat(textContent.trim()).isEqualTo("The third parameter is ITEM NUMBER THREE"); } @Test public void readSkeletonFileArtifactManager() throws TestBundleResourceException, Exception, IOException { - InputStream is = resources.retrieveSkeletonFile("/resources/skeletons/test1.skel", buildHashMap()); + InputStream is = resources.retrieveSkeletonFile("/skeletons/test1.skel", buildHashMap()); String textContent = artifacts.getBundleResources(this.getClass()).streamAsString(is); logger.info("Received the following from the skeleton file: " + textContent); @@ -111,7 +111,7 @@ public void readSkeletonFile2ArtifactManager() throws TestBundleResourceExceptio props.put("ITEM2", "SECOND ITEM"); props.put("ITEM3", "ITEM NUMBER THREE"); - InputStream is = resources.retrieveSkeletonFile("/resources/skeletons/test2.skel", props); + InputStream is = resources.retrieveSkeletonFile("/skeletons/test2.skel", props); String textContent = artifacts.getBundleResources(this.getClass()).streamAsString(is); logger.info("Received the following from the skeleton file: " + textContent); @@ -121,7 +121,7 @@ public void readSkeletonFile2ArtifactManager() throws TestBundleResourceExceptio @Test public void readFileAsList() throws TestBundleResourceException, IOException { - InputStream is = resources.retrieveFile("/resources/textFiles/list.txt"); + InputStream is = resources.retrieveFile("/textFiles/list.txt"); List listContent = artifacts.getBundleResources(this.getClass()).streamAsList(is); logger.info("Received the following from the text file: " + listContent); @@ -133,17 +133,17 @@ public void readFileAsList() throws TestBundleResourceException, IOException { @Test public void retrieveDirectoryContentsTest() throws Exception { - Map contents = resources.retrieveDirectoryContents("/resources/textFiles"); + Map contents = resources.retrieveDirectoryContents("/textFiles"); logger.info("Received the following from the directory: " + contents); - assertThat(contents).containsKey("resources/textFiles/list.txt"); - assertThat(contents).containsKey("resources/textFiles/test1.txt"); + assertThat(contents).containsKey("textFiles/list.txt"); + assertThat(contents).containsKey("textFiles/test1.txt"); } @Test public void retrieveEmptyDirectoryContentsTest() throws Exception { - Map contents = resources.retrieveDirectoryContents("/resources/emptyDirectory"); + Map contents = resources.retrieveDirectoryContents("/emptyDirectory"); logger.info("Received the following from the directory: " + contents); @@ -152,57 +152,43 @@ public void retrieveEmptyDirectoryContentsTest() throws Exception { @Test public void retrieveNestedirectoryContentsTest() throws Exception { - Map contents = resources.retrieveDirectoryContents("/resources/directory"); + Map contents = resources.retrieveDirectoryContents("/directory"); logger.info("Received the following from the directory: " + contents); - assertThat(contents).containsKey("resources/directory/nestedDirectory/nestedFile.txt"); + assertThat(contents).containsKey("directory/nestedDirectory/nestedFile.txt"); } @Test public void retrieveSkeletonDirectoryContentsTest() throws Exception { - Map contents = resources.retrieveSkeletonDirectoryContents("/resources/skeletons", buildHashMap(), 0); + Map contents = resources.retrieveSkeletonDirectoryContents("/skeletons", buildHashMap(), 0); logger.info("Received the following from the directory: " + contents); //Asserts that directory contains correct files - assertThat(contents).containsKey("resources/skeletons/test1.skel"); - assertThat(contents).containsKey("resources/skeletons/test2.skel"); + assertThat(contents).containsKey("skeletons/test1.skel"); + assertThat(contents).containsKey("skeletons/test2.skel"); + + //assert that there are only two entries + assertThat(contents.keySet().size()).isEqualTo(2); + + String textContent = new String(); + + textContent = resources.streamAsString(contents.get("skeletons/test1.skel")); + logger.info("Received the following from the file: " + textContent); + assertThat(textContent).contains("ITEM NUMBER THREE"); - int i = 1; - //Iterates through the directory contents - for (Map.Entry entry : contents.entrySet()) { - //Switch checks i and uses case associated, initially set to 1 - switch(i) - { - //For the first inputStream stored in Map, stream as a string and assert that variables are correctly substituted - case 1: - String textContent = resources.streamAsString(entry.getValue()); - logger.info("Received the following from the file: " + textContent); + textContent = resources.streamAsString(contents.get("skeletons/test2.skel")); + logger.info("Received the following from the file: " + textContent); + assertThat(textContent).contains("The third parameter is ITEM NUMBER THREE\n" + + "The first item was \"THIS IS ITEM1\" and this is the second line "); - assertThat(textContent).contains("ITEM NUMBER THREE"); - break; - //For the second inputStream stored in Map, stream as a string and assert that variables are correctly substituted - case 2: - String textContent2 = resources.streamAsString(entry.getValue()); - logger.info("Received the following from the file: " + textContent2); - - assertThat(textContent2).contains("The third parameter is ITEM NUMBER THREE\n" + - "The first item was \"THIS IS ITEM1\" and this is the second line "); - break; - //If there are more entries than the two expected, throw error - default: - throw new Exception("Invalid content in directory files"); - } - // increments i so that case 2 is used on the next loop - i++; - } } @Test public void retrieveJarTest() throws Exception { - InputStream is = resources.retrieveJar("HelloGalasa", "0.0.1", "/resources/jars/"); + InputStream is = resources.retrieveJar("HelloGalasa", "0.0.1", "/jars/"); String jarContent = resources.streamAsString(is); //If the class file is found then the jar has been retrieved successfully @@ -212,7 +198,7 @@ public void retrieveJarTest() throws Exception { @Test public void retrieveJarTestWithVersionCompare() throws Exception { - InputStream is = resources.retrieveJar("dev.galasa", "0.15.0.202105120649", "/resources/jars/"); + InputStream is = resources.retrieveJar("dev.galasa", "0.15.0.202105120649", "/jars/"); String jarContent = resources.streamAsString(is); @@ -223,7 +209,7 @@ public void retrieveJarTestWithVersionCompare() throws Exception { @Test public void retrieveJarTestWithinRange() throws Exception { - InputStream is = resources.retrieveJar("dev.galasa", "(0.14.0.202105120649,0.16.0.202105120649)", "/resources/jars/"); + InputStream is = resources.retrieveJar("dev.galasa", "(0.14.0.202105120649,0.16.0.202105120649)", "/jars/"); String jarContent = resources.streamAsString(is); @@ -235,7 +221,7 @@ public void retrieveJarTestWithinRange() throws Exception { @Test public void retrieveJarTestNoVersion() throws Exception { - InputStream is = resources.retrieveJar("HelloGalasa", "", "/resources/jars/"); + InputStream is = resources.retrieveJar("HelloGalasa", "", "/jars/"); String jarContent = resources.streamAsString(is); @@ -245,7 +231,7 @@ public void retrieveJarTestNoVersion() throws Exception { @Test public void retrieveJarTestDifferSeperator() throws Exception { - InputStream is = resources.retrieveJar("HelloGalasa", "0.0.1", "/resources/jarsHyphenVersion/"); + InputStream is = resources.retrieveJar("HelloGalasa", "0.0.1", "/jarsHyphenVersion/"); String jarContent = resources.streamAsString(is); @@ -256,7 +242,7 @@ public void retrieveJarTestDifferSeperator() throws Exception { @Test public void zipDirectoryTestGZIP() throws TestBundleResourceException, IOException { - InputStream is = resources.zipDirectoryContents("/resources/zipFiles/", buildHashMap(), "US-ASCII", true); + InputStream is = resources.zipDirectoryContents("/zipFiles/", buildHashMap(), "US-ASCII", true); GZIPInputStream gzip = new GZIPInputStream(is); //Decode zip using "US-ASCII" @@ -273,7 +259,7 @@ public void zipDirectoryTestGZIP() throws TestBundleResourceException, IOExcepti @Test public void zipDirectoryTest() throws TestBundleResourceException, IOException { - InputStream is = resources.zipDirectoryContents("/resources/zipFiles/", buildHashMap(), "US-ASCII", false); + InputStream is = resources.zipDirectoryContents("/zipFiles/", buildHashMap(), "US-ASCII", false); //Decode zip using "US-ASCII" String text = "Decoded Zip: "; @@ -289,7 +275,7 @@ public void zipDirectoryTest() throws TestBundleResourceException, IOException { @Test public void zipDirectoryTestNoEncoding() throws TestBundleResourceException, IOException { - InputStream is = resources.zipDirectoryContents("/resources/zipFiles/", buildHashMap(), null, false); + InputStream is = resources.zipDirectoryContents("/zipFiles/", buildHashMap(), null, false); //Read zip using no encoding" String text = "Zip: "; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/directory/nestedDirectory/nestedFile.txt b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/directory/nestedDirectory/nestedFile.txt similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/directory/nestedDirectory/nestedFile.txt rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/directory/nestedDirectory/nestedFile.txt diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jars/HelloGalasa.jar b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jars/HelloGalasa.jar similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jars/HelloGalasa.jar rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jars/HelloGalasa.jar diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jars/HelloGalasa_0.0.1.jar b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jars/HelloGalasa_0.0.1.jar similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jars/HelloGalasa_0.0.1.jar rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jars/HelloGalasa_0.0.1.jar diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jars/dev.galasa.0.15.0.202105120649.jar b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jars/dev.galasa.0.15.0.202105120649.jar similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jars/dev.galasa.0.15.0.202105120649.jar rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jars/dev.galasa.0.15.0.202105120649.jar diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jarsHyphenVersion/HelloGalasa-0.0.1.jar b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jarsHyphenVersion/HelloGalasa-0.0.1.jar similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/jarsHyphenVersion/HelloGalasa-0.0.1.jar rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/jarsHyphenVersion/HelloGalasa-0.0.1.jar diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/skeletons/test1.skel b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/skeletons/test1.skel similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/skeletons/test1.skel rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/skeletons/test1.skel diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/skeletons/test2.skel b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/skeletons/test2.skel similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/skeletons/test2.skel rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/skeletons/test2.skel diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/textFiles/list.txt b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/textFiles/list.txt similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/textFiles/list.txt rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/textFiles/list.txt diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/textFiles/test1.txt b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/textFiles/test1.txt similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/textFiles/test1.txt rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/textFiles/test1.txt diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/velocity/velocityTest.skel b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/velocity/velocityTest.skel similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/velocity/velocityTest.skel rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/velocity/velocityTest.skel diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/zipFiles/zipTest.txt b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/zipFiles/zipTest.txt similarity index 100% rename from galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/resources/zipFiles/zipTest.txt rename to galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager.ivt/src/main/resources/zipFiles/zipTest.txt diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/build.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/build.gradle index 1ca45aae2..9e9f0d4ec 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/build.gradle @@ -6,9 +6,23 @@ plugins { description = 'Handles the retrieval of artifacts from the OSGi bundles' -version = '0.21.0' +version = '0.34.0' dependencies { - implementation 'org.apache.velocity:velocity:1.7' - implementation 'commons-io:commons-io:2.9.0' -} \ No newline at end of file + implementation 'org.apache.velocity:velocity-engine-core:2.3' + implementation 'commons-io:commons-io:2.16.1' +} + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/settings.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/settings.gradle index 0b8530e68..2a03f16df 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/settings.gradle @@ -1 +1,2 @@ rootProject.name = 'dev.galasa.artifact.manager' + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManager.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManager.java index 6eadb2d02..038127971 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManager.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; @@ -16,7 +16,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author William Yates + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManagerField.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManagerField.java index 9d5e06645..7ff5535ba 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManagerField.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ArtifactManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Will Yates + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/BundleResources.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/BundleResources.java index 37e08172e..df31cdba8 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/BundleResources.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/BundleResources.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; @@ -15,7 +15,7 @@ /** * Obtain a {@link IBundleResources} object for this test class * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IArtifactManager.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IArtifactManager.java index 07b69abe5..f67d3e37a 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IArtifactManager.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IArtifactManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; @@ -12,7 +12,7 @@ * retrieving artifacts/resources from the 'resources' directory in your test * bundle, and manipulating those resources * - * @author James Bartlett + * * */ public interface IArtifactManager { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IBundleResources.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IBundleResources.java index 461d0e94a..3f7ddc1c9 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IBundleResources.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/IBundleResources.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; @@ -24,10 +24,12 @@ public interface IBundleResources { InputStream retrieveFile(String path) throws TestBundleResourceException; /** - * Retrieve a file as a String - * @param path - * @return + * Retrieve the contents of a file as a String + * + * @param path The path to the file to which will be read + * @return The contents of the file * @throws TestBundleResourceException + * @throws IOException */ String retrieveFileAsString(String path) throws TestBundleResourceException, IOException; @@ -46,25 +48,32 @@ InputStream retrieveSkeletonFile(String path, Map parameters, in /** - * Retrieve a single file as an InputStream, if the file is a skeleton then any - * required substitutions will be performed before the stream is returned. Uses - * the default skeleton processor {@link SkeletonType#PLUSPLUS} + * Retrieve a single file as an InputStream * - * @param path + * If the file is a skeleton then any + * required substitutions will be performed before the stream is returned. + * + * Uses the default {@link ISkeletonProcessor} + * + * @param path The path to the file * @param parameters - * @return + * @return A stream so the caller can read the contents of the file * @throws TestBundleResourceException */ InputStream retrieveSkeletonFile(String path, Map parameters) throws TestBundleResourceException; /** - * Retrieve a single file as a String, if the file is a skeleton then any - * required substitutions will be performed before the string is returned. Uses - * the default skeleton processor {@link SkeletonType#PLUSPLUS} - * @param path - * @param parameters - * @return + * Retrieve a single file as a String + * + * If the file is a skeleton then any required substitutions will + * be performed before the string is returned. + * + * Uses the default {@link ISkeletonProcessor} + * + * @param path The path to the file to be read + * @param parameters + * @return The contents of the file * @throws TestBundleResourceException */ String retrieveSkeletonFileAsString(String path, Map parameters) throws TestBundleResourceException, IOException; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ISkeletonProcessor.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ISkeletonProcessor.java index 800cb896c..f66891832 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ISkeletonProcessor.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/ISkeletonProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/OutputRepositoryException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/OutputRepositoryException.java index f0f060b58..599574bbd 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/OutputRepositoryException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/OutputRepositoryException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/SkeletonProcessorException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/SkeletonProcessorException.java index edc2fa60e..346af02b8 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/SkeletonProcessorException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/SkeletonProcessorException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/TestBundleResourceException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/TestBundleResourceException.java index 162773e07..fea92cfe9 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/TestBundleResourceException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/TestBundleResourceException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/ArtifactManagerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/ArtifactManagerImpl.java index 7593d734b..f17974afc 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/ArtifactManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/ArtifactManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/BundleResourcesImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/BundleResourcesImpl.java index e511cd18c..3c71ff47e 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/BundleResourcesImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/BundleResourcesImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact.internal; @@ -484,9 +484,6 @@ private String normalisePath(String rawPath) { if (!rawPath.startsWith(FILE_SEPARATOR)) rawPath = FILE_SEPARATOR + rawPath; - if (!rawPath.startsWith(FILE_SEPARATOR + "resources")) - rawPath = FILE_SEPARATOR + "resources" + rawPath; - rawPath = rawPath.replaceAll("\\/+", "/"); rawPath = rawPath.replaceFirst(FILE_SEPARATOR, ""); diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/PlusPlusSkeletonProcessor.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/PlusPlusSkeletonProcessor.java index 4afcc4cb3..92aaf659a 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/PlusPlusSkeletonProcessor.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/PlusPlusSkeletonProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact.internal; @@ -26,7 +26,7 @@ /** * A simple skeleton processor to replace velocity * - * @author James Bartlett + * * */ public class PlusPlusSkeletonProcessor implements ISkeletonProcessor { @@ -199,7 +199,7 @@ public String purgeUnusedMarkers(String skeletonContent) { /** * Describes a known form of delimiting a value to be substituted * - * @author root + * * */ private class Delimiter { @@ -277,7 +277,7 @@ public String substitute(String input, String key, String value) { * Describes a known way of describing a substitution for each member of some * collection * - * @author root + * * */ private class LoopForm { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/VelocitySkeletonProcessor.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/VelocitySkeletonProcessor.java index f3b8e99b4..8ad5e8e23 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/VelocitySkeletonProcessor.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/internal/VelocitySkeletonProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.artifact.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/package-info.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/package-info.java index 10d2880d1..99bd21c70 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/package-info.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/main/java/dev/galasa/artifact/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * Artifact Manager diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/test/java/dev/galasa/artifact/manager/DummyTest.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/test/java/dev/galasa/artifact/manager/DummyTest.java index efde7b4c4..d82b52d66 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/test/java/dev/galasa/artifact/manager/DummyTest.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.artifact.manager/src/test/java/dev/galasa/artifact/manager/DummyTest.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.artifact.manager; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/build.gradle index 8d10149bf..6f5c3780a 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/build.gradle @@ -9,3 +9,16 @@ version = '0.21.0' dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/settings.gradle index c6115ed62..e5560f772 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.core.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.core.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/core/manager/ivt/CoreManagerIVT.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/core/manager/ivt/CoreManagerIVT.java index c1f0c563b..8c3f3bf61 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/core/manager/ivt/CoreManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/core/manager/ivt/CoreManagerIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.core.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTest.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTest.java index 452747304..a04b5832c 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTest.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTest.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.framework.ivt; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtended.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtended.java index 35d9947aa..577d93813 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtended.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtended.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.framework.ivt; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtendedAgain.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtendedAgain.java index ed217178e..005fe1799 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtendedAgain.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestExtendedAgain.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.framework.ivt; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestFail.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestFail.java index 66bbe87cc..425f79df0 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestFail.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager.ivt/src/main/java/dev/galasa/framework/ivt/BasicTestFail.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.framework.ivt; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/build.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/build.gradle index 1e592576f..965ea1935 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/build.gradle @@ -3,8 +3,22 @@ plugins { } description = 'Galasa Core Manager' -version = '0.21.0' +version = '0.31.0' dependencies { - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/settings.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/settings.gradle index 6b49a5e37..844405f7b 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.core.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.core.manager' + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManager.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManager.java index 66f11210b..f9f138b35 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManager.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManager.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import static java.lang.annotation.ElementType.FIELD; @@ -12,17 +14,11 @@ import dev.galasa.framework.spi.ValidAnnotatedFields; /** - *

* Fill this field with the Core Manager instance. - *

* - *

* Will only populate public {@link ICoreManager} fields. - *

- * - * @author Michael Baylis - * @see {@link ICoreManager} * + * @see ICoreManager */ @Retention(RUNTIME) @Target(FIELD) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerException.java index edb8d8b8b..2e7d2618a 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.core.manager; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerField.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerField.java index f469f5420..82516f544 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerField.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/CoreManagerField.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import java.lang.annotation.ElementType; @@ -12,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ICoreManager.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ICoreManager.java index 621c21812..73e008420 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ICoreManager.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ICoreManager.java @@ -1,31 +1,27 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.core.manager; import javax.validation.constraints.NotNull; import dev.galasa.ICredentials; +import dev.galasa.ICredentialsUsernamePassword; /** - *

* The Core Manager provides Tests with access to some of the most common * features within the Galasa Framework - *

* - *

* To gain access to the Core Manager, include the following in the test class:- - *

* *
- * @CoreManager
- * public ICoreManager coreManager;
- * 
+ @CoreManager + public ICoreManager coreManager; + * - * @author Michael Baylis - * @See {@link CoreManager} + * @see CoreManager * */ public interface ICoreManager { @@ -47,5 +43,15 @@ public interface ICoreManager { */ ICredentials getCredentials(@NotNull String credentialsId) throws CoreManagerException; + /** + * Retrieve Username and Password Credentials only + * + * @param credentialsId + * @return A credentials object or null if id not found + * @throws CoreManagerException If there is a problem accessing the credentials store + * or if the credential is not of type ICredentialsUsernamePassword + */ + ICredentialsUsernamePassword getUsernamePassword(@NotNull String credentialsId) throws CoreManagerException; + void registerConfidentialText(String confidentialString, String comment); } diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/IResourceString.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/IResourceString.java index 181801887..492d7c7e7 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/IResourceString.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/IResourceString.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; public interface IResourceString { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/Logger.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/Logger.java index c360cb49e..cba8e5f8c 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/Logger.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/Logger.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import static java.lang.annotation.ElementType.FIELD; @@ -22,7 +24,7 @@ *

* * @see {@link org.apache.commons.logging.Log} - * @author Michael Baylis + * * */ @Retention(RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ResourceString.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ResourceString.java index d9576142e..913b7aa71 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ResourceString.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/ResourceString.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import static java.lang.annotation.ElementType.FIELD; @@ -17,10 +19,10 @@ * The CPS property core.resource.string.[length].pattern determines the make up of the random string. *

*

- * Will only populate public {@link java.lang.Stringdev.galasa.core.manager.IResourceString} fields. + * Will only populate public {@link dev.galasa.core.manager.IResourceString} fields. *

* - * @author Michael Baylis + * * */ @Retention(RUNTIME) @@ -35,7 +37,7 @@ * * The tag must be provided as there is no default for this resource. * - * The {@link java.lang.Stringdev.galasa.core.manager.IResourceString} object is keyed on the tag, so if the tag is referred to in multiple + * The {@link dev.galasa.core.manager.IResourceString} object is keyed on the tag, so if the tag is referred to in multiple * super classes, then the lengths must be identical otherwise an exception will be thrown. */ String tag(); diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/RunName.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/RunName.java index 3944b51f3..55c741317 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/RunName.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/RunName.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import static java.lang.annotation.ElementType.FIELD; @@ -12,19 +14,13 @@ import dev.galasa.framework.spi.ValidAnnotatedFields; /** - *

- * Fill this field with the name of the Test Run. Can be used for making - * resource names unique to this run. The Test Run will be unique across all - * Local and Automated runs that are in the system at that point. - *

+ * Fill this field with the name of the Test Run. + * + * Can be used for making resource names unique to this run. + * The Test Run will be unique across all Local and Automated runs + * that are in the system at that point. * - *

* Will only populate public {@link java.lang.String} fields. - *

- * - * @author Michael Baylis - * @see {@link java.lang.String} - * */ @Retention(RUNTIME) @Target(FIELD) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/StoredArtifactRoot.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/StoredArtifactRoot.java index 1d1825619..81b656792 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/StoredArtifactRoot.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/StoredArtifactRoot.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import static java.lang.annotation.ElementType.FIELD; @@ -13,18 +15,12 @@ import dev.galasa.framework.spi.ValidAnnotatedFields; /** - *

* Fill this field Root path of the Stored Artifacts for this Test Run. This can * be used to record test logs, job output, trace files etc. - *

- * - *

- * Will only populate public {@link java.nio.files.Path} fields. - *

- * - * @author Michael Baylis - * @see {@link java.nio.files.Path} * + * Will only populate public {@link java.nio.file.Path} fields. + * + * @see java.nio.file.Path */ @Retention(RUNTIME) @Target(FIELD) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/TestProperty.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/TestProperty.java index 12b9d6202..536390407 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/TestProperty.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/TestProperty.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager; import static java.lang.annotation.ElementType.FIELD; @@ -20,7 +22,7 @@ *

* * @see {@link String} - * @author Michael Baylis + * * */ @Retention(RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CoreManagerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CoreManagerImpl.java index c48d70d82..a5e4e5a2e 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CoreManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CoreManagerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal; import java.lang.annotation.Annotation; @@ -16,6 +18,7 @@ import org.osgi.service.component.annotations.Component; import dev.galasa.ICredentials; +import dev.galasa.ICredentialsUsernamePassword; import dev.galasa.ManagerException; import dev.galasa.Tags; import dev.galasa.TestAreas; @@ -174,7 +177,7 @@ public String createTestproperty(Field field, List annotations) thro + ",suffix=" + testPropertyAnnotation.suffix() + ",infixes=" - + testPropertyAnnotation.infixes()); + + String.join(",",testPropertyAnnotation.infixes())); } return value; @@ -222,6 +225,15 @@ public ICredentials getCredentials(@NotNull String credentialsId) throws CoreMan throw new CoreManagerException("Unable to retrieve credentials for id " + credentialsId, e); } } + + @Override + public ICredentialsUsernamePassword getUsernamePassword(@NotNull String credentialsId) throws CoreManagerException { + ICredentials cred =getCredentials(credentialsId); + if(!(cred instanceof ICredentialsUsernamePassword)) { + throw new CoreManagerException("Unable to retrieve username/password credentials for id"+ credentialsId); + } + return (ICredentialsUsernamePassword) cred; + } @Override public void registerConfidentialText(String confidentialString, String comment) { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CorePropertiesSingleton.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CorePropertiesSingleton.java index 02f77e466..af2d570ba 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CorePropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/CorePropertiesSingleton.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal; import org.osgi.service.component.annotations.Activate; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringGenerator.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringGenerator.java index 6d163e169..f47a48c1f 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringGenerator.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringGenerator.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal; import java.lang.reflect.Field; @@ -28,7 +30,7 @@ * Generate Resource Strings using random letters * * - * @author Michael Baylis + * * */ public class ResourceStringGenerator { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringImpl.java index 3e46bca79..9691129c0 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/ResourceStringImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal; import dev.galasa.core.manager.IResourceString; @@ -9,7 +11,7 @@ * Basic holder of a Resource String. * Not strictly necessary, but future proofing * - * @author Michael Baylis + * * */ public class ResourceStringImpl implements IResourceString { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/gherkin/CoreStatementOwner.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/gherkin/CoreStatementOwner.java index c401efac8..afd698ede 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/gherkin/CoreStatementOwner.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/gherkin/CoreStatementOwner.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal.gherkin; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/package-info.java index 735995e3c..acf044e0c 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Galasa Core Manager - Internal Implementation */ diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/properties/ResourceStringPattern.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/properties/ResourceStringPattern.java index 028c379d9..6a15c4c87 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/properties/ResourceStringPattern.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/properties/ResourceStringPattern.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.core.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/CoreResourceManagement.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/CoreResourceManagement.java index a89f37671..75a1f64d7 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/CoreResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/CoreResourceManagement.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.core.manager.internal.resourcemanagement; @@ -21,7 +23,7 @@ * resources after a test has been terminated * * - * @author Michael Baylis + * * */ @Component(service = { IResourceManagementProvider.class }) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/ResourceStringResourceManagement.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/ResourceStringResourceManagement.java index fa1263ec5..250182f94 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/ResourceStringResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/resourcemanagement/ResourceStringResourceManagement.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.core.manager.internal.resourcemanagement; @@ -20,7 +22,7 @@ /** * Core Resource String Resource Management * - * @author Michael Baylis + * * */ public class ResourceStringResourceManagement implements Runnable { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/testcatalog/CoreTestCatalogBuilder.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/testcatalog/CoreTestCatalogBuilder.java index ecb017d0f..bfe35fa3b 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/testcatalog/CoreTestCatalogBuilder.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/internal/testcatalog/CoreTestCatalogBuilder.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal.testcatalog; import com.google.gson.JsonArray; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/package-info.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/package-info.java index e0bc029d3..68256d835 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/package-info.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/main/java/dev/galasa/core/manager/package-info.java @@ -1,7 +1,7 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * Galasa Core Manager diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/test/java/dev/galasa/core/manager/internal/CoreManagerTest.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/test/java/dev/galasa/core/manager/internal/CoreManagerTest.java index 08441c8a3..761a0cc15 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/test/java/dev/galasa/core/manager/internal/CoreManagerTest.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.core.manager/src/test/java/dev/galasa/core/manager/internal/CoreManagerTest.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.core.manager.internal; import static org.mockito.Mockito.when; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/build.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/build.gradle index 42f5f3029..52e6c8ad5 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/build.gradle @@ -4,8 +4,22 @@ plugins { description = 'Galasa Text Scan Manager' -version = '0.21.0' +version = '0.34.0' dependencies { - implementation 'commons-io:commons-io:2.9.0' + implementation 'commons-io:commons-io:2.16.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/settings.gradle b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/settings.gradle index f6a3dec00..9512b318b 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.textscan.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.textscan.manager' + diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/CheckpointException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/CheckpointException.java index 3d2cb9c89..19e30e0cb 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/CheckpointException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/CheckpointException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/FailTextFoundException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/FailTextFoundException.java index 4a0af8455..051153bb5 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/FailTextFoundException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/FailTextFoundException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ILogScanner.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ILogScanner.java index 67cc44793..a99c09e32 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ILogScanner.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ILogScanner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; @@ -15,7 +15,7 @@ * You can obtain an implementation of this interface using the {@link LogScanner} annotation. * You will need a separate object per log you will be scanning. * - * @author Michael Baylis + * * */ public interface ILogScanner { @@ -96,8 +96,8 @@ public interface ILogScanner { /** * Convenience method for scan(Pattern.Compile("\Q" + searchString + "\E"), Pattern.Compile("\Q" + failString + "\E"), count) * - * @param searchText The text to search for - * @param failText Failure text to search for, can be null meaning no fail search + * @param searchString The text to search for + * @param failString Failure text to search for, can be null meaning no fail search * @param count at least how many occurrences of the searchText must exist * @return This log scanner for fluent calls * @throws FailTextFoundException If the failText was found @@ -144,7 +144,7 @@ public interface ILogScanner { * * @param searchPattern The regex to search for * @param failPattern Failure regex to search for, can be null meaning no fail search - * @param occurrence The occurrence to be returned + * @param occurrance The occurrence to be returned * @return The text of the searchPattern found * @throws MissingTextException The searchPattern was not found at all * @throws IncorrectOccurrencesException If the specified occurrence was not found @@ -155,9 +155,9 @@ public interface ILogScanner { /** * Convenience method for scanForMatch(Pattern.Compile("\Q" + searchString + "\E"), Pattern.Compile("\Q" + searchString + "\E"), occurrence) * - * @param searchText The text to search for - * @param failText Failure text to search for, can be null meaning no fail search - * @param occurrence The occurrence to be returned + * @param searchString The text to search for + * @param failString Failure text to search for, can be null meaning no fail search + * @param occurrance The occurrence to be returned * @return The text of the searchPattern found * @throws MissingTextException The searchPattern was not found at all * @throws IncorrectOccurrencesException If the specified occurrence was not found @@ -172,7 +172,7 @@ public interface ILogScanner { * * @param searchPattern The regex to search for * @param failPattern Failure regex to search for, can be null meaning no fail search - * @param occurrence The occurrence to be returned + * @param occurrance The occurrence to be returned * @return The text of the searchPattern found * @throws MissingTextException The searchPattern was not found at all * @throws IncorrectOccurrencesException If the specified occurrence was not found @@ -183,9 +183,9 @@ public interface ILogScanner { /** * Convenience method for scanForMatchSinceCheckpoint(Pattern.Compile("\Q" + searchString + "\E"), Pattern.Compile("\Q" + searchString + "\E"), occurrence) * - * @param searchText The text to search for - * @param failText Failure text to search for, can be null meaning no fail search - * @param occurrence The occurrence to be returned + * @param searchString The text to search for + * @param failString Failure text to search for, can be null meaning no fail search + * @param occurrance The occurrence to be returned * @return The text of the searchPattern found * @throws MissingTextException The searchString was not found at all * @throws IncorrectOccurrencesException If the specified occurrence was not found diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScannable.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScannable.java index 001041c88..788d81258 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScannable.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScannable.java @@ -1,7 +1,7 @@ /* - * Licensed Materials Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; @@ -12,7 +12,7 @@ * Examples with be a running batch job, docker container log or a linux server log. * * It is the intention that other Managers will provide IScannable objects for use within the Text Scan Manager - * @author Michael Baylis + * * */ public interface ITextScannable { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScanner.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScanner.java index daca811ee..3cda91c94 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScanner.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/ITextScanner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; @@ -20,7 +20,7 @@ *
* You can obtain an implementation of this interface using the {@link TextScanner} annotation. * - * @author Michael Baylis + * * */ public interface ITextScanner { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/IncorrectOccurrencesException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/IncorrectOccurrencesException.java index 9e2418b10..6aea7aee8 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/IncorrectOccurrencesException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/IncorrectOccurrencesException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/LogScanner.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/LogScanner.java index b456dd46d..5cd153380 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/LogScanner.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/LogScanner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; @@ -14,17 +14,11 @@ import dev.galasa.framework.spi.ValidAnnotatedFields; /** - *

* Fill this field with a Log Scanner object. - *

- * - *

+ * * Will only populate public {@link ILogScanner} fields. - *

- * - * @author Michael Baylis - * @see {@link ILogScanner} * + * @see ILogScanner */ @Retention(RUNTIME) @Target(FIELD) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/MissingTextException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/MissingTextException.java index 65acb653b..236c24ecb 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/MissingTextException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/MissingTextException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanException.java index aebe1bdac..4386d6702 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerException.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerException.java index 5eadb4cbc..6b474e178 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerException.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerField.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerField.java index 5f8a0b2b7..90af2ce3e 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerField.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanner.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanner.java index bfec48d4d..871438a82 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanner.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/TextScanner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan; @@ -14,17 +14,11 @@ import dev.galasa.framework.spi.ValidAnnotatedFields; /** - *

* Fill this field with a Text Scanner object. - *

* - *

* Will only populate public {@link ITextScanner} fields. - *

- * - * @author Michael Baylis - * @see {@link ITextScanner} * + * @see ITextScanner */ @Retention(RUNTIME) @Target(FIELD) diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/AbstractTextScannable.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/AbstractTextScannable.java index 121759b3b..ec6f2f779 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/AbstractTextScannable.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/AbstractTextScannable.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; @@ -13,7 +13,7 @@ /** * Abstract Text Scannable * - * @author Michael Baylis + * * */ public class AbstractTextScannable implements ITextScannable { diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/LogScannerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/LogScannerImpl.java index 05f44fcc0..6af1dfdc6 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/LogScannerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/LogScannerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScanManagerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScanManagerImpl.java index c14beb7d0..a952e88fe 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScanManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScanManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScannerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScannerImpl.java index 14592d074..e49c31070 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScannerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/TextScannerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.internal; import java.io.BufferedReader; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/package-info.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/package-info.java index 576d6470b..9bc0bbeb1 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/internal/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Galasa Text Scan Manager internal */ diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/package-info.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/package-info.java index eb977a81b..0d58e27c0 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/package-info.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Galasa Text Scan Manager */ diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/ITextScannerManagerSpi.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/ITextScannerManagerSpi.java index f55028b4b..bdeabe3fc 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/ITextScannerManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/ITextScannerManagerSpi.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.spi; import dev.galasa.textscan.ILogScanner; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/package-info.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/package-info.java index 153091eea..c972a2cad 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/main/java/dev/galasa/textscan/spi/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Galasa Text Scan Manager SPI */ diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/TestExceptions.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/TestExceptions.java index b80e81ade..c8fb1be06 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/TestExceptions.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/TestExceptions.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyInputStream.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyInputStream.java index 8d6d0f104..34d41e5ef 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyInputStream.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyInputStream.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableEmpty.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableEmpty.java index 52b183270..c159cf3c4 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableEmpty.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableEmpty.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableInputStream.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableInputStream.java index 0645dc375..c20d9731e 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableInputStream.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableInputStream.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableString.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableString.java index 0d88265a8..00add7ab6 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableString.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/DummyScannableString.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestAbstractTextScannable.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestAbstractTextScannable.java index 2a9604f03..48af1ddbd 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestAbstractTextScannable.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestAbstractTextScannable.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.internal; import static org.junit.Assert.assertEquals; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestLogScannerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestLogScannerImpl.java index 75214f808..dba62dd3a 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestLogScannerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestLogScannerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.internal; import static org.junit.Assert.assertEquals; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScanManagerImpl.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScanManagerImpl.java index 187f372bf..555617c00 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScanManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScanManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.textscan.internal; import static org.assertj.core.api.Assertions.assertThat; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamLargeFile.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamLargeFile.java index 36027e154..e38f068db 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamLargeFile.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamLargeFile.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScan.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScan.java index 52ef7b6d4..8f99e8ca4 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScan.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScan.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScanForMatch.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScanForMatch.java index 28bd4d026..6f6ce6a19 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScanForMatch.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplInputStreamScanForMatch.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplMultilineInterleavedScan.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplMultilineInterleavedScan.java index 57283a7e0..13b66c334 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplMultilineInterleavedScan.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplMultilineInterleavedScan.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScan.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScan.java index 205e409d3..d6a477c37 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScan.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScan.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScanForMatch.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScanForMatch.java index c99c480e6..71c58cacb 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScanForMatch.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplScannableScanForMatch.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScan.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScan.java index a62728d09..843559970 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScan.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScan.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScanForMach.java b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScanForMach.java index 8b63f641e..ef87ae16d 100644 --- a/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScanForMach.java +++ b/galasa-managers-parent/galasa-managers-core-parent/dev.galasa.textscan.manager/src/test/java/dev/galasa/textscan/internal/TestTextScannerImplStringScanForMach.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.textscan.internal; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/README.md b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/README.md new file mode 100644 index 000000000..1076e9b07 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/README.md @@ -0,0 +1,135 @@ +# Running the Db2 Manager IVT locally + +To run the Db2 manager IVT, it requires a Db2 instance to connect to. This can be achieved locally using [Db2 Community Edition for Docker](https://www.ibm.com/docs/en/db2/11.5?topic=deployments-db2-community-edition-docker). + +## Prerequisites + +You will need: + +- Docker engine (e.g. using [Rancher Desktop](https://rancherdesktop.io) or [colima](https://github.com/abiosoft/colima)) +- [galasactl](https://github.com/galasa-dev/cli/releases) +- Gradle 6.8.2 + +### Running on Apple Silicon + +**If you are not on an Apple Silicon machine (e.g. M1 MacBook), you can skip this section.** + +Since the Db2 Community Edition Docker image is only built for x86-based machines, if you are on an Apple Silicon machine, you can start an x86_64 Docker environment with Rosetta emulation, using [colima](https://github.com/abiosoft/colima). + +To do this: + +1. Install colima with `brew install colima` +2. Start the x86_64 Docker environment by running: + ```bash + colima start --arch x86_64 --vm-type=vz --vz-rosetta + ``` +3. Verify that your Docker context is set to the new `colima` context using `docker context ls`. The output should look like this: + ```bash + NAME DESCRIPTION DOCKER ENDPOINT ERROR + colima * colima unix:///Users/em/.colima/default/docker.sock + default Current DOCKER_HOST based configuration unix:///var/run/docker.sock + rancher-desktop Rancher Desktop moby context unix:///Users/em/.rd/docker.sock + ``` + +## Steps + +### 1. Running Db2 in a Docker container + +More guidance around running Db2 on different operating systems can be found [here](https://www.ibm.com/docs/en/db2/11.5?topic=system-linux). + +To run Db2 locally, you can start a Docker container as follows: + +1. Create a `.env_list` file with the following contents: + ``` + LICENSE=accept + DB2INSTANCE=db2inst1 + DB2INST1_PASSWORD=password + DBNAME=testdb + BLU=false + ENABLE_ORACLE_COMPATIBILITY=false + UPDATEAVAIL=NO + TO_CREATE_SAMPLEDB=false + REPODB=false + IS_OSXFS=true + PERSISTENT_HOME=false + HADR_ENABLED=false + ``` + + Note: the `DB2INSTANCE` and `DB2INST1_PASSWORD` values will be used as the credentials to connect to the Db2 server in the IVT. + +2. Pull the Db2 Docker image from ICR: + ```bash + docker pull icr.io/db2_community/db2 + ``` +3. Run a Db2 Docker container, making sure `/path/to/.env_list` is replaced with the actual absolute or relative path to the `.env_list` file you created earlier: + ```bash + docker run -h db2server --name db2server --restart=always --detach --privileged=true -p 50000:50000 --env-file /path/to/.env_list icr.io/db2_community/db2 + ``` +4. It may take a while for Db2 to start, so you can view the logs of the created Docker container until a `(*) Setup has completed` message appears: + ```bash + docker logs db2server -f + ``` + +5. Verify that the testdb database was created by logging into the Db2 Docker container: + ```bash + docker exec -ti db2server bash -c "su - db2inst1" + ``` + + Then, inside the Docker container, run: + ```bash + db2 list db directory + ``` + + The output should look like similar to the output below: + ```bash + [db2inst1@db2server ~]$ db2 list db directory + + System Database Directory + + Number of entries in the directory = 1 + + Database 1 entry: + + Database alias = TESTDB + Database name = TESTDB + Local database directory = /database/data + Database release level = 15.00 + Comment = + Directory entry type = Indirect + Catalog database partition number = 0 + Alternate server hostname = + Alternate server port number = + ``` + +### 2. Setting CPS properties and Credentials + +Once the Docker container running Db2 is working: + +1. Add the following properties to your `cps.properties` file: + + ```properties + db2.dse.instance.PRIMARY.name=DB2INST1 + db2.dse.schema.PRIMARY.name=testdb + db2.instance.DB2INST1.url=jdbc:db2://127.0.0.1:50000/testdb + db2.instance.DB2INST1.credentials=TESTDB + ``` + +2. Add the following properties to your `credentials.properties` file: + + ```properties + secure.credentials.TESTDB.username=db2inst1 + secure.credentials.TESTDB.password=password + ``` + +### 3. Running the Db2 manager IVT + +Having configured your `cps.properties` and `credentials.properties` files, you should now be able to run the Db2 manager IVT using `galasactl`: + +1. Build the `managers` project using the `build-locally.sh` script: + ```bash + ./build-locally -c + ``` +2. Run the Db2 manager IVT, replacing `0.34.0` with the relevant Galasa OBR version you wish to use: + ```bash + galasactl runs submit local --obr mvn:dev.galasa/dev.galasa.uber.obr/0.34.0/obr --class dev.galasa.db2.manager.ivt/dev.galasa.db2.manager.ivt.Db2ManagerIVT --log - + ``` \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/build.gradle index 0dd7a13b4..5a7ca8919 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'Galasa Db2 Manager IVTs' -version = '0.21.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-database-parent:dev.galasa.db2.manager') implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/settings.gradle index a096fe92f..8e2303842 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.db2.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.db2.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/java/dev/galasa/db2/manager/ivt/Db2ManagerIVT.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/java/dev/galasa/db2/manager/ivt/Db2ManagerIVT.java index 9fd7a60c1..d2d304958 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/java/dev/galasa/db2/manager/ivt/Db2ManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/java/dev/galasa/db2/manager/ivt/Db2ManagerIVT.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/resources/resources/Batch.txt b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/resources/Batch.txt similarity index 100% rename from galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/resources/resources/Batch.txt rename to galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager.ivt/src/main/resources/Batch.txt diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/bnd.bnd index ab89ca8e6..9257d2961 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/bnd.bnd @@ -2,10 +2,17 @@ Bundle-Name: Galasa Db2 Manager Export-Package: dev.galasa.db2,\ dev.galasa.db2.spi -Import-Package: !javax.validation.constraints, \ +Import-Package: jakarta.transaction, \ + jakarta.transaction.xa, \ + javax.transaction, \ + javax.transaction.xa, \ + !jakarta.enterprise.util, \ + !jakarta.interceptor, \ + !jakarta.enterprise.context, \ + !javax.validation.constraints, \ !com.ibm.bidiTools.bdlayout, \ !com.ibm.cics.server, \ - !com.ibm.dataaccess, \ + com.ibm.dataaccess, \ !COM.ibm.db2os390.sqlj.runtime, \ !com.ibm.jvm, \ !com.ibm.net, \ diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/build.gradle b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/build.gradle index 7e50268d0..d9a32487c 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/build.gradle @@ -4,10 +4,25 @@ plugins { description = 'Galasa Db2 Manager' -version = '0.24.0' +version = '0.35.0' dependencies { // implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation 'com.ibm.db2.jcc:db2jcc:db2jcc4' - implementation 'dev.galasa:jta:1.1' + implementation 'dev.galasa:jta:2.0.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = true + + diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/settings.gradle b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/settings.gradle index 5a5f81164..c1f00e938 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.db2.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.db2.manager' + diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Instance.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Instance.java index e444c6268..15a467e0d 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Instance.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Instance.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerException.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerException.java index 82a30bf13..38bd5bb5b 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerException.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerField.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerField.java index eeae48aee..265939cc4 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerField.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2ManagerField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2; @@ -11,7 +13,7 @@ /** * Annotation to capture the other db2 realted annotations from the test class * - * @author James Davies + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Schema.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Schema.java index 4508887d3..635715a8a 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Schema.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/Db2Schema.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Instance.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Instance.java index c1103af87..40ee8cf4d 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Instance.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Instance.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2; @@ -11,7 +13,7 @@ * * This connection must be established to connected a IDb2Schema to this database. * - * @author jamesdavies + * * */ public interface IDb2Instance { diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Schema.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Schema.java index df190bba0..5607c85d6 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Schema.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IDb2Schema.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2; @@ -12,7 +14,7 @@ * * Allows users to submit statements as string, or as a batch of statements from a file. * - * @author jamesdavies + * * */ public interface IDb2Schema { diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IResultMap.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IResultMap.java index 82dbe6418..a36bc8442 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IResultMap.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/IResultMap.java @@ -1,6 +1,8 @@ /* * Copyright contributors to the Galasa project - */ + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.db2; import java.math.BigDecimal; @@ -12,7 +14,7 @@ /** * A simple interface to provide easy access to multiple types of returns. * - * @author jamesdavies + * * */ public interface IResultMap { diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2InstanceImpl.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2InstanceImpl.java index 9ae739c0e..9462d789a 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2InstanceImpl.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2InstanceImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal; @@ -38,7 +40,7 @@ * This instance also provides the connection itself back to the tester for any complex usecases not * covered by the methods inside this manager. * - * @author jamesdavies + * * */ public class Db2InstanceImpl implements IDb2Instance{ diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2ManagerImpl.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2ManagerImpl.java index 017dbf9e4..ed1550f96 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2ManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2ManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal; @@ -42,7 +44,7 @@ * Provides two annotations, one for a Db2 Instance connections and one for * a Schema impl * - * @author jamesdavies + * * */ @Component(service = { IManager.class }) diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2SchemaImpl.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2SchemaImpl.java index 323b9c116..98fb58927 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2SchemaImpl.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/Db2SchemaImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal; @@ -56,7 +58,7 @@ * For any unsupported object types please gain a standard * sql connection from the IDb2Instance * - * @author jamesdavies + * * */ public class Db2SchemaImpl implements IDb2Schema{ diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/ResultMap.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/ResultMap.java index 752c4b611..83b9ed5a0 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/ResultMap.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/ResultMap.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal; @@ -17,7 +19,7 @@ * Result Map is a basic object for simple SQL statements returns. * * - * @author jamesdavies + * * */ public class ResultMap implements IResultMap{ diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2Credentials.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2Credentials.java index fe59495b8..3627ca2ed 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2Credentials.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2Credentials.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSEInstanceName.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSEInstanceName.java index da5a4acbe..62b1a340c 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSEInstanceName.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSEInstanceName.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSESchemaName.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSESchemaName.java index 8a6b2c4ee..3ceff9244 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSESchemaName.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2DSESchemaName.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2InstanceUrl.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2InstanceUrl.java index 7c09c7f64..4fb342763 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2InstanceUrl.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2InstanceUrl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2PropertiesSingleton.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2PropertiesSingleton.java index 1c9d3096b..df3440133 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2PropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/internal/properties/Db2PropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/spi/IDb2ManagerSpi.java b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/spi/IDb2ManagerSpi.java index d3d563ba7..44cb345ca 100644 --- a/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/spi/IDb2ManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-database-parent/dev.galasa.db2.manager/src/main/java/dev/galasa/db2/spi/IDb2ManagerSpi.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.db2.spi; @@ -14,7 +16,7 @@ * too before requesting a schema from that database, the connection will be initialised. * * - * @author jamesdavies + * * */ public interface IDb2ManagerSpi { diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/build.gradle b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/build.gradle index d620bb6d6..11a6018c5 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/build.gradle @@ -10,3 +10,15 @@ dependencies { implementation project(':galasa-managers-languages-parent:dev.galasa.java.manager') } +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = false +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseManagerField.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseManagerField.java index 94da9bf61..4aa1a8989 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseManagerField.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseManagerField.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime; import java.lang.annotation.ElementType; @@ -12,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Reece Williams + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseType.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseType.java index b7756e014..dc7a5047c 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseType.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseType.java @@ -1,7 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ - + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime; public enum EclipseType { diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseVersion.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseVersion.java index f195f4aae..581f8f3bc 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseVersion.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/EclipseVersion.java @@ -1,7 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ - + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime; public enum EclipseVersion { diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/IEclipseInstall.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/IEclipseInstall.java index ebbeabec4..07c0bbbf3 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/IEclipseInstall.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.manager/src/main/java/dev/galasa/eclipseruntime/IEclipseInstall.java @@ -1,14 +1,15 @@ /* -* Copyright contributors to the Galasa project -*/ - + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime; import dev.galasa.java.IJavaInstallation; /** * - * @author Reece Williams + * * */ public interface IEclipseInstall { diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/build.gradle b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/build.gradle index 818189838..46ef10945 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/build.gradle @@ -11,3 +11,15 @@ dependencies { implementation project(':galasa-managers-languages-parent:dev.galasa.java.manager') } +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = false +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseInstallUbuntu.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseInstallUbuntu.java index dd617f54d..578bc4e07 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseInstallUbuntu.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseInstallUbuntu.java @@ -1,7 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ - + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime.ubuntu; import java.lang.annotation.Retention; @@ -22,7 +23,7 @@ * Used to populate a {@link IEclipseInstallUbuntu} field *

* - * @author Reece Williams + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseUbuntuManagerField.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseUbuntuManagerField.java index 30a8eaf00..766f573a2 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseUbuntuManagerField.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/EclipseUbuntuManagerField.java @@ -1,7 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ - + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime.ubuntu; import java.lang.annotation.ElementType; @@ -13,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Reece Williams + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/IEclipseInstallUbuntu.java b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/IEclipseInstallUbuntu.java index 45225f41f..c80f7b2b5 100644 --- a/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/IEclipseInstallUbuntu.java +++ b/galasa-managers-parent/galasa-managers-ides-parent/dev.galasa.eclipseruntime.ubuntu.manager/src/main/java/dev/galasa/eclipseruntime/ubuntu/IEclipseInstallUbuntu.java @@ -1,7 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ - + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.eclipseruntime.ubuntu; import dev.galasa.eclipseruntime.IEclipseInstall; @@ -15,7 +16,7 @@ * Use a {@link EclipseInstallUbuntu} annotation to populate this field with *

* - * @author Reece Williams + * * */ diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/build.gradle b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/build.gradle index 8f50024ca..d0794c91f 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa Internal SEM Manager' -version = '0.25.0' +version = '0.36.0' dependencies { implementation files('jars/sem.jar') @@ -17,6 +17,19 @@ dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') - implementation 'org.apache.velocity:velocity:1.7' + implementation 'org.apache.velocity:velocity-engine-core:2.3' implementation 'org.apache.logging.log4j:log4j-1.2-api:2.17.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInput.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInput.java index a5ae67eef..1086e16d6 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInput.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInput.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInputs.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInputs.java index f3bc3e0e8..d4fcff80c 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInputs.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/CSDInputs.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotBuild.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotBuild.java index aadc61f5a..aa80fe201 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotBuild.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotBuild.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; @@ -12,7 +14,7 @@ * Requests that SEM does not build the Complex, used if the test wants to * build the CICS Regions itself * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotStartCICS.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotStartCICS.java index d9714fae2..457809f7c 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotStartCICS.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/DoNotStartCICS.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; @@ -12,7 +14,7 @@ * This annotation will inform the provisioning system (SEM) * not to start any CICS regions. * - * @author Ross Henderson + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerException.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerException.java index fee9c0ce0..202f8ea66 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerException.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerException.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import dev.galasa.cicsts.CicstsManagerException; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerField.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerField.java index f2443effa..f1290f7b5 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerField.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemManagerField.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; @@ -12,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemTopology.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemTopology.java index 1f6b7eee0..eb60d7492 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemTopology.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/SemTopology.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; @@ -11,7 +13,7 @@ /** * Represents a SEM topology to build a set of CICS regions from * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sit.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sit.java index c1126dd48..8f33ce024 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sit.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sit.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; @@ -22,7 +24,7 @@ * {@link @Sit}(parameter="SITPARM2",value="TWO")
*

* - * @author Michael Baylis + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sits.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sits.java index 3ce63e7df..5c3c74b4c 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sits.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/Sits.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem; import java.lang.annotation.ElementType; @@ -20,7 +22,7 @@ * }) *

* - * @author Michael Baylis + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/CsdInputGenerator.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/CsdInputGenerator.java index 702900cd1..99f3aa25e 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/CsdInputGenerator.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/CsdInputGenerator.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.io.BufferedReader; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java index 54cb94ab3..b02b026d6 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.time.Instant; @@ -593,4 +595,5 @@ private void rebuildRuntimeJob(CICSRegion region) throws CicstsManagerException // Perform a rebuild of the JCL buildCicsJcl(jobs.get(0)); } + } diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java index 05381af05..a217cdc87 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.io.ByteArrayInputStream; @@ -667,10 +669,10 @@ public void cicsProvisionBuild() throws ManagerException, ResourceUnavailableExc - private void retrieveOutput(String string, List jobs) { + private void retrieveOutput(String path, List jobs) { for(IZosBatchJob job : jobs) { try { - job.saveOutputToResultsArchive("sem/provision"); + job.saveOutputToResultsArchive(path); } catch (ZosBatchException e) { logger.error("Failed to archive output from " + job); } diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolApplids.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolApplids.java index e0bcab928..4c745866f 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolApplids.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolApplids.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolPorts.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolPorts.java index 76b4fceae..930a8b60e 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolPorts.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolPorts.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolResolver.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolResolver.java index 09b274235..2deadb7b9 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolResolver.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemPoolResolver.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import com.ibm.hursley.cicsts.test.sem.interfaces.complex.IPool; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemZosHandler.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemZosHandler.java index 86dd377cb..f0b10b0f6 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemZosHandler.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemZosHandler.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.io.BufferedReader; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SitGenerator.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SitGenerator.java index 446700628..0c87bd067 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SitGenerator.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SitGenerator.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/BaseModel.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/BaseModel.java index 2a6509a40..c57805819 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/BaseModel.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/BaseModel.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.properties; import dev.galasa.framework.spi.cps.CpsProperties; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/CicsBuild.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/CicsBuild.java index 35273f995..6ace76e27 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/CicsBuild.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/CicsBuild.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.properties; import dev.galasa.framework.spi.ConfigurationPropertyStoreException; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ExternalVersion.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ExternalVersion.java index 7b253aad1..7eeb102d5 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ExternalVersion.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ExternalVersion.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.sem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/InteralVersion.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/InteralVersion.java index 659437392..7b07aa100 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/InteralVersion.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/InteralVersion.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.sem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelApplids.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelApplids.java index 382f55123..c034ff684 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelApplids.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelApplids.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.properties; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelPorts.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelPorts.java index 1b95e8885..17e671529 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelPorts.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelPorts.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.properties; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelUrl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelUrl.java index 85e4f3497..4127133a4 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelUrl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/ModelUrl.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.sem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/SemPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/SemPropertiesSingleton.java index dc5fd64e1..8587a9f29 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/SemPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/properties/SemPropertiesSingleton.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.properties; import org.osgi.service.component.annotations.Activate; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/ApplidResourceMonitor.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/ApplidResourceMonitor.java index 2c587ba9e..574aa2ee6 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/ApplidResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/ApplidResourceMonitor.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.resourcemanagement; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/PortResourceMonitor.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/PortResourceMonitor.java index d4112d42a..940090bfb 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/PortResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/PortResourceMonitor.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.resourcemanagement; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/SemResourceManagement.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/SemResourceManagement.java index 0b5dc5020..b91696799 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/SemResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/resourcemanagement/SemResourceManagement.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.sem.internal.resourcemanagement; import java.util.concurrent.TimeUnit; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/build.gradle b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/build.gradle index ccb97ac9e..a37af53f8 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/build.gradle @@ -9,3 +9,17 @@ version = '0.21.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/settings.gradle b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/settings.gradle index a7cc24960..e963cdaea 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.java.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.java.manager' + diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/IJavaInstallation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/IJavaInstallation.java index cc5b7702d..8797295de 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/IJavaInstallation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/IJavaInstallation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerException.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerException.java index 3ccd3c9f8..69e73e855 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerException.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerField.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerField.java index e89107ac3..a0cd5eda1 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerField.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaType.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaType.java index e28c4cf6c..a38543b1b 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaType.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaType.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaVersion.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaVersion.java index 852966683..6e08c757d 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaVersion.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/JavaVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/JavaManagerImpl.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/JavaManagerImpl.java index 5510d9ae0..1e6a89343 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/JavaManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/JavaManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveCredentials.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveCredentials.java index 2b8942dea..ec1cb06c3 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveCredentials.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveCredentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveLocation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveLocation.java index 229610c2a..3eaac00b4 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveLocation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/CodeCoverageSaveLocation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DefaultVersion.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DefaultVersion.java index 30c04ee30..c206ce609 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DefaultVersion.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DefaultVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DownloadLocation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DownloadLocation.java index 5e042140f..75a7c1c59 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DownloadLocation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/DownloadLocation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JacocoAgentLocation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JacocoAgentLocation.java index ccc179b32..9d3b304b0 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JacocoAgentLocation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JacocoAgentLocation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JavaPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JavaPropertiesSingleton.java index ab369d89f..5f633ec44 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JavaPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/JavaPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/UseCodeCoverage.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/UseCodeCoverage.java index 767273cbf..a34a1ab63 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/UseCodeCoverage.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/internal/properties/UseCodeCoverage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/IJavaManagerSpi.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/IJavaManagerSpi.java index f8f814e35..19352f970 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/IJavaManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/IJavaManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.spi; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/JavaInstallationImpl.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/JavaInstallationImpl.java index bc35061d8..5184ddae8 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/JavaInstallationImpl.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.manager/src/main/java/dev/galasa/java/spi/JavaInstallationImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.spi; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/build.gradle b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/build.gradle index bb0b4f2ea..90fe25808 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/build.gradle @@ -10,3 +10,17 @@ dependencies { api project(':galasa-managers-unix-parent:dev.galasa.linux.manager') api project(':galasa-managers-languages-parent:dev.galasa.java.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/settings.gradle b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/settings.gradle index 6807cded2..c2c5351cd 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.java.ubuntu.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.java.ubuntu.manager' + + diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/IJavaUbuntuInstallation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/IJavaUbuntuInstallation.java index dd4042408..f1e85ff5b 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/IJavaUbuntuInstallation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/IJavaUbuntuInstallation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu; @@ -16,7 +16,7 @@ * Use a {@link JavaUbuntuInstallation} annotation to populate this field with *

* - * @author Michael Baylis + * * */ public interface IJavaUbuntuInstallation extends IJavaInstallation { diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuInstallation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuInstallation.java index b729bc5de..e341b0db0 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuInstallation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuInstallation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu; @@ -21,7 +21,7 @@ * Used to populate a {@link IJavaUbuntuInstallation} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerException.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerException.java index 0bedcd56e..21ae11c66 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerException.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerField.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerField.java index b006d71c3..bc21446f2 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerField.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/JavaUbuntuManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/internal/JavaUbuntuManagerImpl.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/internal/JavaUbuntuManagerImpl.java index 946853567..7476f2cf2 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/internal/JavaUbuntuManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/internal/JavaUbuntuManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu.internal; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/IJavaUbuntuManagerSpi.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/IJavaUbuntuManagerSpi.java index ec26bb9c3..a0bdbbd7e 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/IJavaUbuntuManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/IJavaUbuntuManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu.spi; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/JavaUbuntuInstallationImpl.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/JavaUbuntuInstallationImpl.java index 31bd32e07..d0abc8630 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/JavaUbuntuInstallationImpl.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.ubuntu.manager/src/main/java/dev/galasa/java/ubuntu/spi/JavaUbuntuInstallationImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.ubuntu.spi; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/build.gradle b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/build.gradle index 4548b2ee3..7d25efd38 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/build.gradle @@ -8,4 +8,19 @@ version = '0.21.0' dependencies { api project(':galasa-managers-windows-parent:dev.galasa.windows.manager') - api project(':galasa-managers-languages-parent:dev.galasa.java.manager')} + api project(':galasa-managers-languages-parent:dev.galasa.java.manager') +} + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/settings.gradle b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/settings.gradle index b05d2e45e..19979fd15 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.java.windows.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.java.windows.manager' + diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/IJavaWindowsInstallation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/IJavaWindowsInstallation.java index ef2a9ba8a..2cb327601 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/IJavaWindowsInstallation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/IJavaWindowsInstallation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows; @@ -16,7 +16,7 @@ * Use a {@link JavaWindowsInstallation} annotation to populate this field with *

* - * @author Michael Baylis + * * */ public interface IJavaWindowsInstallation extends IJavaInstallation { diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsInstallation.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsInstallation.java index 20bf558be..49a4417db 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsInstallation.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsInstallation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows; @@ -21,7 +21,7 @@ * Used to populate a {@link IJavaWindowsInstallation} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerException.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerException.java index 29a49d846..b54c673cc 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerException.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerField.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerField.java index a6a75145e..76b03b77f 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerField.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/JavaWindowsManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/internal/JavaWindowsManagerImpl.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/internal/JavaWindowsManagerImpl.java index 3484c768d..29a7ec80d 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/internal/JavaWindowsManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/internal/JavaWindowsManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/IJavaWindowsManagerSpi.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/IJavaWindowsManagerSpi.java index 465a3a185..8efd37261 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/IJavaWindowsManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/IJavaWindowsManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows.spi; diff --git a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/JavaWindowsInstallationImpl.java b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/JavaWindowsInstallationImpl.java index e30b98819..6f64d3f94 100644 --- a/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/JavaWindowsInstallationImpl.java +++ b/galasa-managers-parent/galasa-managers-languages-parent/dev.galasa.java.windows.manager/src/main/java/dev/galasa/java/windows/spi/JavaWindowsInstallationImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.java.windows.spi; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/build.gradle index bbdb83909..9efe5d568 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/build.gradle @@ -10,3 +10,17 @@ dependencies { implementation project(':galasa-managers-logging-parent:dev.galasa.elasticlog.manager') implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/settings.gradle index c907026e1..450365e70 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.elasticlog.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.elasticlog.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/src/main/java/dev/galasa/elasticlog/manager/ivt/ElasticLogManagerIVT.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/src/main/java/dev/galasa/elasticlog/manager/ivt/ElasticLogManagerIVT.java index 3d43a98e1..d7e788e47 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/src/main/java/dev/galasa/elasticlog/manager/ivt/ElasticLogManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager.ivt/src/main/java/dev/galasa/elasticlog/manager/ivt/ElasticLogManagerIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/build.gradle b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/build.gradle index ded9d1604..0f6055e34 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/build.gradle @@ -4,9 +4,22 @@ plugins { description = 'Galasa ElasticLog Manager' -version = '0.21.0' +version = '0.32.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/settings.gradle b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/settings.gradle index e993ecdc8..bb02e8675 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.elasticlog.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.elasticlog.manager' + + diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerException.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerException.java index 3083930ef..18f794326 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerException.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.internal; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerImpl.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerImpl.java index b2457f858..5999a96d7 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/ElasticLogManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.internal; @@ -20,7 +20,6 @@ import org.osgi.service.component.annotations.Component; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import dev.galasa.ICredentials; @@ -40,6 +39,7 @@ import dev.galasa.framework.spi.creds.CredentialsException; import dev.galasa.framework.spi.creds.ICredentialsService; import dev.galasa.framework.spi.language.GalasaTest; +import dev.galasa.framework.spi.utils.GalasaGsonBuilder; import dev.galasa.http.HttpClientException; import dev.galasa.http.HttpClientResponse; import dev.galasa.http.IHttpClient; @@ -48,7 +48,7 @@ /** * ElasticLog Manager implementation * - * @author Richard Somers + * */ @Component(service = { IManager.class }) public class ElasticLogManagerImpl extends AbstractManager { @@ -71,10 +71,9 @@ public class ElasticLogManagerImpl extends AbstractManager { /** * Initialise the ElasticLogManager, adding a pointer to the other active managers * - * @param IFramework - the galasa framework - * @param List - list of all the managers - * @param List - list of all the active managers - * @param Class - the test class + * @param framework - the galasa framework + * @param allManagers - list of all the managers + * @param activeManagers - list of all the active managers * @throws ManagerException */ @Override @@ -101,8 +100,8 @@ public void initialise(@NotNull IFramework framework, @NotNull List al /** * Makes sure that the elastic log manager is added to the list of active managers, and adds the dependency on http manager. * - * @param List - list of all the managers - * @param List - list of the active managers + * @param allManagers - list of all the managers + * @param activeManagers - list of the active managers * @throws ManagerException */ @Override @@ -204,7 +203,7 @@ public void testClassResult(@NotNull String finalResult, Throwable finalExceptio this.runProperties.put("tags", tags.toArray(new String[tags.size()])); //Convert HashMap of run properties to a Json String - Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create(); + Gson gson = new GalasaGsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").getGson(); JsonObject json = gson.toJsonTree(this.runProperties).getAsJsonObject(); logger.info("Sending Run Request to ElasticLog Endpoint"); diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/package-info.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/package-info.java index b8f98b480..d8ebd653f 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * ElasticLog Manager * diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogCredentials.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogCredentials.java index 4d3bec19b..64f4fcd77 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogCredentials.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogCredentials.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.elasticlog.internal.properties; import dev.galasa.elasticlog.internal.ElasticLogManagerException; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogEndpoint.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogEndpoint.java index 526602abb..1ac9affc5 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogEndpoint.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogEndpoint.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogIndex.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogIndex.java index 16a4d6e4a..dec4ba53d 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogIndex.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogIndex.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogLocalRun.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogLocalRun.java index 91b19871c..718191d9f 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogLocalRun.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogLocalRun.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogPropertiesSingleton.java index 19b8a4fa8..ddee2ec7c 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.elasticlog.manager/src/main/java/dev/galasa/elasticlog/internal/properties/ElasticLogPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.elasticlog.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/build.gradle b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/build.gradle index d24100c5d..2f37b77fd 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'Galasa Phoenix 2 PME Manager' -version = '0.21.0' +version = '0.31.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/settings.gradle b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/settings.gradle index eff66c84b..47ff92e80 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.phoenix2.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.phoenix2.manager' + diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerException.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerException.java index 6303c841a..04ea0afd7 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerException.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerImpl.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerImpl.java index 815b0ca97..726aa4427 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/Phoenix2ManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal; @@ -46,7 +46,7 @@ /** * ElasticLog Manager implementation * - * @author Michael Baylis + * */ @Component(service = { IManager.class }) public class Phoenix2ManagerImpl extends AbstractManager { diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Credentials.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Credentials.java index b43984262..2394ccf47 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Credentials.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Credentials.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultBuildLevel.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultBuildLevel.java index f6e6d4105..ab4f16582 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultBuildLevel.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultBuildLevel.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultCustomBuild.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultCustomBuild.java index 07ba3155f..49bd61447 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultCustomBuild.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultCustomBuild.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultProductRelease.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultProductRelease.java index f66c2beaf..2afe0a3e3 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultProductRelease.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultProductRelease.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultTestingEnvironment.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultTestingEnvironment.java index ce9533235..9bef412a4 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultTestingEnvironment.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2DefaultTestingEnvironment.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Enabled.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Enabled.java index 07e1fbe0b..45c2b2d91 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Enabled.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Enabled.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Endpoint.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Endpoint.java index 026940429..eed5c9395 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Endpoint.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2Endpoint.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2LocalRun.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2LocalRun.java index 939f89a99..f0b5db01d 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2LocalRun.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2LocalRun.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2PropertiesSingleton.java b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2PropertiesSingleton.java index fca670396..86d736418 100644 --- a/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2PropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-logging-parent/dev.galasa.phoenix2.manager/src/main/java/dev/galasa/phoenix2/internal/properties/Phoenix2PropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.phoenix2.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/build.gradle index 530aa40b8..3181fdf98 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/build.gradle @@ -13,3 +13,17 @@ dependencies { implementation project(':galasa-managers-cloud-parent:dev.galasa.kubernetes.manager') implementation project(':galasa-managers-other-parent:dev.galasa.galasaecosystem.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/settings.gradle index bd3a326f5..020347ce1 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/settings.gradle @@ -1 +1,4 @@ -rootProject.name = 'dev.galasa.galasaecosystem.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.galasaecosystem.manager.ivt' + + + \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/src/main/java/dev/galasa/galasaecosystem/manager/ivt/EcosystemTest.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/src/main/java/dev/galasa/galasaecosystem/manager/ivt/EcosystemTest.java index ad472474f..827489fb7 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/src/main/java/dev/galasa/galasaecosystem/manager/ivt/EcosystemTest.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager.ivt/src/main/java/dev/galasa/galasaecosystem/manager/ivt/EcosystemTest.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/build.gradle b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/build.gradle index 13f9f7f55..456fcc664 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/build.gradle @@ -4,10 +4,10 @@ plugins { description = 'Galasa Ecosystem Manager' -version = '0.21.0' +version = '0.36.0' dependencies { - implementation 'commons-io:commons-io:2.9.0' + implementation 'commons-io:commons-io:2.16.1' implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') implementation project(':galasa-managers-cloud-parent:dev.galasa.kubernetes.manager') @@ -17,6 +17,20 @@ dependencies { api project(':galasa-managers-unix-parent:dev.galasa.linux.manager') api project(':galasa-managers-windows-parent:dev.galasa.windows.manager') api project(':galasa-managers-zos-parent:dev.galasa.zos.manager') - implementation 'org.yaml:snakeyaml:1.30' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'org.yaml:snakeyaml:2.0' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/settings.gradle b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/settings.gradle index bd3a326f5..aa26c7b19 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.galasaecosystem.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.galasaecosystem.manager' + diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/EcosystemEndpoint.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/EcosystemEndpoint.java index 1138669a6..d23232f9b 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/EcosystemEndpoint.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/EcosystemEndpoint.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; @@ -11,7 +11,7 @@ /** * Types of Endpoints for the Galasa Ecosystem * - * @author Michael Baylis + * * */ public enum EcosystemEndpoint { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerException.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerException.java index 2565d71dd..6e4aeaf00 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerException.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerField.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerField.java index 078e610d2..00ce335e2 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerField.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/GalasaEcosystemManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; @@ -13,7 +13,7 @@ /** * Annotation to identify manager controlled annotated fields * - * @author Michael Baylis + * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE }) diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IGenericEcosystem.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IGenericEcosystem.java index dc5394c38..88a9e21d9 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IGenericEcosystem.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IGenericEcosystem.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; @@ -16,7 +18,7 @@ * * Provides a means to manipulate the ecosystem * - * @author Michael Baylis + * * */ public interface IGenericEcosystem { @@ -32,7 +34,6 @@ public interface IGenericEcosystem { * Retrieve a CPS property from the host ecosystem * * @param namespace The namespace of the CPS - * @param property The property to retrieve * @return the value of the property or null if not found * @throws GalasaEcosystemManagerException if there is a problem accessing the CPS */ diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IKubernetesEcosystem.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IKubernetesEcosystem.java index ede8908cd..43c07a27e 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IKubernetesEcosystem.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IKubernetesEcosystem.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; @@ -12,7 +12,7 @@ * * Provides access to the ecosystem endpoints and provides the mean to manipulate the ecosystem * - * @author Michael Baylis + * * */ public interface IKubernetesEcosystem extends IGenericEcosystem { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/ILocalEcosystem.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/ILocalEcosystem.java index fcf6936d1..c64db4036 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/ILocalEcosystem.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/ILocalEcosystem.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; @@ -10,7 +12,7 @@ * * Provides access to the ecosystem endpoints and provides the mean to manipulate the ecosystem * - * @author Michael Baylis + * * */ public interface ILocalEcosystem extends IGenericEcosystem { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IsolationInstallation.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IsolationInstallation.java index 8a6f17a8a..f81f0437c 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IsolationInstallation.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/IsolationInstallation.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem; public enum IsolationInstallation { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/KubernetesEcosystem.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/KubernetesEcosystem.java index a65e81a5f..38b1c541b 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/KubernetesEcosystem.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/KubernetesEcosystem.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/LocalEcosystem.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/LocalEcosystem.java index 33c935d8f..d3abb2ed0 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/LocalEcosystem.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/LocalEcosystem.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/AbstractEcosystemImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/AbstractEcosystemImpl.java index 016556909..74200b02f 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/AbstractEcosystemImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/AbstractEcosystemImpl.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/GalasaEcosystemManagerImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/GalasaEcosystemManagerImpl.java index 287e4906c..3f2fa10db 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/GalasaEcosystemManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/GalasaEcosystemManagerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import java.lang.annotation.Annotation; @@ -35,6 +37,7 @@ import dev.galasa.framework.spi.ResourceUnavailableException; import dev.galasa.framework.spi.SharedEnvironmentRunType; import dev.galasa.framework.spi.language.GalasaTest; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.galasaecosystem.GalasaEcosystemManagerException; import dev.galasa.galasaecosystem.GalasaEcosystemManagerField; import dev.galasa.galasaecosystem.IKubernetesEcosystem; @@ -66,7 +69,7 @@ /** * The Galasa Ecosystem Manager * - * @author Michael Baylis + * * */ @Component(service = { IManager.class }) @@ -75,7 +78,7 @@ public class GalasaEcosystemManagerImpl extends AbstractManager implements ILogg public final static String NAMESPACE = "galasaecosystem"; private final Log logger = LogFactory.getLog(getClass()); private IDynamicStatusStoreService dss; - private final Gson gson = new Gson(); + private final GalasaGson gson = new GalasaGson(); private IArtifactManager artifactManager; private IHttpManagerSpi httpManager; @@ -549,7 +552,7 @@ protected IWindowsManagerSpi getWindowsManager() { } public Gson getGson() { - return this.gson; + return this.gson.getGson(); } public IDynamicStatusStoreService getDss() { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/IInternalEcosystem.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/IInternalEcosystem.java index ced239b4c..af49db919 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/IInternalEcosystem.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/IInternalEcosystem.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import dev.galasa.galasaecosystem.GalasaEcosystemManagerException; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/KubernetesEcosystemImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/KubernetesEcosystemImpl.java index 821a019a0..398c2fbf9 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/KubernetesEcosystemImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/KubernetesEcosystemImpl.java @@ -1,5 +1,7 @@ /* - * Copyright contributors to the Galasa project + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal; @@ -33,7 +35,6 @@ import org.apache.commons.logging.LogFactory; import org.yaml.snakeyaml.Yaml; -import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -47,7 +48,7 @@ import dev.galasa.framework.spi.IFramework; import dev.galasa.framework.spi.IRun; import dev.galasa.framework.spi.InsufficientResourcesAvailableException; -import dev.galasa.framework.spi.utils.GalasaGsonBuilder; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.galasaecosystem.EcosystemEndpoint; import dev.galasa.galasaecosystem.GalasaEcosystemManagerException; import dev.galasa.galasaecosystem.IKubernetesEcosystem; @@ -76,7 +77,7 @@ /** * Deploy the Ecsosystem into a Kubernetes Namespace * - * @author Michael Baylis + * * */ public class KubernetesEcosystemImpl extends AbstractEcosystemImpl implements IKubernetesEcosystem { @@ -89,7 +90,7 @@ public class KubernetesEcosystemImpl extends AbstractEcosystemImpl implements IK private final Yaml yaml = new Yaml(); - private final Gson gson = GalasaGsonBuilder.build(); + private final GalasaGson gson = new GalasaGson(); private String dockerVersion; private String dockerRegistry; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalEcosystemImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalEcosystemImpl.java index 146376c1a..1e182d0bd 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalEcosystemImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalEcosystemImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import java.io.IOException; @@ -13,11 +15,13 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; +import java.text.MessageFormat; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map.Entry; import java.util.Properties; import java.util.stream.Stream; @@ -30,7 +34,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.http.client.methods.CloseableHttpResponse; -import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; @@ -43,7 +46,7 @@ import dev.galasa.framework.spi.ConfigurationPropertyStoreException; import dev.galasa.framework.spi.IFramework; import dev.galasa.framework.spi.InsufficientResourcesAvailableException; -import dev.galasa.framework.spi.utils.GalasaGsonBuilder; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.galasaecosystem.EcosystemEndpoint; import dev.galasa.galasaecosystem.GalasaEcosystemManagerException; import dev.galasa.galasaecosystem.ILocalEcosystem; @@ -53,6 +56,7 @@ import dev.galasa.galasaecosystem.internal.properties.IsolatedFullZip; import dev.galasa.galasaecosystem.internal.properties.IsolatedMvpZip; import dev.galasa.galasaecosystem.internal.properties.MavenUseDefaultLocalRepository; +import dev.galasa.galasaecosystem.internal.properties.RunsTimeout; import dev.galasa.galasaecosystem.internal.properties.RuntimeRepo; import dev.galasa.galasaecosystem.internal.properties.RuntimeVersion; import dev.galasa.galasaecosystem.internal.properties.SimBankTestsVersion; @@ -91,7 +95,7 @@ public abstract class LocalEcosystemImpl extends AbstractEcosystemImpl implement private SimPlatformInstance simPlatformInstance; - private final Gson gson = GalasaGsonBuilder.build(); + private final GalasaGson gson = new GalasaGson(); private final ArrayList localRuns = new ArrayList<>(); @@ -99,6 +103,8 @@ public abstract class LocalEcosystemImpl extends AbstractEcosystemImpl implement private IFramework framework; + private int runsTimeout; + public LocalEcosystemImpl(@NotNull GalasaEcosystemManagerImpl manager, @NotNull String tag, @NotNull IJavaInstallation javaInstallation, @@ -168,6 +174,7 @@ protected void build(Path runHomeDirectory, Path homeDirectory) throws GalasaEco this.galasaBootVersion = GalasaBootVersion.get(); this.simplatformVersion = SimplatformVersion.get(); + this.runsTimeout = RunsTimeout.get(); switch(this.isolationInstallation) { case Full: @@ -379,7 +386,7 @@ private void downloadArtifactsViaMaven(Path homeDirectory) throws GalasaEcosyste @Override public JsonObject waitForRun(String runName) throws GalasaEcosystemManagerException { - return waitForRun(runName, 3); + return waitForRun(runName, runsTimeout); } @Override @@ -462,117 +469,227 @@ protected void addLocalRun(@NotNull LocalRun localRun) { this.localRuns.add(localRun); } - public void discard() { - + + private void discardRunIdPrefix() { // Release runid prefix - try { this.runIdPrefix.discard(); } catch (GalasaEcosystemManagerException e) { logger.warn("Failed to discard runid prefix from dss", e); } + } - // save all data in the stored artifacts - - Path saRoot = getEcosystemManager().getFramework().getResultArchiveStore().getStoredArtifactsRoot(); - Path saEcosystem = saRoot.resolve("ecosystem"); - - // CPS + private void saveArtifactFile(Path ecosystemRootFolderPath , Path sourceFilePath , String artifactName ) { try { - Files.copy(this.cpsFile, saEcosystem.resolve(cpsFile.getFileName().toString())); + Files.copy(cpsFile, ecosystemRootFolderPath.resolve(sourceFilePath.getFileName().toString())); } catch(Exception e) { - logger.warn("Failed to save the local ecosystem CPS",e); + logger.warn("Failed to save the local ecosystem "+artifactName,e); } + } - // DSS - try { - Files.copy(this.dssFile, saEcosystem.resolve(dssFile.getFileName().toString())); - } catch(Exception e) { - logger.warn("Failed to save the local ecosystem DSS",e); - } + private void saveArtifactFile( + Path targetRunFolderPath , + String runName, + Path sourceRasRunFolderPath , + String artifactName ) { - // overrides try { - Files.copy(this.overridesFile, saEcosystem.resolve(overridesFile.getFileName().toString())); + Path sourceFile = sourceRasRunFolderPath.resolve(artifactName); + if (Files.exists(sourceFile)) { + Files.copy(sourceFile, targetRunFolderPath.resolve(sourceFile.getFileName().toString())); + } } catch(Exception e) { - logger.warn("Failed to save the local ecosystem overrides",e); + logger.warn("Failed to copy run:" + runName + " artifact: "+artifactName,e); } + } - // bootstrap + private void saveBootstrap(Path bootstrapFile, Path ecosystemRootFolderPath) { try { - Files.copy(this.bootstrapFile, saEcosystem.resolve(bootstrapFile.getFileName().toString())); + if (bootstrapFile == null) { + throw new Exception("Programming logic error: Bootstrap file is null."); + } + + Path bootstrapFilePath = bootstrapFile.getFileName(); + if (bootstrapFilePath==null) { + throw new Exception("Programming logic error: Bootstrap file path is null."); + } + + String pathString = bootstrapFilePath.toString(); + logger.debug("Bootstrap file path : "+pathString); + + if (ecosystemRootFolderPath == null) { + throw new Exception("Programming logic error: ecosystemRootFolderPath is null."); + } + + Path ecosystemPath = ecosystemRootFolderPath.resolve(pathString); + if (ecosystemPath == null) { + throw new Exception("Programming logic error: ecosystemPath is null."); + } + logger.debug("ecosystemPath : "+pathString.toString()); + + Files.copy(bootstrapFile, ecosystemPath); + } catch(Exception e) { logger.warn("Failed to save the local ecosystem bootstrap",e); } + } - logger.info("Not saving credentials into stored artifacts for security reasons"); + public void discard() { + + discardRunIdPrefix(); - // copy all the run data - for(LocalRun run : this.localRuns) { - String runName = run.getRunName(); + // save all data in the stored artifacts - Path rasRun = this.rasDirectory.resolve(runName); - Path saRun = saEcosystem.resolve("runs").resolve(runName); + Path saRoot = getEcosystemManager().getFramework().getResultArchiveStore().getStoredArtifactsRoot(); + Path ecosystemRootFolder = saRoot.resolve("ecosystem"); - try { - Path runLog = rasRun.resolve("run.log"); - if (Files.exists(runLog)) { - Files.copy(runLog, saRun.resolve(runLog.getFileName().toString())); - } - } catch(Exception e) { - logger.warn("Failed to copy run " + runName + " run log",e); - } + if (ecosystemRootFolder == null) { + logger.warn("Failed to save the local ecosystem CPS,DSS,overrides: Programming logic error: ecosystemRootFolder is null."); + } else { + saveArtifactFile(cpsFile , ecosystemRootFolder, "CPS"); + saveArtifactFile(this.dssFile , ecosystemRootFolder, "DSS"); + saveArtifactFile(this.overridesFile , ecosystemRootFolder, "Overrides"); + + saveBootstrap(bootstrapFile, ecosystemRootFolder); - try { - Path structure = rasRun.resolve("structure.json"); - if (Files.exists(structure)) { - Files.copy(structure, saRun.resolve(structure.getFileName().toString())); - } - } catch(Exception e) { - logger.warn("Failed to copy run " + runName + " structure json",e); + logger.info("Not saving credentials into stored artifacts for security reasons"); + + saveRunsData( this.localRuns , this.rasDirectory, ecosystemRootFolder); + } + } + + /** + * A data bean class which represents an artifact. + * + * You can get these by reading an artifact metadata file. + */ + public static class ArtifactDescriptor { + private String path ; + private String contentType ; + + public ArtifactDescriptor(String path, String contentType) { + this.path = path ; + this.contentType = contentType; + } + + public String getPath() { + return this.path; + } + + public String getContentType() { + return this.contentType; + } + + @Override + public String toString() { + String template = "path: ''{0}'' contentType: ''{1}''"; + return MessageFormat.format(template,path,contentType); + } + } + + /** + * The artifacts are described by a metadata file. + * + * This is a properties file which has the form + * key=value + * + * Where key is the path into the RAS folder of the artifact. + * And value is the content type used to create the folder + * in the target RAS folder. + * + * Using this function to encapsulate the gathering of the artifact + * descriptor information from that file, in case the file format changes. + * eg: To a json file which has more information inside. + * + * Ideally, we would have an ArtifactMetadata object which housed the code which + * does saving, and loading of the data... + * + * @param sourceRasRunFolder + * @return A list of ArtifactDescriptor objects. + */ + private List getArtifacts(Path sourceRasRunFolder) throws IOException { + Path artifactsMetadataFile = sourceRasRunFolder.resolve("artifacts.properties"); + List artifacts = new ArrayList(); + Properties artifactProperties = new Properties(); + if (Files.exists(artifactsMetadataFile)) { + artifactProperties.load(Files.newInputStream(artifactsMetadataFile)); + + for(Entry entry : artifactProperties.entrySet()) { + + + String path = (String) entry.getKey(); + String pathNoLeadingSlash = path.substring(1); + + String contentType = (String) entry.getValue(); + ArtifactDescriptor artifact = new ArtifactDescriptor(pathNoLeadingSlash, contentType); + + artifacts.add(artifact); } + } + return artifacts ; + } + + private void saveRunsData( List localRuns , Path rasDirectory, Path ecosystemRootFolder ) { + + if (ecosystemRootFolder == null) { + logger.warn("Failed to save the local run log, structure, artifacts.properties, all other artifacts...etc : Programming logic error: saEcosystem is null."); + } else { + + // copy all the run data + for(LocalRun run : localRuns) { + String runName = run.getRunName(); + + Path rasRun = rasDirectory.resolve(runName); + + Path saRun = ecosystemRootFolder.resolve("runs").resolve(runName); + if (saRun==null) { + logger.warn("Failed to save artifacts for run "+runName+": Program logic error: saRun is null."); + } else { + // Save the framework files. + saveArtifactFile(saRun, runName, rasRun, "run.log"); + saveArtifactFile(saRun, runName, rasRun, "structure.json"); + saveArtifactFile(saRun, runName, rasRun, "artifacts.properties"); - try { - Path artifacts = rasRun.resolve("artifacts.properties"); - if (Files.exists(artifacts)) { - Files.copy(artifacts, saRun.resolve(artifacts.getFileName().toString())); + // Save the files that testcases/managers added. + saveTestCaseArtifactFiles(saRun, runName, rasRun); } - } catch(Exception e) { - logger.warn("Failed to copy run " + runName + " artifacts properties",e); } + } + } + private void saveTestCaseArtifactFiles(Path saRun, String runName, Path rasRun) { + try { + Path artifactsDirectory = rasRun.resolve("artifacts"); - try { - Properties artifacts = new Properties(); - Path artifactsFile = rasRun.resolve("artifacts.properties"); - Path artifactsDirectory = rasRun.resolve("artifacts"); - if (Files.exists(artifactsFile) && Files.exists(artifactsDirectory)) { - artifacts.load(Files.newInputStream(artifactsFile)); + // Don't bother going further if there is no artifacts folder + // where testcase-generated artifacts get stored. + if( Files.exists(artifactsDirectory) ) { - for(Entry entry : artifacts.entrySet()) { - String key = (String) entry.getKey(); - String value = (String) entry.getValue(); + List artifacts = getArtifacts(rasRun); + for( ArtifactDescriptor artifactDescriptor : artifacts ) { - try { - String artifactPath = key.substring(1); + try { + String artifactPath = artifactDescriptor.getPath(); + String contentType = artifactDescriptor.getContentType(); + + Path sourceArtifactPath = saRun.resolve(artifactPath); + Files.createDirectories(sourceArtifactPath.getParent()); - Path saArtifact = saRun.resolve(artifactPath); - Files.createDirectories(saArtifact.getParent()); - Path rasArtifact = artifactsDirectory.resolve(artifactPath); - ResultArchiveStoreContentType type = new ResultArchiveStoreContentType(value); + Path rasArtifact = artifactsDirectory.resolve(artifactPath); + ResultArchiveStoreContentType type = new ResultArchiveStoreContentType(contentType); - try (InputStream is = Files.newInputStream(rasArtifact); - OutputStream os = Files.newOutputStream(saArtifact, StandardOpenOption.CREATE_NEW, new SetContentType(type))) { - IOUtils.copy(is, os); - } - } catch(Exception e) { - logger.warn("Failed to copy run " + runName + " artifact " + key,e); + try (InputStream is = Files.newInputStream(rasArtifact); + OutputStream os = Files.newOutputStream(sourceArtifactPath, StandardOpenOption.CREATE_NEW, new SetContentType(type))) { + IOUtils.copy(is, os); } + + } catch(Exception e) { + logger.warn("Failed to copy run " + runName + " artifact " + artifactDescriptor,e); } } - } catch(Exception e) { - logger.warn("Failed to copy run " + runName + " artifacts",e); } + } catch(Exception e) { + logger.warn("Failed to copy run " + runName + " artifacts",e); } } diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalLinuxEcosystemImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalLinuxEcosystemImpl.java index 8591ae4af..aecdfb841 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalLinuxEcosystemImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalLinuxEcosystemImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalRun.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalRun.java index b4be0031e..637c67b39 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalRun.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalRun.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalWindowsEcosystemImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalWindowsEcosystemImpl.java index dfe342e35..6cba9be5f 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalWindowsEcosystemImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/LocalWindowsEcosystemImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import java.util.Properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/RunIdPrefixImpl.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/RunIdPrefixImpl.java index 2210c4663..41534f356 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/RunIdPrefixImpl.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/RunIdPrefixImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/SimPlatformInstance.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/SimPlatformInstance.java index 5bf86f4e6..9661364e8 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/SimPlatformInstance.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/SimPlatformInstance.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal; import java.net.InetSocketAddress; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/CentralRepo.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/CentralRepo.java index 38799805a..5cc0546cb 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/CentralRepo.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/CentralRepo.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerRegistry.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerRegistry.java index 78d51c410..71e6051b6 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerRegistry.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerRegistry.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; @@ -21,12 +21,12 @@ * * @galasa.required No * - * @galasa.default docker.galasa.dev + * @galasa.default docker.io * * @galasa.valid_values a valid hostname * * @galasa.examples - * galasaecosystem.docker.version=docker.galasa.dev + * galasaecosystem.docker.registry=docker.io * */ public class DockerRegistry extends CpsProperties { @@ -35,7 +35,7 @@ public static String get() throws GalasaEcosystemManagerException { try { String version = getStringNulled(GalasaEcosystemPropertiesSingleton.cps(), "docker", "registry") ; if (version == null) { - return "docker.galasa.dev"; + return "docker.io"; } return version; } catch (ConfigurationPropertyStoreException e) { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerVersion.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerVersion.java index ab518283f..0cd2ed09f 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerVersion.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/DockerVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaBootVersion.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaBootVersion.java index 2b750184e..d6c8c0692 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaBootVersion.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaBootVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaEcosystemPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaEcosystemPropertiesSingleton.java index 06b764070..344d84e91 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaEcosystemPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/GalasaEcosystemPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedFullZip.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedFullZip.java index 7109b60f2..a5a144c11 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedFullZip.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedFullZip.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedMvpZip.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedMvpZip.java index f4f81da22..892f06c6f 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedMvpZip.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/IsolatedMvpZip.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/KubernetesEcosystemTagSharedEnvironment.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/KubernetesEcosystemTagSharedEnvironment.java index 26bc98440..3497ab607 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/KubernetesEcosystemTagSharedEnvironment.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/KubernetesEcosystemTagSharedEnvironment.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/MavenUseDefaultLocalRepository.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/MavenUseDefaultLocalRepository.java index 30cf36826..9c1988970 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/MavenUseDefaultLocalRepository.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/MavenUseDefaultLocalRepository.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunIdPrefix.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunIdPrefix.java index a0dc09560..bd06901bc 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunIdPrefix.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunIdPrefix.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal.properties; import java.util.List; @@ -27,7 +29,7 @@ * default value is TEST{A-Z}{A-Z} *

* - * @author Michael Baylis + * * */ public class RunIdPrefix extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunsTimeout.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunsTimeout.java new file mode 100644 index 000000000..2065b87a1 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RunsTimeout.java @@ -0,0 +1,29 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.galasaecosystem.internal.properties; + +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.galasaecosystem.GalasaEcosystemManagerException; + +/** + * Timeout for Galasa Ecosystem manager nested test runs + * + * In minutes, how long the Galasa Ecosystem manager should wait for nested runs to complete before + * timing out. The default timeout value is 3 minutes. + * + * The property is:- + * galasaecosystem.runs.timeout + * + */ +public class RunsTimeout extends CpsProperties { + + private static final int DEFAULT_TIMEOUT_MINUTES = 3; + + public static int get() throws GalasaEcosystemManagerException { + return getIntWithDefault(GalasaEcosystemPropertiesSingleton.cps(), DEFAULT_TIMEOUT_MINUTES, "runs", "timeout"); + } + +} diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeRepo.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeRepo.java index 37f8c292e..a639e4642 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeRepo.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeRepo.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; @@ -29,7 +29,7 @@ * @galasa.valid_values Value URL * * @galasa.examples - * galasaecosystem.runtime.repository=https://nexus.galasa.dev/repository/maven-development + * galasaecosystem.runtime.repository=http://development.galasa.dev/main/maven-repo/obr * */ public class RuntimeRepo extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeVersion.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeVersion.java index 6965297fb..c9d9d138a 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeVersion.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/RuntimeVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimBankTestsVersion.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimBankTestsVersion.java index c19740aa4..a79e435cd 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimBankTestsVersion.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimBankTestsVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformDockerVersion.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformDockerVersion.java index 3bd8fd4c1..1ed16afe3 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformDockerVersion.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformDockerVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformRepo.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformRepo.java index 62ae0413e..71849ec67 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformRepo.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformRepo.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; @@ -29,7 +29,7 @@ * @galasa.valid_values Value URL * * @galasa.examples - * galasaecosystem.simplatform.repository=https://nexus.galasa.dev/repository/maven-development + * galasaecosystem.simplatform.repository=http://development.galasa.dev/main/maven-repo/obr * */ public class SimplatformRepo extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformVersion.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformVersion.java index dfde30b63..556563e9c 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformVersion.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/properties/SimplatformVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.galasaecosystem.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/GalasaEcosystemResourceManagement.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/GalasaEcosystemResourceManagement.java index ef2d205c1..6535e35f0 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/GalasaEcosystemResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/GalasaEcosystemResourceManagement.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal.resourcemanagement; import java.util.concurrent.TimeUnit; @@ -19,7 +21,7 @@ /** * Initialise the Resource Management routines for the Galasa Ecosystem Manager * - * @author Michael Baylis + * * */ @Component(service= {IResourceManagementProvider.class}) diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunIdPrefixMonitor.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunIdPrefixMonitor.java index 3a42a45c4..c721141da 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunIdPrefixMonitor.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunIdPrefixMonitor.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal.resourcemanagement; import java.util.HashSet; @@ -21,7 +23,7 @@ /** * Clean up the hanging runid prefixes * - * @author Michael Baylis + * * */ public class RunIdPrefixMonitor implements Runnable { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunResourceMonitor.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunResourceMonitor.java index 6218dd75d..93b73c26c 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/internal/resourcemanagement/RunResourceMonitor.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.galasaecosystem.internal.resourcemanagement; import java.util.HashSet; @@ -20,7 +22,7 @@ /** * Clean up the ecosystem properties when the run is deleted * - * @author Michael Baylis + * * */ public class RunResourceMonitor implements Runnable { diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/package-info.java b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/package-info.java index df7c12d47..fe8e2e551 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/package-info.java +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/java/dev/galasa/galasaecosystem/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Galasa Ecosystem Manager * diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/bootstrap-file.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/bootstrap-file.yaml similarity index 69% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/bootstrap-file.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/bootstrap-file.yaml index bd03289aa..8c1eb5782 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/bootstrap-file.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/bootstrap-file.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: ConfigMap metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config-grafana.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config-grafana.yaml similarity index 97% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config-grafana.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config-grafana.yaml index 4f1b560bd..4c24153d9 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config-grafana.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config-grafana.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: ConfigMap metadata: @@ -84,7 +90,7 @@ data: ;password = # Use either URL or the previous fields to configure the database - # Example: mysql://user:secret@host:port/database + # Example: mysql://user:secret@host:port/database #pragma: allowlist secret ;url = # For "postgres" only, either "disable", "require" or "verify-full" @@ -158,7 +164,7 @@ data: ;admin_user = admin # default admin password, can be changed before first start of grafana, or in profile settings - ;admin_password = admin + ;admin_password = admin #property is not used as it is commented out #pragma: allowlist secret # used for signing ;secret_key = SW2YcwTIb9zpOOhoPsMm @@ -270,7 +276,7 @@ data: ;enabled = false ;allow_sign_up = true ;client_id = some_id - ;client_secret = some_secret + ;client_secret = some_secret #property is not used as it is commented out #pragma: allowlist secret ;scopes = user:email,read:org ;auth_url = https://github.com/login/oauth/authorize ;token_url = https://github.com/login/oauth/access_token @@ -283,7 +289,7 @@ data: ;enabled = false ;allow_sign_up = true ;client_id = some_client_id - ;client_secret = some_client_secret + ;client_secret = some_client_secret #property is not used as it is commented out #pragma: allowlist secret ;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email ;auth_url = https://accounts.google.com/o/oauth2/auth ;token_url = https://accounts.google.com/o/oauth2/token @@ -296,7 +302,7 @@ data: ;name = OAuth ;allow_sign_up = true ;client_id = some_id - ;client_secret = some_secret + ;client_secret = some_secret #property is not used as it is commented out #pragma: allowlist secret ;scopes = user:email,read:org ;auth_url = https://foo.bar/login/oauth/authorize ;token_url = https://foo.bar/login/oauth/access_token @@ -317,7 +323,7 @@ data: ;enabled = false ;allow_sign_up = true ;client_id = some_id - ;client_secret = some_secret + ;client_secret = some_secret #property is not used as it is commented out #pragma: allowlist secret ;scopes = user:email ;allowed_organizations = diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config-prometheus.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config-prometheus.yaml similarity index 89% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config-prometheus.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config-prometheus.yaml index 84ee7b8e8..1c0ff3733 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config-prometheus.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config-prometheus.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: ConfigMap metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config.yaml similarity index 87% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config.yaml index 9e49d6a3a..086ce6922 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/config.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/config.yaml @@ -1,6 +1,11 @@ # -# The configuration properties for the Galasa Ecosystem +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 # + +# The configuration properties for the Galasa Ecosystem + apiVersion: v1 kind: ConfigMap metadata: @@ -29,4 +34,4 @@ data: # engine_memory_request: "300" # engine_memory_limit: "300" # run_poll: "20" -# run_poll_recheck: "5" \ No newline at end of file +# run_poll_recheck: "5" diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose-simbank.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose-simbank.yaml similarity index 90% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose-simbank.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose-simbank.yaml index 695114031..807a3a402 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose-simbank.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose-simbank.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Service metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose-testing.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose-testing.yaml similarity index 89% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose-testing.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose-testing.yaml index 8522fc5dd..e10da0aaa 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose-testing.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose-testing.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Service metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose.yaml similarity index 92% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose.yaml index 34fbec6d2..f7b4d6221 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/expose.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/expose.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Service metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-api.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-api.yaml similarity index 63% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-api.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-api.yaml index 58439c445..b74cec1ed 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-api.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-api.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-grafana.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-grafana.yaml similarity index 64% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-grafana.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-grafana.yaml index 837bc8897..cbe0f6fa0 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-grafana.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-grafana.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-prometheus.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-prometheus.yaml similarity index 64% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-prometheus.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-prometheus.yaml index 02a0577c2..b26452b46 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/pvc-prometheus.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/pvc-prometheus.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-api.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-api.yaml similarity index 96% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-api.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-api.yaml index 8972e48e7..e92f9e30e 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-api.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-api.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-cps-etcd3.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-cps-etcd3.yaml similarity index 98% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-cps-etcd3.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-cps-etcd3.yaml index 124e291b5..2afdca843 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-cps-etcd3.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-cps-etcd3.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-engine-controller.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-engine-controller.yaml similarity index 94% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-engine-controller.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-engine-controller.yaml index d081a45e6..c4f84fb77 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-engine-controller.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-engine-controller.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-grafana.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-grafana.yaml similarity index 95% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-grafana.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-grafana.yaml index a7f34dda3..ccff26592 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-grafana.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-grafana.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-metrics.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-metrics.yaml similarity index 93% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-metrics.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-metrics.yaml index 2207ba194..64a4eb756 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-metrics.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-metrics.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-prometheus.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-prometheus.yaml similarity index 94% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-prometheus.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-prometheus.yaml index 76d3bab69..50f4532ee 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-prometheus.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-prometheus.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-ras-couchdb.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-ras-couchdb.yaml similarity index 93% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-ras-couchdb.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-ras-couchdb.yaml index f7c3e3af2..b28b0f042 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-ras-couchdb.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-ras-couchdb.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-resource-monitor.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-resource-monitor.yaml similarity index 94% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-resource-monitor.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-resource-monitor.yaml index 82e0d3f72..95b5763aa 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-resource-monitor.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-resource-monitor.yaml @@ -1,6 +1,9 @@ # -# Copyright contributors to the Galasa project +# Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-simbank.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-simbank.yaml similarity index 95% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-simbank.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-simbank.yaml index 387fa70c5..95e0944e5 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/server-simbank.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/server-simbank.yaml @@ -1,6 +1,9 @@ # # Copyright contributors to the Galasa project # +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/testcatalog-file.yaml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/testcatalog-file.yaml similarity index 64% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/testcatalog-file.yaml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/testcatalog-file.yaml index b487cfcef..f586a2a10 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/k8s/testcatalog-file.yaml +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/k8s/testcatalog-file.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: ConfigMap metadata: diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/local/run.sh b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/local/run.sh similarity index 73% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/local/run.sh rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/local/run.sh index eb7c45640..d70a7b3ef 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/local/run.sh +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/local/run.sh @@ -1,5 +1,11 @@ #!/bin/bash +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + nohup ++JAVA_CMD++ -jar ++BOOT_JAR++ --bootstrap ++BOOTSTRAP++ --remotemaven ++MAVEN_REPO++ --localmaven ++MAVEN_LOCAL++ --obr mvn:dev.galasa/dev.galasa.uber.obr/++MAVEN_VERSION++/obr --trace $2 > $1 & diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/local/simplatform.sh b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/local/simplatform.sh similarity index 55% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/local/simplatform.sh rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/local/simplatform.sh index 8a0454d00..99d115523 100644 --- a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/local/simplatform.sh +++ b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/local/simplatform.sh @@ -1,5 +1,11 @@ #!/bin/bash +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + nohup ++JAVA_CMD++ -jar ++SIMPLATFORM_JAR++ > ++SIMPLATFORM_CONSOLE++ & echo PROCESS=$! diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/maven/pom.xml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/maven/pom.xml similarity index 100% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/maven/pom.xml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/maven/pom.xml diff --git a/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/maven/settings.xml b/galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/maven/settings.xml similarity index 100% rename from galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/resources/maven/settings.xml rename to galasa-managers-parent/galasa-managers-other-parent/dev.galasa.galasaecosystem.manager/src/main/resources/maven/settings.xml diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/build.gradle index 01da4d5be..6884b32f5 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/build.gradle @@ -4,10 +4,23 @@ plugins { description = 'Galasa JMeter Manager IVT' -version = '0.21.0' +version = '0.25.0' dependencies { implementation project(':galasa-managers-testingtools-parent:dev.galasa.jmeter.manager') implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = true diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/settings.gradle index 568edb9b9..b98a3e27a 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.jmeter.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.jmeter.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/java/dev/galasa/jmeter/manager/ivt/JMeterManagerIVT.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/java/dev/galasa/jmeter/manager/ivt/JMeterManagerIVT.java index 4921eac27..f97bd4d71 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/java/dev/galasa/jmeter/manager/ivt/JMeterManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/java/dev/galasa/jmeter/manager/ivt/JMeterManagerIVT.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.jmeter.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; @@ -16,13 +21,7 @@ import dev.galasa.jmeter.JMeterManagerException; import dev.galasa.jmeter.JMeterSession; -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ - - @Test +@Test public class JMeterManagerIVT { @Logger diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/DynamicTest.jmx b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/DynamicTest.jmx similarity index 100% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/DynamicTest.jmx rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/DynamicTest.jmx diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/ExistingTest.jmx b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/ExistingTest.jmx similarity index 100% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/ExistingTest.jmx rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/ExistingTest.jmx diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/jmeter.properties b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/jmeter.properties similarity index 96% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/jmeter.properties rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/jmeter.properties index a002245bd..72cde0228 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/resources/resources/jmeter.properties +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager.ivt/src/main/res/jmeter.properties @@ -70,7 +70,7 @@ # By default, SSL session contexts are now created per-thread, rather than being shared. # The original behaviour can be enabled by setting the JMeter property to true -#https.sessioncontext.shared=false +#https.sessioncontext.shared= false # Be aware that https default protocol may vary depending on the version of JVM # See https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https @@ -140,7 +140,7 @@ # LoggerPanel display # default to false -#jmeter.loggerpanel.display=false +#jmeter.loggerpanel.display= false # Enable LogViewer Panel to receive log event even if closed # Enabled since 2.12 @@ -158,7 +158,7 @@ # HiDPI mode (default: false) # Activate a 'pseudo'-hidpi mode. Allows to increase size of some UI elements # which are not correctly managed by JVM with high resolution screens in Linux or Windows -#jmeter.hidpi.mode=false +#jmeter.hidpi.mode= false # To enable pseudo-hidpi mode change to true #jmeter.hidpi.mode=true # HiDPI scale factor @@ -290,7 +290,7 @@ remote_hosts=127.0.0.1 # When all initialization tries was made, test will fail if some remote engines are failed # Set following property to true to ignore failed nodes and proceed with test -#client.continue_on_fail=false +#client.continue_on_fail= false # To change the default port (1099) used to access the server: #server.rmi.port=1234 @@ -301,7 +301,7 @@ remote_hosts=127.0.0.1 # The jmeter server creates by default the RMI registry as part of the server process. # To stop the server creating the RMI registry: -#server.rmi.create=false +#server.rmi.create= false # Define the following property to cause JMeter to exit after the first test #server.exitaftertest=true @@ -316,7 +316,7 @@ remote_hosts=127.0.0.1 #server.rmi.ssl.keystore.file=rmi_keystore.jks # # Password of Keystore -#server.rmi.ssl.keystore.password=changeit +#server.rmi.ssl.keystore.password=changeit #property is not used as it is commented out #pragma: allowlist secret # # Key alias #server.rmi.ssl.keystore.alias=rmi @@ -328,10 +328,10 @@ remote_hosts=127.0.0.1 #server.rmi.ssl.truststore.file=rmi_keystore.jks # # Password of Trust store -#server.rmi.ssl.truststore.password=changeit +#server.rmi.ssl.truststore.password=changeit #property is not used as it is commented out #pragma: allowlist secret # # Set this if you don't want to use SSL for RMI -#server.rmi.ssl.disable=false +#server.rmi.ssl.disable= false #--------------------------------------------------------------------------- # Include Controller #--------------------------------------------------------------------------- @@ -347,7 +347,7 @@ remote_hosts=127.0.0.1 # Should JMeter add to POST request content-type header if missing: # Content-Type: application/x-www-form-urlencoded # Was true before version 5.0 -#post_add_content_type_if_missing=false +#post_add_content_type_if_missing= false #--------------------------------------------------------------------------- # HTTP Java configuration @@ -394,7 +394,7 @@ remote_hosts=127.0.0.1 # Should credentials be delegated to webservers when using # SPNEGO authentication -#kerberos.spnego.delegate_cred=false +#kerberos.spnego.delegate_cred= false #--------------------------------------------------------------------------- # Apache HttpComponents HTTPClient configuration (HTTPClient4) @@ -405,7 +405,7 @@ remote_hosts=127.0.0.1 #hc.parameters.file=hc.parameters # If true, default HC4 User-Agent will not be added -#httpclient4.default_user_agent_disabled=false +#httpclient4.default_user_agent_disabled= false # Preemptively send Authorization Header when BASIC auth is used #httpclient4.auth.preemptive=true @@ -417,7 +417,7 @@ remote_hosts=127.0.0.1 # This will retry Idempotent and non Idempotent requests # This should usually be false, but it can be useful # when testing against some Load Balancers like Amazon ELB -#httpclient4.request_sent_retry_enabled=false +#httpclient4.request_sent_retry_enabled= false # Idle connection timeout (Milliseconds) to apply if the server does not send # Keep-Alive headers (default 0) @@ -439,11 +439,11 @@ remote_hosts=127.0.0.1 # Ignore EOFException that some edgy application may emit to signal end of GZIP stream # Defaults to false -#httpclient4.gzip_relax_mode=false +#httpclient4.gzip_relax_mode= false # Ignore EOFException that some edgy application may emit to signal end of Deflated stream # Defaults to false -#httpclient4.deflate_relax_mode=false +#httpclient4.deflate_relax_mode= false #--------------------------------------------------------------------------- # HTTP Cache Manager configuration @@ -499,9 +499,9 @@ remote_hosts=127.0.0.1 #jmeter.save.saveservice.label=true #jmeter.save.saveservice.response_code=true # response_data is not currently supported for CSV output -#jmeter.save.saveservice.response_data=false +#jmeter.save.saveservice.response_data= false # Save ResponseData for failed samples -#jmeter.save.saveservice.response_data.on_error=false +#jmeter.save.saveservice.response_data.on_error= false #jmeter.save.saveservice.response_message=true #jmeter.save.saveservice.successful=true #jmeter.save.saveservice.thread_name=true @@ -511,18 +511,18 @@ remote_hosts=127.0.0.1 #jmeter.save.saveservice.latency=true # Only available with HttpClient4 #jmeter.save.saveservice.connect_time=true -#jmeter.save.saveservice.samplerData=false -#jmeter.save.saveservice.responseHeaders=false -#jmeter.save.saveservice.requestHeaders=false -#jmeter.save.saveservice.encoding=false +#jmeter.save.saveservice.samplerData= false +#jmeter.save.saveservice.responseHeaders= false +#jmeter.save.saveservice.requestHeaders= false +#jmeter.save.saveservice.encoding= false #jmeter.save.saveservice.bytes=true # Only available with HttpClient4 #jmeter.save.saveservice.sent_bytes=true #jmeter.save.saveservice.url=true -#jmeter.save.saveservice.filename=false -#jmeter.save.saveservice.hostname=false +#jmeter.save.saveservice.filename= false +#jmeter.save.saveservice.hostname= false #jmeter.save.saveservice.thread_counts=true -#jmeter.save.saveservice.sample_count=false +#jmeter.save.saveservice.sample_count= false #jmeter.save.saveservice.idle_time=true # Timestamp format - this only affects CSV output files @@ -562,7 +562,7 @@ remote_hosts=127.0.0.1 # Setting this to true will result in less test results data loss in case of Crash # but with impact on performances, particularly for intensive tests (low or no pauses) # Since JMeter 2.10, this is false by default -#jmeter.save.saveservice.autoflush=false +#jmeter.save.saveservice.autoflush= false #--------------------------------------------------------------------------- # Settings that affect SampleResults @@ -582,7 +582,7 @@ sampleresult.timestamp.start=true # Since version 5.0 JMeter has a new SubResult Naming Policy which numbers subresults by default # This property if set to true discards renaming policy. This can be required if you're using JMeter for functional testing. # Defaults to: false -#subresults.disable_renaming=false +#subresults.disable_renaming= false #--------------------------------------------------------------------------- # Upgrade property @@ -622,7 +622,7 @@ upgrade_properties=/bin/upgrade.properties # relative paths. # If you want to test strict conformance, set this value to true # When the property is true, JMeter follows http://tools.ietf.org/html/rfc3986#section-5.2 -#jmeter.httpclient.strict_rfc2616=false +#jmeter.httpclient.strict_rfc2616= false # Default content-type include filter to use #proxy.content_type_include=text/html|text/plain|text/xml @@ -757,7 +757,7 @@ wmlParser.types=text/vnd.wap.wml #mode=Batch #mode=Statistical #Set to true to key statistical samples on threadName rather than threadGroup -#key_on_threadname=false +#key_on_threadname= false #mode=Stripped #mode=StrippedBatch #mode=org.example.load.MySampleSender @@ -1068,14 +1068,14 @@ csvdataset.file.encoding_list=UTF-8|UTF-16|ISO-8859-15|US-ASCII # If embedded resources download fails due to missing resources or other reasons, if this property is true # Parent sample will not be marked as failed -#httpsampler.ignore_failed_embedded_resources=false +#httpsampler.ignore_failed_embedded_resources= false #keep alive time for the parallel download threads (in seconds) #httpsampler.parallel_download_thread_keepalive_inseconds=60 # Don't keep the embedded resources response data : just keep the size and the md5 # default to false -#httpsampler.embedded_resources_use_md5=false +#httpsampler.embedded_resources_use_md5= false # List of extra HTTP methods that should be available in select box #httpsampler.user_defined_methods=VERSION-CONTROL,REPORT,CHECKOUT,CHECKIN,UNCHECKOUT,MKWORKSPACE,UPDATE,LABEL,MERGE,BASELINE-CONTROL,MKACTIVITY @@ -1093,7 +1093,7 @@ csvdataset.file.encoding_list=UTF-8|UTF-16|ISO-8859-15|US-ASCII # CookieManager behaviour - should Cookies be stored as variables? # Default is false -#CookieManager.save.cookies=false +#CookieManager.save.cookies= false # CookieManager behaviour - prefix to add to cookie name before storing it as a variable # Default is COOKIE_; to remove the prefix, define it as one or more spaces @@ -1108,16 +1108,16 @@ cookies=cookies # Ability to switch to Nashorn as default Javascript Engine used by IfController and __javaScript function # JMeter works as following: -# - JDK >= 8 and javascript.use_rhino=false or not set : Nashorn +# - JDK >= 8 and javascript.use_rhino= false or not set : Nashorn # - JDK >= 8 and javascript.use_rhino=true: Rhino # If you want to use Rhino on JDK8, set this property to true -#javascript.use_rhino=false +#javascript.use_rhino= false # Number of milliseconds to wait for a thread to stop #jmeterengine.threadstop.wait=5000 #Whether to invoke System.exit(0) in server exit code after stopping RMI -#jmeterengine.remote.system.exit=false +#jmeterengine.remote.system.exit= false # Whether to call System.exit(1) on failure to stop threads in non-GUI mode. # This only takes effect if the test was explicitly requested to stop. @@ -1128,7 +1128,7 @@ cookies=cookies # there were no failures and the test was not explicitly asked to stop. # Without this, the JVM may never exit if there are other threads spawned by # the test which never exit. -#jmeterengine.force.system.exit=false +#jmeterengine.force.system.exit= false # How long to pause (in ms) in the daemon thread before reporting that the JVM has failed to exit. # If the value is <= 0, the JMeter does not start the daemon thread @@ -1147,7 +1147,7 @@ cookies=cookies #Should JMeter expand the tree when loading a test plan? # default value is false since JMeter 2.7 -#onload.expandtree=false +#onload.expandtree= false #JSyntaxTextArea configuration #jsyntaxtextarea.wrapstyleword=true @@ -1183,10 +1183,10 @@ view.results.tree.renderers_order=.RenderAsText,.RenderAsRegexp,.RenderAsBoundar #JMS options # Enable the following property to stop JMS Point-to-Point Sampler from using # the properties java.naming.security.[principal|credentials] when creating the queue connection -#JMSSampler.useSecurity.properties=false +#JMSSampler.useSecurity.properties= false # Set the following value to true in order to skip the delete confirmation dialogue -#confirm.delete.skip=false +#confirm.delete.skip= false # Used by JSR223 elements # Size of compiled scripts cache @@ -1281,7 +1281,7 @@ system.properties=system.properties # Force throuput controllers that work in percentage mode to be a 100% # Disabled by default -#testplan_validation.tpc_force_100_pct=false +#testplan_validation.tpc_force_100_pct= false #--------------------------------------------------------------------------- # Think Time configuration @@ -1335,7 +1335,7 @@ jmeter.reportgenerator.apdex_tolerated_threshold=1500 # Switch that allows using Local documentation opened in JMeter GUI # By default we use Online documentation opened in Browser -#help.local=false +#help.local= false #--------------------------------------------------------------------------- # Documentation generation diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/build.gradle index 4f272681b..6ca387a85 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'Galasa JMeter Manager' -version = '0.21.0' +version = '0.25.0' dependencies { implementation project(':galasa-managers-cloud-parent:dev.galasa.docker.manager') - implementation 'org.apache.velocity:velocity:1.7' + implementation 'org.apache.velocity:velocity-engine-core:2.3' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/resources/Dockerfile b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/resources/Dockerfile deleted file mode 100644 index 4e0d3762c..000000000 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/resources/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM openjdk:8-jdk-alpine3.9 -LABEL maintainer="lukas.marivoet@ibm.com" -ENV MIRROR https://downloads.apache.org/jmeter/binaries -ENV JMETER_VERSION 5.2.1 -ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION} -ENV JMETER_BIN ${JMETER_HOME}/bin -ENV ALPN_VERSION 8.1.13.v20181017 -ENV PATH ${JMETER_BIN}:$PATH -COPY entrypoint.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/entrypoint.sh \ - && apk add --no-cache \ - curl \ - fontconfig \ - net-tools \ - shadow \ - su-exec \ - tcpdump \ - ttf-dejavu \ - && cd /tmp/ \ - && curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz ${MIRROR}/apache-jmeter-${JMETER_VERSION}.tgz \ - && curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz.sha512 ${MIRROR}/apache-jmeter-${JMETER_VERSION}.tgz.sha512 \ - && sha512sum -c apache-jmeter-${JMETER_VERSION}.tgz.sha512 \ - && mkdir -p /opt/ \ - && tar x -z -f apache-jmeter-${JMETER_VERSION}.tgz -C /opt \ - && rm -R -f apache* \ - && sed -i '/RUN_IN_DOCKER/s/^# //g' ${JMETER_BIN}/jmeter \ - && sed -i '/PrintGCDetails/s/^# /: "${/g' ${JMETER_BIN}/jmeter && sed -i '/PrintGCDetails/s/$/}"/g' ${JMETER_BIN}/jmeter \ - && chmod +x ${JMETER_HOME}/bin/*.sh \ - && jmeter --version \ - && curl --location --silent --show-error --output /opt/alpn-boot-${ALPN_VERSION}.jar https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/${ALPN_VERSION}/alpn-boot-${ALPN_VERSION}.jar \ - && rm -rf /tmp/* -ENV JVM_ARGS -Xbootclasspath/p:/opt/alpn-boot-${ALPN_VERSION}.jar -WORKDIR /jmeter -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/resources/entrypoint.sh b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/resources/entrypoint.sh deleted file mode 100644 index 89c1c7bdb..000000000 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/resources/entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/ash -mkdir /var/mail -groupadd --non-unique --gid ${JMETER_GROUP_ID:-1000} jmeter -useradd --non-unique --uid ${JMETER_USER_ID:-1000} --no-log-init --create-home --gid jmeter jmeter -chown jmeter:jmeter /jmeter -tail -f /dev/null diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/settings.gradle index f327327b7..55a7634f0 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.jmeter.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.jmeter.manager' + + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/IJMeterSession.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/IJMeterSession.java index 9ccac17d1..c9eba0acd 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/IJMeterSession.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/IJMeterSession.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.jmeter; @@ -60,9 +60,11 @@ public interface IJMeterSession { * JMX-files have to be prepared for this by replacing ALL the $P__VARIABLE notations with $VARIABLE notations * Then by adding neccesary parameters inside a HashMap with it, it is possible to change the target of a test dynamically inside the test * Example: - * HashMap map = new HashMap(); - * map.put("HOST", "galasa.dev"); - * session.setChangedParametersJmxFile(jmxStream, map); + *
+        HashMap map = new HashMap();
+        map.put("HOST", "galasa.dev");
+        session.setChangedParametersJmxFile(jmxStream, map);
+     
* @param jmxStream * @param parameters * @throws JMeterManagerException @@ -107,7 +109,6 @@ public interface IJMeterSession { /** * Giving jmeter instance a shutdown signal to finish and clean up all running tests - * @param timeout specifying a timeout in milliseconds * @throws JMeterManagerException */ public void stopTest() throws JMeterManagerException; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerException.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerException.java index 03e492feb..3fa312703 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerException.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.jmeter; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerField.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerField.java index c0db29b28..271070093 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerField.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.jmeter; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterSession.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterSession.java index eb0a3fae0..4afa57843 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterSession.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/JMeterSession.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.jmeter; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterManagerImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterManagerImpl.java index 5f095ab03..de4dc7e1e 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.jmeter.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterSessionImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterSessionImpl.java index 63dd79200..d874509d7 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterSessionImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/internal/JMeterSessionImpl.java @@ -1,9 +1,8 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.jmeter.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/package-info.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/package-info.java index 8038bac1e..d51faa30c 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/package-info.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.jmeter.manager/src/main/java/dev/galasa/jmeter/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * JMeter Manager diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/build.gradle new file mode 100644 index 000000000..d993f5c54 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'galasa.manager.ivt' +} + +description = 'Galasa SDV Manager IVT' + +version = '0.35.0' + +dependencies { + implementation project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.ceci.manager') + implementation project (':galasa-managers-core-parent:dev.galasa.core.manager') + implementation project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') + implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager') + implementation project (':galasa-managers-zos-parent:dev.galasa.zos.manager') + implementation project (':galasa-managers-core-parent:dev.galasa.artifact.manager') + implementation project (':galasa-managers-testingtools-parent:dev.galasa.sdv.manager') +} + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = false +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/settings.gradle new file mode 100644 index 000000000..96a5356df --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'dev.galasa.sdv.manager.ivt' \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/src/main/java/dev/galasa/sdv/manager/ivt/SdvManagerIVT.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/src/main/java/dev/galasa/sdv/manager/ivt/SdvManagerIVT.java new file mode 100644 index 000000000..d6383f238 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager.ivt/src/main/java/dev/galasa/sdv/manager/ivt/SdvManagerIVT.java @@ -0,0 +1,51 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.sdv.manager.ivt; + +import org.apache.commons.logging.Log; + +import static org.assertj.core.api.Assertions.assertThat; + +import dev.galasa.BeforeClass; +import dev.galasa.Test; +import dev.galasa.cicsts.CicsTerminal; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.core.manager.Logger; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.SdvUser; + + @Test + public class SdvManagerIVT { + + @Logger + public Log logger; + + @CicsTerminal(cicsTag = "SDVIVT") + public ICicsTerminal terminal; + + @SdvUser(cicsTag = "SDVIVT", roleTag = "R1") + public ISdvUser user1; + + private static final String SDV_TCPIPSERVICE_NAME = "SDVXSDT"; + + @BeforeClass + public void logIntoTerminals() throws SdvManagerException { + user1.logIntoTerminal(terminal); + } + + @Test + public void userUsesCeda() throws Exception { + + terminal.type("CEDA DI G(SDVGRP)").enter().waitForTextInField(SDV_TCPIPSERVICE_NAME); + + assertThat(terminal.searchText(SDV_TCPIPSERVICE_NAME)) + .as("Expectation to see " + SDV_TCPIPSERVICE_NAME + " in terminal").isTrue(); + terminal.pf3(); + } + + } + \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/bnd.bnd new file mode 100644 index 000000000..2c28add93 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/bnd.bnd @@ -0,0 +1,7 @@ +-snapshot: ${tstamp} +Bundle-Name: Galasa SDV Manager +Export-Package: dev.galasa.sdv +Import-Package: !javax.validation.constraints,\ + * + + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/build.gradle new file mode 100644 index 000000000..1b42d130a --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/build.gradle @@ -0,0 +1,102 @@ +plugins { + id 'galasa.manager' + id 'checkstyle' + id 'pmd' + id("com.github.spotbugs") version "6.0.20" +} + +description = 'Galasa SDV Manager' + +version = '0.36.0' + +checkstyle { + configFile = file("config/checkstyle/checkstyle.xml") + toolVersion = "10.14.2" +} + +// Apply a workaround to get checkstyle working with Gradle 6.x, +// this workaround is not required for later versions of Gradle. +if (project.getGradle().getGradleVersion().compareTo("7.0") < 0) { + configurations.all { + attributes { + attribute(Attribute.of('org.gradle.jvm.environment', String), 'standard-jvm') + } + } +} + +jacoco { + toolVersion = "0.8.7" +} + +pmd { + consoleOutput = true + toolVersion = "6.50.0" + ruleSetFiles = files("config/pmd/sdvrules.xml") + ruleSets = [] +} + +dependencies { + + implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') + implementation project(':galasa-managers-zos-parent:dev.galasa.zos3270.manager') + implementation project(':galasa-managers-cicsts-parent:dev.galasa.cicsts.manager') + implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') + implementation 'com.google.code.gson:gson:2.10.1' + + // Unit testing + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' + testImplementation 'org.mockito:mockito-core:5.3.1' + testImplementation 'org.mockito:mockito-junit-jupiter:5.3.1' + testImplementation 'commons-io:commons-io:2.16.1' +} + +test { + useJUnitPlatform() + maxHeapSize = '1G' + finalizedBy jacocoTestReport // report is always generated after tests run + enabled true +} + +tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { + excludeFilter = file("config/spotbugs/excludes.xml") + reports { + xml { + enabled = true + } + html { + enabled = true + } + } +} + +jacocoTestReport { + enabled true + dependsOn test // tests are required to run before generating the report +} + +jacocoTestCoverageVerification { + violationRules { + rule { + limit { + counter = 'LINE' + value = 'COVEREDRATIO' + minimum = 0.84 + } + } + } +} + +check.dependsOn jacocoTestCoverageVerification + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/checkstyle/checkstyle.xml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/checkstyle/checkstyle.xml new file mode 100644 index 000000000..f795191a7 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/checkstyle/checkstyle.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/pmd/sdvrules.xml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/pmd/sdvrules.xml new file mode 100644 index 000000000..dcc694c47 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/pmd/sdvrules.xml @@ -0,0 +1,317 @@ + + + SDV configuration of PMD. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/spotbugs/excludes.xml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/spotbugs/excludes.xml new file mode 100644 index 000000000..57a96c9ec --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/config/spotbugs/excludes.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/settings.gradle new file mode 100644 index 000000000..fa2508d23 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'dev.galasa.sdv.manager' diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/ISdvUser.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/ISdvUser.java new file mode 100644 index 000000000..e94d9c3ca --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/ISdvUser.java @@ -0,0 +1,38 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv; + +import dev.galasa.cicsts.ICicsTerminal; + +/** + * This class provides the interface for + * SDVUserImpl. + * + */ +public interface ISdvUser { + + String getCredentialsTag(); + + String getUsername(); + + String getPassword(); + + String getRole(); + + String getCicsTag(); + + String getSrrId(); + + Boolean isRecording(); + + void setSrrId(String srrId); + + void setNotRecording(); + + void logIntoTerminal(ICicsTerminal terminal) throws SdvManagerException; + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvManagerException.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvManagerException.java new file mode 100644 index 000000000..9d8d0fd06 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvManagerException.java @@ -0,0 +1,32 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv; + +import dev.galasa.ManagerException; + +/** + * This class provides a generic Exception which can be thrown + * throughout the SDV Manager. + * + */ +public class SdvManagerException extends ManagerException { + + private static final long serialVersionUID = 1L; + + public SdvManagerException() { + // This constructor is intentionally empty. Nothing special is needed here. + } + + public SdvManagerException(String message) { + super(message); + } + + public SdvManagerException(String message, Throwable cause) { + super(message, cause); + } + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvManagerField.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvManagerField.java new file mode 100644 index 000000000..165fadb03 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvManagerField.java @@ -0,0 +1,23 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Used to annotate annotations that are to be used for Test Class fields. To be populated by the + * Manager. + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface SdvManagerField { + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvUser.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvUser.java new file mode 100644 index 000000000..a7f8fdd72 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/SdvUser.java @@ -0,0 +1,41 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv; + +import dev.galasa.framework.spi.ValidAnnotatedFields; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * A zOS User that will have SDV recording switched on, on a specified CICS TS Region. + * + *

+ * Used to populate a {@link ISdvUser} field + *

+ * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD}) +@SdvManagerField +@ValidAnnotatedFields({ISdvUser.class}) +public @interface SdvUser { + + /** + * The tag of the CICS region the User is to be associated with. SDV Recording will take place + * for this user on this CICS Region. + */ + String cicsTag() default "PRIMARY"; + + /** + * The SDV manager will select a user from the zOS image pool user matching this roleTag. + */ + String roleTag(); + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/RecordingRegion.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/RecordingRegion.java new file mode 100644 index 000000000..3f95e389d --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/RecordingRegion.java @@ -0,0 +1,59 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import java.util.ArrayList; +import java.util.List; + +/** + * This class contains all required information to run SDV + * for a single CICS Region under test. + * + *

Each region has it own maintenance terminal to allow the + * creation, and tear down of required resources, and contains a + * list of all SDV Users being recorded on that region. + * + */ +class RecordingRegion { + + private ICicsTerminal maintenanceTerminal; + private List recordingUsers = new ArrayList<>(); + + public RecordingRegion(ICicsTerminal maintenanceTerminal) { + this.maintenanceTerminal = maintenanceTerminal; + } + + public ICicsTerminal getMaintenanceTerminal() { + return this.maintenanceTerminal; + } + + public Boolean addUserToRecord(ISdvUser user) throws SdvManagerException { + + // Check if user already exists in the list. This would mean + // the user had incorrectly been provisioned to a CICS region + // more than one by the pool code. In which case, this would + // be a bug + for (ISdvUser ru : recordingUsers) { + if (user.getUsername().equals(ru.getUsername())) { + throw new SdvManagerException("User '" + user.getUsername() + + "' has been allocated to more than one region in the test." + + " Please report this to the Galasa project."); + } + } + + recordingUsers.add(user); + return true; + } + + public List getRecordingUsers() { + return this.recordingUsers; + } + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvHttpRecorderImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvHttpRecorderImpl.java new file mode 100644 index 000000000..7e95e2246 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvHttpRecorderImpl.java @@ -0,0 +1,415 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import com.google.gson.JsonObject; +import dev.galasa.artifact.IArtifactManager; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.http.HttpClientException; +import dev.galasa.http.HttpClientResponse; +import dev.galasa.http.IHttpClient; +import dev.galasa.http.spi.IHttpManagerSpi; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.internal.properties.SdvPort; +import dev.galasa.zosbatch.spi.IZosBatchSpi; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * This class contains HTTP specific implementations of the SdvRecorderImpl abstract class. + * + *

A number of functions from SdvRecorderImpl are overridden to provide HTTP recorder-only + * functionality. In particular, the creation and teardown of HTTP specific resources, and the + * start/end of SDC recording via HTTP endpoints. + * + */ +public class SdvHttpRecorderImpl extends SdvRecorderImpl { + + private static final String TCPIPSERVICE_TEXT = "TCPIPSERVICE"; + private static final String SDV_TCPIPSERVICE_RESOURCE_NAME = "SDVXSDT"; + private static final String URIMAP_TEXT = "URIMAP"; + private static final String SDV_URIMAP_RESOURCE_NAME = "SDVXSDU"; + private static final String SDV_HTTP_ENDPOINT_PATH = "/DFHSDC"; + private static final String ON_CICS_REGION_MSG = "', on CICS Region "; + private static final String STATUS_CODE_MSG = ". Status code: "; + + private static final Log LOG = LogFactory.getLog(SdvHttpRecorderImpl.class); + + private IHttpManagerSpi httpManager; + + /** + * The HTTP recorder constructor, which instantiates super class SdvRecorderImpl, then + * additionally takes an http manager. + * + * @param framework - Galasa framework + * @param recordingRegions - A unique Map of CICS regions under test. + * @param artifactManager - Galasa Artifact Manager. + * @param batchManager - Galasa Batch Manager. + * @param storedArtifactRoot - The path where files should be stored to be included as test + * artifacts. + * @param dss - Galasa DSS. + * @param httpManager - Galasa HTTP Manager. + */ + public SdvHttpRecorderImpl(IFramework framework, Map recordingRegions, IArtifactManager artifactManager, + IZosBatchSpi batchManager, Path storedArtifactRoot, + IDynamicStatusStoreService dss, IHttpManagerSpi httpManager) { + super(framework, recordingRegions, artifactManager, batchManager, storedArtifactRoot, dss); + + this.httpManager = httpManager; + } + + @Override + protected void createCicsResources(ICicsRegion region, ICicsTerminal terminal) + throws SdvManagerException { + + // Deleting possible remains of a previous run + if (LOG.isInfoEnabled()) { + LOG.info("Deleting any existing resources on " + region.getApplid()); + } + try { + if (region.ceda().resourceExists(terminal, TCPIPSERVICE_TEXT, + SDV_TCPIPSERVICE_RESOURCE_NAME, CICS_RESOURCES_GROUP_NAME)) { + region.cemt().setResource(terminal, TCPIPSERVICE_TEXT, + SDV_TCPIPSERVICE_RESOURCE_NAME, "CLOSED"); + } + if (region.ceda().resourceExists(terminal, URIMAP_TEXT, SDV_URIMAP_RESOURCE_NAME, + CICS_RESOURCES_GROUP_NAME)) { + region.cemt().setResource(terminal, URIMAP_TEXT, SDV_URIMAP_RESOURCE_NAME, + "DISABLED"); + } + region.ceda().deleteGroup(terminal, CICS_RESOURCES_GROUP_NAME); + } catch (CicstsManagerException e) { + if (LOG.isDebugEnabled()) { + LOG.debug("CICS resource disabling expectedly failed on " + region.getApplid()); + } + } + + // Run common SDC pre-reqs + super.createCicsResources(region, terminal); + + // Run HTTP specific pre-reqs + // TCPIPSERVICE + if (LOG.isInfoEnabled()) { + LOG.info("Creating TCPIPSERVICE on " + region.getApplid()); + } + + String port = SdvPort.get(region.getTag()); + if (port == null) { + throw new SdvManagerException( + "Could not find SDC port in CPS properties for CICS tag: " + region.getTag() + ); + } + + try { + region.ceda().createResource(terminal, TCPIPSERVICE_TEXT, + SDV_TCPIPSERVICE_RESOURCE_NAME, CICS_RESOURCES_GROUP_NAME, + "TRANSACTION(CWXN) PORTNUMBER(" + port + ") AUTHENTICATE(BASIC)" + + "PROTOCOL(HTTP)"); + } catch (CicstsManagerException e) { + throw new SdvManagerException( + "Could not create TCPIPSERVICE on CICS Region " + region.getApplid(), e + ); + } + + // URIMAP + if (LOG.isInfoEnabled()) { + LOG.info("Creating URIMAP on " + region.getApplid()); + } + try { + region.ceda().createResource(terminal, URIMAP_TEXT, SDV_URIMAP_RESOURCE_NAME, + CICS_RESOURCES_GROUP_NAME, + "USAGE(SERVER) SCHEME(HTTP) PATH(" + SDV_HTTP_ENDPOINT_PATH + "*) TCPIPSERVICE(" + + SDV_TCPIPSERVICE_RESOURCE_NAME + ") " + + "PROGRAM(DFHXSJH) HOST(*) TRANSACTION(CXSD)"); + } catch (CicstsManagerException e) { + throw new SdvManagerException( + "Could not create URIMAP on CICS region " + region.getApplid(), e + ); + } + + try { + region.ceda().installGroup(terminal, CICS_RESOURCES_GROUP_NAME); + } catch (CicstsManagerException e) { + throw new SdvManagerException( + "Could not install SDV resource group on CICS region " + region.getApplid(), e + ); + } + } + + @Override + protected void deleteCicsResources(ICicsRegion region, ICicsTerminal terminal) { + + // URIMAP + if (LOG.isInfoEnabled()) { + LOG.info("Disabling URIMAP on " + region.getApplid()); + } + try { + region.cemt().setResource(terminal, URIMAP_TEXT, SDV_URIMAP_RESOURCE_NAME, "DISABLED"); + } catch (CicstsManagerException e) { + if (LOG.isErrorEnabled()) { + LOG.error("Could not create URIMAP on CICS Region " + region.getApplid()); + } + } + + // TCPIPSERVICE + if (LOG.isInfoEnabled()) { + LOG.info("Disabling TCPIPSERVICE on " + region.getApplid()); + } + try { + region.cemt().setResource(terminal, TCPIPSERVICE_TEXT, SDV_TCPIPSERVICE_RESOURCE_NAME, + "CLOSED"); + } catch (CicstsManagerException e) { + if (LOG.isErrorEnabled()) { + LOG.error("Could not create TCPIPSERVICE on CICS Region " + region.getApplid()); + } + } + + // Delete common SDC resources + super.deleteCicsResources(region, terminal); + } + + @Override + void startRecording() throws SdvManagerException { + for (Map.Entry entry : recordingRegions.entrySet()) { + for (ISdvUser recordingUser : entry.getValue().getRecordingUsers()) { + + if (LOG.isInfoEnabled()) { + LOG.info("Starting SDV Recording for CICS region: " + entry.getKey().getApplid() + + ", User: " + recordingUser.getUsername()); + } + try { + startRecordingUsingHttp(entry.getKey(), recordingUser); + + if (LOG.isInfoEnabled()) { + LOG.info("Recording CICS region: " + entry.getKey().getApplid() + ", User: " + + recordingUser.getUsername() + ", SRR ID: " + + recordingUser.getSrrId()); + } + } catch (SdvManagerException e) { + throw new SdvManagerException( + "Was unable to start recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + entry.getKey().getApplid(), e); + } + } + } + } + + private void startRecordingUsingHttp(ICicsRegion cicsRegion, ISdvUser recordingUser) + throws SdvManagerException { + + IHttpClient httpClient = this.httpManager.newHttpClient(); + + try { + httpClient.setURI(new URI("http://" + cicsRegion.getZosImage().getIpHost().getHostname() + + ":" + SdvPort.get(cicsRegion.getTag()))); + } catch (URISyntaxException e) { + throw new SdvManagerException( + "Badly formed URI for SDC service for CICS Region " + cicsRegion.getApplid(), e + ); + } + + HttpClientResponse response; + httpClient.setAuthorisation(recordingUser.getUsername(), recordingUser.getPassword()); + + // Check that an SDC isn't already running + Boolean sdcAlreadyRunning = false; + try { + response = httpClient.getJson(SDV_HTTP_ENDPOINT_PATH); + + if (response.getStatusCode() == 200) { + sdcAlreadyRunning = true; + } else if (response.getStatusCode() == 404) { + sdcAlreadyRunning = false; + } else { + JsonObject payload = response.getContent(); + String payloadStr = ""; + if (payload != null) { + payloadStr = payload.toString(); + } + + throw new SdvManagerException( + "Error whilst obtaining current SDC status for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + + STATUS_CODE_MSG + + response.getStatusCode() + "\n" + response.getStatusMessage() + + "\n" + payloadStr); + } + } catch (HttpClientException e) { + throw new SdvManagerException( + "Could not check status SDC recording status for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + + ". Is SDC activated?", e); + } + + // If an SDC is already running, stop it + if (sdcAlreadyRunning) { + try { + JsonObject body = new JsonObject(); + body.addProperty("submit", false); + response = httpClient.deleteJson(SDV_HTTP_ENDPOINT_PATH, body); + + if (response.getStatusCode() != 200) { + JsonObject payload = response.getContent(); + String payloadStr = ""; + if (payload != null) { + payloadStr = payload.toString(); + } + throw new SdvManagerException( + "Could not stop SDC recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + + STATUS_CODE_MSG + + response.getStatusCode() + + "\n" + response.getStatusMessage() + + "\n" + payloadStr); + } + } catch (HttpClientException e) { + throw new SdvManagerException("Could not stop existing SDC recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + ".", e); + } + } + + try { + JsonObject body = new JsonObject(); + response = httpClient.postJson(SDV_HTTP_ENDPOINT_PATH, body); + + if (response.getStatusCode() == 201) { + if (response.getContent().has("srr_id") + && !response.getContent().get("srr_id").getAsString().isBlank()) { + recordingUser.setSrrId(response.getContent().get("srr_id").getAsString()); + } else { + throw new SdvManagerException( + "SDC recording did not return an SRR ID for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + ); + } + } else { + JsonObject payload = response.getContent(); + String payloadStr = ""; + if (payload != null) { + payloadStr = payload.toString(); + } + throw new SdvManagerException( + "Could not start SDC recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + + STATUS_CODE_MSG + + response.getStatusCode() + + "\n" + response.getStatusMessage() + "\n" + payloadStr + ); + } + } catch (HttpClientException e) { + throw new SdvManagerException( + "Could not start SDC recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid(), e + ); + } + } + + @Override + void endRecording() throws SdvManagerException { + for (Map.Entry entry : recordingRegions.entrySet()) { + for (ISdvUser recordingUser : entry.getValue().getRecordingUsers()) { + if (recordingUser.isRecording()) { + if (LOG.isInfoEnabled()) { + LOG.info("Ending SDV Recording for region: " + entry.getKey().getApplid() + + ", User: " + recordingUser.getUsername() + ", SRR ID: " + + recordingUser.getSrrId()); + } + try { + stopRecordingUsingHttp(entry.getKey(), recordingUser); + } catch (SdvManagerException e) { + throw new SdvManagerException( + "Unable to stop SRR recording " + + recordingUser.getSrrId() + + ", for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + entry.getKey().getApplid(), e + ); + } + } + } + } + } + + private void stopRecordingUsingHttp(ICicsRegion cicsRegion, ISdvUser recordingUser) + throws SdvManagerException { + + IHttpClient httpClient = this.httpManager.newHttpClient(); + + try { + httpClient.setURI(new URI("http://" + cicsRegion.getZosImage().getIpHost().getHostname() + + ":" + SdvPort.get(cicsRegion.getTag()))); + } catch (URISyntaxException e) { + throw new SdvManagerException( + "Badly formed URI for SDC service for CICS Region " + cicsRegion.getApplid(), e + ); + } + + HttpClientResponse response; + httpClient.setAuthorisation(recordingUser.getUsername(), recordingUser.getPassword()); + + try { + JsonObject body = new JsonObject(); + body.addProperty("submit", false); + response = httpClient.deleteJson(SDV_HTTP_ENDPOINT_PATH, body); + + if (response.getStatusCode() != 200) { + JsonObject payload = response.getContent(); + String payloadStr = ""; + if (payload != null) { + payloadStr = payload.toString(); + } + throw new SdvManagerException( + "Could not stop SDC recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid() + + STATUS_CODE_MSG + + response.getStatusCode() + + "\n" + response.getStatusMessage() + + "\n" + payloadStr + ); + } + + recordingUser.setNotRecording(); + } catch (HttpClientException e) { + throw new SdvManagerException( + "Could not stop existing SDC recording for user '" + + recordingUser.getUsername() + + ON_CICS_REGION_MSG + + cicsRegion.getApplid(), e + ); + } + } + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvManagerImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvManagerImpl.java new file mode 100644 index 000000000..3f4e73f9c --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvManagerImpl.java @@ -0,0 +1,448 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.ICredentialsUsernamePassword; +import dev.galasa.ManagerException; +import dev.galasa.ProductVersion; +import dev.galasa.artifact.IArtifactManager; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.cicsts.spi.ICicsRegionProvisioned; +import dev.galasa.cicsts.spi.ICicstsManagerSpi; +import dev.galasa.framework.spi.AbstractManager; +import dev.galasa.framework.spi.AnnotatedField; +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.GenerateAnnotatedField; +import dev.galasa.framework.spi.IConfidentialTextService; +import dev.galasa.framework.spi.IConfigurationPropertyStoreService; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IManager; +import dev.galasa.framework.spi.ResourceUnavailableException; +import dev.galasa.framework.spi.Result; +import dev.galasa.framework.spi.creds.CredentialsException; +import dev.galasa.framework.spi.language.GalasaTest; +import dev.galasa.http.spi.IHttpManagerSpi; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.SdvManagerField; +import dev.galasa.sdv.SdvUser; +import dev.galasa.sdv.internal.properties.SdvHlq; +import dev.galasa.sdv.internal.properties.SdvPort; +import dev.galasa.sdv.internal.properties.SdvPropertiesSingleton; +import dev.galasa.sdv.internal.properties.SdvRole; +import dev.galasa.zosbatch.spi.IZosBatchSpi; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; +import javax.validation.constraints.NotNull; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.annotations.Component; + +/** + * This class acts as the entry points to the SDV manager + * by the Galasa framework, and implements various functions + * at various points throughout the test framework lifecycle. + * + *

It initialises the SDV manager, gathers all required + * config, assess which regions to record and what users, and + * intercepts and implements behaviour for test creation and + * teardown. + * + */ +@Component(service = {IManager.class}) +public class SdvManagerImpl extends AbstractManager { + + public static final String NAMESPACE = "sdv"; + + private static final Log LOG = LogFactory.getLog(SdvManagerImpl.class); + + // Dependencies on other managers + private ICicstsManagerSpi cicsManager; + private IZosBatchSpi batchManager; + private IHttpManagerSpi httpManager; + private IArtifactManager artifactManager; + private IDynamicStatusStoreService dss; + + private IConfidentialTextService cts; + + // User Pool management + private SdvUserPool sdvUserPool; + + // Local store of tested CICS regions, linked to their users and associated roles, each + // of which being recorded independently + private Map recordingRegions = new HashMap<>(); + + private Path storedArtifactRoot; + private SdvRecorderImpl sdvRecorder; + private List sdvUsersToRecordList = new ArrayList<>(); + + /** Define CF structure to be used when creating logstreams. */ + private static final String CFstructure = "LOG_GENERAL_001"; + + @Override + public void initialise(@NotNull IFramework framework, @NotNull List allManagers, + @NotNull List activeManagers, @NotNull GalasaTest galasaTest) + throws ManagerException { + super.initialise(framework, allManagers, activeManagers, galasaTest); + + // If this is not a java galasa test then exit + if (!galasaTest.isJava()) { + LOG.info("SDV recording is requested but is not eligible as this is not a Java test"); + return; + } + + // Check if SDV specific annotations exist. + // If not, don't use this manager. + List ourFields = findAnnotatedFields(SdvManagerField.class); + if (ourFields.isEmpty()) { + return; + } + + // Get access to the CPS so we can configure ourself + IConfigurationPropertyStoreService cps; + try { + cps = getFramework().getConfigurationPropertyService(NAMESPACE); + SdvPropertiesSingleton.setCps(cps); + } catch (ConfigurationPropertyStoreException e1) { + throw new SdvManagerException( + "Unable to access 'sdv' CPS namespace from framework services", + e1 + ); + } + + try { + this.dss = this.getFramework().getDynamicStatusStoreService(NAMESPACE); + } catch (DynamicStatusStoreException e) { + throw new SdvManagerException( + "Unable to access 'sdv' DSS namespace from framework services", + e + ); + } + + this.cts = framework.getConfidentialTextService(); + + // Initialise the SDV User pool manager + this.sdvUserPool = new SdvUserPool(this.getFramework(), dss, + this.getFramework().getResourcePoolingService()); + + this.storedArtifactRoot = getFramework().getResultArchiveStore().getStoredArtifactsRoot() + .resolve(NAMESPACE); + + // if we get here then we are required so add ourself to the list of active + // managers + youAreRequired(allManagers, activeManagers, galasaTest); + } + + @Override + public void youAreRequired(@NotNull List allManagers, + @NotNull List activeManagers, @NotNull GalasaTest galasaTest) + throws ManagerException { + + if (activeManagers.contains(this)) { + return; + } + + activeManagers.add(this); + + cicsManager = addDependentManager(allManagers, activeManagers, galasaTest, + ICicstsManagerSpi.class); + + if (cicsManager == null) { + throw new SdvManagerException("The CICS Manager is not available"); + } + + batchManager = + addDependentManager(allManagers, activeManagers, galasaTest, IZosBatchSpi.class); + if (batchManager == null) { + throw new SdvManagerException("The z/OS Batch Manager is not available"); + } + + artifactManager = addDependentManager(allManagers, activeManagers, galasaTest, + IArtifactManager.class); + if (artifactManager == null) { + throw new SdvManagerException("The Artifact Manager is not available"); + } + + httpManager = + addDependentManager(allManagers, activeManagers, galasaTest, IHttpManagerSpi.class); + if (httpManager == null) { + throw new SdvManagerException("The HTTP Manager is not available"); + } + } + + @Override + public boolean areYouProvisionalDependentOn(@NotNull IManager otherManager) { + if (otherManager instanceof ICicstsManagerSpi || otherManager instanceof IArtifactManager + || otherManager instanceof IHttpManagerSpi) { + return true; + } + + return super.areYouProvisionalDependentOn(otherManager); + } + + /** + * Provides what is returned by the SdvUser annotation. + * + *

It will obtain an available zOS user from a pool users, which + * matches the specified role. If no users are availble, this + * function will throw an ResourceUnavailableException exception + * which will result in the Galasa framework cancelling the test run, and + * requeuing it to reattempt the test again after a period of time. + * + *

The user will be added to the list of SDV Users within the + * RecordingRegion object. + * + * @param field - + * @param annotations - + * @return - ISdvUser + * @throws SdvManagerException generic errors encountered. + * @throws ResourceUnavailableException no available users in the pool. Galasa framework + * will handle. + */ + @GenerateAnnotatedField(annotation = SdvUser.class) + public ISdvUser getSdvUser(Field field, List annotations) + throws SdvManagerException, ResourceUnavailableException { + SdvUser annotation = field.getAnnotation(SdvUser.class); + + String cicsTag = defaultString(annotation.cicsTag(), "PRIMARY").toUpperCase(Locale.ROOT); + String roleTag = annotation.roleTag().toUpperCase(Locale.ROOT); + + if (roleTag.isBlank()) { + throw new SdvManagerException( + "SdvUser " + field.getName() + " cannot have a blank RoleTag."); + } + + String role = SdvRole.get(roleTag); + if (role == null) { + throw new SdvManagerException( + "Cannot find role. Please create or update CPS Property 'sdv.roleTag." + + roleTag + ".role'."); + } + + ICicsRegionProvisioned region = this.cicsManager.getTaggedCicsRegions().get(cicsTag); + if (region == null) { + throw new SdvManagerException( + "Unable to setup SDV User '" + field.getName() + "', for region with tag '" + + cicsTag + "' as a region with a matching 'cicsTag' tag was not found" + + ", or the region was not provisioned."); + } + + // Check a port has been given for the CICS region under test. + String port = SdvPort.get(region.getTag()); + if (port == null) { + throw new SdvManagerException( + "Could not find port. Please create or update CPS property 'sdv.cicsTag." + + region.getTag() + ".port'."); + } + + // Check an HLQ has been given for the CICS region under test. + String hlq = SdvHlq.get(region.getTag()); + if (hlq == null) { + throw new SdvManagerException( + "Could not find HLQ. Please create or update CPS property 'sdv.cicsTag." + + region.getTag() + ".hlq'."); + } + + // This can throw a ResourceUnavailableException, do not capture this + // let the framework handle it as it will re-queue the test for re-run + // later + String credentialTag = ""; + credentialTag = this.sdvUserPool.allocateUser(role, region); + + ICredentialsUsernamePassword credsObj = null; + try { + credsObj = (ICredentialsUsernamePassword) getFramework().getCredentialsService() + .getCredentials(credentialTag); + + cts.registerText(credsObj.getPassword(), + "Password for credential tag: " + credentialTag); + + } catch (CredentialsException e) { + throw new SdvManagerException( + "No credentials were found with the tag: " + credentialTag, e); + } + + SdvUserImpl newSdvUser = new SdvUserImpl(credentialTag, credsObj, cicsTag, role); + sdvUsersToRecordList.add(newSdvUser); + + return newSdvUser; + + } + + private void releaseUsers() throws CicstsManagerException { + // Release the users back to the pool + for (ISdvUser sdvUser : sdvUsersToRecordList) { + try { + SdvUserPool.deleteDss( + sdvUser.getCredentialsTag(), + cicsManager.locateCicsRegion(sdvUser.getCicsTag()).getApplid(), + getFramework().getTestRunName(), + this.dss + ); + } catch (DynamicStatusStoreException | CicstsManagerException e) { + if (LOG.isErrorEnabled()) { + LOG.error("Could not release SDV User: " + sdvUser.getCredentialsTag() + + ", on CICS region " + + cicsManager.locateCicsRegion(sdvUser.getCicsTag()).getApplid() + + ", for test run " + getFramework().getTestRunName(), e); + } + } + } + } + + @Override + public void provisionGenerate() throws ManagerException, ResourceUnavailableException { + + // *** Auto generate the fields + generateAnnotatedFields(SdvManagerField.class); + + // Create a list of regions, and their associated recordings + // per user + LOG.info("Populating list of CICS regions under test and recordings " + + "required for each user."); + + try { + for (Map.Entry entry : + cicsManager.getTaggedCicsRegions() + .entrySet()) { + + // Check CICS region is running version 750 or greater + if (entry.getValue().getVersion().isEarlierThan(ProductVersion.v(750))) { + if (LOG.isWarnEnabled()) { + LOG.warn("SDV recording will not take place on CICS region '" + + entry.getValue().getApplid() + + "'. Running version earlier than 750."); + } + continue; + } + + // Check CICS region has SEC=YES set + if (entry.getValue().getRegionJob().retrieveOutputAsString() + .contains("DFHXS1102I")) { + if (LOG.isWarnEnabled()) { + LOG.warn("SDV recording will not take place on CICS region '" + + entry.getValue().getApplid() + "'. Security is not active."); + } + continue; + } + + // Get list of users for this CICS region + List listOfUsersForRegion = + sdvUsersToRecordList.stream() + .filter(u -> entry.getKey().equals(u.getCicsTag())) + .collect(Collectors.toList()); + + if (!listOfUsersForRegion.isEmpty()) { + // Create maintenance terminal for CICS region as + // we know we definitely plan to record something there + // and will need this to create resources + ICicsTerminal terminal; + terminal = cicsManager.generateCicsTerminal(entry.getKey()); + RecordingRegion rr = new RecordingRegion(terminal); + recordingRegions.put(entry.getValue(), rr); + + // Add each SdvUser associated to the region to the + // list of recording Users on that region + for (ISdvUser sdvUser : listOfUsersForRegion) { + if (recordingRegions.get(entry.getValue()).addUserToRecord(sdvUser)) { + if (LOG.isInfoEnabled()) { + LOG.info("Will record - CICS Region: " + + entry.getValue().getApplid() + + ", User: " + sdvUser.getUsername() + ", Role: " + + sdvUser.getRole()); + } + } + } + } else { + if (LOG.isWarnEnabled()) { + LOG.warn( + "No users have been listed for recording via the " + + "SdvUser annotation for cicsTag '" + + entry.getValue().getTag() + + "'."); + } + } + } + LOG.info("Finished populating list of tested CICS regions and recordings " + + "required for each user/role."); + + // Create instance of the HTTP SDV recording tool + this.sdvRecorder = new SdvHttpRecorderImpl(getFramework(), recordingRegions, + artifactManager, batchManager, storedArtifactRoot, dss, httpManager); + } catch (ManagerException e) { + // If anything fails in here, we've already allocated the users, in + // which case, release them. + releaseUsers(); + throw e; + } + + } + + @Override + public void provisionStart() throws SdvManagerException { + // Create necessary resources to run SDV + sdvRecorder.prepareEnvironments(CFstructure); + } + + @Override + public void provisionStop() { + // SDV is ending, possibly via an exception + // so stop any known recordings & remove + // all resources + try { + sdvRecorder.endRecording(); + } catch (SdvManagerException e) { + LOG.error("Could not stop known SDC recordings in provisionStop.", e); + } + + try { + releaseUsers(); + } catch (CicstsManagerException e) { + LOG.error("Could not release SDV SdvUsers in provisionStop.", e); + } + + try { + sdvRecorder.cleanUpEnvironments(); + } catch (SdvManagerException e) { + LOG.error("Could not cleanup SDV environments in provisionStop.", e); + } + + } + + @Override + public void startOfTestClass() throws SdvManagerException { + // Start recording before test run + sdvRecorder.startRecording(); + } + + @Override + public Result endOfTestClass(@NotNull Result currentResult, Throwable currentException) + throws ManagerException { + + // Stop recording after test run + sdvRecorder.endRecording(); + + if (currentResult.isPassed()) { + sdvRecorder.exportRecordings(getFramework().getTestRun().getTestBundleName(), + getFramework().getTestRun().getTestClassName()); + } + + // We are not going to change the result + return super.endOfTestClass(currentResult, currentException); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvManagersResourceMonitor.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvManagersResourceMonitor.java new file mode 100644 index 000000000..1e70189af --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvManagersResourceMonitor.java @@ -0,0 +1,151 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.framework.spi.DssDelete; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.DynamicStatusStoreMatchException; +import dev.galasa.framework.spi.FrameworkException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IResourceManagement; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * This class provides specific implementation to monitor the number of running SDV managers. + * + */ +public class SdvManagersResourceMonitor implements Runnable { + + private static final Log LOG = LogFactory.getLog(SdvManagersResourceMonitor.class); + + private final IFramework framework; + private final IResourceManagement resourceManagement; + private final IDynamicStatusStoreService dss; + + private static final String PERIOD_REGEX = "\\."; + + /** + * SdvManagersResourceMonitor constructor. + * + * @param framework - Galasa framework. + * @param resourceManagement - Galasa Resource Management. + * @param dss - Galasa DSS. + */ + public SdvManagersResourceMonitor(IFramework framework, IResourceManagement resourceManagement, + IDynamicStatusStoreService dss) { + this.framework = framework; + this.resourceManagement = resourceManagement; + this.dss = dss; + LOG.info("SDV Managers resource monitor initialised"); + } + + @Override + public void run() { + LOG.info("Monitoring for SDV managers held up in active status"); + + try { + // Get the list of SDV manager props in the DSS + Map sdvManagersInDss = dss.getPrefix("manager.runningManagers"); + + Set allActiveRuns = this.framework.getFrameworkRuns().getActiveRunNames(); + + // Iterate through all SDV managers stored in the DSS + for (Map.Entry entry : sdvManagersInDss.entrySet()) { + // Split list of managers into array + Set initialRunList = + new HashSet(Arrays.asList(entry.getValue().split(","))); + + for (String runName : initialRunList) { + if (!allActiveRuns.contains(runName)) { + String removeRun = runName; + String removeCicsApplId = entry.getKey().split(PERIOD_REGEX)[2]; + + deleteDss(removeCicsApplId, removeRun); + } + } + } + } catch (FrameworkException e) { + LOG.error("Failure during scanning DSS for SDV Managers"); + } + + this.resourceManagement.resourceManagementRunSuccessful(); + LOG.info("Finished cleaning up SDV Manager activity"); + } + + /** + * Called when a Galasa test run ends or is removed. + * + * @param runName - Galasa test run name. + */ + public void runFinishedOrDeleted(String runName) { + + try { + // Get list of SDV Managers listed as active in the DSS + Map sdvManagersInDss = dss.getPrefix("manager.runningManagers"); + + for (Map.Entry entry : sdvManagersInDss.entrySet()) { + // Split list of managers into array + Set initialRunList = + new HashSet(Arrays.asList(entry.getValue().split(","))); + + // This SDV Manager belongs to the run + if (initialRunList.contains(runName)) { + String removeCicsApplId = entry.getKey().split(PERIOD_REGEX)[2]; + deleteDss(removeCicsApplId, runName); + } + } + } catch (FrameworkException e) { + if (LOG.isErrorEnabled()) { + LOG.error("Failure cleaning up SDV Managers for finished run " + runName); + } + } + } + + private void deleteDss(String cicsApplid, String run) + throws DynamicStatusStoreMatchException, DynamicStatusStoreException { + + Set currentRunList = + new HashSet(Arrays.asList( + dss.get("manager.runningManagers." + cicsApplid).split(",") + )); + + if (currentRunList.size() == 1) { + // This is the last manager against the region + // and is stale, so delete all manager entries for + // this region + if (LOG.isInfoEnabled()) { + LOG.info("Removing SDV Manager props for CICS region " + cicsApplid + + ", assigned to inactive run " + run); + } + + dss.performActions( + new DssDelete("manager.runningManagers." + cicsApplid, null), + new DssDelete("manager." + cicsApplid + ".sdcLive", null) + ); + + } else { + // There are other managers, which may be live, or not. + // leave it to the last manager standing to tidy up. + // Just remove this run from the list + if (LOG.isInfoEnabled()) { + LOG.info("Removing SDV Manager from list on CICS region " + cicsApplid + + ", assigned to inactive run " + run); + } + + currentRunList.remove(run); + + dss.put("manager.runningManagers." + cicsApplid, String.join(",", currentRunList)); + } + + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvRecorderImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvRecorderImpl.java new file mode 100644 index 000000000..1c17c07fb --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvRecorderImpl.java @@ -0,0 +1,554 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.artifact.IArtifactManager; +import dev.galasa.artifact.TestBundleResourceException; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.internal.properties.SdvHlq; +import dev.galasa.sdv.internal.properties.SdvSdcActivation; +import dev.galasa.sdv.internal.properties.SdvSrrLogstreamRemoval; +import dev.galasa.zosbatch.IZosBatchJob; +import dev.galasa.zosbatch.IZosBatchJobOutputSpoolFile; +import dev.galasa.zosbatch.ZosBatchException; +import dev.galasa.zosbatch.spi.IZosBatchSpi; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + + +/** + * This is the abstract base class for all SDV recorders. + * + *

It contains all common implementations for any SDV records. + * + *

It expects start/end recording functions to be overridden and implemented by specific child + * classes, but provides common resource creation/teardown, and YAML job generation. + * + */ +public abstract class SdvRecorderImpl { + + private static final Log LOG = LogFactory.getLog(SdvRecorderImpl.class); + + protected Map recordingRegions; + + private Path storedArtifactRoot; + private IArtifactManager artifactManager; + private IZosBatchSpi batchManager; + private IDynamicStatusStoreService dss; + private IFramework framework; + + protected static final String CICS_RESOURCES_GROUP_NAME = "SDVGRP"; + + private static final String DSS_MANAGER_PREFIX = "manager."; + private static final String DSS_RUNNING_MANAGERS_TAG = "runningManagers."; + private static final String DSS_SDC_LIVE_TAG = ".sdcLive"; + + /** + * SdvRecorderImpl constructor. + * + * @param framework - Galasa framework + * @param recordingRegions - A unique Map of CICS regions under test. + * @param artifactManager - Galasa Artifact Manager. + * @param batchManager - Galasa Batch Manager. + * @param storedArtifactRoot - The path where files should be stored to be included as test + * artifacts. + * @param dss - Galasa DSS. + */ + public SdvRecorderImpl(IFramework framework, Map recordingRegions, + IArtifactManager artifactManager, IZosBatchSpi batchManager, Path storedArtifactRoot, + IDynamicStatusStoreService dss) { + this.framework = framework; + this.recordingRegions = recordingRegions; + this.artifactManager = artifactManager; + this.batchManager = batchManager; + this.storedArtifactRoot = storedArtifactRoot; + this.dss = dss; + } + + abstract void startRecording() throws SdvManagerException; + + abstract void endRecording() throws SdvManagerException; + + /** + * Implements the full configuration of SDC on CICS regions under test. + * + *

It firstly consults the DSS to see if any other managers are running on a + * given CICS region, which will have already configured SDC. If no regions are found, and + * the SDV config states SDC should be configured, this manager adds an entry to the DSS to + * claim it will configure SDC. A list of running managers in the DSS is then created and + * updated. If another manager is found, this manager will only add to the list of running + * managers on the region and will skip SDC configuration. + * + *

See cleanUpEnvironments to see how the running manager list is used. + * + * @param cfStructure - Coupling Facility structure name to use when creating logstream. + * @throws SdvManagerException general error encountered. + */ + public void prepareEnvironments(String cfStructure) throws SdvManagerException { + for (Map.Entry entry : recordingRegions.entrySet()) { + try { + // Attempt to see if we are the first SDV manager working on the region, then + // create the runningManagers prop. Then configure SDC, if necessary. + if (LOG.isInfoEnabled()) { + LOG.info("Attempting to find other SDV managers running on " + + entry.getKey().getApplid()); + } + + if (dss.putSwap( + DSS_MANAGER_PREFIX + DSS_RUNNING_MANAGERS_TAG + entry.getKey().getApplid(), + null, framework.getTestRunName())) { + dss.put(DSS_MANAGER_PREFIX + entry.getKey().getApplid() + DSS_SDC_LIVE_TAG, + "false"); + + if (LOG.isInfoEnabled()) { + LOG.info("No other SDV managers found running on " + + entry.getKey().getApplid() + ". Created runningManagers list."); + } + + if (SdvSdcActivation.get(entry.getKey().getTag())) { + if (LOG.isInfoEnabled()) { + LOG.info( + "Activating SDC on CICS region: " + entry.getKey().getApplid()); + } + + createSrrLogstream(entry.getKey(), cfStructure); + createCicsResources(entry.getKey(), + entry.getValue().getMaintenanceTerminal()); + } + + dss.put(DSS_MANAGER_PREFIX + entry.getKey().getApplid() + DSS_SDC_LIVE_TAG, + "true"); + } else { + // We are not the first SDV manager running on the region, therefore + // SDC will already be set up (or is currently in the process of being set up), + // if necessary. + // Add to the running manager list only, and wait for SDC to be reported as live + // before continuing. + Set runningManagers = new HashSet( + Arrays.asList(dss.get(DSS_MANAGER_PREFIX + + DSS_RUNNING_MANAGERS_TAG + entry.getKey().getApplid()).split(","))); + + if (LOG.isInfoEnabled()) { + LOG.info(runningManagers.size() + " other SDV managers found running on " + + entry.getKey().getApplid() + ". Adding new manager to list."); + } + + runningManagers.add(framework.getTestRunName()); + dss.put( + DSS_MANAGER_PREFIX + DSS_RUNNING_MANAGERS_TAG + entry.getKey().getApplid(), + String.join(",", runningManagers)); + + // Wait for sdcLive to become True before continuing + if (LOG.isInfoEnabled()) { + LOG.info("Will wait for SDC to become live on " + + entry.getKey().getApplid()); + } + + int i = 0; + while (!"true".equals(dss.get( + DSS_MANAGER_PREFIX + entry.getKey().getApplid() + DSS_SDC_LIVE_TAG)) + && i++ < 20) { + if (LOG.isInfoEnabled()) { + LOG.info("SDC not live, reattempting on " + entry.getKey().getApplid() + + "..."); + } + Thread.sleep(1000); + } + + if (LOG.isInfoEnabled()) { + LOG.info( + "SDC made live by another SDV manager, continuing on " + + entry.getKey().getApplid() + ); + } + } + } catch (DynamicStatusStoreException | InterruptedException e) { + throw new SdvManagerException("Unable interact with DSS for SDV.", e); + } + } + } + + /** + * Implements the teardown of SDC on CICS regions under test. + * + *

It firstly consults the DSS to see if it is the last manager running on the given CICS + * region. If it is, and the SDV config states SDC should be configured, this manager will + * deconfigure SDC on the region and remove all resources. It will then remove entries from the + * DSS related to this. If more than one manager is found, this manager will only decrement the + * count of running managers on the region. + * + *

SRR Logstream removal is not done by default but can be configured to do so via the CPS + * properties. It would be essential to do this if provisioning a CICS region for the lifespan + * of the test run, to ensure no artifacts are left behind. + * + * @throws SdvManagerException general error encountered. + */ + public void cleanUpEnvironments() throws SdvManagerException { + for (Map.Entry entry : recordingRegions.entrySet()) { + + try { + if (LOG.isInfoEnabled()) { + LOG.info("Attempting to find other SDV managers running on " + + entry.getKey().getApplid()); + } + + // Get number of running SDV managers. + Set runningManagers = new HashSet( + Arrays.asList(dss.get(DSS_MANAGER_PREFIX + + DSS_RUNNING_MANAGERS_TAG + entry.getKey().getApplid()).split(","))); + + if (LOG.isInfoEnabled()) { + LOG.info(runningManagers + " SDV managers found running on " + + entry.getKey().getApplid() + "."); + } + + // If we are the last running for a + // region, clean up the resources on your way out, if necessary. + if (runningManagers.size() == 1) { + // Remove entry from DSS + if (LOG.isInfoEnabled()) { + LOG.info("Removing DSS entry, as this is the final SDV manager on " + + entry.getKey().getApplid() + "."); + } + + dss.delete( + DSS_MANAGER_PREFIX + DSS_RUNNING_MANAGERS_TAG + entry.getKey().getApplid() + ); + + if (SdvSdcActivation.get(entry.getKey().getTag())) { + if (LOG.isInfoEnabled()) { + LOG.info("Cleaning up CICS region after SDV recording: " + + entry.getKey().getApplid()); + } + + deleteCicsResources(entry.getKey(), + entry.getValue().getMaintenanceTerminal()); + } + + if (SdvSrrLogstreamRemoval.get(entry.getKey().getTag())) { + deleteSrrLogstream(entry.getKey()); + } + + dss.delete(DSS_MANAGER_PREFIX + entry.getKey().getApplid() + DSS_SDC_LIVE_TAG); + } else { + // We are not the SDV manager running, so just remove yourself + // from the equation & leave the last manager to do the tidying up + if (runningManagers != null) { + if (LOG.isInfoEnabled()) { + LOG.info( + "Removing " + framework.getTestRunName() + + " from running SDV manager list on " + entry.getKey().getApplid() + ); + } + + runningManagers.remove(framework.getTestRunName()); + + dss.put( + DSS_MANAGER_PREFIX + + DSS_RUNNING_MANAGERS_TAG + entry.getKey().getApplid(), + String.join(",", runningManagers) + ); + } + } + } catch (DynamicStatusStoreException e) { + throw new SdvManagerException("Unable interact with DSS for SDV.", e); + } + } + } + + /** + * Orchestrates the generation and storage of the Security YAML for each CICS region under test. + * + *

It loops through each CICS region under test, obtains the combined YAML + * for all users under test, then stores it as part of the test runs stored artifacts. + * + */ + public void exportRecordings(String testBundleName, String testClassName) + throws SdvManagerException { + for (Map.Entry entry : recordingRegions.entrySet()) { + if (LOG.isInfoEnabled()) { + LOG.info("Exporting SDV Security YAML for CICS region: " + + entry.getKey().getApplid()); + } + + String regionYaml = getRegionSecurityYaml(entry.getKey(), entry.getValue()); + storeYaml(entry.getKey(), regionYaml, testBundleName, testClassName); + } + } + + private void createSrrLogstream(ICicsRegion region, String cfStructure) + throws SdvManagerException { + + if (LOG.isInfoEnabled()) { + LOG.info("Attepmting to create LOGSTREAM on " + region.getApplid()); + } + + try { + Map attrs = new HashMap(); + attrs.put("OWNER", region.getRegionJob().getOwner()); + attrs.put("APPLID", region.getApplid()); + attrs.put("CFSTRUCT", cfStructure); + + String jcl = artifactManager.getBundleResources(this.getClass()) + .retrieveSkeletonFileAsString("/jcl/definelogstream.jcl", attrs).trim(); + + IZosBatchJob job = batchManager.getZosBatch(region.getZosImage()).submitJob(jcl, null); + int rc = job.waitForJob(); + if (rc == 12) { + if (LOG.isInfoEnabled()) { + LOG.info( + "Logstream not created, using existing, on CICS Region " + + region.getApplid() + + "." + ); + } + } else if (rc > 4) { + if (LOG.isWarnEnabled()) { + LOG.warn( + "JCL to define logstreams fail for CICS Region " + + region.getApplid() + + ", check artifacts for more details" + ); + } + } + } catch (ZosBatchException | TestBundleResourceException | IOException + | CicstsManagerException e) { + throw new SdvManagerException( + "Unable to run JCL to define logstreams for CICS Region " + + region.getApplid(), + e + ); + } + } + + private void deleteSrrLogstream(ICicsRegion region) throws SdvManagerException { + + if (LOG.isInfoEnabled()) { + LOG.info("Deleting LOGSTREAM on " + region.getApplid()); + } + + try { + Map attrs = new HashMap(); + attrs.put("OWNER", region.getRegionJob().getOwner()); + attrs.put("APPLID", region.getApplid()); + + String jcl = artifactManager.getBundleResources(this.getClass()) + .retrieveSkeletonFileAsString("/jcl/deletelogstreams.jcl", attrs).trim(); + + IZosBatchJob job = batchManager.getZosBatch(region.getZosImage()).submitJob(jcl, null); + int rc = job.waitForJob(); + if (rc > 4) { + throw new SdvManagerException( + "JCL to delete logstreams fail on CICS Region " + + region.getApplid() + + ", check artifacts for more details." + ); + } + } catch (ZosBatchException | TestBundleResourceException | IOException + | CicstsManagerException e) { + throw new SdvManagerException( + "Unable to run JCL to delete logstreams for CICS Region " + + region.getApplid(), + e + ); + } + + } + + protected void createCicsResources(ICicsRegion region, ICicsTerminal terminal) + throws SdvManagerException { + + // JOURNALMODEL + if (LOG.isInfoEnabled()) { + LOG.info("Creating JOURNALMODEL on " + region.getApplid()); + } + try { + region.ceda().createResource(terminal, "JOURNALMODEL", "SRR", CICS_RESOURCES_GROUP_NAME, + "JOURNALNAME(DFHSECR) DESCRIPTION(SRR JOURNAL) TYPE(MVS) STREAMNAME(" + + region.getRegionJob().getOwner() + "." + region.getApplid() + + ".DFHSECR)"); + } catch (CicstsManagerException e) { + throw new SdvManagerException( + "Could not create SRR JOURNALMODEL definition on CICS Region " + + region.getApplid() + + ".", + e + ); + } + + try { + region.ceda().installGroup(terminal, "DFHXSD"); + } catch (CicstsManagerException e) { + if (LOG.isInfoEnabled()) { + LOG.info( + "Couldn't install DFHXSD, already installed on CICS Region " + + region.getApplid() + ); + } + } + } + + protected void deleteCicsResources(ICicsRegion region, ICicsTerminal terminal) { + + if (LOG.isInfoEnabled()) { + LOG.info("Deleting the " + CICS_RESOURCES_GROUP_NAME + " group on " + + region.getApplid()); + } + try { + region.ceda().deleteGroup(terminal, CICS_RESOURCES_GROUP_NAME); + } catch (CicstsManagerException e) { + if (LOG.isErrorEnabled()) { + LOG.error( + "Could not delete the " + + CICS_RESOURCES_GROUP_NAME + + " on CICS Region " + + region.getApplid(), + e + ); + } + } + } + + private String getRegionSecurityYaml(ICicsRegion region, RecordingRegion recordingRegionData) + throws SdvManagerException { + + String yaml = ""; + try { + if (LOG.isInfoEnabled()) { + LOG.info("Building Security metadata job JCL for " + region.getApplid()); + } + Map attrs = new HashMap(); + attrs.put("OWNER", region.getRegionJob().getOwner()); + attrs.put("APPLID", region.getApplid()); + attrs.put("CICSHLQ", SdvHlq.get(region.getTag())); + + String jcl = artifactManager.getBundleResources(this.getClass()) + .retrieveSkeletonFileAsString("/jcl/getYaml.jcl", attrs).trim(); + + // Append to the JCL user and their role recorded on the region + // for the test + Boolean srrFound = false; + List srrIds = new ArrayList<>(); + for (ISdvUser recordingUser : recordingRegionData.getRecordingUsers()) { + if (recordingUser.getSrrId() != null) { + srrFound = true; + srrIds.add(recordingUser.getSrrId()); + jcl = jcl + "\nMATCHID=" + recordingUser.getSrrId() + "\nUSERID=" + + recordingUser.getUsername() + ",ROLE=" + recordingUser.getRole(); + } else { + if (LOG.isWarnEnabled()) { + LOG.warn("No SDC registered for user " + recordingUser.getUsername() + + " on region " + region.getApplid() + + ", skipping YAML generation."); + } + } + } + + if (!srrFound) { + return null; + } + + // Add final line indicating the end of the DDIN + jcl = jcl + "\n/*\n//"; + + if (LOG.isInfoEnabled()) { + LOG.info("Submitting Security metadata job JCL for " + region.getApplid()); + } + IZosBatchJob job = batchManager.getZosBatch(region.getZosImage()).submitJob(jcl, null); + int rc = job.waitForJob(); + + if (rc > 4) { + if (LOG.isErrorEnabled()) { + LOG.error( + "JCL to get Security metadata fail on CICS Region " + + region.getApplid() + + ", check artifacts for more details" + ); + } + } + + if (LOG.isInfoEnabled()) { + LOG.info( + "Grabbing Security metadata job output on CICS Region " + + region.getApplid() + ); + } + List spoolFiles; + spoolFiles = job.retrieveOutput().getSpoolFiles(); + + IZosBatchJobOutputSpoolFile yamlFile = spoolFiles.stream() + .filter(file -> "YAML".equals(file.getDdname())).findAny().orElse(null); + + if (yamlFile != null) { + if (LOG.isInfoEnabled()) { + LOG.info("YAML output obtained on " + region.getApplid()); + } + yaml = yamlFile.getRecords(); + } else { + throw new SdvManagerException( + "Security metadata job did not return any YAML for CICS Region " + + region.getApplid() + + ", containing SRR IDs: " + + String.join(",", srrIds) + ); + } + + } catch (ZosBatchException | TestBundleResourceException | IOException + | CicstsManagerException e) { + throw new SdvManagerException( + "Unable to run JCL to get Security metadata on CICS Region " + + region.getApplid(), + e + ); + } + + return yaml; + + } + + private void storeYaml(ICicsRegion region, String regionYaml, String testBundleName, + String testClassName) throws SdvManagerException { + + if (regionYaml != null) { + if (LOG.isInfoEnabled()) { + LOG.info("Storing YAML as test artifact for " + region.getApplid()); + } + + // Add to Galasa run + Path f = storedArtifactRoot.resolve(testBundleName + "/" + testClassName + "." + + region.getTag() + ".cics-security.yaml"); + try { + Files.write(f, regionYaml.getBytes("utf8"), StandardOpenOption.CREATE); + } catch (Exception e) { + throw new SdvManagerException( + "Unable to add YAML to Galasa run for CICS Region " + + region.getApplid() + + ". Attempting to save to path: " + f.toString(), + e + ); + } + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvResourceManagement.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvResourceManagement.java new file mode 100644 index 000000000..0b79f970b --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvResourceManagement.java @@ -0,0 +1,83 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IResourceManagement; +import dev.galasa.framework.spi.IResourceManagementProvider; +import dev.galasa.framework.spi.ResourceManagerException; +import java.util.concurrent.TimeUnit; +import org.osgi.service.component.annotations.Component; + +/** + * This class acts as the high-level resource management deamon for + * SDV manager. + * + *

It will ensure sdv entries in the DSS are kept in-sync, + * up-to-date, and will tidy up any stale information. + * + */ +@Component(service = {IResourceManagementProvider.class}) +public class SdvResourceManagement implements IResourceManagementProvider { + + private IFramework framework; + private IResourceManagement resourceManagement; + + private SdvUserResourceMonitor sdvUserResourceMonitor; + private SdvManagersResourceMonitor sdvManagersResourceMonitor; + + @Override + public boolean initialise(IFramework framework, IResourceManagement resourceManagement) + throws ResourceManagerException { + this.framework = framework; + this.resourceManagement = resourceManagement; + + IDynamicStatusStoreService dss; + try { + dss = this.framework.getDynamicStatusStoreService("sdv"); + } catch (Exception e) { + throw new ResourceManagerException("Unable to initialise 'sdv' namespace from DSS.", e); + } + + sdvUserResourceMonitor = new SdvUserResourceMonitor( + framework, + resourceManagement, + dss + ); + sdvManagersResourceMonitor = new SdvManagersResourceMonitor( + framework, + resourceManagement, + dss + ); + + return true; + } + + @Override + public void start() { + + this.resourceManagement.getScheduledExecutorService().scheduleWithFixedDelay( + sdvUserResourceMonitor, this.framework.getRandom().nextInt(20), 20, + TimeUnit.SECONDS); + + this.resourceManagement.getScheduledExecutorService().scheduleWithFixedDelay( + sdvManagersResourceMonitor, this.framework.getRandom().nextInt(20), 20, + TimeUnit.SECONDS); + } + + @Override + public void shutdown() { + // Not required + } + + @Override + public void runFinishedOrDeleted(String runName) { + this.sdvUserResourceMonitor.runFinishedOrDeleted(runName); + this.sdvManagersResourceMonitor.runFinishedOrDeleted(runName); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserImpl.java new file mode 100644 index 000000000..be5e6435f --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserImpl.java @@ -0,0 +1,154 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.ICredentialsUsernamePassword; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.zos3270.Zos3270Exception; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * This class implements the ISdvUser interface. + * + *

It provides all implementation for methods called on the + * ISdvUser interface. + * + */ +public class SdvUserImpl implements ISdvUser { + + private static final Log LOG = LogFactory.getLog(SdvUserImpl.class); + + private String credentialsTag; + private String role; + private String cicsTag; + private ICredentialsUsernamePassword credentials; + private String srrId; // When null, no recording is taking place + private Boolean recording; + + /** + * The SdvUserImpl constructor. + * + * @param credentialsTag - The string tag for the credential in the secure Galasa properties. + * @param credentials - ICredentialsUsernamePassword object containing the actual credentials. + * @param cicsTag - The string tag for the CICS region the user will run on. + * @param role - The role name the user belongs to. + */ + public SdvUserImpl(String credentialsTag, ICredentialsUsernamePassword credentials, + String cicsTag, String role) { + + this.credentialsTag = credentialsTag; + this.credentials = credentials; + this.cicsTag = cicsTag; + this.srrId = null; + this.recording = false; + this.role = role; + } + + @Override + public String getCredentialsTag() { + return this.credentialsTag; + } + + @Override + public String getUsername() { + return this.credentials.getUsername(); + } + + @Override + public String getPassword() { + return this.credentials.getPassword(); + } + + @Override + public String getRole() { + return this.role; + } + + @Override + public String getCicsTag() { + return this.cicsTag; + } + + @Override + public void logIntoTerminal(ICicsTerminal terminal) throws SdvManagerException { + try { + // Are we already on CESL/N? If not go to it + long timeout = 0; + if (!terminal.searchText("Signon to CICS", timeout)) { + terminal.clear().wfk(); + + terminal.type("CESL").enter().wfk(); + } + + terminal.waitForTextInField(new String[] {"Userid"}, + new String[] {"Security is not active"}); + terminal.type(this.credentials.getUsername()); + terminal.positionCursorToFieldContaining("Password"); + terminal.tab(); + terminal.type(this.credentials.getPassword()); + terminal.enter().wfk(); + + waitForLoggedOnText(terminal); + if (LOG.isDebugEnabled()) { + LOG.debug("Logged into CICS TS as user: " + this.credentials.getUsername()); + } + + terminal.clear().wfk(); + } catch (CicstsManagerException | Zos3270Exception e) { + throw new SdvManagerException( + "Could not log in via CESL on CICS region " + + terminal.getCicsRegion().getApplid(), + e + ); + } + + } + + @Override + public String getSrrId() { + return this.srrId; + } + + @Override + public Boolean isRecording() { + return this.recording; + } + + @Override + public void setSrrId(String srrId) { + this.srrId = srrId; + this.recording = true; + } + + @Override + public void setNotRecording() { + this.recording = false; + } + + private void waitForLoggedOnText(ICicsTerminal cicsTerminal) throws CicstsManagerException { + + String[] pass = {"Sign-on is complete"}; + String[] fail = {"Your password has expired. Please type your new password.", + "Invalid credentials entered", "userid has been revoked"}; + + try { + cicsTerminal.waitForTextInField(pass, fail); + } catch (Exception e) { + throw new CicstsManagerException( + "Unable to wait for the initial CICS screen, looking for '" + + String.join("', '", pass) + + "' on CICS Region " + + cicsTerminal.getCicsRegion().getApplid(), + e); + } + } + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserPool.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserPool.java new file mode 100644 index 000000000..66bcaa593 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserPool.java @@ -0,0 +1,140 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.framework.spi.DssDelete; +import dev.galasa.framework.spi.DssUpdate; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.DynamicStatusStoreMatchException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IResourcePoolingService; +import dev.galasa.framework.spi.InsufficientResourcesAvailableException; +import dev.galasa.framework.spi.ResourceUnavailableException; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.internal.properties.SdvPoolUsers; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * This class provides the implementation for querying available + * users in a pool matching a role, and then picks one, and marks + * it as being in use. + * + *

It additonally implements the ability to release users back to + * the pool. + */ +public class SdvUserPool { + + private static final Log LOG = LogFactory.getLog(SdvUserPool.class); + + private final IDynamicStatusStoreService dss; + private final IResourcePoolingService rps; + private final IFramework framework; + + /** + * SdvUserPool contructor. + * + * @param framework - Galasa framework object. + * @param dss - Galasa DSS. + * @param rps - Galasa Resource Pooling Service. + * @throws SdvManagerException general error encountered. + */ + public SdvUserPool(IFramework framework, IDynamicStatusStoreService dss, + IResourcePoolingService rps) throws SdvManagerException { + + this.framework = framework; + this.dss = dss; + this.rps = rps; + } + + /** + * Will return an available user for a given role, if one is + * available. The user will then be marked as unavailable. + * + *

If a user is not available, an exception will be thrown. + * + * @param role - The role name the returned user must belong to. + * @param cicsRegion - The CICS Region which the user will interact with. + * @return - The Galasa credentials tag string for the allocated user. + * @throws SdvManagerException general error encountered. + * @throws ResourceUnavailableException no available users for that role currently. + */ + public String allocateUser(String role, ICicsRegion cicsRegion) + throws SdvManagerException, ResourceUnavailableException { + + List availableSdvUsers = null; + String theSdvUser = null; + + // Get the full pool of user credential tags for the + // specified zOS image and role + List fullZosImageUserListForRole = + SdvPoolUsers.get(cicsRegion.getZosImage().getImageID(), role); + + if (fullZosImageUserListForRole.isEmpty()) { + throw new SdvManagerException( + "No user credential tags provided for role '" + role + + "' on z/OS image '" + + cicsRegion.getZosImage().getImageID() + + "'. Please create or update CPS property 'sdv.zosImage." + + cicsRegion.getZosImage().getImageID() + + ".role." + + role + + ".credTags'." + ); + } + + // Retrieve available users from the pool, not being used by the region + try { + availableSdvUsers = this.rps.obtainResources(fullZosImageUserListForRole, null, 1, 1, + dss, "sdvuser." + cicsRegion.getApplid() + "."); + } catch (InsufficientResourcesAvailableException e) { + // There are no users available, inform the framework that we should go into wait state + // and try again later + // All resources (from other managers) will be discarded by using this + throw new ResourceUnavailableException( + "Could not obtain a user from the SDV user pool for image " + + cicsRegion.getZosImage().getImageID() + ", and role " + role, + e); + } + + // Allocate the user retrieved from the pool + try { + // There should only be a single user in the list allocated + theSdvUser = availableSdvUsers.get(0); + + // Allocate the user in the DSS + this.dss.performActions( + new DssUpdate("sdvuser." + cicsRegion.getApplid() + "." + theSdvUser, + this.framework.getTestRunName()), + new DssUpdate("run." + this.framework.getTestRunName() + ".sdvuser." + + cicsRegion.getApplid() + "." + theSdvUser, "active")); + + if (LOG.isTraceEnabled()) { + LOG.trace("Allocated SDV User " + theSdvUser + " on image " + + cicsRegion.getZosImage().getImageID() + " for CICS Applid " + + cicsRegion.getApplid() + " from SDV User pool allocation"); + } + + } catch (DynamicStatusStoreException e) { + throw new SdvManagerException( + "Could not update the DSS for user allocation of SDV User " + theSdvUser + + " on image " + cicsRegion.getZosImage().getImageID(), + e); + } + return theSdvUser; + } + + public static void deleteDss(String user, String cicsApplid, String run, + IDynamicStatusStoreService dss) + throws DynamicStatusStoreMatchException, DynamicStatusStoreException { + dss.performActions(new DssDelete("sdvuser." + cicsApplid + "." + user, run), + new DssDelete("run." + run + ".sdvuser." + cicsApplid + "." + user, "active")); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserResourceMonitor.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserResourceMonitor.java new file mode 100644 index 000000000..c06820f6b --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/SdvUserResourceMonitor.java @@ -0,0 +1,122 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IResourceManagement; +import java.util.Map; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * This class provides specific implementation to monitor SdvUser usage. + * + */ +public class SdvUserResourceMonitor implements Runnable { + + private static final Log LOG = LogFactory.getLog(SdvUserResourceMonitor.class); + + private final IFramework framework; + private final IResourceManagement resourceManagement; + private final IDynamicStatusStoreService dss; + + private static final String PERIOD_REGEX = "\\."; + + /** + * SdvUserResourceMonitor constructor. + * + * @param framework - Galasa framework. + * @param resourceManagement - Galasa Resource Management. + * @param dss - Galasa DSS. + */ + public SdvUserResourceMonitor(IFramework framework, IResourceManagement resourceManagement, + IDynamicStatusStoreService dss) { + this.framework = framework; + this.resourceManagement = resourceManagement; + this.dss = dss; + LOG.info("SDV User provisioning resource monitor initialised"); + } + + @Override + public void run() { + LOG.info("Monitoring for SDV Users held up in allocated status"); + + try { + + // Get the list of SDV Users allocated in the DSS + Map sdvUsersInDss = dss.getPrefix("sdvuser"); + + Set allActiveRuns = this.framework.getFrameworkRuns().getActiveRunNames(); + + // Iterate through all SDV Users stored in the DSS + for (Map.Entry entry : sdvUsersInDss.entrySet()) { + // Delete DSS SDV User allocation to run not active + if (!allActiveRuns.contains(entry.getValue())) { + String removeRun = entry.getValue(); + String removeCicsApplId = entry.getKey().split(PERIOD_REGEX)[1]; + String removeUser = entry.getKey().split(PERIOD_REGEX)[2]; + + if (LOG.isInfoEnabled()) { + LOG.info("Freeing allocated user " + removeUser + + " assigned to inactive run " + removeRun); + } + + deleteDss(removeUser, removeCicsApplId, removeRun); + } + } + } catch (Exception e) { + LOG.error("Failure during scanning DSS for SDV Users"); + } + + this.resourceManagement.resourceManagementRunSuccessful(); + LOG.info("Finished cleaning up SDV User allocation"); + } + + /** + * Called when a Galasa test run ends or is removed. + * + * @param runName - Galasa test run name. + */ + public void runFinishedOrDeleted(String runName) { + + try { + // Get list of SDV Users allocated in the DSS + Map sdvUsersInDss = dss.getPrefix("sdvuser"); + + for (Map.Entry entry : sdvUsersInDss.entrySet()) { + + // This SDV User allocation belongs to the run + if (entry.getValue().equals(runName)) { + deleteDss(entry.getKey().split(PERIOD_REGEX)[2], + entry.getKey().split(PERIOD_REGEX)[1], entry.getValue()); + } + } + } catch (Exception e) { + if (LOG.isErrorEnabled()) { + LOG.error("Failure cleaning up SDV Users for finished run " + runName); + } + } + } + + private void deleteDss(String user, String cicsApplid, String run) { + if (LOG.isInfoEnabled()) { + LOG.info("Freeing user " + user + " on CICS Applid " + cicsApplid + " allocated to run " + + run + " which has finished"); + } + + try { + SdvUserPool.deleteDss(user, cicsApplid, run, dss); + } catch (Exception e) { + if (LOG.isErrorEnabled()) { + LOG.error("Failure in discarding SDV User " + user + " on CICS Applid " + cicsApplid + + " allocated to run " + run); + } + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvHlq.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvHlq.java new file mode 100644 index 000000000..4d1e6c8e0 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvHlq.java @@ -0,0 +1,45 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.sdv.SdvManagerException; +import javax.validation.constraints.NotNull; + +/** + * The HLQ of the CICS region install. + * + * @galasa.cps.property + * + * @galasa.name sdv.cicsTag.[cicsTag].hlq + * + * @galasa.description The HLQ of the CICS region install + * + * @galasa.required Yes + * + * @galasa.default None + * + * @galasa.valid_values String + * + * @galasa.examples sdv.cicsTag.A.hlq=CICS.INSTALL
+ * + */ +public class SdvHlq extends CpsProperties { + + /** + * Returns the HLQ for a given cicsTag. + */ + public static String get(@NotNull String cicsTag) throws SdvManagerException { + try { + return getStringNulled(SdvPropertiesSingleton.cps(), "cicsTag", "hlq", cicsTag); + } catch (ConfigurationPropertyStoreException e) { + throw new SdvManagerException("Problem asking CPS for the HLQ for CICS tag: " + cicsTag, + e); + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPoolUsers.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPoolUsers.java new file mode 100644 index 000000000..224188dc5 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPoolUsers.java @@ -0,0 +1,48 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.sdv.SdvManagerException; +import java.util.List; +import javax.validation.constraints.NotNull; + +/** + * The list of credentials that belong to a given role on a zOS image. + * + * @galasa.cps.property + * + * @galasa.name sdv.zosImage.[imageID].role.[Role].credTags + * + * @galasa.description The list of credentials that belong to a given role on a zOS image + * + * @galasa.required Yes + * + * @galasa.default [] + * + * @galasa.valid_values String[] + * + * @galasa.examples sdv.zosImage.ABC.role.TELLER.credTags=USER1,USER2
+ * + */ +public class SdvPoolUsers extends CpsProperties { + + /** + * Returns a List of users from the pool that belong to the provided role. + */ + public static @NotNull @NotNull List get(String image, String role) + throws SdvManagerException { + try { + return getStringList(SdvPropertiesSingleton.cps(), "zosImage", "credTags", image, + "role", role); + } catch (ConfigurationPropertyStoreException e) { + throw new SdvManagerException("Problem asking CPS for the User pool for zOS image: " + + image + ", and role: " + role, e); + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPort.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPort.java new file mode 100644 index 000000000..90cf9802a --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPort.java @@ -0,0 +1,45 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.sdv.SdvManagerException; +import javax.validation.constraints.NotNull; + +/** + * The port the SDC TCPIPSERVICE should serve from on a CICS region. + * + * @galasa.cps.property + * + * @galasa.name sdv.cicsTag.[cicsTag].port + * + * @galasa.description The port the SDC TCPIPSERVICE should serve from on a CICS region + * + * @galasa.required Yes + * + * @galasa.default None + * + * @galasa.valid_values String + * + * @galasa.examples sdv.cicsTag.A.port=32000
+ * + */ +public class SdvPort extends CpsProperties { + + /** + * Returns the port number for a given cicsTag a TCPIPSERVICE should serve from. + */ + public static String get(@NotNull String cicsTag) throws SdvManagerException { + try { + return getStringNulled(SdvPropertiesSingleton.cps(), "cicsTag", "port", cicsTag); + } catch (ConfigurationPropertyStoreException e) { + throw new SdvManagerException( + "Problem asking CPS for the SDV port for CICS tag: " + cicsTag, e); + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPropertiesSingleton.java new file mode 100644 index 000000000..27575a9d0 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvPropertiesSingleton.java @@ -0,0 +1,58 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.IConfigurationPropertyStoreService; +import dev.galasa.sdv.SdvManagerException; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; + +/** + * CPS Properties singleton class. + */ +@Component(service = SdvPropertiesSingleton.class, immediate = true) +public class SdvPropertiesSingleton { + + private static SdvPropertiesSingleton instance; + + private IConfigurationPropertyStoreService cps; + + @Activate + public void activate() { + instance = this; // NOSONAR + } + + @Deactivate + public void deactivate() { + instance = null; // NOSONAR + } + + /** + * Returns instance of CPS Properties class. + */ + public static IConfigurationPropertyStoreService cps() throws SdvManagerException { + if (instance != null) { + return instance.cps; + } + + throw new SdvManagerException( + "Attempt to access manager CPS before it has been initialised"); + } + + /** + * Sets instance of CPS Properties class. + */ + public static void setCps(IConfigurationPropertyStoreService cps) throws SdvManagerException { + if (instance != null) { + instance.cps = cps; + return; + } + + throw new SdvManagerException("Attempt to set manager CPS before instance created"); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvRole.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvRole.java new file mode 100644 index 000000000..0dfe3d7be --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvRole.java @@ -0,0 +1,45 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.sdv.SdvManagerException; +import javax.validation.constraints.NotNull; + +/** + * The role associated with a role tag. + * + * @galasa.cps.property + * + * @galasa.name sdv.roleTag.[roleTag].role + * + * @galasa.description The role associated with a role tag. + * + * @galasa.required Yes + * + * @galasa.default None + * + * @galasa.valid_values String + * + * @galasa.examples sdv.roleTag.A.role=TELLER
+ * + */ +public class SdvRole extends CpsProperties { + + /** + * Returns the Role name associated with a provided RoleTag. + */ + public static String get(@NotNull String roleTag) throws SdvManagerException { + try { + return getStringNulled(SdvPropertiesSingleton.cps(), "roleTag", "role", roleTag); + } catch (ConfigurationPropertyStoreException e) { + throw new SdvManagerException( + "Problem asking CPS for the Role for Role tag: " + roleTag, e); + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvSdcActivation.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvSdcActivation.java new file mode 100644 index 000000000..c4486f2ac --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvSdcActivation.java @@ -0,0 +1,55 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.sdv.SdvManagerException; +import javax.validation.constraints.NotNull; + +/** + * Should the SDV manager configure and make SDC active on the CICS region?. + * + * @galasa.cps.property + * + * @galasa.name sdv.cicsTag.[cicsTag].SdcActivation + * + * @galasa.description Should the SDV manager configure all pre-reqs and make SDC active on the CICS + * region? + * + * Typically should be enabled for CICS regions that will be created as part of + * test, and then discarded. + * + * @galasa.required No + * + * @galasa.default false + * + * @galasa.valid_values true, false + * + * @galasa.examples sdv.cicsTag.A.SdcActivation=true
+ * + */ +public class SdvSdcActivation extends CpsProperties { + + /** + * Returns a boolean indicating if the manager should activate SDC as part of its set up. + */ + public static boolean get(@NotNull String cicsTag) throws SdvManagerException { + try { + String sdvSdcActivation = getStringNulled(SdvPropertiesSingleton.cps(), "cicsTag", + "SdcActivation", cicsTag); + + if (sdvSdcActivation == null) { + return false; + } + return Boolean.parseBoolean(sdvSdcActivation); + } catch (ConfigurationPropertyStoreException e) { + throw new SdvManagerException( + "Problem asking CPS for SDC activation config for CICS tag: " + cicsTag, e); + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvSrrLogstreamRemoval.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvSrrLogstreamRemoval.java new file mode 100644 index 000000000..13d12a234 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/java/dev/galasa/sdv/internal/properties/SdvSrrLogstreamRemoval.java @@ -0,0 +1,57 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal.properties; + +import dev.galasa.framework.spi.ConfigurationPropertyStoreException; +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.sdv.SdvManagerException; +import javax.validation.constraints.NotNull; + +/** + * Should the SDV manager remove the SRR Journal and logstream on the CICS region?. + * + * @galasa.cps.property + * + * @galasa.name sdv.cicsTag.[cicsTag].SrrLogstreamRemoval + * + * @galasa.description Should the SDV manager remove the SRR Journal and logstream on the CICS + * region? + * + * Typically should be enabled for CICS regions that will be shutdown as part of + * test, and then discarded. + * + * @galasa.required No + * + * @galasa.default false + * + * @galasa.valid_values true, false + * + * @galasa.examples sdv.cicsTag.A.SrrLogstreamRemoval=true
+ * + */ +public class SdvSrrLogstreamRemoval extends CpsProperties { + + /** + * Returns a boolean indicating if the manager should delete the SRR logstream as part + * of its cleanup. + */ + public static boolean get(@NotNull String cicsTag) throws SdvManagerException { + try { + String sdvSrrLogstreamRemoval = getStringNulled(SdvPropertiesSingleton.cps(), "cicsTag", + "SrrLogstreamRemoval", cicsTag); + + if (sdvSrrLogstreamRemoval == null) { + return false; + } + return Boolean.parseBoolean(sdvSrrLogstreamRemoval); + } catch (ConfigurationPropertyStoreException e) { + throw new SdvManagerException( + "Problem asking CPS for SRR Logstream removal config for CICS tag: " + cicsTag, + e); + } + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/definelogstream.jcl b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/definelogstream.jcl new file mode 100644 index 000000000..4efa39e0f --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/definelogstream.jcl @@ -0,0 +1,12 @@ +//****************************************************** +//* DEFINE a new logstream model for DFHSECR journal +//* Note: Log data will be autodeleted after 1 day +//****************************************************** +//DEFMODEL EXEC PGM=IXCMIAPU +//SYSPRINT DD SYSOUT=A,DCB=RECFM=FBA +//SYSIN DD * + DATA TYPE(LOGR) REPORT(NO) + DEFINE LOGSTREAM NAME(++OWNER++.++APPLID++.MODEL) + STRUCTNAME(++CFSTRUCT++) MODEL(YES) + AUTODELETE(YES) RETPD(0001) +/* \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/deletelogstreams.jcl b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/deletelogstreams.jcl new file mode 100644 index 000000000..805cf71b9 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/deletelogstreams.jcl @@ -0,0 +1,19 @@ +//****************************************************** +//* DELETE logstreams used by any previous instances +//* of this CICS +//****************************************************** +//DELSTR EXEC PGM=IXCMIAPU +//SYSPRINT DD SYSOUT=A,DCB=RECFM=FBA +//SYSIN DD * + DATA TYPE(LOGR) REPORT(NO) + DELETE LOGSTREAM NAME(++OWNER++.++APPLID++.DFHSECR) +/* +//* +//DELMOD EXEC PGM=IXCMIAPU +//SYSPRINT DD SYSOUT=A,DCB=RECFM=FBA +//SYSIN DD * + DATA TYPE(LOGR) REPORT(NO) + DELETE LOGSTREAM NAME(++OWNER++.++APPLID++.MODEL) +/* + SET MAXCC=0 +// \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/getYaml.jcl b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/getYaml.jcl new file mode 100644 index 000000000..908cfd8bf --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/main/resources/jcl/getYaml.jcl @@ -0,0 +1,7 @@ +//MYLIB JCLLIB ORDER=(++CICSHLQ++.SDFHPROC) +//SDVCAPTR EXEC DFHXSDSO, +// HLQ=++CICSHLQ++, +// LOGSTRM=++OWNER++.++APPLID++.DFHSECR, +// CYL=100 +//EXTRACT.SYSIN DD * +HEADER=NO \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestRecordingRegion.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestRecordingRegion.java new file mode 100644 index 000000000..ed6391249 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestRecordingRegion.java @@ -0,0 +1,71 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.ICredentialsUsernamePassword; +import dev.galasa.framework.spi.creds.CredentialsException; +import dev.galasa.framework.spi.creds.CredentialsUsernamePassword; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + + +class TestRecordingRegion { + + RecordingRegion rr; + ICredentialsUsernamePassword credentials; + + @BeforeEach + void beforeEach() throws CredentialsException { + rr = new RecordingRegion(null); + + credentials = + new CredentialsUsernamePassword(null, "user1", "password1"); + } + + @Test + void testAddingNewUserToRegion() throws SdvManagerException, CredentialsException { + // No users to start + List beforeList = rr.getRecordingUsers(); + Assertions.assertEquals(0, beforeList.size()); + + // Add new user + ISdvUser newUser = new SdvUserImpl("creds1", credentials, "cics1", "TELLER"); + rr.addUserToRecord(newUser); + + // Number of users increment, and user is the one created + List afterList = rr.getRecordingUsers(); + Assertions.assertEquals(1, afterList.size()); + Assertions.assertEquals(newUser, afterList.get(0)); + } + + @Test + void testAddingExistingUserToRegion() throws SdvManagerException, CredentialsException { + // Add existing user + ISdvUser existingUser = new SdvUserImpl("creds1", credentials, "cics1", "TELLER"); + rr.addUserToRecord(existingUser); + List beforeList = rr.getRecordingUsers(); + Assertions.assertEquals(1, beforeList.size()); + Assertions.assertEquals(existingUser, beforeList.get(0)); + + // Create new user with same user name + ISdvUser newUser = new SdvUserImpl("creds2", credentials, "cics1", "ADMIN"); + Throwable exception = Assertions.assertThrows( + SdvManagerException.class, + () -> rr.addUserToRecord(newUser) + ); + + Assertions.assertEquals( + "User 'user1' has been allocated to more than one region in the test." + + " Please report this to the Galasa project.", + exception.getMessage() + ); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvHttpRecorderImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvHttpRecorderImpl.java new file mode 100644 index 000000000..c6bdf72b5 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvHttpRecorderImpl.java @@ -0,0 +1,4233 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import com.google.gson.JsonObject; +import dev.galasa.ICredentialsUsernamePassword; +import dev.galasa.artifact.IArtifactManager; +import dev.galasa.artifact.IBundleResources; +import dev.galasa.artifact.TestBundleResourceException; +import dev.galasa.cicsts.CedaException; +import dev.galasa.cicsts.CemtException; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICeda; +import dev.galasa.cicsts.ICemt; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.cicsts.spi.ICicsRegionProvisioned; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.ResourceUnavailableException; +import dev.galasa.framework.spi.creds.CredentialsException; +import dev.galasa.framework.spi.creds.CredentialsUsernamePassword; +import dev.galasa.http.HttpClientException; +import dev.galasa.http.HttpClientResponse; +import dev.galasa.http.IHttpClient; +import dev.galasa.http.spi.IHttpManagerSpi; +import dev.galasa.ipnetwork.IIpHost; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.internal.properties.SdvHlq; +import dev.galasa.sdv.internal.properties.SdvPort; +import dev.galasa.sdv.internal.properties.SdvSdcActivation; +import dev.galasa.sdv.internal.properties.SdvSrrLogstreamRemoval; +import dev.galasa.zos.IZosImage; +import dev.galasa.zosbatch.IZosBatch; +import dev.galasa.zosbatch.IZosBatchJob; +import dev.galasa.zosbatch.IZosBatchJobOutput; +import dev.galasa.zosbatch.IZosBatchJobOutputSpoolFile; +import dev.galasa.zosbatch.ZosBatchException; +import dev.galasa.zosbatch.internal.ZosBatchJobOutputSpoolFileImpl; +import dev.galasa.zosbatch.spi.IZosBatchSpi; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import sun.misc.Unsafe; + + +class TestSdvHttpRecorderImpl { + + private MockedStatic sdvSdcActivation; + private MockedStatic sdvPort; + private MockedStatic sdvSrrLogstreamRemoval; + private MockedStatic sdvHlq; + private MockedStatic files; + + private ICicsRegionProvisioned mockCicsaRegion; + private IZosImage regionaImage; + private ICicsRegionProvisioned mockCicsbRegion; + private IZosImage regionbImage; + + private String regionaTag = "CICSA"; + private String regionaApplid = "APPL1"; + private String passwordString = "password123"; + private String regionbTag = "CICSB"; + private String regionbApplid = "APPL2"; + private String tellerRoleString = "TELLER"; + private String testRunName = "RUN123"; + private String createLogstreamJcl = "jcl_for_defining_logstreams"; + private String deleteLogstreamJcl = "jcl_for_defining_logstreams"; + private String logVariableString = "LOG"; + private String regionAportString = "32000"; + private String regionBportString = "32001"; + private String owner1String = "owner1"; + private String owner2String = "owner2"; + private String user1String = "user1"; + private String user2String = "user2"; + private String user3String = "user3"; + private String creds1String = "CREDS1"; + private String creds2String = "CREDS2"; + private String creds3String = "CREDS3"; + private String adminRoleString = "ADMIN"; + private String sdvHttpRecorderImplClassString = + "dev.galasa.sdv.internal.SdvHttpRecorderImpl"; + private String jclCreateLogstreamPathString = "/jcl/definelogstream.jcl"; + private String jclDeleteLogstreamPathString = "/jcl/deletelogstreams.jcl"; + private String jclGetYamlPathString = "/jcl/getYaml.jcl"; + private String structureString = "A_STRUCTURE"; + private String theUnsafeString = "theUnsafe"; + private String managerPrefixString = "manager."; + private String runningManagersString = "runningManagers."; + private String falseString = "false"; + private String sdcLiveString = ".sdcLive"; + private String cicsServerStringA = "cicsServerA"; + private String sdcUrl = "/DFHSDC"; + private String httpString = "http://"; + private String srrIdString = "srr_id"; + private String srrId1 = "_654654"; + private String srrId2 = "_7676575"; + private String srrId3 = "_4543634"; + private static final String uncheckedString = "unchecked"; + private String user1UnableToStartErrorString + = "Was unable to start recording for user 'user1', on CICS Region APPL1"; + private String messagePropString = "message"; + private String errorMessageString = "bad stuff happening"; + private String submitString = "submit"; + private String nullString = "null"; + private String errorOutputBadStuffString = "\nbad stuff happening"; + private String errorOutputPayloadStrng = + "\n{\"srr_id\":\"null\",\"message\":\"somethings gone badly wrong\"}"; + private String serverErrorMessage = "somethings gone badly wrong"; + private String utfString = "utf8"; + private String getYamlString = "/getYaml.jcl"; + private String onCicsRegionMsg = "', on CICS Region "; + + + @SuppressWarnings("PMD") + private static final Log mockLog = Mockito.mock(Log.class); + + @BeforeEach + public void setUp() throws CicstsManagerException { + // Registering static mocks before each test + sdvSdcActivation = Mockito.mockStatic(SdvSdcActivation.class); + sdvPort = Mockito.mockStatic(SdvPort.class); + sdvSrrLogstreamRemoval = Mockito.mockStatic(SdvSrrLogstreamRemoval.class); + sdvHlq = Mockito.mockStatic(SdvHlq.class); + files = Mockito.mockStatic(Files.class); + + sdvHlq.when(() -> SdvHlq.get(regionaTag)).thenReturn("CICS.INSTALL"); + sdvHlq.when(() -> SdvHlq.get(regionbTag)).thenReturn("CICS.INSTALL"); + + // LOG + Mockito.reset(mockLog); + Mockito.when(mockLog.isInfoEnabled()).thenReturn(true); + Mockito.when(mockLog.isWarnEnabled()).thenReturn(true); + Mockito.when(mockLog.isErrorEnabled()).thenReturn(true); + Mockito.when(mockLog.isTraceEnabled()).thenReturn(true); + Mockito.when(mockLog.isDebugEnabled()).thenReturn(true); + + // Region A SdvPort + sdvPort.when(() -> SdvPort.get(regionaTag)).thenReturn(regionAportString); + + sdvSrrLogstreamRemoval.when(() -> SdvSrrLogstreamRemoval.get(regionaTag)).thenReturn(true); + + // Mock RegionA + IIpHost ipHostA = Mockito.mock(IIpHost.class); + Mockito.when(ipHostA.getHostname()).thenReturn(cicsServerStringA); + regionaImage = Mockito.mock(IZosImage.class); + Mockito.when(regionaImage.getIpHost()).thenReturn(ipHostA); + IZosBatchJob mockIzOsBatchJoba = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJoba.getOwner()).thenReturn(owner1String); + mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(regionaTag); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(mockCicsaRegion.getRegionJob()).thenReturn(mockIzOsBatchJoba); + Mockito.when(mockCicsaRegion.getZosImage()).thenReturn(regionaImage); + + // Region B SdvPort + sdvPort.when(() -> SdvPort.get(regionbTag)).thenReturn(regionBportString); + + sdvSrrLogstreamRemoval.when(() -> SdvSrrLogstreamRemoval.get(regionbTag)).thenReturn(true); + + // Mock RegionB + IIpHost ipHostB = Mockito.mock(IIpHost.class); + Mockito.when(ipHostB.getHostname()).thenReturn("cicsServerB"); + regionbImage = Mockito.mock(IZosImage.class); + Mockito.when(regionbImage.getIpHost()).thenReturn(ipHostB); + IZosBatchJob mockIzOsBatchJobb = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJobb.getOwner()).thenReturn(owner2String); + mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getTag()).thenReturn(regionbTag); + Mockito.when(mockCicsbRegion.getApplid()).thenReturn(regionbApplid); + Mockito.when(mockCicsbRegion.getRegionJob()).thenReturn(mockIzOsBatchJobb); + Mockito.when(mockCicsbRegion.getZosImage()).thenReturn(regionbImage); + } + + @AfterEach + public void tearDown() { + // Closing static mocks after each test + sdvSdcActivation.close(); + sdvPort.close(); + sdvSrrLogstreamRemoval.close(); + sdvHlq.close(); + files.close(); + } + + @Test + void testPrepareEnvironmentsAsFirstManagerOnRegionWithSdcActivation() + throws CredentialsException, SdvManagerException, ClassNotFoundException, + NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InstantiationException, InvocationTargetException, + NoSuchMethodException, ResourceUnavailableException, DynamicStatusStoreException, + CicstsManagerException, TestBundleResourceException, IOException, ZosBatchException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + Mockito.when(mockCicsbRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsbRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 1 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionbApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionbApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + Mockito.when(batchManager.getZosBatch(regionbImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionbTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we call ceda & cemt to create resources + Mockito.verify(cemt, Mockito.times(4)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(6)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(4)).installGroup(Mockito.any(), Mockito.any()); + } + + @Test + void testPrepareEnvironmentsAsSecondManagerOnRegion() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, TestBundleResourceException, IOException, + ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + Mockito.when(mockCicsbRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsbRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 1 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(false); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn("L1,L2"); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + runningManagersString + regionaApplid, + "L1,L2,RUN123"); + Mockito.when(dssService.get(managerPrefixString + regionaApplid + sdcLiveString)) + .thenReturn(falseString, "true"); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionbApplid, + null, testRunName)).thenReturn(false); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionbApplid)) + .thenReturn("L1,L2"); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + runningManagersString + regionbApplid, + "L5,L6,RUN123"); + Mockito.when(dssService.get(managerPrefixString + regionbApplid + sdcLiveString)) + .thenReturn(falseString, "true"); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we DO NOT call ceda & cemt to create resources. + // Another manager will had created the resource, so this manager didn't have to. + Mockito.verify(cemt, Mockito.times(0)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(0)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(0)).installGroup(Mockito.any(), Mockito.any()); + } + + @Test + void testPrepareEnvironmentsLogstreamJobFailsDueToExisting() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, TestBundleResourceException, IOException, + ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(12); // EXISTING RETURN CODE + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we call ceda & cemt to create resources + Mockito.verify(cemt, Mockito.times(2)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(3)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(2)).installGroup(Mockito.any(), Mockito.any()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog).info( + "Logstream not created, using existing, on CICS Region " + + regionaApplid + + "." + ); + } + + @Test + void testPrepareEnvironmentsLogstreamJobFailsDueToError() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, TestBundleResourceException, IOException, + ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(16); // EXISTING RETURN CODE + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we call ceda & cemt to create resources + Mockito.verify(cemt, Mockito.times(2)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(3)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(2)).installGroup(Mockito.any(), Mockito.any()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog).warn( + "JCL to define logstreams fail for CICS Region " + + regionaApplid + + ", check artifacts for more details" + ); + } + + @Test + void testPrepareEnvironmentsCedaCreateException() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, TestBundleResourceException, IOException, + ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doThrow(new CedaException("Could not create resource")).when(ceda).createResource( + Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.prepareEnvironments(structureString); + }); + + Assertions.assertEquals( + "Could not create SRR JOURNALMODEL definition on CICS Region " + + regionaApplid + + ".", + exception.getMessage() + ); + + } + + @Test + void testPrepareEnvironmentsCedaInstallSdvGrpException() + throws IllegalArgumentException, IllegalAccessException, InstantiationException, + InvocationTargetException, NoSuchMethodException, SecurityException, + NoSuchFieldException, ClassNotFoundException, ZosBatchException, + TestBundleResourceException, IOException, DynamicStatusStoreException, + CicstsManagerException, CredentialsException, SdvManagerException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doThrow(new CedaException("could not install")).when(ceda) + .installGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.prepareEnvironments(structureString); + }); + + Assertions.assertEquals( + "Could not install SDV resource group on CICS region " + + regionaApplid, + exception.getMessage() + ); + + } + + @Test + void testPrepareEnvironmentsCedaInstallDfhxsdException() + throws IllegalArgumentException, IllegalAccessException, InstantiationException, + InvocationTargetException, NoSuchMethodException, SecurityException, + NoSuchFieldException, ClassNotFoundException, ZosBatchException, + TestBundleResourceException, IOException, DynamicStatusStoreException, + CicstsManagerException, CredentialsException, SdvManagerException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.eq("SDVGRP")); + Mockito.doThrow(new CedaException("could not install")).when(ceda) + .installGroup(Mockito.any(), Mockito.eq("DFHXSD")); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we call ceda & cemt to create resources + Mockito.verify(cemt, Mockito.times(0)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(3)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(2)).installGroup(Mockito.any(), Mockito.any()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog, Mockito.times(1)).info( + "Couldn't install DFHXSD, already installed on CICS Region " + + regionaApplid + ); + + } + + @Test + void testPrepareEnvironmentsBatchJobThrowsException() throws CredentialsException, + SdvManagerException, DynamicStatusStoreException, TestBundleResourceException, + IOException, ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException, CicstsManagerException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenThrow(new ZosBatchException("bad job run")); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.prepareEnvironments(structureString); + }); + + Assertions.assertEquals( + "Unable to run JCL to define logstreams for CICS Region " + + regionaApplid, + exception.getMessage() + ); + } + + @Test + void testPrepareEnvironmentsDssThrowsException() + throws DynamicStatusStoreException, NoSuchFieldException, SecurityException, + IllegalArgumentException, IllegalAccessException, InstantiationException, + InvocationTargetException, NoSuchMethodException, CicstsManagerException, + CredentialsException, SdvManagerException, ClassNotFoundException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenThrow(new DynamicStatusStoreException("dss issues")); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, null, null, null, dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.prepareEnvironments(structureString); + }); + + Assertions.assertEquals("Unable interact with DSS for SDV.", exception.getMessage()); + } + + @Test + void testPrepareEnvironmentsCemtThrowsException() throws DynamicStatusStoreException, + TestBundleResourceException, IOException, CicstsManagerException, CredentialsException, + SdvManagerException, ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doThrow(new CemtException("bad news")).when(cemt).setResource(Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we call ceda & cemt to create resources + Mockito.verify(cemt, Mockito.times(1)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(3)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(2)).installGroup(Mockito.any(), Mockito.any()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog).debug( + "CICS resource disabling expectedly failed on " + + regionaApplid + ); + } + + @Test + void testPrepareEnvironmentsPortNotFound() throws SdvManagerException, IllegalArgumentException, + IllegalAccessException, NoSuchFieldException, SecurityException, InstantiationException, + InvocationTargetException, NoSuchMethodException, ZosBatchException, + TestBundleResourceException, IOException, DynamicStatusStoreException, + CredentialsException, CicstsManagerException, ClassNotFoundException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(true); + + // Mock SDVPort + sdvPort.when(() -> SdvPort.get(regionaTag)).thenReturn(null); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(16); // EXISTING RETURN CODE + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.prepareEnvironments(structureString); + }); + + Assertions.assertEquals( + "Could not find SDC port in CPS properties for CICS tag: " + + regionaTag, + exception.getMessage() + ); + + } + + @Test + void testPrepareEnvironmentsHttpResourcesDoNotAlreadyExist() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, TestBundleResourceException, IOException, + ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).createResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), + Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).installGroup(Mockito.any(), Mockito.any()); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.when( + ceda.resourceExists(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) + .thenReturn(false); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.putSwap(managerPrefixString + runningManagersString + regionaApplid, + null, testRunName)).thenReturn(true); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + regionaApplid + sdcLiveString, falseString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclCreateLogstreamPathString), Mockito.any())) + .thenReturn(createLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(16); // EXISTING RETURN CODE + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(createLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.prepareEnvironments(structureString); + + // Ensure that we call ceda & cemt was not used to disable resources + Mockito.verify(cemt, Mockito.times(0)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(3)).createResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(2)).installGroup(Mockito.any(), Mockito.any()); + } + + @Test + void testCleanUpEnvironmentsAsLastManagerOnRegionWithSdcActivation() + throws CredentialsException, SdvManagerException, ClassNotFoundException, + NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InstantiationException, InvocationTargetException, + NoSuchMethodException, ResourceUnavailableException, DynamicStatusStoreException, + CicstsManagerException, TestBundleResourceException, IOException, ZosBatchException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + Mockito.when(mockCicsbRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsbRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 1 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn(testRunName); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).delete(managerPrefixString + runningManagersString + regionaApplid); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).delete(managerPrefixString + regionaApplid + sdcLiveString); + + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionbApplid)) + .thenReturn(testRunName); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).delete(managerPrefixString + runningManagersString + regionbApplid); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).delete(managerPrefixString + regionbApplid + sdcLiveString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclDeleteLogstreamPathString), Mockito.any())) + .thenReturn(deleteLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(deleteLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + Mockito.when(batchManager.getZosBatch(regionbImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionbTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.cleanUpEnvironments(); + + // Ensure that we call ceda & cemt to delete resources + Mockito.verify(cemt, Mockito.times(4)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(2)).deleteGroup(Mockito.any(), Mockito.any()); + } + + @Test + void testCleanUpEnvironmentsNotAsLastManagerOnRegionWithSdcActivation() + throws CredentialsException, SdvManagerException, ClassNotFoundException, + NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InstantiationException, InvocationTargetException, + NoSuchMethodException, ResourceUnavailableException, DynamicStatusStoreException, + CicstsManagerException, TestBundleResourceException, IOException, ZosBatchException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + Mockito.when(mockCicsbRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsbRegion.cemt()).thenReturn(cemt); + // Mock RegionA Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 1 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn(testRunName + ",L564,L234"); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + runningManagersString + regionaApplid, + "L564,L234"); + + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionbApplid)) + .thenReturn(testRunName + ",L789,L101"); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).put(managerPrefixString + runningManagersString + regionbApplid, + "L789,L101"); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, null, null, null, dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionbTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.cleanUpEnvironments(); + + // Ensure that we do not call ceda & cemt to delete resources + Mockito.verify(cemt, Mockito.times(0)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(0)).deleteGroup(Mockito.any(), Mockito.any()); + } + + @Test + void testCleanUpEnvironmentsDssException() throws CredentialsException, SdvManagerException, + DynamicStatusStoreException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenThrow(new DynamicStatusStoreException("Unable interact with DSS for SDV.")); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, null, null, null, dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.cleanUpEnvironments(); + }); + + Assertions.assertEquals("Unable interact with DSS for SDV.", exception.getMessage()); + } + + @Test + void testCleanUpEnvironmentsCedaDeleteGroupThrowsException() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException, + TestBundleResourceException, IOException, ZosBatchException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doThrow(new CedaException("cannot delete group")).when(ceda) + .deleteGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn(testRunName); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclDeleteLogstreamPathString), Mockito.any())) + .thenReturn(deleteLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(deleteLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + Mockito.when(batchManager.getZosBatch(regionbImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.cleanUpEnvironments(); + + Mockito.verify(cemt, Mockito.times(2)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + Mockito.verify(ceda, Mockito.times(1)).deleteGroup(Mockito.any(), Mockito.any()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog).error(Mockito.eq( + "Could not delete the SDVGRP on CICS Region " + + regionaApplid + ), Mockito.any()); + } + + @Test + void testCleanUpEnvironmentsDeleteSrrLogstreamJobError() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, TestBundleResourceException, IOException, + ZosBatchException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn(testRunName); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclDeleteLogstreamPathString), Mockito.any())) + .thenReturn(deleteLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(8); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(deleteLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + Mockito.when(batchManager.getZosBatch(regionbImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.cleanUpEnvironments(); + }); + + Assertions.assertEquals( + "JCL to delete logstreams fail on CICS Region " + + regionaApplid + + ", check artifacts for more details.", + exception.getMessage() + ); + } + + @Test + void testCleanUpEnvironmentsArtifactManagerException() throws CicstsManagerException, + CredentialsException, SdvManagerException, DynamicStatusStoreException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, TestBundleResourceException, IOException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cemt).setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn(testRunName); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclDeleteLogstreamPathString), Mockito.any())) + .thenThrow(new TestBundleResourceException("not found")); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, null, null, dssService, + null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.cleanUpEnvironments(); + }); + + Assertions.assertEquals( + "Unable to run JCL to delete logstreams for CICS Region " + + regionaApplid, + exception.getMessage() + ); + } + + @Test + void testCleanUpEnvironmentsCemtSetResourceException() + throws CicstsManagerException, CredentialsException, SdvManagerException, + DynamicStatusStoreException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, ClassNotFoundException, + TestBundleResourceException, IOException, ZosBatchException { + // Mock Cemt + ICemt cemt = Mockito.mock(ICemt.class); + Mockito.doThrow(new CemtException("couldn't set resource")).when(cemt) + .setResource(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + + // Mock Ceda + ICeda ceda = Mockito.mock(ICeda.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(ceda).deleteGroup(Mockito.any(), Mockito.any()); + + Mockito.when(mockCicsaRegion.ceda()).thenReturn(ceda); + Mockito.when(mockCicsaRegion.cemt()).thenReturn(cemt); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(testRunName); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.get(managerPrefixString + runningManagersString + regionaApplid)) + .thenReturn(testRunName); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString( + Mockito.eq(jclDeleteLogstreamPathString), Mockito.any())) + .thenReturn(deleteLogstreamJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJob.waitForJob()).thenReturn(0); + IZosBatch zosBatch = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatch.submitJob(deleteLogstreamJcl, null)).thenReturn(zosJob); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatch); + Mockito.when(batchManager.getZosBatch(regionbImage)).thenReturn(zosBatch); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(framework, recordingRegions, artifactManager, batchManager, null, + dssService, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionaTag)).thenReturn(true); + sdvSdcActivation.when(() -> SdvSdcActivation.get(regionbTag)).thenReturn(true); + + // Make call to funtion under test + sdvHttpRecorder.cleanUpEnvironments(); + + // Ensure that we call ceda & cemt to create resources + Mockito.verify(ceda, Mockito.times(1)).deleteGroup(Mockito.any(), Mockito.any()); + Mockito.verify(cemt, Mockito.times(2)).setResource(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog, Mockito.times(1)) + .error("Could not create URIMAP on CICS Region " + regionaApplid); + Mockito.verify(mockLog, Mockito.times(1)) + .error("Could not create TCPIPSERVICE on CICS Region " + regionaApplid); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingNoExistingSdcForMultipleRegionsAndUsers() + throws SdvManagerException, CicstsManagerException, CredentialsException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, URISyntaxException, HttpClientException { + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock RegionB Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionB + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 3 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(404); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock POST JSON return from SDC - to start recording + HttpClientResponse mockPostResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockPostResponse1.getStatusCode()).thenReturn(201); + JsonObject postResponseContent1 = new JsonObject(); + postResponseContent1.addProperty(srrIdString, srrId1); + Mockito.when(mockPostResponse1.getContent()).thenReturn(postResponseContent1); + JsonObject postBody = new JsonObject(); + Mockito.when(httpClient1.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse1); + + // Mock HTTP Client - 2nd time + IHttpClient httpClient2 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient2) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient2).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse2 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse2.getStatusCode()).thenReturn(404); + Mockito.when(httpClient2.getJson(sdcUrl)).thenReturn(mockGetResponse2); + // Mock POST JSON return from SDC - to start recording + HttpClientResponse mockPostResponse2 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockPostResponse2.getStatusCode()).thenReturn(201); + JsonObject postResponseContent2 = new JsonObject(); + postResponseContent2.addProperty(srrIdString, srrId2); + Mockito.when(mockPostResponse2.getContent()).thenReturn(postResponseContent2); + Mockito.when(httpClient2.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse2); + + // Mock HTTP Client - 3rd time + IHttpClient httpClient3 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient3) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient3).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse3 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse3.getStatusCode()).thenReturn(404); + Mockito.when(httpClient3.getJson(sdcUrl)).thenReturn(mockGetResponse3); + // Mock POST JSON return from SDC - to start recording + HttpClientResponse mockPostResponse3 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockPostResponse3.getStatusCode()).thenReturn(201); + JsonObject postResponseContent3 = new JsonObject(); + postResponseContent3.addProperty(srrIdString, srrId3); + Mockito.when(mockPostResponse3.getContent()).thenReturn(postResponseContent3); + Mockito.when(httpClient3.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse3); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1, httpClient2, httpClient3); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvHttpRecorder.startRecording(); + + // Assert HTTP endpoints called + Mockito.verify(httpClient1, Mockito.times(1)).getJson(Mockito.any()); + Mockito.verify(httpClient1, Mockito.times(1)).postJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient2, Mockito.times(1)).getJson(Mockito.any()); + Mockito.verify(httpClient2, Mockito.times(1)).postJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient3, Mockito.times(1)).getJson(Mockito.any()); + Mockito.verify(httpClient3, Mockito.times(1)).postJson(Mockito.any(), Mockito.any()); + + // Assert that all users are set to recording with SRR IDs + List expectedSrrIdsList = new ArrayList<>(); + expectedSrrIdsList.add(srrId1); + expectedSrrIdsList.add(srrId2); + expectedSrrIdsList.add(srrId3); + + Assertions.assertEquals(true, user1.isRecording()); + Assertions.assertTrue(expectedSrrIdsList.contains(user1.getSrrId())); + Assertions.assertEquals(true, user1.isRecording()); + expectedSrrIdsList.remove(user1.getSrrId()); + + Assertions.assertEquals(true, user2.isRecording()); + Assertions.assertTrue(expectedSrrIdsList.contains(user2.getSrrId())); + Assertions.assertEquals(true, user2.isRecording()); + expectedSrrIdsList.remove(user2.getSrrId()); + + Assertions.assertEquals(true, user3.isRecording()); + Assertions.assertTrue(expectedSrrIdsList.contains(user3.getSrrId())); + Assertions.assertEquals(true, user3.isRecording()); + expectedSrrIdsList.remove(user3.getSrrId()); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingExistingSdcForMultipleRegionsAndUsers() + throws CicstsManagerException, CredentialsException, SdvManagerException, + URISyntaxException, HttpClientException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + rrA.addUserToRecord(user2); + + // Mock RegionB Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionB + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 3 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(200); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock DELETE JSON return from SDC - to stop existing SDC + HttpClientResponse mockDeleteResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockDeleteResponse1.getStatusCode()).thenReturn(200); + JsonObject deleteBody = new JsonObject(); + deleteBody.addProperty(submitString, false); + Mockito.when(httpClient1.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse1); + // Mock POST JSON return from SDC - to start recording + HttpClientResponse mockPostResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockPostResponse1.getStatusCode()).thenReturn(201); + JsonObject postResponseContent1 = new JsonObject(); + postResponseContent1.addProperty(srrIdString, srrId1); + Mockito.when(mockPostResponse1.getContent()).thenReturn(postResponseContent1); + JsonObject postBody = new JsonObject(); + Mockito.when(httpClient1.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse1); + + // Mock HTTP Client - 2nd time + IHttpClient httpClient2 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient2) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient2).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse2 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse2.getStatusCode()).thenReturn(200); + Mockito.when(httpClient2.getJson(sdcUrl)).thenReturn(mockGetResponse2); + // Mock DELETE JSON return from SDC - to stop existing SDC + HttpClientResponse mockDeleteResponse2 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockDeleteResponse2.getStatusCode()).thenReturn(200); + Mockito.when(httpClient2.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse2); + // Mock POST JSON return from SDC - to start recording + HttpClientResponse mockPostResponse2 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockPostResponse2.getStatusCode()).thenReturn(201); + JsonObject postResponseContent2 = new JsonObject(); + postResponseContent2.addProperty(srrIdString, srrId2); + Mockito.when(mockPostResponse2.getContent()).thenReturn(postResponseContent2); + Mockito.when(httpClient2.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse2); + + // Mock HTTP Client - 3rd time + IHttpClient httpClient3 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient3) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient3).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse3 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse3.getStatusCode()).thenReturn(200); + Mockito.when(httpClient3.getJson(sdcUrl)).thenReturn(mockGetResponse3); + // Mock DELETE JSON return from SDC - to stop existing SDC + HttpClientResponse mockDeleteResponse3 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockDeleteResponse3.getStatusCode()).thenReturn(200); + Mockito.when(httpClient3.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse3); + // Mock POST JSON return from SDC - to start recording + HttpClientResponse mockPostResponse3 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockPostResponse3.getStatusCode()).thenReturn(201); + JsonObject postResponseContent3 = new JsonObject(); + postResponseContent3.addProperty(srrIdString, srrId3); + Mockito.when(mockPostResponse3.getContent()).thenReturn(postResponseContent3); + Mockito.when(httpClient3.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse3); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1, httpClient2, httpClient3); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvHttpRecorder.startRecording(); + + // Assert HTTP endpoints called + Mockito.verify(httpClient1, Mockito.times(1)).getJson(Mockito.any()); + Mockito.verify(httpClient1, Mockito.times(1)).deleteJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient1, Mockito.times(1)).postJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient2, Mockito.times(1)).getJson(Mockito.any()); + Mockito.verify(httpClient2, Mockito.times(1)).deleteJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient2, Mockito.times(1)).postJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient3, Mockito.times(1)).getJson(Mockito.any()); + Mockito.verify(httpClient3, Mockito.times(1)).deleteJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient3, Mockito.times(1)).postJson(Mockito.any(), Mockito.any()); + + // Assert that all users are set to recording with SRR IDs + List expectedSrrIdsList = new ArrayList<>(); + expectedSrrIdsList.add(srrId1); + expectedSrrIdsList.add(srrId2); + expectedSrrIdsList.add(srrId3); + + Assertions.assertEquals(true, user1.isRecording()); + Assertions.assertTrue(expectedSrrIdsList.contains(user1.getSrrId())); + Assertions.assertEquals(true, user1.isRecording()); + expectedSrrIdsList.remove(user1.getSrrId()); + + Assertions.assertEquals(true, user2.isRecording()); + Assertions.assertTrue(expectedSrrIdsList.contains(user2.getSrrId())); + Assertions.assertEquals(true, user2.isRecording()); + expectedSrrIdsList.remove(user2.getSrrId()); + + Assertions.assertEquals(true, user3.isRecording()); + Assertions.assertTrue(expectedSrrIdsList.contains(user3.getSrrId())); + Assertions.assertEquals(true, user3.isRecording()); + expectedSrrIdsList.remove(user3.getSrrId()); + + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingHttpGetSdcServerError() throws CredentialsException, SdvManagerException, + URISyntaxException, HttpClientException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException, CicstsManagerException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(500); + Mockito.when(mockGetResponse1.getStatusMessage()).thenReturn(errorMessageString); + JsonObject getResponseContent1 = new JsonObject(); + getResponseContent1.addProperty(srrIdString, nullString); + getResponseContent1.addProperty(messagePropString, serverErrorMessage); + Mockito.when(mockGetResponse1.getContent()).thenReturn(getResponseContent1); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Error whilst obtaining current SDC status for user 'user1', " + + "on CICS Region APPL1. Status code: 500" + + errorOutputBadStuffString + errorOutputPayloadStrng, + exception.getCause().getMessage() + ); + } + + @Test + void testStartRecordingGetHttpClientException() + throws CicstsManagerException, CredentialsException, SdvManagerException, + URISyntaxException, HttpClientException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + Mockito.when(httpClient1.getJson(sdcUrl)) + .thenThrow(new HttpClientException("Could not get response from SDC")); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Could not check status SDC recording status for user '" + + user1String + + onCicsRegionMsg + + regionaApplid + + ". Is SDC activated?", + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingHttpDeleteSdcServerError() + throws CicstsManagerException, CredentialsException, SdvManagerException, + URISyntaxException, HttpClientException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, ClassNotFoundException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(200); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock DELETE JSON return from SDC - to stop existing SDC + HttpClientResponse mockDeleteResponse1 = Mockito.mock(HttpClientResponse.class); + JsonObject deleteResponseContent1 = new JsonObject(); + deleteResponseContent1.addProperty(srrIdString, nullString); + deleteResponseContent1.addProperty(messagePropString, serverErrorMessage); + Mockito.when(mockDeleteResponse1.getStatusCode()).thenReturn(500); + Mockito.when(mockDeleteResponse1.getStatusMessage()).thenReturn(errorMessageString); + Mockito.when(mockDeleteResponse1.getContent()).thenReturn(deleteResponseContent1); + JsonObject deleteBody = new JsonObject(); + deleteBody.addProperty(submitString, false); + Mockito.when(httpClient1.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse1); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Could not stop SDC recording for user '" + + user1String + + onCicsRegionMsg + + regionaApplid + + ". Status code: 500" + + errorOutputBadStuffString + + errorOutputPayloadStrng, + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingDeleteHttpClientException() + throws HttpClientException, CicstsManagerException, CredentialsException, + SdvManagerException, URISyntaxException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(200); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock DELETE JSON return from SDC - to stop existing SDC + JsonObject deleteBody = new JsonObject(); + deleteBody.addProperty(submitString, false); + Mockito.when(httpClient1.deleteJson(sdcUrl, deleteBody)) + .thenThrow(new HttpClientException("No response")); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Could not stop existing SDC recording for user '" + + user1String + + onCicsRegionMsg + + regionaApplid + + ".", + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingHttpPostSdcServerError() + throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, + SecurityException, InstantiationException, InvocationTargetException, + NoSuchMethodException, HttpClientException, URISyntaxException, ClassNotFoundException, + SdvManagerException, CredentialsException, CicstsManagerException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(404); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock POST return from SDC + HttpClientResponse mockPostResponse1 = Mockito.mock(HttpClientResponse.class); + JsonObject postResponseContent1 = new JsonObject(); + postResponseContent1.addProperty(srrIdString, nullString); + postResponseContent1.addProperty(messagePropString, serverErrorMessage); + Mockito.when(mockPostResponse1.getStatusCode()).thenReturn(500); + Mockito.when(mockPostResponse1.getStatusMessage()).thenReturn(errorMessageString); + Mockito.when(mockPostResponse1.getContent()).thenReturn(postResponseContent1); + JsonObject postBody = new JsonObject(); + Mockito.when(httpClient1.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse1); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Could not start SDC recording for user '" + + user1String + + onCicsRegionMsg + + regionaApplid + + ". Status code: 500" + + errorOutputBadStuffString + + errorOutputPayloadStrng, + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingPostHttpClientException() + throws CicstsManagerException, CredentialsException, SdvManagerException, + URISyntaxException, HttpClientException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(404); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock POST return from SDC + JsonObject postBody = new JsonObject(); + Mockito.when(httpClient1.postJson(sdcUrl, postBody)) + .thenThrow(new HttpClientException("no response")); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Could not start SDC recording for user '" + + user1String + + onCicsRegionMsg + + regionaApplid, + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testStartRecordingNoSrrIdInResponse() + throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, + SecurityException, InstantiationException, InvocationTargetException, + NoSuchMethodException, ClassNotFoundException, HttpClientException, + CicstsManagerException, CredentialsException, SdvManagerException, URISyntaxException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock GET JSON return from SDC - to find current status + HttpClientResponse mockGetResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockGetResponse1.getStatusCode()).thenReturn(404); + Mockito.when(httpClient1.getJson(sdcUrl)).thenReturn(mockGetResponse1); + // Mock POST return from SDC + HttpClientResponse mockPostResponse1 = Mockito.mock(HttpClientResponse.class); + JsonObject postResponseContent1 = new JsonObject(); + postResponseContent1.addProperty(srrIdString, ""); + postResponseContent1.addProperty(messagePropString, "edge case"); + Mockito.when(mockPostResponse1.getStatusCode()).thenReturn(201); + Mockito.when(mockPostResponse1.getStatusMessage()).thenReturn(errorMessageString); + Mockito.when(mockPostResponse1.getContent()).thenReturn(postResponseContent1); + JsonObject postBody = new JsonObject(); + Mockito.when(httpClient1.postJson(sdcUrl, postBody)).thenReturn(mockPostResponse1); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "SDC recording did not return an SRR ID for user '" + + user1String + + onCicsRegionMsg + + regionaApplid, + exception.getCause().getMessage() + ); + } + + @Test + void testStartRecordingBadUri() throws IllegalArgumentException, IllegalAccessException, + NoSuchFieldException, SecurityException, InstantiationException, + InvocationTargetException, NoSuchMethodException, ClassNotFoundException, + SdvManagerException, CredentialsException, CicstsManagerException { + // Mock SDVPort + sdvPort.when(() -> SdvPort.get(regionaTag)).thenReturn("////gfg\\"); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setURI(Mockito.any()); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.startRecording(); + }); + + Assertions.assertEquals(user1UnableToStartErrorString, exception.getMessage()); + Assertions.assertEquals( + "Badly formed URI for SDC service for CICS Region " + + regionaApplid, + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testEndRecordingForMultipleRegionsAndUsers() + throws SdvManagerException, CicstsManagerException, CredentialsException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, URISyntaxException, HttpClientException { + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + user2.setSrrId(srrId2); + rrA.addUserToRecord(user2); + + // Mock RegionB Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionB + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 3 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + user3.setSrrId(srrId3); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock DELETE JSON return from SDC + HttpClientResponse mockDeleteResponse1 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockDeleteResponse1.getStatusCode()).thenReturn(200); + JsonObject deleteBody = new JsonObject(); + deleteBody.addProperty(submitString, false); + Mockito.when(httpClient1.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse1); + + // Mock HTTP Client - 2nd time + IHttpClient httpClient2 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient2) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient2).setAuthorisation(user1String, passwordString); + // Mock DELETE JSON return from SDC + HttpClientResponse mockDeleteResponse2 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockDeleteResponse2.getStatusCode()).thenReturn(200); + Mockito.when(httpClient2.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse2); + + // Mock HTTP Client - 3rd time + IHttpClient httpClient3 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient3) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient3).setAuthorisation(user1String, passwordString); + // Mock DELETE JSON return from SDC + HttpClientResponse mockDeleteResponse3 = Mockito.mock(HttpClientResponse.class); + Mockito.when(mockDeleteResponse3.getStatusCode()).thenReturn(200); + Mockito.when(httpClient3.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse3); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1, httpClient2, httpClient3); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvHttpRecorder.endRecording(); + + // Assert HTTP endpoints called + Mockito.verify(httpClient1, Mockito.times(1)).deleteJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient2, Mockito.times(1)).deleteJson(Mockito.any(), Mockito.any()); + Mockito.verify(httpClient3, Mockito.times(1)).deleteJson(Mockito.any(), Mockito.any()); + + // Assert that all users are no longer recording + Assertions.assertEquals(false, user1.isRecording()); + Assertions.assertEquals(false, user2.isRecording()); + Assertions.assertEquals(false, user3.isRecording()); + + } + + @SuppressWarnings(uncheckedString) + @Test + void testEndRecordingDeleteServerError() + throws SdvManagerException, CicstsManagerException, CredentialsException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, URISyntaxException, HttpClientException { + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock DELETE JSON return from SDC + HttpClientResponse mockDeleteResponse1 = Mockito.mock(HttpClientResponse.class); + JsonObject deleteResponseContent1 = new JsonObject(); + deleteResponseContent1.addProperty(srrIdString, nullString); + deleteResponseContent1.addProperty(messagePropString, serverErrorMessage); + Mockito.when(mockDeleteResponse1.getStatusCode()).thenReturn(500); + Mockito.when(mockDeleteResponse1.getStatusMessage()).thenReturn(errorMessageString); + Mockito.when(mockDeleteResponse1.getContent()).thenReturn(deleteResponseContent1); + JsonObject deleteBody = new JsonObject(); + deleteBody.addProperty(submitString, false); + Mockito.when(httpClient1.deleteJson(sdcUrl, deleteBody)).thenReturn(mockDeleteResponse1); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.endRecording(); + }); + + Assertions.assertEquals( + "Unable to stop SRR recording " + + srrId1 + + ", for user '" + + user1String + + onCicsRegionMsg + + regionaApplid, + exception.getMessage() + ); + Assertions.assertEquals( + "Could not stop SDC recording for user '" + + user1String + + onCicsRegionMsg + + regionaApplid + + ". Status code: 500" + + errorOutputBadStuffString + + errorOutputPayloadStrng, + exception.getCause().getMessage() + ); + } + + @SuppressWarnings(uncheckedString) + @Test + void testEndRecordingDeleteHttpClientException() + throws SdvManagerException, CicstsManagerException, CredentialsException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, URISyntaxException, HttpClientException { + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1) + .setURI(new URI(httpString + cicsServerStringA + ":" + regionAportString)); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setAuthorisation(user1String, passwordString); + // Mock DELETE JSON return from SDC + JsonObject deleteBody = new JsonObject(); + deleteBody.addProperty(submitString, false); + Mockito.when(httpClient1.deleteJson(sdcUrl, deleteBody)) + .thenThrow(new HttpClientException("Nothing back")); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.endRecording(); + }); + + Assertions.assertEquals( + "Unable to stop SRR recording " + + srrId1 + + ", for user '" + + user1String + + onCicsRegionMsg + + regionaApplid, + exception.getMessage() + ); + Assertions.assertEquals( + "Could not stop existing SDC recording for user '" + + user1String + + onCicsRegionMsg + + regionaApplid, + exception.getCause().getMessage() + ); + } + + @Test + void testEndRecordingBadUri() throws CredentialsException, SdvManagerException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException { + // Mock SDVPort + sdvPort.when(() -> SdvPort.get(regionaTag)).thenReturn("////gfg\\"); + + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock HTTP Client - 1st time + IHttpClient httpClient1 = Mockito.mock(IHttpClient.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(httpClient1).setURI(Mockito.any()); + + // Mock HTTP Manager + IHttpManagerSpi httpManager = Mockito.mock(IHttpManagerSpi.class); + Mockito.when(httpManager.newHttpClient()).thenReturn(httpClient1); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, null, null, null, null, httpManager); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.endRecording(); + }); + + Assertions.assertEquals( + "Unable to stop SRR recording " + + srrId1 + + ", for user '" + + user1String + + onCicsRegionMsg + + regionaApplid, + exception.getMessage() + ); + Assertions.assertEquals( + "Badly formed URI for SDC service for CICS Region " + + regionaApplid, + exception.getCause().getMessage() + ); + } + + @Test + void testExportRecordingsForMulitpleRegions() + throws CredentialsException, SdvManagerException, ClassNotFoundException, + InstantiationException, IllegalAccessException, IllegalArgumentException, + InvocationTargetException, NoSuchMethodException, SecurityException, + NoSuchFieldException, TestBundleResourceException, IOException, ZosBatchException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + user1.setNotRecording(); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + user2.setSrrId(srrId2); + user2.setNotRecording(); + rrA.addUserToRecord(user2); + + // Mock RegionA Terminal + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrB = new RecordingRegion(regionbTerminal); + // Mock user 1 + ICredentialsUsernamePassword user3Creds = + new CredentialsUsernamePassword(null, user3String, passwordString); + ISdvUser user3 = new SdvUserImpl(creds3String, user3Creds, regionbTag, tellerRoleString); + user3.setSrrId(srrId3); + user3.setNotRecording(); + rrB.addUserToRecord(user3); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + recordingRegions.put(mockCicsbRegion, rrB); + + String getYamlJcl = + IOUtils.toString(this.getClass().getResourceAsStream(getYamlString), utfString); + + String getYamlAppendedRegionaJcl = IOUtils + .toString(this.getClass().getResourceAsStream("/getYamlRegionA.jcl"), utfString); + + String getYamlAppendedRegionbJcl = IOUtils + .toString(this.getClass().getResourceAsStream("/getYamlRegionB.jcl"), utfString); + + String regionAyaml = IOUtils + .toString(this.getClass().getResourceAsStream("/yamlRegionA.yaml"), utfString); + + String regionByaml = IOUtils + .toString(this.getClass().getResourceAsStream("/yamlRegionB.yaml"), utfString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString(Mockito.eq(jclGetYamlPathString), + Mockito.any())).thenReturn(getYamlJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJobA = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJobA.waitForJob()).thenReturn(0); + IZosBatchJob zosJobB = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJobB.waitForJob()).thenReturn(0); + IZosBatchJobOutput batchJobOutputRegionA = Mockito.mock(IZosBatchJobOutput.class); + IZosBatchJobOutput batchJobOutputRegionB = Mockito.mock(IZosBatchJobOutput.class); + List spoolFilesRegionA = new ArrayList<>(); + IZosBatchJobOutputSpoolFile spoolYamlFileRegionA = new ZosBatchJobOutputSpoolFileImpl( + zosJobA, "JobA", "ID123", "STEPA", "PROCA", "YAML", "SECA", regionAyaml); + spoolFilesRegionA.add(spoolYamlFileRegionA); + List spoolFilesRegionB = new ArrayList<>(); + IZosBatchJobOutputSpoolFile spoolYamlFileRegionB = new ZosBatchJobOutputSpoolFileImpl( + zosJobB, "JobB", "ID234", "STEPB", "PROCB", "YAML", "SECB", regionByaml); + spoolFilesRegionB.add(spoolYamlFileRegionB); + Mockito.when(batchJobOutputRegionA.getSpoolFiles()).thenReturn(spoolFilesRegionA); + Mockito.when(batchJobOutputRegionB.getSpoolFiles()).thenReturn(spoolFilesRegionB); + Mockito.when(zosJobA.retrieveOutput()).thenReturn(batchJobOutputRegionA); + Mockito.when(zosJobB.retrieveOutput()).thenReturn(batchJobOutputRegionB); + IZosBatch zosBatchRegionA = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatchRegionA.submitJob(getYamlAppendedRegionaJcl, null)) + .thenReturn(zosJobA); + IZosBatch zosBatchRegionB = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatchRegionB.submitJob(getYamlAppendedRegionbJcl, null)) + .thenReturn(zosJobB); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatchRegionA); + Mockito.when(batchManager.getZosBatch(regionbImage)).thenReturn(zosBatchRegionB); + + Path storedArtifactRoot = Mockito.mock(Path.class); + Path finalYamlPath = Mockito.mock(Path.class); + Mockito.when(storedArtifactRoot.resolve("bundleB/TestClassB.CICSA.cics-security.yaml")) + .thenReturn(finalYamlPath); + Mockito.when(storedArtifactRoot.resolve("bundleB/TestClassB.CICSB.cics-security.yaml")) + .thenReturn(finalYamlPath); + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, artifactManager, batchManager, + storedArtifactRoot, null, null); + + files.when(() -> Files.write(Mockito.eq(finalYamlPath), + Mockito.eq(regionAyaml.getBytes(utfString)), Mockito.any())).thenReturn(null); + + files.when(() -> Files.write(Mockito.eq(finalYamlPath), + Mockito.eq(regionByaml.getBytes(utfString)), Mockito.any())).thenReturn(null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + sdvHttpRecorder.exportRecordings("bundleB", "TestClassB"); + + // If these write calls are made, we can say all mocks were used with + // their expected attributes and all works + files.verify(() -> Files.write(finalYamlPath, regionAyaml.getBytes(utfString), + StandardOpenOption.CREATE), Mockito.times(1)); + + files.verify(() -> Files.write(finalYamlPath, regionByaml.getBytes(utfString), + StandardOpenOption.CREATE), Mockito.times(1)); + + Mockito.verify(mockLog, Mockito.times(1)) + .info("Storing YAML as test artifact for " + regionaApplid); + + Mockito.verify(mockLog, Mockito.times(1)) + .info("Storing YAML as test artifact for " + regionbApplid); + } + + @Test + void testExportRecordingsWithBadSrrIdForRecording() + throws CredentialsException, SdvManagerException, IOException, + TestBundleResourceException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(null); + user1.setNotRecording(); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + String getYamlJcl = + IOUtils.toString(this.getClass().getResourceAsStream(getYamlString), utfString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString(Mockito.eq(jclGetYamlPathString), + Mockito.any())).thenReturn(getYamlJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, artifactManager, null, null, null, null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + files.when(() -> Files.write(Mockito.any(Path.class), Mockito.any(byte[].class), + Mockito.any(OpenOption.class))).thenReturn(null); + + sdvHttpRecorder.exportRecordings("bundleC", "TestClassC"); + + files.verify(() -> Files.write(Mockito.any(Path.class), Mockito.any(byte[].class), + Mockito.any(OpenOption.class)), Mockito.times(0)); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog).warn("No SDC registered for user " + user1String + " on region " + + regionaApplid + ", skipping YAML generation."); + + } + + @Test + void testExportRecordingsYamlJobErrorCode() + throws CredentialsException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException, SdvManagerException, + ZosBatchException, IOException, TestBundleResourceException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + user1.setNotRecording(); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + String getYamlJcl = + IOUtils.toString(this.getClass().getResourceAsStream(getYamlString), utfString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString(Mockito.eq(jclGetYamlPathString), + Mockito.any())).thenReturn(getYamlJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJobA = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJobA.waitForJob()).thenReturn(12); + IZosBatchJobOutput batchJobOutputRegionA = Mockito.mock(IZosBatchJobOutput.class); + List spoolFilesRegionA = new ArrayList<>(); + Mockito.when(batchJobOutputRegionA.getSpoolFiles()).thenReturn(spoolFilesRegionA); + Mockito.when(zosJobA.retrieveOutput()).thenReturn(batchJobOutputRegionA); + IZosBatch zosBatchRegionA = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatchRegionA.submitJob(Mockito.any(), Mockito.eq(null))) + .thenReturn(zosJobA); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatchRegionA); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, artifactManager, batchManager, null, null, + null); + + files.when(() -> Files.write(Mockito.any(Path.class), Mockito.any(byte[].class), + Mockito.any(OpenOption.class))).thenReturn(null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.exportRecordings("bundleD", "TestClassD"); + }); + + Assertions.assertEquals( + "Security metadata job did not return any YAML for CICS Region " + + regionaApplid + + ", containing SRR IDs: " + + srrId1, + exception.getMessage() + ); + + files.verify(() -> Files.write(Mockito.any(Path.class), Mockito.any(byte[].class), + Mockito.any(OpenOption.class)), Mockito.times(0)); + + Mockito.verify(mockLog, Mockito.times(1)).error( + "JCL to get Security metadata fail on CICS Region " + + regionaApplid + + ", check artifacts for more details" + ); + } + + @Test + void testExportRecordingsArtifactFindException() throws CredentialsException, + SdvManagerException, IOException, TestBundleResourceException, ZosBatchException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + user1.setNotRecording(); + rrA.addUserToRecord(user1); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString(Mockito.eq(jclGetYamlPathString), + Mockito.any())).thenThrow(new TestBundleResourceException("cant find files")); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, artifactManager, null, null, null, null); + + files.when(() -> Files.write(Mockito.any(Path.class), Mockito.any(byte[].class), + Mockito.any(OpenOption.class))).thenReturn(null); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.exportRecordings("bundleE", "TestClassE"); + }); + + Assertions.assertEquals( + "Unable to run JCL to get Security metadata on CICS Region " + + regionaApplid, + exception.getMessage() + ); + + files.verify(() -> Files.write(Mockito.any(Path.class), Mockito.any(byte[].class), + Mockito.any(OpenOption.class)), Mockito.times(0)); + } + + @Test + void testExportRecordingsUnableToSaveYamlFile() throws CredentialsException, + SdvManagerException, IOException, TestBundleResourceException, ZosBatchException, + ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException { + // Mock RegionA Terminal + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + // Mock RecordingRegionA + RecordingRegion rrA = new RecordingRegion(regionaTerminal); + // Mock user 1 + ICredentialsUsernamePassword user1Creds = + new CredentialsUsernamePassword(null, user1String, passwordString); + ISdvUser user1 = new SdvUserImpl(creds1String, user1Creds, regionaTag, tellerRoleString); + user1.setSrrId(srrId1); + user1.setNotRecording(); + rrA.addUserToRecord(user1); + // Mock user 2 + ICredentialsUsernamePassword user2Creds = + new CredentialsUsernamePassword(null, user2String, passwordString); + ISdvUser user2 = new SdvUserImpl(creds2String, user2Creds, regionaTag, adminRoleString); + user2.setSrrId(srrId2); + user2.setNotRecording(); + rrA.addUserToRecord(user2); + + // Mock recordingRegions + Map recordingRegions = new HashMap<>(); + recordingRegions.put(mockCicsaRegion, rrA); + + String getYamlJcl = + IOUtils.toString(this.getClass().getResourceAsStream(getYamlString), utfString); + + String getYamlAppendedRegionaJcl = IOUtils + .toString(this.getClass().getResourceAsStream("/getYamlRegionA.jcl"), utfString); + + String regionAyaml = IOUtils + .toString(this.getClass().getResourceAsStream("/yamlRegionA.yaml"), utfString); + + // Mock artifactManager + IBundleResources bundleResources = Mockito.mock(IBundleResources.class); + Mockito.when(bundleResources.retrieveSkeletonFileAsString(Mockito.eq(jclGetYamlPathString), + Mockito.any())).thenReturn(getYamlJcl); + IArtifactManager artifactManager = Mockito.mock(IArtifactManager.class); + Mockito.when(artifactManager.getBundleResources(SdvHttpRecorderImpl.class)) + .thenReturn(bundleResources); + + // Mock batchManager + IZosBatchJob zosJobA = Mockito.mock(IZosBatchJob.class); + Mockito.when(zosJobA.waitForJob()).thenReturn(0); + IZosBatchJobOutput batchJobOutputRegionA = Mockito.mock(IZosBatchJobOutput.class); + List spoolFilesRegionA = new ArrayList<>(); + IZosBatchJobOutputSpoolFile spoolYamlFileRegionA = new ZosBatchJobOutputSpoolFileImpl( + zosJobA, "JobA", "ID123", "STEPA", "PROCA", "YAML", "SECA", regionAyaml); + spoolFilesRegionA.add(spoolYamlFileRegionA); + Mockito.when(batchJobOutputRegionA.getSpoolFiles()).thenReturn(spoolFilesRegionA); + Mockito.when(zosJobA.retrieveOutput()).thenReturn(batchJobOutputRegionA); + IZosBatch zosBatchRegionA = Mockito.mock(IZosBatch.class); + Mockito.when(zosBatchRegionA.submitJob(getYamlAppendedRegionaJcl, null)) + .thenReturn(zosJobA); + IZosBatchSpi batchManager = Mockito.mock(IZosBatchSpi.class); + Mockito.when(batchManager.getZosBatch(regionaImage)).thenReturn(zosBatchRegionA); + + Path storedArtifactRoot = Mockito.mock(Path.class); + Path finalYamlPath = Paths.get("/c/dir/" + "bundleF/TestClassF.CICSA.cics-security.yaml"); + Mockito.when(storedArtifactRoot.resolve("bundleF/TestClassF.CICSA.cics-security.yaml")) + .thenReturn(finalYamlPath); + Mockito.when(storedArtifactRoot.resolve("bundleF/TestClassF.CICSB.cics-security.yaml")) + .thenReturn(finalYamlPath); + // Mock SdvRecorderImpl + Class sdvHttpRecorderImplClass = Class.forName(sdvHttpRecorderImplClassString); + SdvHttpRecorderImpl sdvHttpRecorder = (SdvHttpRecorderImpl) sdvHttpRecorderImplClass + .getDeclaredConstructor(IFramework.class, Map.class, IArtifactManager.class, + IZosBatchSpi.class, Path.class, IDynamicStatusStoreService.class, + IHttpManagerSpi.class) + .newInstance(null, recordingRegions, artifactManager, batchManager, + storedArtifactRoot, null, null); + + files.when(() -> Files.write(Mockito.eq(finalYamlPath), + Mockito.eq(regionAyaml.getBytes(utfString)), Mockito.any())) + .thenThrow(new IOException("path not there")); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvHttpRecorderImplClass.getDeclaredField(logVariableString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + final Field superLoggerField = sdvHttpRecorderImplClass.getSuperclass() + .getDeclaredField(logVariableString); + final Object staticSuperLoggerFieldBase = unsafe.staticFieldBase(superLoggerField); + final long staticSuperLoggerFieldOffset = unsafe.staticFieldOffset(superLoggerField); + unsafe.putObject(staticSuperLoggerFieldBase, staticSuperLoggerFieldOffset, mockLog); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvHttpRecorder.exportRecordings("bundleF", "TestClassF"); + }); + + Assertions.assertEquals( + "Unable to add YAML to Galasa run for CICS Region APPL1. " + + "Attempting to save to path: /c/dir/bundleF/TestClassF.CICSA.cics-security.yaml", + exception.getMessage() + ); + + } + +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvManagerImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvManagerImpl.java new file mode 100644 index 000000000..7b5d3c103 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvManagerImpl.java @@ -0,0 +1,1935 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.ICredentialsUsernamePassword; +import dev.galasa.ManagerException; +import dev.galasa.ProductVersion; +import dev.galasa.artifact.internal.ArtifactManagerImpl; +import dev.galasa.cicsts.CicstsManagerException; +import dev.galasa.cicsts.ICicsRegion; +import dev.galasa.cicsts.ICicsTerminal; +import dev.galasa.cicsts.internal.CicstsManagerImpl; +import dev.galasa.cicsts.spi.ICicsRegionProvisioned; +import dev.galasa.cicsts.spi.ICicstsManagerSpi; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.IConfidentialTextService; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IManager; +import dev.galasa.framework.spi.IRun; +import dev.galasa.framework.spi.ResourceUnavailableException; +import dev.galasa.framework.spi.Result; +import dev.galasa.framework.spi.creds.CredentialsException; +import dev.galasa.framework.spi.creds.CredentialsUsernamePassword; +import dev.galasa.framework.spi.creds.ICredentialsService; +import dev.galasa.http.internal.HttpManagerImpl; +import dev.galasa.sdv.ISdvUser; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.SdvUser; +import dev.galasa.sdv.internal.properties.SdvHlq; +import dev.galasa.sdv.internal.properties.SdvPort; +import dev.galasa.sdv.internal.properties.SdvRole; +import dev.galasa.zos.internal.ZosManagerImpl; +import dev.galasa.zosbatch.IZosBatchJob; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.logging.Log; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import sun.misc.Unsafe; + + +class TestSdvManagerImpl { + + private MockedStatic sdvRole; + private MockedStatic sdvPort; + private MockedStatic sdvHlq; + private MockedStatic sdvUserPoolStatic; + + + @SuppressWarnings("PMD") + private static final Log mockLog = Mockito.mock(Log.class); + + private String testCicsTagA = "CICSA"; + private String testCicsTagB = "CICSB"; + private String testCicsTagC = "CICSC"; + private String roleNameTeller = "TELLER"; + private String roleNameAdmin = "ADMIN"; + private String roleNameOperator = "OPERATOR"; + private String testPort = "32000"; + private String sdvManagerImplClassString = "dev.galasa.sdv.internal.SdvManagerImpl"; + private String privateCicsManagerVariableName = "cicsManager"; + private String creds1Tag = "CREDS1"; + private String creds2Tag = "CREDS2"; + private String creds3Tag = "CREDS3"; + private String creds4Tag = "CREDS4"; + private String user1String = "user1"; + private String user2String = "user2"; + private String user3String = "user3"; + private String user4String = "user4"; + private String password1 = "password1"; + private String password2 = "password2"; + private String password3 = "password3"; + private String password4 = "password4"; + private String secOnMsg = "blah\n\nDFHXS1100I: Security initialization has started.\nblah"; + private String testClassString = "testClass"; + private String sdvUsersToRecordListString = "sdvUsersToRecordList"; + private String recordingRegionsString = "recordingRegions"; + private static final String uncheckedString = "unchecked"; + private String frameworkString = "framework"; + private String sdvRecorderVarName = "sdvRecorder"; + private String logString = "LOG"; + private String theUnsafeString = "theUnsafe"; + private String regionaApplid = "APPL1"; + private String runName = "RUN123"; + private String regionbApplid = "APPL2"; + + @BeforeAll + public static void beforeClass() { + Mockito.when(mockLog.isInfoEnabled()).thenReturn(true); + Mockito.when(mockLog.isWarnEnabled()).thenReturn(true); + Mockito.when(mockLog.isErrorEnabled()).thenReturn(true); + } + + @BeforeEach + public void setUp() { + // Registering static mocks before each test + sdvRole = Mockito.mockStatic(SdvRole.class); + sdvPort = Mockito.mockStatic(SdvPort.class); + sdvHlq = Mockito.mockStatic(SdvHlq.class); + sdvUserPoolStatic = Mockito.mockStatic(SdvUserPool.class); + } + + @AfterEach + public void tearDown() { + // Closing static mocks after each test + sdvRole.close(); + sdvPort.close(); + sdvHlq.close(); + sdvUserPoolStatic.close(); + } + + @Test + void testGetSdvUser() throws CredentialsException, SdvManagerException, ClassNotFoundException, + NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InstantiationException, InvocationTargetException, + NoSuchMethodException, ResourceUnavailableException { + // Create variables for common values used throughout test + String roleTag = "R1"; + String username = user1String; + + // Mocks for statics + sdvPort.when(() -> SdvPort.get(testCicsTagA)).thenReturn(testPort); + sdvHlq.when(() -> SdvHlq.get(testCicsTagA)).thenReturn("CICS.INSTALL"); + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(roleNameTeller); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + + // Mock check for CICS region + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + // Mock sdvUserPool + SdvUserPool sdvUserPool = Mockito.mock(SdvUserPool.class); + Mockito.when(sdvUserPool.allocateUser(roleNameTeller, mockCicsaRegion)) + .thenReturn(creds1Tag); + Field sdvUserPoolField = sdvManagerImplClass.getDeclaredField("sdvUserPool"); + sdvUserPoolField.setAccessible(true); + sdvUserPoolField.set(sdvManager, sdvUserPool); + + // Mock getFramework().getCredentialsService() + ICredentialsUsernamePassword testCreds = + new CredentialsUsernamePassword(null, username, password1); + ICredentialsService credService = Mockito.mock(ICredentialsService.class); + Mockito.when(credService.getCredentials(creds1Tag)).thenReturn(testCreds); + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getCredentialsService()).thenReturn(credService); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Mock cts + IConfidentialTextService cts = Mockito.mock(IConfidentialTextService.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(cts).registerText(password1, "Password for credential tag: " + creds1Tag); + Field ctsField = sdvManagerImplClass.getDeclaredField("cts"); + ctsField.setAccessible(true); + ctsField.set(sdvManager, cts); + + // Make call to funtion under test + ISdvUser resultUser = sdvManager.getSdvUser(testField, null); + + Assertions.assertEquals(creds1Tag, resultUser.getCredentialsTag()); + Assertions.assertEquals(testCicsTagA, resultUser.getCicsTag()); + Assertions.assertEquals(password1, resultUser.getPassword()); + Assertions.assertEquals(roleNameTeller, resultUser.getRole()); + Assertions.assertEquals(username, resultUser.getUsername()); + Assertions.assertEquals(false, resultUser.isRecording()); + } + + @Test + void testGetSdvUserBlankRoleTag() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException { + // Create variables for common values used throughout test + String roleTag = ""; + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + Mockito.when(testField.getName()).thenReturn("testUser"); + + // Get an SdvManager instance + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions.assertEquals("SdvUser testUser cannot have a blank RoleTag.", + exception.getMessage()); + } + + @Test + void testGetSdvUserNoMatchingRole() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException { + // Create variables for common values used throughout test + String roleTag = "R1"; + + // Mocks for statics + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(null); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + + // Get an SdvManager instance + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions + .assertEquals("Cannot find role. Please create or update CPS Property 'sdv.roleTag." + + roleTag + ".role'.", exception.getMessage()); + } + + @Test + void testGetSdvUserNoMatchingCicsRegion() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Create variables for common values used throughout test + String roleTag = "R1"; + + // Mocks for statics + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(roleNameTeller); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + Mockito.when(testField.getName()).thenReturn("testUser"); + + // Mock check for CICS region + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions.assertEquals("Unable to setup SDV User 'testUser', for region with tag '" + + testCicsTagA + "' as a region with a matching 'cicsTag' tag was not found," + + " or the region was not provisioned.", exception.getMessage()); + } + + @Test + void testGetSdvUserNoPort() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Create variables for common values used throughout test + String roleTag = "R1"; + + // Mocks for statics + sdvPort.when(() -> SdvPort.get(testCicsTagA)).thenReturn(null); + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(roleNameTeller); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + Mockito.when(testField.getName()).thenReturn("testUser"); + + // Mock check for CICS region + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions.assertEquals( + "Could not find port. Please create or update CPS property 'sdv.cicsTag." + + testCicsTagA + ".port'.", + exception.getMessage()); + } + + @Test + void testGetSdvUserNoHlq() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, ResourceUnavailableException { + // Create variables for common values used throughout test + String roleTag = "R1"; + + // Mocks for statics + sdvPort.when(() -> SdvPort.get(testCicsTagA)).thenReturn(testPort); + sdvHlq.when(() -> SdvHlq.get(testCicsTagA)).thenReturn(null); + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(roleNameTeller); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + + // Mock check for CICS region + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions.assertEquals( + "Could not find HLQ. Please create or update CPS property 'sdv.cicsTag." + + testCicsTagA + ".hlq'.", + exception.getMessage()); + } + + @Test + void testGetSdvUserUserAllocationException() throws ClassNotFoundException, + InstantiationException, IllegalAccessException, IllegalArgumentException, + InvocationTargetException, NoSuchMethodException, SecurityException, + NoSuchFieldException, SdvManagerException, ResourceUnavailableException { + // Create variables for common values used throughout test + String roleTag = "R1"; + + // Mocks for statics + sdvPort.when(() -> SdvPort.get(testCicsTagA)).thenReturn(testPort); + sdvHlq.when(() -> SdvHlq.get(testCicsTagA)).thenReturn("CICS.INSTALL"); + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(roleNameTeller); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + + // Mock check for CICS region + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + // Mock sdvUserPool + SdvUserPool sdvUserPool = Mockito.mock(SdvUserPool.class); + Mockito.when(sdvUserPool.allocateUser(roleNameTeller, mockCicsaRegion)) + .thenThrow(new ResourceUnavailableException("No users available")); + Field sdvUserPoolField = sdvManagerImplClass.getDeclaredField("sdvUserPool"); + sdvUserPoolField.setAccessible(true); + sdvUserPoolField.set(sdvManager, sdvUserPool); + + // Make call to funtion under test + ResourceUnavailableException exception = + Assertions.assertThrows(ResourceUnavailableException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions.assertEquals("No users available", exception.getMessage()); + } + + @Test + void testGetSdvUserCredentialsNotFound() throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, SdvManagerException, + ResourceUnavailableException, CredentialsException, ClassNotFoundException { + // Create variables for common values used throughout test + String roleTag = "R1"; + + // Mocks for statics + sdvPort.when(() -> SdvPort.get(testCicsTagA)).thenReturn(testPort); + sdvHlq.when(() -> SdvHlq.get(testCicsTagA)).thenReturn("CICS.INSTALL"); + sdvRole.when(() -> SdvRole.get(roleTag)).thenReturn(roleNameTeller); + + // Mock ISdvUser annotation + Field testField = Mockito.mock(Field.class); + SdvUser sdvUser = Mockito.mock(SdvUser.class); + Mockito.when(sdvUser.cicsTag()).thenReturn(testCicsTagA); + Mockito.when(sdvUser.roleTag()).thenReturn(roleTag); + Mockito.when(testField.getAnnotation(SdvUser.class)).thenReturn(sdvUser); + + // Mock check for CICS region + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + // Mock sdvUserPool + SdvUserPool sdvUserPool = Mockito.mock(SdvUserPool.class); + Mockito.when(sdvUserPool.allocateUser(roleNameTeller, mockCicsaRegion)) + .thenReturn(creds1Tag); + Field sdvUserPoolField = sdvManagerImplClass.getDeclaredField("sdvUserPool"); + sdvUserPoolField.setAccessible(true); + sdvUserPoolField.set(sdvManager, sdvUserPool); + + // Mock getFramework().getCredentialsService() + ICredentialsService credService = Mockito.mock(ICredentialsService.class); + Mockito.when(credService.getCredentials(creds1Tag)) + .thenThrow(new CredentialsException("Did not find user")); + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getCredentialsService()).thenReturn(credService); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvManager.getSdvUser(testField, null); + }); + + Assertions.assertEquals("No credentials were found with the tag: " + creds1Tag, + exception.getMessage()); + } + + @Test + void testProvisionGenerate() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException, + ResourceUnavailableException, ManagerException, CredentialsException { + + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + // Mock for CICS region A + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + ProductVersion mockProductVersion = Mockito.mock(ProductVersion.class); + Mockito.when(mockProductVersion.isEarlierThan(ProductVersion.v(750))).thenReturn(false); + Mockito.when(mockCicsaRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + IZosBatchJob mockIzOsBatchJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJob.retrieveOutputAsString()).thenReturn(secOnMsg); + Mockito.when(mockCicsaRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + + // Mock for CICS region B + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicsbRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicsbRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagB, mockCicsbRegion); + + // Mock for CICS region C + ICicsRegionProvisioned mockCicscRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicscRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicscRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicscRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagC, mockCicscRegion); + + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Mock Terminals + ICicsTerminal regionaTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagA)).thenReturn(regionaTerminal); + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagB)).thenReturn(regionbTerminal); + ICicsTerminal regioncTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagC)).thenReturn(regioncTerminal); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + // Replace testClass to bypass generateAnnotatedFields + Field testClass = sdvManagerImplClass.getSuperclass().getDeclaredField(testClassString); + testClass.setAccessible(true); + testClass.set(sdvManager, null); + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + // user4 + ICredentialsUsernamePassword testCreds4 = + new CredentialsUsernamePassword(null, user4String, password4); + SdvUserImpl newSdvUser4 = + new SdvUserImpl(creds4Tag, testCreds4, testCicsTagC, roleNameOperator); + listOfUsersForAllRegions.add(newSdvUser4); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + // Make call to funtion under test + sdvManager.provisionGenerate(); + + Field recordingRegionsField = sdvManagerImplClass.getDeclaredField(recordingRegionsString); + recordingRegionsField.setAccessible(true); + + @SuppressWarnings(uncheckedString) + Map recordingRegions = + (Map) recordingRegionsField.get(sdvManager); + + // Check correct number of users against each region + Assertions.assertEquals(2, + recordingRegions.get(mockCicsaRegion).getRecordingUsers().size()); + Assertions.assertEquals(1, + recordingRegions.get(mockCicsbRegion).getRecordingUsers().size()); + Assertions.assertEquals(1, + recordingRegions.get(mockCicscRegion).getRecordingUsers().size()); + + // Check correct users against each region + List regionaUsers = new ArrayList<>(); + regionaUsers.add(user1String); + regionaUsers.add(user3String); + for (ISdvUser user : recordingRegions.get(mockCicsaRegion).getRecordingUsers()) { + Assertions.assertTrue(regionaUsers.contains(user.getUsername())); + } + + List regionbUsers = new ArrayList<>(); + regionbUsers.add(user2String); + for (ISdvUser user : recordingRegions.get(mockCicsbRegion).getRecordingUsers()) { + Assertions.assertTrue(regionbUsers.contains(user.getUsername())); + } + + List regioncUsers = new ArrayList<>(); + regioncUsers.add(user4String); + for (ISdvUser user : recordingRegions.get(mockCicscRegion).getRecordingUsers()) { + Assertions.assertTrue(regioncUsers.contains(user.getUsername())); + } + + // Check each region has correct terminal + Assertions.assertEquals(regionaTerminal, + recordingRegions.get(mockCicsaRegion).getMaintenanceTerminal()); + Assertions.assertEquals(regionbTerminal, + recordingRegions.get(mockCicsbRegion).getMaintenanceTerminal()); + Assertions.assertEquals(regioncTerminal, + recordingRegions.get(mockCicscRegion).getMaintenanceTerminal()); + } + + @Test + void testProvisionGenerateOldCicsVersionForRegionA() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, CredentialsException, + ResourceUnavailableException, ManagerException { + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + // Mock for CICS region A + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn("OLDREGION"); + // Mock region Product version + ProductVersion mockProductVersion = Mockito.mock(ProductVersion.class); + Mockito.when(mockProductVersion.isEarlierThan(ProductVersion.v(750))).thenReturn(true, + false, false); + Mockito.when(mockCicsaRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + IZosBatchJob mockIzOsBatchJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJob.retrieveOutputAsString()).thenReturn(secOnMsg); + Mockito.when(mockCicsaRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + + // Mock for CICS region B + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicsbRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicsbRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagB, mockCicsbRegion); + + // Mock for CICS region C + ICicsRegionProvisioned mockCicscRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicscRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicscRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicscRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagC, mockCicscRegion); + + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Mock Terminals + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagB)).thenReturn(regionbTerminal); + ICicsTerminal regioncTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagC)).thenReturn(regioncTerminal); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + // Replace testClass to bypass generateAnnotatedFields + Field testClass = sdvManagerImplClass.getSuperclass().getDeclaredField(testClassString); + testClass.setAccessible(true); + testClass.set(sdvManager, null); + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + // user4 + ICredentialsUsernamePassword testCreds4 = + new CredentialsUsernamePassword(null, user4String, password4); + SdvUserImpl newSdvUser4 = + new SdvUserImpl(creds4Tag, testCreds4, testCicsTagC, roleNameOperator); + listOfUsersForAllRegions.add(newSdvUser4); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionGenerate(); + + Field recordingRegionsField = sdvManagerImplClass.getDeclaredField(recordingRegionsString); + recordingRegionsField.setAccessible(true); + + @SuppressWarnings(uncheckedString) + Map recordingRegions = + (Map) recordingRegionsField.get(sdvManager); + + // Check correct number of users against each region + Assertions.assertEquals(null, recordingRegions.get(mockCicsaRegion)); + Assertions.assertEquals(1, + recordingRegions.get(mockCicsbRegion).getRecordingUsers().size()); + Assertions.assertEquals(1, + recordingRegions.get(mockCicscRegion).getRecordingUsers().size()); + + // Check correct users against each region + List regionbUsers = new ArrayList<>(); + regionbUsers.add(user2String); + for (ISdvUser user : recordingRegions.get(mockCicsbRegion).getRecordingUsers()) { + Assertions.assertTrue(regionbUsers.contains(user.getUsername())); + } + + List regioncUsers = new ArrayList<>(); + regioncUsers.add(user4String); + for (ISdvUser user : recordingRegions.get(mockCicscRegion).getRecordingUsers()) { + Assertions.assertTrue(regioncUsers.contains(user.getUsername())); + } + + // Check each region has correct terminal + Assertions.assertEquals(regionbTerminal, + recordingRegions.get(mockCicsbRegion).getMaintenanceTerminal()); + Assertions.assertEquals(regioncTerminal, + recordingRegions.get(mockCicscRegion).getMaintenanceTerminal()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog, Mockito.times(1)) + .warn("SDV recording will not take place on CICS region 'OLDREGION'" + + ". Running version earlier than 750."); + + } + + @Test + void testProvisionGenerateNoSecMsg() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException, CredentialsException, + ResourceUnavailableException, ManagerException { + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + // Mock for CICS region A + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn("NOSEC"); + // Mock region Product version + ProductVersion mockProductVersion = Mockito.mock(ProductVersion.class); + Mockito.when(mockProductVersion.isEarlierThan(ProductVersion.v(750))).thenReturn(false, + false, false); + Mockito.when(mockCicsaRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + IZosBatchJob mockIzOsBatchJobNoSec = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJobNoSec.retrieveOutputAsString()) + .thenReturn("blah\n\nDFHXS1102I: Security is inactive.\nblah"); + Mockito.when(mockCicsaRegion.getRegionJob()).thenReturn(mockIzOsBatchJobNoSec); + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + + // Mock for CICS region B + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicsbRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + IZosBatchJob mockIzOsBatchJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJob.retrieveOutputAsString()).thenReturn(secOnMsg); + Mockito.when(mockCicsbRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagB, mockCicsbRegion); + + // Mock for CICS region C + ICicsRegionProvisioned mockCicscRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicscRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicscRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicscRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagC, mockCicscRegion); + + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Mock Terminals + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagB)).thenReturn(regionbTerminal); + ICicsTerminal regioncTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagC)).thenReturn(regioncTerminal); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + // Replace testClass to bypass generateAnnotatedFields + Field testClass = sdvManagerImplClass.getSuperclass().getDeclaredField(testClassString); + testClass.setAccessible(true); + testClass.set(sdvManager, null); + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + // user4 + ICredentialsUsernamePassword testCreds4 = + new CredentialsUsernamePassword(null, user4String, password4); + SdvUserImpl newSdvUser4 = + new SdvUserImpl(creds4Tag, testCreds4, testCicsTagC, roleNameOperator); + listOfUsersForAllRegions.add(newSdvUser4); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionGenerate(); + + Field recordingRegionsField = sdvManagerImplClass.getDeclaredField(recordingRegionsString); + recordingRegionsField.setAccessible(true); + + @SuppressWarnings(uncheckedString) + Map recordingRegions = + (Map) recordingRegionsField.get(sdvManager); + + // Check correct number of users against each region + Assertions.assertEquals(null, recordingRegions.get(mockCicsaRegion)); + Assertions.assertEquals(1, + recordingRegions.get(mockCicsbRegion).getRecordingUsers().size()); + Assertions.assertEquals(1, + recordingRegions.get(mockCicscRegion).getRecordingUsers().size()); + + // Check correct users against each region + List regionbUsers = new ArrayList<>(); + regionbUsers.add(user2String); + for (ISdvUser user : recordingRegions.get(mockCicsbRegion).getRecordingUsers()) { + Assertions.assertTrue(regionbUsers.contains(user.getUsername())); + } + + List regioncUsers = new ArrayList<>(); + regioncUsers.add(user4String); + for (ISdvUser user : recordingRegions.get(mockCicscRegion).getRecordingUsers()) { + Assertions.assertTrue(regioncUsers.contains(user.getUsername())); + } + + // Check each region has correct terminal + Assertions.assertEquals(regionbTerminal, + recordingRegions.get(mockCicsbRegion).getMaintenanceTerminal()); + Assertions.assertEquals(regioncTerminal, + recordingRegions.get(mockCicscRegion).getMaintenanceTerminal()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog, Mockito.times(1)) + .warn("SDV recording will not take place on CICS region 'NOSEC'" + + ". Security is not active."); + } + + @Test + void testProvisionGenerateNoUsersForRegion() + throws ClassNotFoundException, NoSuchFieldException, SecurityException, + IllegalArgumentException, IllegalAccessException, CredentialsException, + InstantiationException, InvocationTargetException, NoSuchMethodException, + ResourceUnavailableException, ManagerException { + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + // Mock for CICS region A + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn("OLDREGION"); + // Mock region Product version + ProductVersion mockProductVersion = Mockito.mock(ProductVersion.class); + Mockito.when(mockProductVersion.isEarlierThan(ProductVersion.v(750))).thenReturn(false, + false, false); + Mockito.when(mockCicsaRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + IZosBatchJob mockIzOsBatchJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJob.retrieveOutputAsString()).thenReturn(secOnMsg); + Mockito.when(mockCicsaRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + + // Mock for CICS region B + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicsbRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicsbRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagB, mockCicsbRegion); + + // Mock for CICS region C + ICicsRegionProvisioned mockCicscRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicscRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + Mockito.when(mockCicscRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + Mockito.when(mockCicscRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagC, mockCicscRegion); + + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + + // Mock Terminals + ICicsTerminal regionbTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagB)).thenReturn(regionbTerminal); + ICicsTerminal regioncTerminal = Mockito.mock(ICicsTerminal.class); + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagC)).thenReturn(regioncTerminal); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + // Replace testClass to bypass generateAnnotatedFields + Field testClass = sdvManagerImplClass.getSuperclass().getDeclaredField(testClassString); + testClass.setAccessible(true); + testClass.set(sdvManager, null); + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagB, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + // user4 + ICredentialsUsernamePassword testCreds4 = + new CredentialsUsernamePassword(null, user4String, password4); + SdvUserImpl newSdvUser4 = + new SdvUserImpl(creds4Tag, testCreds4, testCicsTagC, roleNameOperator); + listOfUsersForAllRegions.add(newSdvUser4); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionGenerate(); + + Field recordingRegionsField = sdvManagerImplClass.getDeclaredField(recordingRegionsString); + recordingRegionsField.setAccessible(true); + + @SuppressWarnings(uncheckedString) + Map recordingRegions = + (Map) recordingRegionsField.get(sdvManager); + + // Check correct number of users against each region + Assertions.assertEquals(null, recordingRegions.get(mockCicsaRegion)); + Assertions.assertEquals(3, + recordingRegions.get(mockCicsbRegion).getRecordingUsers().size()); + Assertions.assertEquals(1, + recordingRegions.get(mockCicscRegion).getRecordingUsers().size()); + + // Check correct users against each region + List regionbUsers = new ArrayList<>(); + regionbUsers.add(user1String); + regionbUsers.add(user2String); + regionbUsers.add(user3String); + for (ISdvUser user : recordingRegions.get(mockCicsbRegion).getRecordingUsers()) { + Assertions.assertTrue(regionbUsers.contains(user.getUsername())); + } + + List regioncUsers = new ArrayList<>(); + regioncUsers.add(user4String); + for (ISdvUser user : recordingRegions.get(mockCicscRegion).getRecordingUsers()) { + Assertions.assertTrue(regioncUsers.contains(user.getUsername())); + } + + // Check each region has correct terminal + Assertions.assertEquals(regionbTerminal, + recordingRegions.get(mockCicsbRegion).getMaintenanceTerminal()); + Assertions.assertEquals(regioncTerminal, + recordingRegions.get(mockCicscRegion).getMaintenanceTerminal()); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog, Mockito.times(1)) + .warn("No users have been listed for recording via the SdvUser " + + "annotation for cicsTag 'CICSA'."); + + } + + @Test + void testProvisionGenerateException() throws CredentialsException, NoSuchFieldException, + SecurityException, IllegalArgumentException, IllegalAccessException, + ResourceUnavailableException, ManagerException, ClassNotFoundException, + InstantiationException, InvocationTargetException, NoSuchMethodException { + + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + Map mockCicsRegionList = new HashMap<>(); + + // Mock for CICS region A + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getTag()).thenReturn(testCicsTagA); + // Mock region Product version + ProductVersion mockProductVersion = Mockito.mock(ProductVersion.class); + Mockito.when(mockProductVersion.isEarlierThan(ProductVersion.v(750))).thenReturn(false); + Mockito.when(mockCicsaRegion.getVersion()).thenReturn(mockProductVersion); + // Mock region SEC=YES log message + IZosBatchJob mockIzOsBatchJob = Mockito.mock(IZosBatchJob.class); + Mockito.when(mockIzOsBatchJob.retrieveOutputAsString()).thenReturn(secOnMsg); + Mockito.when(mockCicsaRegion.getRegionJob()).thenReturn(mockIzOsBatchJob); + mockCicsRegionList.put(testCicsTagA, mockCicsaRegion); + + Mockito.when(cicsManager.getTaggedCicsRegions()).thenReturn(mockCicsRegionList); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagA)).thenReturn(mockCicsaRegion); + + // Mock Terminals + Mockito.when(cicsManager.generateCicsTerminal(testCicsTagA)) + .thenThrow(new CicstsManagerException("Ooppss")); + + // Replace private cicsManager instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + // Replace testClass to bypass generateAnnotatedFields + Field testClass = sdvManagerImplClass.getSuperclass().getDeclaredField(testClassString); + testClass.setAccessible(true); + testClass.set(sdvManager, null); + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Field dssField = sdvManagerImplClass.getDeclaredField("dss"); + dssField.setAccessible(true); + dssField.set(sdvManager, dssService); + + // Mock releaseUsers bits + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds1Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds3Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(runName); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Make call to funtion under test + ManagerException exception = Assertions.assertThrows(ManagerException.class, () -> { + sdvManager.provisionGenerate(); + }); + + Assertions.assertEquals("Ooppss", exception.getMessage()); + + // Verify users released. + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds1Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds3Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + } + + @Test + void testProvisionStart() throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, ClassNotFoundException, SdvManagerException, NoSuchFieldException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Make call to funtion under test + sdvManager.provisionStart(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).prepareEnvironments("LOG_GENERAL_001"); + Mockito.verifyNoMoreInteractions(sdvRecorder); + } + + @Test + void testProvisionStop() throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, ClassNotFoundException, SdvManagerException, NoSuchFieldException, + CredentialsException, CicstsManagerException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + + // Mock cicsManager + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagA)).thenReturn(mockCicsaRegion); + + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getApplid()).thenReturn(regionbApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagB)).thenReturn(mockCicsbRegion); + + // Replace private cicsManager instance in sdvManager + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds1Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds3Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds2Tag, regionbApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(runName); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Make call to funtion under test + sdvManager.provisionStop(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(1)).cleanUpEnvironments(); + Mockito.verifyNoMoreInteractions(sdvRecorder); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds1Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds3Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds2Tag), + Mockito.eq(regionbApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + } + + @Test + void testProvisionStopEndRecordingException() throws InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, ClassNotFoundException, SdvManagerException, + NoSuchFieldException, CredentialsException, CicstsManagerException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Mockito.doThrow(new SdvManagerException("test1")).when(sdvRecorder).endRecording(); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + + // Mock cicsManager + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagA)).thenReturn(mockCicsaRegion); + + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getApplid()).thenReturn(regionbApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagB)).thenReturn(mockCicsbRegion); + + // Replace private cicsManager instance in sdvManager + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds1Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds3Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds2Tag, regionbApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(runName); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionStop(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(1)).cleanUpEnvironments(); + Mockito.verifyNoMoreInteractions(sdvRecorder); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds1Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds3Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds2Tag), + Mockito.eq(regionbApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + // endRecording exception should not have stopped everything else from running, + // but it should had made a log output to make the user aware. + Mockito.verify(mockLog, Mockito.times(1)) + .error(Mockito.eq("Could not stop known SDC recordings in provisionStop."), + Mockito.any(SdvManagerException.class)); + } + + @Test + void testProvisionStopReleaseUsersException() throws InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, ClassNotFoundException, SdvManagerException, + NoSuchFieldException, CredentialsException, CicstsManagerException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + + // Mock cicsManager + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagA)) + .thenThrow(new CicstsManagerException("test 2")); + + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getApplid()).thenReturn(regionbApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagB)).thenReturn(mockCicsbRegion); + + // Replace private cicsManager instance in sdvManager + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds1Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds3Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds2Tag, regionbApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(runName); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionStop(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(1)).cleanUpEnvironments(); + Mockito.verifyNoMoreInteractions(sdvRecorder); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds1Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds3Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds2Tag), + Mockito.eq(regionbApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + // endRecording exception should not have stopped everything else from running, + // but it should had made a log output to make the user aware. + Mockito.verify(mockLog, Mockito.times(1)) + .error(Mockito.eq("Could not release SDV SdvUsers in provisionStop."), + Mockito.any(CicstsManagerException.class)); + } + + @Test + void testProvisionStopcleanUpEnvironmentsException() throws InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, ClassNotFoundException, SdvManagerException, + NoSuchFieldException, CredentialsException, CicstsManagerException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Mockito.doThrow(new SdvManagerException("test3")).when(sdvRecorder).cleanUpEnvironments(); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + + // Mock cicsManager + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagA)).thenReturn(mockCicsaRegion); + + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getApplid()).thenReturn(regionbApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagB)).thenReturn(mockCicsbRegion); + + // Replace private cicsManager instance in sdvManager + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds1Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds3Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds2Tag, regionbApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(runName); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionStop(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(1)).cleanUpEnvironments(); + Mockito.verifyNoMoreInteractions(sdvRecorder); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds1Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds3Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds2Tag), + Mockito.eq(regionbApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + // endRecording exception should not have stopped everything else from running, + // but it should had made a log output to make the user aware. + Mockito.verify(mockLog, Mockito.times(1)) + .error(Mockito.eq("Could not cleanup SDV environments in provisionStop."), + Mockito.any(SdvManagerException.class)); + } + + @Test + void testStartOfTestClass() throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, ClassNotFoundException, SdvManagerException, NoSuchFieldException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Make call to funtion under test + sdvManager.startOfTestClass(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).startRecording(); + Mockito.verifyNoMoreInteractions(sdvRecorder); + } + + @Test + void testEndOfTestClassTestPassed() throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, ClassNotFoundException, NoSuchFieldException, ManagerException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + IFramework framework = Mockito.mock(IFramework.class); + IRun testRun = Mockito.mock(IRun.class); + Mockito.when(testRun.getTestBundleName()).thenReturn("bundleA"); + Mockito.when(testRun.getTestClassName()).thenReturn("classA"); + Mockito.when(framework.getTestRun()).thenReturn(testRun); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Make call to funtion under test + Result res = Mockito.mock(Result.class); + Mockito.when(res.isPassed()).thenReturn(true); + + sdvManager.endOfTestClass(res, null); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(1)).exportRecordings("bundleA", "classA"); + Mockito.verifyNoMoreInteractions(sdvRecorder); + } + + @Test + void testEndOfTestClassTestFailed() throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, ClassNotFoundException, NoSuchFieldException, ManagerException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + IFramework framework = Mockito.mock(IFramework.class); + IRun testRun = Mockito.mock(IRun.class); + Mockito.when(testRun.getTestBundleName()).thenReturn("bundleB"); + Mockito.when(testRun.getTestClassName()).thenReturn("classB"); + Mockito.when(framework.getTestRun()).thenReturn(testRun); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Make call to funtion under test + Result res = Mockito.mock(Result.class); + Mockito.when(res.isPassed()).thenReturn(false); + + sdvManager.endOfTestClass(res, null); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(0)).exportRecordings("bundleB", "classB"); + Mockito.verifyNoMoreInteractions(sdvRecorder); + } + + @Test + void testAreYouProvisionalDependentOn() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + Boolean dependent = false; + // Test ICicstsManagerSpi + IManager cicsManager = new CicstsManagerImpl(); + dependent = sdvManager.areYouProvisionalDependentOn(cicsManager); + Assertions.assertTrue(dependent); + + // Test IArtifactManager + IManager artifactManager = new ArtifactManagerImpl(); + dependent = sdvManager.areYouProvisionalDependentOn(artifactManager); + Assertions.assertTrue(dependent); + + // Test IHttpManagerSpi + IManager httpManager = new HttpManagerImpl(); + dependent = sdvManager.areYouProvisionalDependentOn(httpManager); + Assertions.assertTrue(dependent); + + // Test a random manager + IManager zosManager = new ZosManagerImpl(); + dependent = sdvManager.areYouProvisionalDependentOn(zosManager); + Assertions.assertFalse(dependent); + + } + + @Test + void testReleaseUsersException() throws CredentialsException, NoSuchFieldException, + SecurityException, IllegalArgumentException, IllegalAccessException, + ResourceUnavailableException, ManagerException, ClassNotFoundException, + InstantiationException, InvocationTargetException, NoSuchMethodException { + // Replace private sdvRecorder instance in sdvManager + Class sdvManagerImplClass = Class.forName(sdvManagerImplClassString); + SdvManagerImpl sdvManager = + (SdvManagerImpl) sdvManagerImplClass.getDeclaredConstructor().newInstance(); + + SdvHttpRecorderImpl sdvRecorder = Mockito.mock(SdvHttpRecorderImpl.class); + Field sdvRecorderField = sdvManagerImplClass.getDeclaredField(sdvRecorderVarName); + sdvRecorderField.setAccessible(true); + sdvRecorderField.set(sdvManager, sdvRecorder); + + // Replace sdvUsersToRecordList with a mocked list + List listOfUsersForAllRegions = new ArrayList<>(); + // user1 + ICredentialsUsernamePassword testCreds1 = + new CredentialsUsernamePassword(null, user1String, password1); + SdvUserImpl newSdvUser1 = + new SdvUserImpl(creds1Tag, testCreds1, testCicsTagA, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser1); + // user2 + ICredentialsUsernamePassword testCreds2 = + new CredentialsUsernamePassword(null, user2String, password2); + SdvUserImpl newSdvUser2 = + new SdvUserImpl(creds2Tag, testCreds2, testCicsTagB, roleNameTeller); + listOfUsersForAllRegions.add(newSdvUser2); + // user3 + ICredentialsUsernamePassword testCreds3 = + new CredentialsUsernamePassword(null, user3String, password3); + SdvUserImpl newSdvUser3 = + new SdvUserImpl(creds3Tag, testCreds3, testCicsTagA, roleNameAdmin); + listOfUsersForAllRegions.add(newSdvUser3); + + Field sdvUsersToRecordList = + sdvManagerImplClass.getDeclaredField(sdvUsersToRecordListString); + sdvUsersToRecordList.setAccessible(true); + sdvUsersToRecordList.set(sdvManager, listOfUsersForAllRegions); + + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Field dssField = sdvManagerImplClass.getDeclaredField("dss"); + dssField.setAccessible(true); + dssField.set(sdvManager, dssService); + + // Mock cicsManager + ICicstsManagerSpi cicsManager = Mockito.mock(ICicstsManagerSpi.class); + + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(regionaApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagA)).thenReturn(mockCicsaRegion); + + ICicsRegionProvisioned mockCicsbRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsbRegion.getApplid()).thenReturn(regionbApplid); + Mockito.when(cicsManager.locateCicsRegion(testCicsTagB)).thenReturn(mockCicsbRegion); + + // Replace private cicsManager instance in sdvManager + Field cicsManagerField = + sdvManagerImplClass.getDeclaredField(privateCicsManagerVariableName); + cicsManagerField.setAccessible(true); + cicsManagerField.set(sdvManager, cicsManager); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds1Tag, regionaApplid, runName, dssService)) + .thenThrow(new DynamicStatusStoreException("could not delete")); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds3Tag, regionaApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + sdvUserPoolStatic + .when(() -> SdvUserPool.deleteDss(creds2Tag, regionbApplid, runName, dssService)) + .thenAnswer(invocation -> { + return null; + }); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn(runName); + Field frameworkField = + sdvManagerImplClass.getSuperclass().getDeclaredField(frameworkString); + frameworkField.setAccessible(true); + frameworkField.set(sdvManager, framework); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagerImplClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManager.provisionStop(); + + Mockito.verify(sdvRecorder, Mockito.times(1)).endRecording(); + Mockito.verify(sdvRecorder, Mockito.times(1)).cleanUpEnvironments(); + Mockito.verifyNoMoreInteractions(sdvRecorder); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds1Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds3Tag), + Mockito.eq(regionaApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(creds2Tag), + Mockito.eq(regionbApplid), Mockito.eq(runName), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + Mockito.verify(mockLog, Mockito.times(1)) + .error(Mockito.eq("Could not release SDV User: " + creds1Tag + ", on CICS region " + + regionaApplid + ", for test run " + runName), + Mockito.any(DynamicStatusStoreException.class)); + + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvManagersResourceMonitor.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvManagersResourceMonitor.java new file mode 100644 index 000000000..63cb2c0f8 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvManagersResourceMonitor.java @@ -0,0 +1,468 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.FrameworkException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IFrameworkRuns; +import dev.galasa.framework.spi.IResourceManagement; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import sun.misc.Unsafe; + + +class TestSdvManagersResourceMonitor { + + private String runningManagersPrefixString = "manager.runningManagers"; + private String sdvManagersResourceMonitorClassString = + "dev.galasa.sdv.internal.SdvManagersResourceMonitor"; + private String logString = "LOG"; + private String theUnsafeString = "theUnsafe"; + + private String runOneString = "RUN1"; + private String runTwoString = "RUN2"; + private String runThreeString = "RUN3"; + private String runningManagersApplid1 = "manager.runningManagers.APPL1"; + private String runningManagersApplid2 = "manager.runningManagers.APPL2"; + + @SuppressWarnings("PMD") + private static final Log mockLog = Mockito.mock(Log.class); + + @BeforeEach + public void setUp() { + Mockito.reset(mockLog); + Mockito.when(mockLog.isInfoEnabled()).thenReturn(true); + Mockito.when(mockLog.isWarnEnabled()).thenReturn(true); + Mockito.when(mockLog.isErrorEnabled()).thenReturn(true); + Mockito.when(mockLog.isTraceEnabled()).thenReturn(true); + Mockito.when(mockLog.isDebugEnabled()).thenReturn(true); + } + + @Test + void testRunWithNoActiveRunsOrDssEntries() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, FrameworkException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map runningManagersInDss = new HashMap<>(); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenReturn(runningManagersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.run(); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).put(Mockito.any(String.class), + Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).performActions(Mockito.any()); + } + + @Test + void testRunWithActiveRunsMatchingDssEntries() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, FrameworkException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + allActiveRuns.add(runOneString); + allActiveRuns.add(runTwoString); + allActiveRuns.add(runThreeString); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map runningManagersInDss = new HashMap<>(); + runningManagersInDss.put(runningManagersApplid1, runOneString + "," + runTwoString); + runningManagersInDss.put(runningManagersApplid2, runThreeString); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenReturn(runningManagersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.run(); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).put(Mockito.any(String.class), + Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).performActions(Mockito.any()); + } + + @Test + void testRunException() + throws DynamicStatusStoreException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenThrow(new DynamicStatusStoreException("cannot read store")); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.run(); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).put(Mockito.any(String.class), + Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).performActions(Mockito.any()); + + // Verify that although an exception occurred, the program continues, and simply logs + // an error to the log. + Mockito.verify(mockLog, Mockito.times(1)) + .error("Failure during scanning DSS for SDV Managers"); + } + + @Test + void testRunWithDssEntryNotInActiveRunsButNotLastManagerOnRegion() + throws FrameworkException, ClassNotFoundException, NoSuchFieldException, + SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + allActiveRuns.add(runTwoString); + allActiveRuns.add(runThreeString); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map runningManagersInDss = new HashMap<>(); + runningManagersInDss.put(runningManagersApplid1, runOneString + "," + runTwoString); + runningManagersInDss.put(runningManagersApplid2, runThreeString); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenReturn(runningManagersInDss); + Mockito.when(dssService.get(runningManagersApplid1)) + .thenReturn(runOneString + "," + runTwoString); + Mockito.when(dssService.get(runningManagersApplid2)).thenReturn(runThreeString); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.run(); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(1)).put(runningManagersApplid1, runTwoString); + Mockito.verify(dssService, Mockito.times(0)).performActions(Mockito.any()); + } + + @Test + void testRunWithDssEntryNotInActiveRunsButIsLastManagerOnRegion() + throws FrameworkException, ClassNotFoundException, NoSuchFieldException, + SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + allActiveRuns.add(runOneString); + allActiveRuns.add(runTwoString); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map runningManagersInDss = new HashMap<>(); + runningManagersInDss.put(runningManagersApplid1, runOneString + "," + runTwoString); + runningManagersInDss.put(runningManagersApplid2, runThreeString); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenReturn(runningManagersInDss); + Mockito.when(dssService.get(runningManagersApplid2)).thenReturn(runThreeString); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.run(); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).put(Mockito.any(String.class), + Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(1)).performActions(Mockito.any(), Mockito.any()); + } + + @Test + void testrunFinishedOrDeletedIsLastManagerOnRegion() + throws FrameworkException, ClassNotFoundException, NoSuchFieldException, + SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map runningManagersInDss = new HashMap<>(); + runningManagersInDss.put(runningManagersApplid1, runOneString + "," + runTwoString); + runningManagersInDss.put(runningManagersApplid2, runThreeString); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenReturn(runningManagersInDss); + Mockito.when(dssService.get(runningManagersApplid1)) + .thenReturn(runOneString + "," + runTwoString); + Mockito.when(dssService.get(runningManagersApplid2)).thenReturn(runThreeString); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.runFinishedOrDeleted(runOneString); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(1)).put(runningManagersApplid1, runTwoString); + Mockito.verify(dssService, Mockito.times(0)).performActions(Mockito.any()); + } + + @Test + void testrunFinishedOrDeletedNotLastManagerOnRegion() + throws FrameworkException, ClassNotFoundException, NoSuchFieldException, + SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map runningManagersInDss = new HashMap<>(); + runningManagersInDss.put(runningManagersApplid1, runOneString + "," + runTwoString); + runningManagersInDss.put(runningManagersApplid2, runThreeString); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenReturn(runningManagersInDss); + Mockito.when(dssService.get(runningManagersApplid2)).thenReturn(runThreeString); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.runFinishedOrDeleted(runThreeString); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).put(Mockito.any(String.class), + Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(1)).performActions(Mockito.any(), Mockito.any()); + } + + @Test + void testrunFinishedOrDeletedException() + throws DynamicStatusStoreException, ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, NoSuchFieldException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.when(dssService.getPrefix(runningManagersPrefixString)) + .thenThrow(new DynamicStatusStoreException("cannot read store")); + + // Get SdvUserResourceMonitor instance + Class sdvManagersResourceMonitorClass = + Class.forName(sdvManagersResourceMonitorClassString); + SdvManagersResourceMonitor sdvManagersResourceMonitor = + (SdvManagersResourceMonitor) sdvManagersResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvManagersResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvManagersResourceMonitor.runFinishedOrDeleted(runOneString); + + Mockito.verify(dssService, Mockito.times(0)).delete(Mockito.any(String.class)); + Mockito.verify(dssService, Mockito.times(0)).put(runningManagersApplid1, runTwoString); + Mockito.verify(dssService, Mockito.times(0)).performActions(Mockito.any()); + + // Verify that although an exception occurred, the program continues, and simply logs + // an error to the log. + Mockito.verify(mockLog, Mockito.times(1)) + .error("Failure cleaning up SDV Managers for finished run RUN1"); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvResourceManagement.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvResourceManagement.java new file mode 100644 index 000000000..f4dd85ccc --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvResourceManagement.java @@ -0,0 +1,135 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.FrameworkException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IResourceManagement; +import dev.galasa.framework.spi.ResourceManagerException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.Random; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + + +class TestSdvResourceManagement { + + private String sdvResourceManagementClassString = + "dev.galasa.sdv.internal.SdvResourceManagement"; + + @Test + void testStart() throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, FrameworkException, ResourceManagerException { + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getDynamicStatusStoreService("sdv")).thenReturn(dssService); + Random randomNum = Mockito.mock(Random.class); + Mockito.when(randomNum.nextInt()).thenReturn(16); + Mockito.when(framework.getRandom()).thenReturn(randomNum); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + ScheduledExecutorService exeService = Mockito.mock(ScheduledExecutorService.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(exeService).scheduleWithFixedDelay(Mockito.any(SdvUserResourceMonitor.class), + Mockito.any(int.class), Mockito.eq(20), Mockito.eq(TimeUnit.SECONDS)); + Mockito.doAnswer(invocation -> { + return null; + }).when(exeService).scheduleWithFixedDelay(Mockito.any(SdvManagersResourceMonitor.class), + Mockito.any(int.class), Mockito.eq(20), Mockito.eq(TimeUnit.SECONDS)); + Mockito.when(resMan.getScheduledExecutorService()).thenReturn(exeService); + + // Get SdvUserResourceMonitor instance + Class sdvResourceManagementClass = Class.forName(sdvResourceManagementClassString); + SdvResourceManagement sdvResourceManagement = + (SdvResourceManagement) sdvResourceManagementClass.getDeclaredConstructor() + .newInstance(); + + Boolean initialised = sdvResourceManagement.initialise(framework, resMan); + Assertions.assertTrue(initialised); + + // Make call to funtion under test + sdvResourceManagement.start(); + + Mockito.verify(exeService, Mockito.times(1)).scheduleWithFixedDelay( + Mockito.any(SdvUserResourceMonitor.class), Mockito.any(long.class), + Mockito.any(long.class), Mockito.eq(TimeUnit.SECONDS)); + + Mockito.verify(exeService, Mockito.times(1)).scheduleWithFixedDelay( + Mockito.any(SdvManagersResourceMonitor.class), Mockito.any(long.class), + Mockito.any(long.class), Mockito.eq(TimeUnit.SECONDS)); + } + + @Test + void testRunFinishedOrDeleted() throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, + NoSuchMethodException, SecurityException, ResourceManagerException, + DynamicStatusStoreException, NoSuchFieldException { + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getDynamicStatusStoreService("sdv")).thenReturn(dssService); + Random randomNum = Mockito.mock(Random.class); + Mockito.when(randomNum.nextInt()).thenReturn(16); + Mockito.when(framework.getRandom()).thenReturn(randomNum); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + ScheduledExecutorService exeService = Mockito.mock(ScheduledExecutorService.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(exeService).scheduleWithFixedDelay(Mockito.any(SdvUserResourceMonitor.class), + Mockito.any(int.class), Mockito.eq(20), Mockito.eq(TimeUnit.SECONDS)); + Mockito.doAnswer(invocation -> { + return null; + }).when(exeService).scheduleWithFixedDelay(Mockito.any(SdvManagersResourceMonitor.class), + Mockito.any(int.class), Mockito.eq(20), Mockito.eq(TimeUnit.SECONDS)); + Mockito.when(resMan.getScheduledExecutorService()).thenReturn(exeService); + + // Get SdvUserResourceMonitor instance + Class sdvResourceManagementClass = Class.forName(sdvResourceManagementClassString); + SdvResourceManagement sdvResourceManagement = + (SdvResourceManagement) sdvResourceManagementClass.getDeclaredConstructor() + .newInstance(); + + Boolean initialised = sdvResourceManagement.initialise(framework, resMan); + Assertions.assertTrue(initialised); + + // Replace the monitors + SdvUserResourceMonitor userResMon = Mockito.mock(SdvUserResourceMonitor.class); + SdvManagersResourceMonitor manResMon = Mockito.mock(SdvManagersResourceMonitor.class); + + Field sdvUserResourceMonitorField = + sdvResourceManagementClass.getDeclaredField("sdvUserResourceMonitor"); + sdvUserResourceMonitorField.setAccessible(true); + sdvUserResourceMonitorField.set(sdvResourceManagement, userResMon); + + Field sdvManagersResourceMonitorField = + sdvResourceManagementClass.getDeclaredField("sdvManagersResourceMonitor"); + sdvManagersResourceMonitorField.setAccessible(true); + sdvManagersResourceMonitorField.set(sdvResourceManagement, manResMon); + + // Make call to funtion under test + sdvResourceManagement.runFinishedOrDeleted("RUN123"); + + Mockito.verify(userResMon, Mockito.times(1)).runFinishedOrDeleted("RUN123"); + Mockito.verify(manResMon, Mockito.times(1)).runFinishedOrDeleted("RUN123"); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserImpl.java new file mode 100644 index 000000000..5d2c6cf19 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserImpl.java @@ -0,0 +1,71 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.ICredentialsUsernamePassword; +import dev.galasa.framework.spi.creds.CredentialsException; +import dev.galasa.framework.spi.creds.CredentialsUsernamePassword; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class TestSdvUserImpl { + + SdvUserImpl ru; + + private static final String TEST_SRR_ID = "1234"; + + @BeforeEach + void beforeEach() throws CredentialsException { + ICredentialsUsernamePassword credentials = + new CredentialsUsernamePassword(null, "user1", "password1"); + ru = new SdvUserImpl("CREDS1", credentials, "CICS1", "TELLER"); + } + + @Test + void testGetCredentials() { + Assertions.assertEquals("CREDS1", ru.getCredentialsTag()); + + Assertions.assertEquals("user1", ru.getUsername()); + Assertions.assertEquals("password1", ru.getPassword()); + } + + @Test + void testGetRole() { + Assertions.assertEquals("TELLER", ru.getRole()); + } + + @Test + void testGetSrrIdAndIsRecordingWhenNotSet() { + Assertions.assertEquals(null, ru.getSrrId()); + Assertions.assertEquals(false, ru.isRecording()); + } + + @Test + void testGetSrrIdAndIsRecordingWhenSet() { + + ru.setSrrId(TEST_SRR_ID); + + Assertions.assertEquals(TEST_SRR_ID, ru.getSrrId()); + Assertions.assertEquals(true, ru.isRecording()); + } + + @Test + void testSetNotRecording() { + + ru.setSrrId(TEST_SRR_ID); + ru.setNotRecording(); + + Assertions.assertEquals(TEST_SRR_ID, ru.getSrrId()); + Assertions.assertEquals(false, ru.isRecording()); + } + + @Test + void testgetCicsTag() { + Assertions.assertEquals("CICS1", ru.getCicsTag()); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserPool.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserPool.java new file mode 100644 index 000000000..1c7c228e5 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserPool.java @@ -0,0 +1,329 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.cicsts.spi.ICicsRegionProvisioned; +import dev.galasa.framework.spi.DssDelete; +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.DynamicStatusStoreMatchException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IResourcePoolingService; +import dev.galasa.framework.spi.InsufficientResourcesAvailableException; +import dev.galasa.framework.spi.ResourceUnavailableException; +import dev.galasa.sdv.SdvManagerException; +import dev.galasa.sdv.internal.properties.SdvPoolUsers; +import dev.galasa.zos.IZosImage; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.logging.Log; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import sun.misc.Unsafe; + + +class TestSdvUserPool { + + private MockedStatic sdvPoolUsers; + + private String roleName = "TELLER"; + private String zosImageId = "IMG1"; + private String applidString = "APPL1"; + private String sdvUserPoolClassString = "dev.galasa.sdv.internal.SdvUserPool"; + private String dssVariableString = "dss"; + + @SuppressWarnings("PMD") + private static final Log mockLog = Mockito.mock(Log.class); + + @BeforeEach + public void setUp() { + // Registering static mocks before each test + sdvPoolUsers = Mockito.mockStatic(SdvPoolUsers.class); + + Mockito.when(mockLog.isTraceEnabled()).thenReturn(true); + } + + @AfterEach + public void tearDown() { + // Closing static mocks after each test + sdvPoolUsers.close(); + } + + @Test + void testAllocateUser() throws SdvManagerException, ResourceUnavailableException, + InstantiationException, IllegalAccessException, IllegalArgumentException, + InvocationTargetException, NoSuchMethodException, SecurityException, + InsufficientResourcesAvailableException, NoSuchFieldException, ClassNotFoundException, + DynamicStatusStoreMatchException, DynamicStatusStoreException { + // Mock IZosImage + IZosImage mockZosImage = Mockito.mock(IZosImage.class); + Mockito.when(mockZosImage.getImageID()).thenReturn(zosImageId); + + // Mock CICS region + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getZosImage()).thenReturn(mockZosImage); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(applidString); + + // Mocks for statics + List userCredList = new ArrayList<>(); + userCredList.add("CREDS11"); + userCredList.add("CREDS22"); + userCredList.add("CREDS33"); + sdvPoolUsers.when(() -> SdvPoolUsers.get(zosImageId, roleName)).thenReturn(userCredList); + + // Get SdvUserPool instance + Class sdvUserPoolClass = Class.forName(sdvUserPoolClassString); + SdvUserPool sdvUserPool = + (SdvUserPool) sdvUserPoolClass.getDeclaredConstructor(IFramework.class, + IDynamicStatusStoreService.class, IResourcePoolingService.class) + .newInstance(null, null, null); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).performActions(Mockito.any()); + Field dssField = sdvUserPoolClass.getDeclaredField(dssVariableString); + dssField.setAccessible(true); + dssField.set(sdvUserPool, dssService); + + // Mock rps + List allocatedUserCredList = new ArrayList<>(); + allocatedUserCredList.add("CREDS33"); + IResourcePoolingService resourcePoolingService = + Mockito.mock(IResourcePoolingService.class); + Mockito.when(resourcePoolingService.obtainResources(userCredList, null, 1, 1, dssService, + "sdvuser.APPL1.")).thenReturn(allocatedUserCredList); + Field rpsField = sdvUserPoolClass.getDeclaredField("rps"); + rpsField.setAccessible(true); + rpsField.set(sdvUserPool, resourcePoolingService); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn("RUN123"); + Field frameworkField = sdvUserPoolClass.getDeclaredField("framework"); + frameworkField.setAccessible(true); + frameworkField.set(sdvUserPool, framework); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe"); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserPoolClass.getDeclaredField("LOG"); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + String userCred = sdvUserPool.allocateUser(roleName, mockCicsaRegion); + + Assertions.assertEquals("CREDS33", userCred); + + // Check there is a warning in the log indicating Region A won't record + Mockito.verify(mockLog, Mockito.times(1)).trace("Allocated SDV User CREDS33 on image " + + zosImageId + " for CICS Applid APPL1 from SDV User pool allocation"); + } + + @Test + void testNoUsersFoundForRoleOnImage() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, SdvManagerException, ResourceUnavailableException { + // Mock IZosImage + IZosImage mockZosImage = Mockito.mock(IZosImage.class); + Mockito.when(mockZosImage.getImageID()).thenReturn(zosImageId); + + // Mock CICS region + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getZosImage()).thenReturn(mockZosImage); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(applidString); + + // Mocks for statics + List userCredList = new ArrayList<>(); + sdvPoolUsers.when(() -> SdvPoolUsers.get(zosImageId, roleName)).thenReturn(userCredList); + + // Get SdvUserPool instance + Class sdvUserPoolClass = Class.forName(sdvUserPoolClassString); + SdvUserPool sdvUserPool = + (SdvUserPool) sdvUserPoolClass.getDeclaredConstructor(IFramework.class, + IDynamicStatusStoreService.class, IResourcePoolingService.class) + .newInstance(null, null, null); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvUserPool.allocateUser(roleName, mockCicsaRegion); + }); + + Assertions.assertEquals( + "No user credential tags provided for role '" + roleName + "' on z/OS image '" + + zosImageId + "'. Please create or update CPS property 'sdv.zosImage." + + zosImageId + ".role." + roleName + ".credTags'.", + exception.getMessage()); + } + + @Test + void testNoResourcesAvailable() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, DynamicStatusStoreMatchException, DynamicStatusStoreException, + NoSuchFieldException, InsufficientResourcesAvailableException { + // Mock IZosImage + IZosImage mockZosImage = Mockito.mock(IZosImage.class); + Mockito.when(mockZosImage.getImageID()).thenReturn(zosImageId); + + // Mock CICS region + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getZosImage()).thenReturn(mockZosImage); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(applidString); + + // Mocks for statics + List userCredList = new ArrayList<>(); + userCredList.add("CREDS44"); + userCredList.add("CREDS55"); + userCredList.add("CREDS66"); + sdvPoolUsers.when(() -> SdvPoolUsers.get(zosImageId, roleName)).thenReturn(userCredList); + + // Get SdvUserPool instance + Class sdvUserPoolClass = Class.forName(sdvUserPoolClassString); + SdvUserPool sdvUserPool = + (SdvUserPool) sdvUserPoolClass.getDeclaredConstructor(IFramework.class, + IDynamicStatusStoreService.class, IResourcePoolingService.class) + .newInstance(null, null, null); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService).performActions(Mockito.any()); + Field dssField = sdvUserPoolClass.getDeclaredField(dssVariableString); + dssField.setAccessible(true); + dssField.set(sdvUserPool, dssService); + + // Mock rps + List allocatedUserCredList = new ArrayList<>(); + allocatedUserCredList.add("CREDS66"); + IResourcePoolingService resourcePoolingService = + Mockito.mock(IResourcePoolingService.class); + Mockito.when(resourcePoolingService.obtainResources(userCredList, null, 1, 1, dssService, + "sdvuser.APPL1.")) + .thenThrow(new InsufficientResourcesAvailableException("No Users")); + Field rpsField = sdvUserPoolClass.getDeclaredField("rps"); + rpsField.setAccessible(true); + rpsField.set(sdvUserPool, resourcePoolingService); + + // Make call to funtion under test + ResourceUnavailableException exception = + Assertions.assertThrows(ResourceUnavailableException.class, () -> { + sdvUserPool.allocateUser(roleName, mockCicsaRegion); + }); + + Assertions.assertEquals("No Users", exception.getMessage()); + } + + @Test + void testDssError() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, DynamicStatusStoreMatchException, DynamicStatusStoreException, + NoSuchFieldException, InsufficientResourcesAvailableException { + // Mock IZosImage + IZosImage mockZosImage = Mockito.mock(IZosImage.class); + Mockito.when(mockZosImage.getImageID()).thenReturn(zosImageId); + + // Mock CICS region + ICicsRegionProvisioned mockCicsaRegion = Mockito.mock(ICicsRegionProvisioned.class); + Mockito.when(mockCicsaRegion.getZosImage()).thenReturn(mockZosImage); + Mockito.when(mockCicsaRegion.getApplid()).thenReturn(applidString); + + // Mocks for statics + List userCredList = new ArrayList<>(); + userCredList.add("CREDS77"); + userCredList.add("CREDS88"); + userCredList.add("CREDS99"); + sdvPoolUsers.when(() -> SdvPoolUsers.get(zosImageId, roleName)).thenReturn(userCredList); + + // Get SdvUserPool instance + Class sdvUserPoolClass = Class.forName(sdvUserPoolClassString); + SdvUserPool sdvUserPool = + (SdvUserPool) sdvUserPoolClass.getDeclaredConstructor(IFramework.class, + IDynamicStatusStoreService.class, IResourcePoolingService.class) + .newInstance(null, null, null); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.doThrow(new DynamicStatusStoreException("something went wrong")).when(dssService) + .performActions(Mockito.any(), Mockito.any()); + Field dssField = sdvUserPoolClass.getDeclaredField(dssVariableString); + dssField.setAccessible(true); + dssField.set(sdvUserPool, dssService); + + // Mock rps + List allocatedUserCredList = new ArrayList<>(); + allocatedUserCredList.add("CREDS99"); + IResourcePoolingService resourcePoolingService = + Mockito.mock(IResourcePoolingService.class); + Mockito.when(resourcePoolingService.obtainResources(userCredList, null, 1, 1, dssService, + "sdvuser.APPL1.")).thenReturn(allocatedUserCredList); + Field rpsField = sdvUserPoolClass.getDeclaredField("rps"); + rpsField.setAccessible(true); + rpsField.set(sdvUserPool, resourcePoolingService); + + IFramework framework = Mockito.mock(IFramework.class); + Mockito.when(framework.getTestRunName()).thenReturn("RUN123"); + Field frameworkField = sdvUserPoolClass.getDeclaredField("framework"); + frameworkField.setAccessible(true); + frameworkField.set(sdvUserPool, framework); + + // Make call to funtion under test + SdvManagerException exception = Assertions.assertThrows(SdvManagerException.class, () -> { + sdvUserPool.allocateUser(roleName, mockCicsaRegion); + }); + + Assertions.assertEquals( + "Could not update the DSS for user allocation of SDV User CREDS99 on image " + + zosImageId, + exception.getMessage()); + } + + @Test + void testDeleteDss() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, DynamicStatusStoreMatchException, DynamicStatusStoreException, + NoSuchFieldException, InsufficientResourcesAvailableException { + // Get SdvUserPool instance + Class sdvUserPoolClass = Class.forName(sdvUserPoolClassString); + SdvUserPool sdvUserPool = + (SdvUserPool) sdvUserPoolClass.getDeclaredConstructor(IFramework.class, + IDynamicStatusStoreService.class, IResourcePoolingService.class) + .newInstance(null, null, null); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Mockito.doAnswer(invocation -> { + return null; + }).when(dssService) + .performActions(Mockito.any(DssDelete.class), Mockito.any(DssDelete.class)); + Field dssField = sdvUserPoolClass.getDeclaredField(dssVariableString); + dssField.setAccessible(true); + dssField.set(sdvUserPool, dssService); + + // Make call to funtion under test + sdvUserPool.deleteDss("user1", "APPL1", "RUN123", dssService); + + // Ensure perform action is called, with 2x dss entries to delete + Mockito.verify(dssService, Mockito.times(1)) + .performActions(Mockito.any(DssDelete.class), Mockito.any(DssDelete.class)); + + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserResourceMonitor.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserResourceMonitor.java new file mode 100644 index 000000000..328823c27 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/java/dev/galasa/sdv/internal/TestSdvUserResourceMonitor.java @@ -0,0 +1,447 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package dev.galasa.sdv.internal; + +import dev.galasa.framework.spi.DynamicStatusStoreException; +import dev.galasa.framework.spi.DynamicStatusStoreMatchException; +import dev.galasa.framework.spi.FrameworkException; +import dev.galasa.framework.spi.IDynamicStatusStoreService; +import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.IFrameworkRuns; +import dev.galasa.framework.spi.IResourceManagement; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import sun.misc.Unsafe; + + +class TestSdvUserResourceMonitor { + + private MockedStatic sdvUserPoolStatic; + + private String sdvUserString = "sdvuser"; + private String sdvUserResourceMonitorClassString = + "dev.galasa.sdv.internal.SdvUserResourceMonitor"; + private String logString = "LOG"; + private String theUnsafeString = "theUnsafe"; + + private String dssEntryUser1RegionA = "sdvuser.APPL1.USER1"; + private String dssEntryUser2RegionA = "sdvuser.APPL1.USER2"; + private String dssEntryUser1RegionB = "sdvuser.APPL2.USER1"; + private String runThreeString = "RUN3"; + private String runFourString = "RUN4"; + private String user1String = "USER1"; + private String user2String = "USER2"; + + @SuppressWarnings("PMD") + private static final Log mockLog = Mockito.mock(Log.class); + + @BeforeEach + public void setUp() { + // Registering static mocks before each test + sdvUserPoolStatic = Mockito.mockStatic(SdvUserPool.class); + + Mockito.reset(mockLog); + Mockito.when(mockLog.isInfoEnabled()).thenReturn(true); + Mockito.when(mockLog.isWarnEnabled()).thenReturn(true); + Mockito.when(mockLog.isErrorEnabled()).thenReturn(true); + Mockito.when(mockLog.isTraceEnabled()).thenReturn(true); + Mockito.when(mockLog.isDebugEnabled()).thenReturn(true); + } + + @AfterEach + public void tearDown() { + // Closing static mocks after each test + sdvUserPoolStatic.close(); + } + + @Test + void testRunWithNoActiveRunsOrDssEntries() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, FrameworkException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + Mockito.when(dssService.getPrefix(sdvUserString)).thenReturn(sdvUsersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvUserResourceMonitor.run(); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + Assertions.assertTrue(true); + } + + @Test + void testRunWithActiveRunsMatchingDssEntries() + throws ClassNotFoundException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException, NoSuchFieldException, FrameworkException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + allActiveRuns.add("RUN1"); + allActiveRuns.add("RUN2"); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + sdvUsersInDss.put(dssEntryUser1RegionA, "RUN1"); + sdvUsersInDss.put(dssEntryUser2RegionA, "RUN1"); + sdvUsersInDss.put(dssEntryUser1RegionB, "RUN2"); + Mockito.when(dssService.getPrefix(sdvUserString)).thenReturn(sdvUsersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvUserResourceMonitor.run(); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.any(), Mockito.any(), + Mockito.any(), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + Assertions.assertTrue(true); + } + + @Test + void testRunWithDssEntriesNotInActiveRuns() throws FrameworkException, ClassNotFoundException, + NoSuchFieldException, SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + allActiveRuns.add(runFourString); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()).thenReturn(frameworkRuns); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + sdvUsersInDss.put(dssEntryUser1RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser2RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser1RegionB, runFourString); + Mockito.when(dssService.getPrefix(sdvUserString)).thenReturn(sdvUsersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvUserResourceMonitor.run(); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user1String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user2String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + Assertions.assertTrue(true); + } + + @Test + void testRunException() throws FrameworkException, ClassNotFoundException, NoSuchFieldException, + SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + IFrameworkRuns frameworkRuns = Mockito.mock(IFrameworkRuns.class); + + Set allActiveRuns = new HashSet(); + allActiveRuns.add(runFourString); + Mockito.when(frameworkRuns.getActiveRunNames()).thenReturn(allActiveRuns); + + Mockito.when(framework.getFrameworkRuns()) + .thenThrow(new FrameworkException("cannot access framework")); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + sdvUsersInDss.put(dssEntryUser1RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser2RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser1RegionB, runFourString); + Mockito.when(dssService.getPrefix(sdvUserString)).thenReturn(sdvUsersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvUserResourceMonitor.run(); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user1String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user2String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + // Verify that although an exception occurred, the program continues, and simply logs + // an error to the log. + Mockito.verify(mockLog, Mockito.times(1)) + .error("Failure during scanning DSS for SDV Users"); + } + + @Test + void testrunFinishedOrDeleted() throws FrameworkException, ClassNotFoundException, + NoSuchFieldException, SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + sdvUsersInDss.put(dssEntryUser1RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser2RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser1RegionB, runFourString); + Mockito.when(dssService.getPrefix(sdvUserString)).thenReturn(sdvUsersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvUserResourceMonitor.runFinishedOrDeleted(runThreeString); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user1String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user2String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + Assertions.assertTrue(true); + } + + @Test + void testrunFinishedOrDeletedException() throws FrameworkException, ClassNotFoundException, + NoSuchFieldException, SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + sdvUsersInDss.put(dssEntryUser1RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser2RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser1RegionB, runFourString); + Mockito.when(dssService.getPrefix(sdvUserString)) + .thenThrow(new DynamicStatusStoreException("cannot read dss")); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + // Make call to funtion under test + sdvUserResourceMonitor.runFinishedOrDeleted(runThreeString); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user1String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user2String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(0)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + // Verify that although an exception occurred, the program continues, and simply logs + // an error to the log. + Mockito.verify(mockLog, Mockito.times(1)) + .error("Failure cleaning up SDV Users for finished run " + runThreeString); + } + + @Test + void testrunFinishedOrDeletedDssDeleteException() + throws FrameworkException, ClassNotFoundException, NoSuchFieldException, + SecurityException, InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException { + // Mock framework + IFramework framework = Mockito.mock(IFramework.class); + + // Mock resourceManagement + IResourceManagement resMan = Mockito.mock(IResourceManagement.class); + + // Mock dss + IDynamicStatusStoreService dssService = Mockito.mock(IDynamicStatusStoreService.class); + Map sdvUsersInDss = new HashMap<>(); + sdvUsersInDss.put(dssEntryUser1RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser2RegionA, runThreeString); + sdvUsersInDss.put(dssEntryUser1RegionB, runFourString); + Mockito.when(dssService.getPrefix(sdvUserString)).thenReturn(sdvUsersInDss); + + // Get SdvUserResourceMonitor instance + Class sdvUserResourceMonitorClass = Class.forName(sdvUserResourceMonitorClassString); + SdvUserResourceMonitor sdvUserResourceMonitor = + (SdvUserResourceMonitor) sdvUserResourceMonitorClass + .getDeclaredConstructor(IFramework.class, IResourceManagement.class, + IDynamicStatusStoreService.class) + .newInstance(framework, resMan, dssService); + + // Replace LOG + final Field unsafeField = Unsafe.class.getDeclaredField(theUnsafeString); + unsafeField.setAccessible(true); + final Unsafe unsafe = (Unsafe) unsafeField.get(null); + + final Field loggerField = sdvUserResourceMonitorClass.getDeclaredField(logString); + final Object staticLoggerFieldBase = unsafe.staticFieldBase(loggerField); + final long staticLoggerFieldOffset = unsafe.staticFieldOffset(loggerField); + unsafe.putObject(staticLoggerFieldBase, staticLoggerFieldOffset, mockLog); + + sdvUserPoolStatic.when(() -> SdvUserPool.deleteDss(Mockito.eq(user1String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any())) + .thenThrow(new DynamicStatusStoreMatchException("not found")); + + // Make call to funtion under test + sdvUserResourceMonitor.runFinishedOrDeleted(runThreeString); + + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user1String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verify(() -> SdvUserPool.deleteDss(Mockito.eq(user2String), Mockito.any(), + Mockito.eq(runThreeString), Mockito.any()), Mockito.times(1)); + sdvUserPoolStatic.verifyNoMoreInteractions(); + + // Verify that although an exception occurred, the program continues, and simply logs + // an error to the log. + Mockito.verify(mockLog, Mockito.times(1)) + .error("Failure in discarding SDV User " + user1String + " on CICS Applid APPL1" + + " allocated to run " + runThreeString); + } +} diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYaml.jcl b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYaml.jcl new file mode 100644 index 000000000..e35c7b071 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYaml.jcl @@ -0,0 +1,7 @@ +//MYLIB JCLLIB ORDER=(CICS.INSTALL.SDFHPROC) +//SDVCAPTR EXEC DFHXSDSO, +// HLQ=CICS.INSTALL, +// LOGSTRM=owner1.APPL1.DFHSECR, +// CYL=100 +//EXTRACT.SYSIN DD * +HEADER=NO \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYamlRegionA.jcl b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYamlRegionA.jcl new file mode 100644 index 000000000..a12289b56 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYamlRegionA.jcl @@ -0,0 +1,13 @@ +//MYLIB JCLLIB ORDER=(CICS.INSTALL.SDFHPROC) +//SDVCAPTR EXEC DFHXSDSO, +// HLQ=CICS.INSTALL, +// LOGSTRM=owner1.APPL1.DFHSECR, +// CYL=100 +//EXTRACT.SYSIN DD * +HEADER=NO +MATCHID=_654654 +USERID=user1,ROLE=TELLER +MATCHID=_7676575 +USERID=user2,ROLE=ADMIN +/* +// \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYamlRegionB.jcl b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYamlRegionB.jcl new file mode 100644 index 000000000..210b62f76 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/getYamlRegionB.jcl @@ -0,0 +1,11 @@ +//MYLIB JCLLIB ORDER=(CICS.INSTALL.SDFHPROC) +//SDVCAPTR EXEC DFHXSDSO, +// HLQ=CICS.INSTALL, +// LOGSTRM=owner1.APPL1.DFHSECR, +// CYL=100 +//EXTRACT.SYSIN DD * +HEADER=NO +MATCHID=_4543634 +USERID=user3,ROLE=TELLER +/* +// \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/yamlRegionA.yaml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/yamlRegionA.yaml new file mode 100644 index 000000000..47cd4ee41 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/yamlRegionA.yaml @@ -0,0 +1 @@ +regionASecurityYAML \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/yamlRegionB.yaml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/yamlRegionB.yaml new file mode 100644 index 000000000..a304c420a --- /dev/null +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.sdv.manager/src/test/resources/yamlRegionB.yaml @@ -0,0 +1 @@ +regionBSecurityYAML \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/build.gradle index 505524264..db90bc8f3 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/build.gradle @@ -10,3 +10,17 @@ dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') implementation project(':galasa-managers-testingtools-parent:dev.galasa.selenium.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/settings.gradle index a90d1366e..411dbccd7 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.selenium.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.selenium.manager.ivt' diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/src/main/java/dev/galasa/selenium/manager/ivt/SeleniumManagerIVT.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/src/main/java/dev/galasa/selenium/manager/ivt/SeleniumManagerIVT.java index c2e3fd5d0..c30a2b28a 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/src/main/java/dev/galasa/selenium/manager/ivt/SeleniumManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager.ivt/src/main/java/dev/galasa/selenium/manager/ivt/SeleniumManagerIVT.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/bnd.bnd b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/bnd.bnd index 67add6b33..a941c8c5d 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/bnd.bnd @@ -51,8 +51,9 @@ Embed-Dependency: *;scope=compile guava-30.1.1-jre.jar; lib:=true,\ j2objc-annotations-1.3.jar; lib:=true,\ jsr305-3.0.2.jar; lib:=true,\ - okhttp-3.11.0.jar; lib:=true,\ - okio-1.14.0.jar; lib:=true,\ + okhttp-4.10.0.jar; lib:=true,\ + okio-jvm-3.0.0.jar; lib:=true,\ + kotlin-osgi-bundle-1.7.22.jar; lib:=true,\ selenium-api-3.141.59.jar; lib:=true,\ selenium-chrome-driver-3.141.59.jar; lib:=true,\ selenium-edge-driver-3.141.59.jar; lib:=true,\ diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/build.gradle index 6c802ca10..46c07ab01 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa Selenium Manager' -version = '0.25.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') @@ -22,10 +22,26 @@ dependencies { api 'org.seleniumhq.selenium:selenium-firefox-driver:3.141.59' api 'org.seleniumhq.selenium:selenium-remote-driver:3.141.59' implementation 'com.google.guava:guava:30.1.1-jre' - implementation 'com.squareup.okhttp3:okhttp:3.11.0' - implementation 'com.squareup.okio:okio:1.14.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okio:okio-jvm:3.0.0' + implementation 'org.jetbrains.kotlin:kotlin-osgi-bundle:1.7.22' implementation 'net.bytebuddy:byte-buddy:1.8.15' implementation 'org.apache.commons:commons-exec:1.3' - implementation 'commons-io:commons-io:2.6' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'commons-io:commons-io:2.16.1' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/settings.gradle index 9664f1919..74dfea3a6 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.selenium.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.selenium.manager' + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/Browser.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/Browser.java index ef71110f9..42031d658 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/Browser.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/Browser.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.security.SecureRandom; @@ -12,7 +14,7 @@ /** * Specifies the supported browser types for Local and remote versions * - * @author jamesdavies + * * */ public enum Browser { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IChromeOptions.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IChromeOptions.java index 59de92a6b..6079d97a8 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IChromeOptions.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IChromeOptions.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.io.File; @@ -16,7 +18,7 @@ /** * A Options pass through interface for the Selenium Options object * - * @author jamesdavies + * * */ public interface IChromeOptions { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IEdgeOptions.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IEdgeOptions.java index c2309bb64..426b0a5e1 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IEdgeOptions.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IEdgeOptions.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.util.Map; @@ -12,7 +14,7 @@ /** * A Options pass through interface for the Selenium Options object * - * @author jamesdavies + * * */ public interface IEdgeOptions { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IFirefoxOptions.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IFirefoxOptions.java index 608307585..8e3ddf2c1 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IFirefoxOptions.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IFirefoxOptions.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.nio.file.Path; @@ -20,7 +22,7 @@ /** * A Options pass through interface for the Selenium Options object * - * @author jamesdavies + * * */ public interface IFirefoxOptions { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IInternetExplorerOptions.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IInternetExplorerOptions.java index 6f7cd3dfd..a20fd15f0 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IInternetExplorerOptions.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IInternetExplorerOptions.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.time.Duration; @@ -17,7 +19,7 @@ /** * A Options pass through interface for the Selenium Options object * - * @author jamesdavies + * * */ public interface IInternetExplorerOptions { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IOperaOptions.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IOperaOptions.java index ab5637af8..042fa22e2 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IOperaOptions.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IOperaOptions.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/ISeleniumManager.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/ISeleniumManager.java index 4fbeb9189..76d92db29 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/ISeleniumManager.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/ISeleniumManager.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.util.List; @@ -8,7 +10,7 @@ /** * This interface is being deprecated and replaced with a more appropriately named IWebDriver interface. * - * @author jamesdavies + * * */ @Deprecated diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebDriver.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebDriver.java index 4a0ee9365..15b620602 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebDriver.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebDriver.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebPage.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebPage.java index 1464b0860..ab7bc6ebb 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebPage.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/IWebPage.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.util.List; @@ -27,7 +29,6 @@ public interface IWebPage { /** * Clears the Element specified by a Class Name * @param className The Object used to specify the Element - * @param secondsTimeout The wait timeout in seconds * @return The WebPage after the Element is cleared */ public IWebPage clearElementByClassName(String className); diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManager.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManager.java index 09864bbbe..15afb36c4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManager.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManager.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.lang.annotation.ElementType; @@ -13,7 +15,7 @@ /** * This annotation is being deprecated and replaced with a more appropriately named @WebDriver. There is no functionality differences between the two * - * @author jamesdavies + * * */ @Deprecated diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerException.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerException.java index 10532198b..39e4604bc 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerException.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerException.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import dev.galasa.ManagerException; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerField.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerField.java index 380531cad..1f0450b5e 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerField.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/SeleniumManagerField.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.lang.annotation.Retention; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/WebDriver.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/WebDriver.java index 0c3f94c0a..633cd0d0c 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/WebDriver.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/WebDriver.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.selenium; import java.lang.annotation.ElementType; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/ChromeOptionsImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/ChromeOptionsImpl.java index 8ef49fe4d..56ab981b6 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/ChromeOptionsImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/ChromeOptionsImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/DriverImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/DriverImpl.java index aa759a21d..1b352d580 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/DriverImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/DriverImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -15,7 +17,7 @@ /** * Superclass for the local and remote driver implementations for tracking and discarding webpages * - * @author jamesdavies + * * */ public class DriverImpl { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/EdgeOptionsImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/EdgeOptionsImpl.java index 3739a546b..c1760dae4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/EdgeOptionsImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/EdgeOptionsImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/FirefoxOptionsImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/FirefoxOptionsImpl.java index 0ae3dc046..98620adf7 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/FirefoxOptionsImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/FirefoxOptionsImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/InternetExplorerOptionsImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/InternetExplorerOptionsImpl.java index 219f0034e..b9c52e960 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/InternetExplorerOptionsImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/InternetExplorerOptionsImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalBrowser.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalBrowser.java index 24e1fa3bc..21e973a0d 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalBrowser.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalBrowser.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -35,7 +35,7 @@ /** * Interactions with a different browser types for local Selenium drivers. * - * @author jamesdavies + * * */ public enum LocalBrowser { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalDriverImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalDriverImpl.java index a1fd6cd4e..4736c93bc 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalDriverImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/LocalDriverImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -21,7 +23,7 @@ * A local driver can be used to run Selenium tests. This is not support inside an Galasa ecosystem, as the tests run inside * the default engine. Please use the Docker, Kubernetes or Grid implementations for automation runs. * - * @author jamesdavies + * * */ public class LocalDriverImpl extends DriverImpl implements IWebDriver{ diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/OperaOptionsImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/OperaOptionsImpl.java index fd695dfb8..028c851e4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/OperaOptionsImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/OperaOptionsImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/RemoteDriverImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/RemoteDriverImpl.java index 7956fae9d..369001124 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/RemoteDriverImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/RemoteDriverImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumEnvironment.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumEnvironment.java index 20c928086..603bf8963 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumEnvironment.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumEnvironment.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -31,7 +33,7 @@ * Selenium Environment is a generic environment for both local and remote drivers * * - * @author jamesdavies + * * */ public class SeleniumEnvironment { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumGridSessionMonitor.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumGridSessionMonitor.java index 0513f3606..c8e4cb049 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumGridSessionMonitor.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumGridSessionMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -34,7 +34,7 @@ /** * Monitors any configured Selenium Grids for stale sessions. * - * @author jamesdavies + * * */ public class SeleniumGridSessionMonitor implements Runnable { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumManagerImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumManagerImpl.java index 95258c72c..5dda32ef4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumResourceManagement.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumResourceManagement.java index 354db9645..9afa400dc 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumResourceManagement.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -24,7 +24,7 @@ * We only watch the slot properties and the Grid interactions. Both Docker * and Kubernetes are responsible for the own cleanup of stale resources. * - * @author jamesdavies + * * */ @Component(service = { IResourceManagementProvider.class }) diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumSlotResourceMonitor.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumSlotResourceMonitor.java index 508977935..fa83f5bf4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumSlotResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/SeleniumSlotResourceMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; @@ -24,7 +24,7 @@ /** * Looks for slots allocated to non active tests. * - * @author jamesdavies + * * */ public class SeleniumSlotResourceMonitor implements Runnable { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/WebPageImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/WebPageImpl.java index aef5772e4..c9d7f89b8 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/WebPageImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/WebPageImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumAvailableDrivers.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumAvailableDrivers.java index 25a8e5489..eaba28107 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumAvailableDrivers.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumAvailableDrivers.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDefaultDriver.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDefaultDriver.java index a8d3edc62..264cc7378 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDefaultDriver.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDefaultDriver.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDockerNodeVersion.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDockerNodeVersion.java index 2c6691ce6..391688e66 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDockerNodeVersion.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDockerNodeVersion.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDriverMaxSlots.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDriverMaxSlots.java index cd9103a23..38d1d150d 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDriverMaxSlots.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumDriverMaxSlots.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoPreferences.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoPreferences.java index 0392cc5b5..4d7f78fc4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoPreferences.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoPreferences.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoProfile.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoProfile.java index 496f7373c..084bbb93b 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoProfile.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGeckoProfile.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGridEndpoint.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGridEndpoint.java index 268cd1c4e..a0c5e3ec9 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGridEndpoint.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumGridEndpoint.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNamespace.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNamespace.java index 6c790cd4e..c5ecfb28c 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNamespace.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNamespace.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNodeSelector.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNodeSelector.java index c78cf2a66..0e803bda3 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNodeSelector.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumKubernetesNodeSelector.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumLocalDriverPath.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumLocalDriverPath.java index ccc34f04c..45fc8880a 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumLocalDriverPath.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumLocalDriverPath.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumPropertiesSingleton.java index 0643e3348..71887ff79 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumScreenshotFailure.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumScreenshotFailure.java index d89271664..9f718890c 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumScreenshotFailure.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumScreenshotFailure.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumWebDriverType.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumWebDriverType.java index 1a95c29a3..e04066f34 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumWebDriverType.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/internal/properties/SeleniumWebDriverType.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/package-info.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/package-info.java index 97a6e3a0f..9170ca932 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/package-info.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/package-info.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Selenium Manager * diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/spi/ISeleniumManagerSpi.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/spi/ISeleniumManagerSpi.java index 1f12675b7..6a64c7564 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/spi/ISeleniumManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/java/dev/galasa/selenium/spi/ISeleniumManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.selenium.spi; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-deployment.yaml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-deployment.yaml similarity index 85% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-deployment.yaml rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-deployment.yaml index e7c4b8d15..e0851735f 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-deployment.yaml +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-deployment.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-expose.yaml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-expose.yaml similarity index 75% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-expose.yaml rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-expose.yaml index 016238cc8..8f535ac8d 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-expose.yaml +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-expose.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Service metadata: diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-pod.yaml b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-pod.yaml similarity index 75% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-pod.yaml rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-pod.yaml index fcdc6f544..49f13a133 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/resources/selenium-node-pod.yaml +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.selenium.manager/src/main/resources/selenium-node-pod.yaml @@ -1,3 +1,9 @@ +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# + apiVersion: v1 kind: Pod metadata: diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/build.gradle index a10ac62ef..ada3f4ade 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/build.gradle @@ -15,3 +15,16 @@ dependencies { implementation project (':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project (':galasa-managers-testingtools-parent:dev.galasa.vtp.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = false +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = false +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/src/main/java/dev/galasa/vtp/manager/ivt/VtpManagerIVT.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/src/main/java/dev/galasa/vtp/manager/ivt/VtpManagerIVT.java index ef97e96d1..40c95e113 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/src/main/java/dev/galasa/vtp/manager/ivt/VtpManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager.ivt/src/main/java/dev/galasa/vtp/manager/ivt/VtpManagerIVT.java @@ -1,7 +1,8 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.vtp.manager.ivt; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/build.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/build.gradle index a9ca8db18..19a02114a 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/build.gradle @@ -11,3 +11,17 @@ dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zos3270.manager') implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/settings.gradle b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/settings.gradle index 96c363848..940eb943f 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.vtp.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.vtp.manager' diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/DataSetHLQ.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/DataSetHLQ.java index e30412b5d..19cca7e9c 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/DataSetHLQ.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/DataSetHLQ.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/TransactionNamesForTag.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/TransactionNamesForTag.java index bdec7979f..e3d595fa0 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/TransactionNamesForTag.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/TransactionNamesForTag.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpAPI.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpAPI.java index a9ee38df8..84af5eeeb 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpAPI.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpAPI.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpEnable.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpEnable.java index 0ef87771f..351647cb7 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpEnable.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpEnable.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpPropertiesSingleton.java index 37c9b4d98..cf01e05f4 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/internal/properties/VtpPropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/VtpManagerException.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/VtpManagerException.java index d8dc30e62..48f9f6bad 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/VtpManagerException.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/VtpManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.manager; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/RecordingData.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/RecordingData.java index 362f6f8e5..28b7e44d8 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/RecordingData.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/RecordingData.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpApiRecorderImp.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpApiRecorderImp.java index d6e6bc97e..d4f85ba79 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpApiRecorderImp.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpApiRecorderImp.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpManagerImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpManagerImpl.java index 98d9005cc..a54d55ac2 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.manager.internal; @@ -89,8 +91,10 @@ public void provisionGenerate() throws ManagerException, ResourceUnavailableExce boolean useAPI = VtpAPI.get(); if(useAPI) { + logger.info("VTP Manager will use the VTP API for recordings"); this.recorder = new VtpApiRecorderImp(recordingRegions, this.dumpDataSetHLQ, logger, this); }else { + logger.info("VTP Manager will use the VTP txns for recordings"); this.recorder = new VtpTxnRecorderImpl(recordingRegions, this.dumpDataSetHLQ, logger, this); } } @@ -273,7 +277,7 @@ public void startOfTestClass() throws ManagerException { public void copyDumpedPlaybackFile(IZosImage image, HashMap attrs) throws VtpManagerException { try { - String jcl = artifactManager.getBundleResources(this.getClass()).retrieveSkeletonFileAsString("resources/jcl/dumpJCL", attrs).trim(); + String jcl = artifactManager.getBundleResources(this.getClass()).retrieveSkeletonFileAsString("/jcl/dumpJCL", attrs).trim(); IZosBatchJob job = batchManager.getZosBatch(image).submitJob(jcl, null); int rc = job.waitForJob(); if(rc > 4) { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpRecorderImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpRecorderImpl.java index 892196c31..1183081d9 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpRecorderImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpRecorderImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpTxnRecorderImpl.java b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpTxnRecorderImpl.java index 17cc19b2c..c55805ac6 100644 --- a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpTxnRecorderImpl.java +++ b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/java/dev/galasa/vtp/manager/internal/VtpTxnRecorderImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.vtp.manager.internal; @@ -24,7 +26,7 @@ public VtpTxnRecorderImpl(HashMap recordingRegions, void startRecording() { for(ICicsRegion region : recordingRegions.keySet()) { ICicsTerminal terminal = recordingRegions.get(region).getRecordingTerminal(); - logger.info("Starting VTP Recording"); + logger.info("Starting VTP Recording for region: " + region.getApplid()); try { startRecordingUsingTxn(region, terminal); }catch(VtpManagerException e) { @@ -38,8 +40,13 @@ private void startRecordingUsingTxn(ICicsRegion region, ICicsTerminal terminal) String command = "BZUT " + transaction; String expectedResponse = "RECORDING STARTED FOR TRANSACTION " + transaction; try { + logger.trace("Waiting for keyboard to be ready"); + terminal.waitForKeyboard(); + logger.trace("Entering command to start recording: " + command); terminal.type(command).enter(); + logger.trace("Waiting for response: " + expectedResponse); terminal.waitForTextInField(expectedResponse); + logger.trace("Resetting terminal"); terminal.clear().wfk(); } catch (Zos3270Exception e) { throw new VtpManagerException("Error when starting recording for region: " + region.getApplid(), e); @@ -61,9 +68,16 @@ void endRecording() { } private void stopRecordingUsingTxn(ICicsRegion region, ICicsTerminal terminal) throws VtpManagerException{ + String command = "BZUE"; + String expectedResponse = "RECORDING STOPPED"; try { - terminal.type("BZUE").enter(); - terminal.waitForTextInField("RECORDING STOPPED"); + logger.trace("Waiting for keyboard to be ready"); + terminal.waitForKeyboard(); + logger.trace("Entering command to start recording: " + command); + terminal.type(command).enter(); + logger.trace("Waiting for response: " + expectedResponse); + terminal.waitForTextInField(expectedResponse); + logger.trace("Resetting terminal"); terminal.clear().wfk(); } catch (Zos3270Exception e) { throw new VtpManagerException(e); @@ -74,7 +88,7 @@ private void stopRecordingUsingTxn(ICicsRegion region, ICicsTerminal terminal) t void writeRecording() { for(ICicsRegion region : recordingRegions.keySet()) { ICicsTerminal terminal = recordingRegions.get(region).getRecordingTerminal(); - logger.info("Writing VTP Recording"); + logger.info("Writing VTP Recording for region: " + region.getApplid()); try { writeRecordingUsingTxn(region, terminal); } catch (VtpManagerException e) { @@ -84,9 +98,16 @@ void writeRecording() { } private void writeRecordingUsingTxn(ICicsRegion region, ICicsTerminal terminal) throws VtpManagerException{ + String command = "BZUW"; + String expectedResponse = "RECORDS WRITTEN"; try { - terminal.type("BZUW").enter(); - terminal.waitForTextInField("RECORDS WRITTEN"); + logger.trace("Waiting for keyboard to be ready"); + terminal.waitForKeyboard(); + logger.trace("Entering command to start recording: " + command); + terminal.type(command).enter(); + logger.trace("Waiting for response: " + expectedResponse); + terminal.waitForTextInField(expectedResponse); + logger.trace("Resetting terminal"); terminal.clear().wfk(); } catch (Zos3270Exception e) { diff --git a/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/resources/resources/jcl/dumpJCL b/galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/resources/jcl/dumpJCL similarity index 100% rename from galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/resources/resources/jcl/dumpJCL rename to galasa-managers-parent/galasa-managers-testingtools-parent/dev.galasa.vtp.manager/src/main/resources/jcl/dumpJCL diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/build.gradle index 7a34ed495..2f5595bab 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/build.gradle @@ -10,3 +10,18 @@ dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') implementation project(':galasa-managers-unix-parent:dev.galasa.linux.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + + diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/settings.gradle index 34b923e99..b05b6a060 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.linux.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.linux.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/src/main/java/dev/galasa/linux/manager/ivt/LinuxManagerIVT.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/src/main/java/dev/galasa/linux/manager/ivt/LinuxManagerIVT.java index fdcca21f6..84a54b8c0 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/src/main/java/dev/galasa/linux/manager/ivt/LinuxManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager.ivt/src/main/java/dev/galasa/linux/manager/ivt/LinuxManagerIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/build.gradle b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/build.gradle index 60cedf5d6..11cf1e2b4 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/build.gradle @@ -11,3 +11,17 @@ dependencies { implementation 'io.prometheus:simpleclient:0.6.0' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/settings.gradle b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/settings.gradle index ddb3dcf86..79f4cac27 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.linux.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.linux.manager' + + diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxImage.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxImage.java index d7ae188fb..136bae52e 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxImage.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxImage.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; @@ -20,7 +22,7 @@ * Use a {@link LinuxImage} annotation to populate this field with *

* - * @author Michael Baylis + * * */ public interface ILinuxImage { @@ -45,7 +47,7 @@ public interface ILinuxImage { * Retrieve the default credentials for the Image. * * @return The default credentials - see - * {@link dev.galasa.framework.spi.creds.ICredentials} + * {@link dev.galasa.ICredentials} * @throws LinuxManagerException if the credentials are missing or there is a * problem with the credentials store */ diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxManager.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxManager.java index 5c2b3dade..c01df3544 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxManager.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/ILinuxManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxImage.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxImage.java index 0ae0ac46f..b30519dec 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxImage.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; @@ -19,7 +19,7 @@ * Used to populate a {@link ILinuxImage} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxIpHost.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxIpHost.java index 002beff0d..818bbddf0 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxIpHost.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxIpHost.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; @@ -20,7 +20,7 @@ * Used to populate a {@link dev.galasa.ipnetwork.IIpHost} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerException.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerException.java index 61fba04df..4949ea954 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerException.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerField.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerField.java index bd77b84e7..c88611fb0 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerField.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/LinuxManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/OperatingSystem.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/OperatingSystem.java index 00a4faad4..05f0da482 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/OperatingSystem.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/OperatingSystem.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxManagerImpl.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxManagerImpl.java index 72bee514a..7698b581b 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxManagerImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.linux.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxProperties.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxProperties.java index 942c26f3e..60576b8c6 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxProperties.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/LinuxProperties.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEImage.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEImage.java index 1a24cf685..b7640aee0 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEImage.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEImage.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.dse; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEIpHost.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEIpHost.java index 7172469cd..3c4aaf597 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEIpHost.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEIpHost.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.linux.internal.dse; import dev.galasa.ipnetwork.IIpPort; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEProvisioner.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEProvisioner.java index 24148f301..6f3feb2cf 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEProvisioner.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/dse/LinuxDSEProvisioner.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.linux.internal.dse; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxArchivesDirectory.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxArchivesDirectory.java index 5b9228987..a15fa9297 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxArchivesDirectory.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxArchivesDirectory.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -22,7 +24,7 @@ * Default is /opt/archives *

* - * @author Michael Baylis + * * */ public class LinuxArchivesDirectory extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxCapabilities.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxCapabilities.java index a57d2dfc8..9ba394c0a 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxCapabilities.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxCapabilities.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -24,7 +26,7 @@ * The default is empty, ie no special capabilities *

* - * @author Michael Baylis + * * */ public class LinuxCapabilities extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxOperatingSystem.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxOperatingSystem.java index b53efc89b..223851748 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxOperatingSystem.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxOperatingSystem.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -22,7 +24,7 @@ * There is no default, the property must be provided for the image to be selectable *

* - * @author Michael Baylis + * * */ public class LinuxOperatingSystem extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxPropertiesSingleton.java index c1504ad4e..e2384db13 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/LinuxPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/MaximumSlots.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/MaximumSlots.java index 16d19c2d9..c9c1c0d45 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/MaximumSlots.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/MaximumSlots.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -21,7 +23,7 @@ * default value is 2 slots *

* - * @author Michael Baylis + * * */ public class MaximumSlots extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/RetainRunDirectory.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/RetainRunDirectory.java index b813f7741..257f7c231 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/RetainRunDirectory.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/RetainRunDirectory.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxImages.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxImages.java index a9e80b93d..88b107642 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxImages.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxImages.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -25,7 +27,7 @@ * There are no defaults *

* - * @author Michael Baylis + * * */ public class SharedLinuxImages extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxPriority.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxPriority.java index 56ce7d7bc..abec16834 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxPriority.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/SharedLinuxPriority.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -22,7 +24,7 @@ * default value is 1 *

* - * @author Michael Baylis + * * */ public class SharedLinuxPriority extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/UsernamePool.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/UsernamePool.java index b4956d052..d787ede09 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/UsernamePool.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/UsernamePool.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.properties; @@ -28,7 +30,7 @@ * default value is galasa{0-9}{0-9} *

* - * @author Michael Baylis + * * */ public class UsernamePool extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/package-info.java index 51b2536cc..f5ccc4b6f 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Linux Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/LinuxResourceManagement.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/LinuxResourceManagement.java index b56d72fb7..540821965 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/LinuxResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/LinuxResourceManagement.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.resourcemanagement; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/SlotResourceManagement.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/SlotResourceManagement.java index 09945765a..77939ef70 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/SlotResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/SlotResourceManagement.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.resourcemanagement; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/UsernameResourceManagement.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/UsernameResourceManagement.java index 2211e309b..66ab9fbc2 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/UsernameResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/resourcemanagement/UsernameResourceManagement.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.resourcemanagement; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedImage.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedImage.java index f52a396b0..f56ba7215 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedImage.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedImage.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.shared; @@ -76,7 +78,7 @@ public LinuxSharedImage(LinuxManagerImpl manager, String tag, String hostid, Str throw new LinuxManagerException("useradd of username " + this.username + " failed:-\n" + response); } - String tempPassword = "ThisIsTheFutureOfTesting"; + String tempPassword = "ThisIsTheFutureOfTesting"; //Not a secret but this raises a vulnerability on server side runs. Issue has been raised to correct this //pragma: allowlist secret for(int i = 0; i < 4; i++) { tempPassword = tempPassword + Integer.toString(this.random.nextInt(10)); } diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedIpHost.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedIpHost.java index 63f0d973a..bf164560f 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedIpHost.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedIpHost.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.shared; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedProvisioner.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedProvisioner.java index 4ed64e2e5..84e704df7 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedProvisioner.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/internal/shared/LinuxSharedProvisioner.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.internal.shared; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/package-info.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/package-info.java index 752357b93..7d4137bfa 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/package-info.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * Linux Manager diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxManagerSpi.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxManagerSpi.java index 63390d9fa..528c39f41 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.spi; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisionedImage.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisionedImage.java index 551083ceb..b35574083 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisionedImage.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisionedImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.spi; diff --git a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisioner.java b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisioner.java index a637bd360..dd60a7dc0 100644 --- a/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisioner.java +++ b/galasa-managers-parent/galasa-managers-unix-parent/dev.galasa.linux.manager/src/main/java/dev/galasa/linux/spi/ILinuxProvisioner.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.linux.spi; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/build.gradle b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/build.gradle index 60b72de39..3eb98c53c 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/build.gradle @@ -11,3 +11,16 @@ dependencies { implementation 'io.prometheus:simpleclient:0.6.0' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/settings.gradle b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/settings.gradle index 98942ec01..035638855 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.windows.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.windows.manager' + diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsImage.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsImage.java index 75d492d45..4d2a3151d 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsImage.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows; @@ -22,7 +22,7 @@ * Use a {@link WindowsImage} annotation to populate this field with *

* - * @author Michael Baylis + * * */ public interface IWindowsImage { @@ -47,7 +47,7 @@ public interface IWindowsImage { * Retrieve the default credentials for the Image. * * @return The default credentials - see - * {@link dev.galasa.framework.spi.creds.ICredentials} + * {@link dev.galasa.ICredentials} * @throws WindowsManagerException if the credentials are missing or there is a * problem with the credentials store */ diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsManager.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsManager.java index 09b7b36f2..756e4787c 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsManager.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/IWindowsManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsImage.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsImage.java index 5c7f5880b..5bae187e1 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsImage.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows; @@ -19,7 +19,7 @@ * Used to populate a {@link IWindowsImage} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsIpHost.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsIpHost.java index 4afe337a4..c04f54e58 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsIpHost.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsIpHost.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows; @@ -20,7 +20,7 @@ * Used to populate a {@link dev.galasa.ipnetwork.IIpHost} field *

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerException.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerException.java index 1af558c91..b08714ccc 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerException.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerField.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerField.java index 1781018b9..1c814a77e 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerField.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/WindowsManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEImage.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEImage.java index fd6ecf746..44facbc6a 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEImage.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEIpHost.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEIpHost.java index 2836a1bb1..bd254cd0f 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEIpHost.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEIpHost.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEProvisioner.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEProvisioner.java index 2c7a08b10..89d588a0d 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEProvisioner.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDSEProvisioner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDefaultProvisioner.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDefaultProvisioner.java index 8e0309a16..bdf77f2ab 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDefaultProvisioner.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsDefaultProvisioner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsManagerImpl.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsManagerImpl.java index d1b698bfb..bdf4614ca 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsProperties.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsProperties.java index 1effa4be7..681a802fa 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsProperties.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/WindowsProperties.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/RetainRunDirectory.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/RetainRunDirectory.java index 1adb90985..f0d67af5a 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/RetainRunDirectory.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/RetainRunDirectory.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/WindowsPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/WindowsPropertiesSingleton.java index 6508393e9..5abcb1c24 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/WindowsPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/internal/properties/WindowsPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsManagerSpi.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsManagerSpi.java index 356cabef8..887f4d927 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.spi; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisionedImage.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisionedImage.java index 294ef5743..18a3670ce 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisionedImage.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisionedImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.spi; diff --git a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisioner.java b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisioner.java index 08f19990d..245f6783b 100644 --- a/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisioner.java +++ b/galasa-managers-parent/galasa-managers-windows-parent/dev.galasa.windows.manager/src/main/java/dev/galasa/windows/spi/IWindowsProvisioner.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.windows.spi; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/build.gradle b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/build.gradle index d654c23be..ae7c642a7 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/build.gradle @@ -4,9 +4,24 @@ plugins { description = 'Galasa GitHub Issue Manager' -version = '0.25.0' +version = '0.31.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + + diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/settings.gradle b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/settings.gradle index 430d1242d..fc17ff395 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/settings.gradle @@ -1 +1,3 @@ rootProject.name = 'dev.galasa.githubissue.manager' + + diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssue.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssue.java index b3cb92813..4439cae2f 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssue.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssue.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue; @@ -12,7 +14,7 @@ * This annotation will cause the Manager to influence the "failed" result of the test based on * whether a GitHub issue is open or closed. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssueManagerException.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssueManagerException.java index 4728df4ab..9c9d6ce47 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssueManagerException.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/GitHubIssueManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/Issue.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/Issue.java index 5bdfd90ec..0c6139d18 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/Issue.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/Issue.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/GitHubIssueManagerImpl.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/GitHubIssueManagerImpl.java index edc43786f..7b600b1b1 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/GitHubIssueManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/GitHubIssueManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue.internal; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubCredentials.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubCredentials.java index 22495ea8a..103769d46 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubCredentials.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubCredentials.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceRepository.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceRepository.java index 0fa1b0c0e..00e7c6d55 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceRepository.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceRepository.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceUrl.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceUrl.java index b283d69dc..74ded02ff 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceUrl.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssueInstanceUrl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssuePropertiesSingleton.java b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssuePropertiesSingleton.java index 9b4efbc3f..721e8beed 100644 --- a/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssuePropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-workflow-parent/dev.galasa.githubissue.manager/src/main/java/dev/galasa/githubissue/internal/properties/GitHubIssuePropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.githubissue.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/build.gradle index 2ea8b5aad..bb6bf4806 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/build.gradle @@ -4,10 +4,24 @@ plugins { description = 'Galasa zOS Manager IVTs' -version = '0.21.0' +version = '0.28.0' dependencies { implementation project (':galasa-managers-zos-parent:dev.galasa.zos.manager') implementation project (':galasa-managers-core-parent:dev.galasa.core.manager') implementation project (':galasa-managers-core-parent:dev.galasa.artifact.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/settings.gradle index 5a9b5d76c..8e257a791 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.zos.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.zos.manager.ivt' + + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerBatchIVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerBatchIVT.java index a99fd006c..2b6df603a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerBatchIVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerBatchIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.manager.ivt; @@ -95,7 +95,7 @@ public void preFlightTestsBatch() { */ @Test public void submitJCLNoSteps() throws TestBundleResourceException, IOException, ZosBatchException { - String jclInput = resources.retrieveFileAsString("/resources/jcl/noSteps.jcl"); + String jclInput = resources.retrieveFileAsString("/jcl/noSteps.jcl"); IZosBatchJob job = batch.submitJob(jclInput, null); int returnCode = job.waitForJob(); IZosBatchJobOutputSpoolFile spool = job.getSpoolFile("COBOL"); @@ -108,7 +108,7 @@ public void submitJCLNoSteps() throws TestBundleResourceException, IOException, */ @Test public void submitJCLDoNothing() throws TestBundleResourceException, IOException, ZosBatchException { - String jclInput = resources.retrieveFileAsString("/resources/jcl/doNothing.jcl"); + String jclInput = resources.retrieveFileAsString("/jcl/doNothing.jcl"); IZosBatchJob job = batch.submitJob(jclInput, null); int returnCode = job.waitForJob(); assertThat(returnCode).isEqualTo(0); @@ -121,7 +121,7 @@ public void submitJCLDoNothing() throws TestBundleResourceException, IOException */ @Test public void submitJCLDoNothingJobName() throws TestBundleResourceException, IOException, ZosBatchException { - String jclInput = resources.retrieveFileAsString("/resources/jcl/doNothing.jcl"); + String jclInput = resources.retrieveFileAsString("/jcl/doNothing.jcl"); IZosBatchJob job = batch.submitJob(jclInput, jobName); int returnCode = job.waitForJob(); assertThat(job.getJobname().getName()).isEqualTo(jobName.getName()); @@ -134,7 +134,7 @@ public void submitJCLDoNothingJobName() throws TestBundleResourceException, IOEx */ @Test public void submitJCLDoNothingJobNameAndBlankCard() throws TestBundleResourceException, IOException, ZosBatchException { - String jclInput = resources.retrieveFileAsString("/resources/jcl/doNothing.jcl"); + String jclInput = resources.retrieveFileAsString("/jcl/doNothing.jcl"); ZosBatchJobcard jobCard = new ZosBatchJobcard(); IZosBatchJob job = batch.submitJob(jclInput, jobName2, jobCard); int returnCode = job.waitForJob(); @@ -147,7 +147,7 @@ public void submitJCLDoNothingJobNameAndBlankCard() throws TestBundleResourceExc */ @Test public void checkOutputIsStoredInRAS() throws TestBundleResourceException, IOException, ZosBatchException { - String jclInput = resources.retrieveFileAsString("/resources/jcl/doNothing.jcl"); + String jclInput = resources.retrieveFileAsString("/jcl/doNothing.jcl"); IZosBatchJob job = batch.submitJob(jclInput, null); job.setShouldArchive(true); job.waitForJob(); @@ -162,7 +162,7 @@ public void checkOutputIsStoredInRAS() throws TestBundleResourceException, IOExc */ @Test public void retrieveJobs() throws TestBundleResourceException, IOException, ZosBatchException { - String jclInput = resources.retrieveFileAsString("/resources/jcl/doNothing.jcl"); + String jclInput = resources.retrieveFileAsString("/jcl/doNothing.jcl"); IZosBatchJob job = batch.submitJob(jclInput, null); job.waitForJob(); List jobs = batch.getJobs(job.getJobname().getName(), job.getOwner()); @@ -174,7 +174,7 @@ public void getAsString() throws TestBundleResourceException, IOException, ZosBa String message = "HELLO WORLD FROM GALASA"; Map parameters = new HashMap<>(); parameters.put("MESSAGE", message); - String jclInput = resources.retrieveSkeletonFileAsString("resources/jcl/helloWorld.jcl", parameters); + String jclInput = resources.retrieveSkeletonFileAsString("/jcl/helloWorld.jcl", parameters); assertThat(jclInput).contains(message); //submit the job, check that it completes and we got some output @@ -196,7 +196,7 @@ public void retrieveAndCheckOutput() throws TestBundleResourceException, IOExcep String message = "HELLO WORLD FROM GALASA"; Map parameters = new HashMap<>(); parameters.put("MESSAGE", message); - String jclInput = resources.retrieveSkeletonFileAsString("resources/jcl/helloWorld.jcl", parameters); + String jclInput = resources.retrieveSkeletonFileAsString("/jcl/helloWorld.jcl", parameters); assertThat(jclInput).contains(message); //submit the job, check that it completes and we got some output diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileDatasetIVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileDatasetIVT.java index ed9ade5c7..a753d1080 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileDatasetIVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileDatasetIVT.java @@ -1,7 +1,8 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ - package dev.galasa.zos.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; @@ -247,7 +248,7 @@ public void deleteNonExistingMember() throws ZosDatasetException { private boolean checkThatPDSExists(String dataset) throws TestBundleResourceException, IOException, ZosBatchException { HashMap parms = new HashMap<>(); parms.put("DATASET", dataset); - String jcl = resources.retrieveSkeletonFileAsString("/resources/jcl/PDSCheck.jcl", parms); + String jcl = resources.retrieveSkeletonFileAsString("/jcl/PDSCheck.jcl", parms); return(batch.submitJob(jcl, null).waitForJob() == 0); } @@ -278,7 +279,7 @@ private IZosDataset createBasicDataset(String name, boolean pds) throws ZosDatas private void deleteDataSet(String dataset) throws ZosBatchException, TestBundleResourceException, IOException { HashMap parms = new HashMap<>(); parms.put("DATASET", dataset); - String jcl = resources.retrieveSkeletonFileAsString("/resources/jcl/PDSDelete.jcl", parms); + String jcl = resources.retrieveSkeletonFileAsString("/jcl/PDSDelete.jcl", parms); IZosBatchJob job = batch.submitJob(jcl, null); job.waitForJob(); // Do not archive this batch job to RAS as it isn't what is being tested @@ -302,7 +303,7 @@ private boolean checkContentWasWritten(String pds, String member, String... cont String fullName = pds+"("+member+")"; HashMap parms = new HashMap<>(); parms.put("MEMBER_NAME",fullName); - IZosBatchJob job = batch.submitJob(resources.retrieveSkeletonFileAsString("/resources/jcl/list.jcl", parms),null); + IZosBatchJob job = batch.submitJob(resources.retrieveSkeletonFileAsString("/jcl/list.jcl", parms),null); job.setShouldArchive(false); if(job.waitForJob() > 0) return false; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileIVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileIVT.java index 0627ae059..9e2aaaab7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileIVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileIVT.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.manager.ivt; import static org.assertj.core.api.Assertions.assertThat; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileVSAMIVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileVSAMIVT.java index 1496587b6..1cae1033c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileVSAMIVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerFileVSAMIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.manager.ivt; @@ -92,6 +92,14 @@ public void basicKSDSDefine() throws ZosVSAMDatasetException, ZosBatchException, IZosVSAMDataset vsamDataSet = fileHandler.newVSAMDataset(DSName, imagePrimary); vsamDataSet.setSpace(VSAMSpaceUnit.CYLINDERS, 1, 1); vsamDataSet.setRecordSize(50, 101); + + if (checkThatPDSExists(DSName)) { + logger.info("Dataset " + DSName + " already exists. Deleting..."); + vsamDataSet.delete(); + logger.info("Dataset " + DSName + " deleted OK."); + } + assertThat(checkThatPDSExists(DSName)).isFalse(); + vsamDataSet.create(); assertThat(checkThatPDSExists(DSName)).isTrue(); @@ -115,7 +123,7 @@ public void basicKSDSDefine() throws ZosVSAMDatasetException, ZosBatchException, private boolean checkThatPDSExists(String dataset) throws TestBundleResourceException, IOException, ZosBatchException { HashMap parms = new HashMap<>(); parms.put("DATASET", dataset); - String jcl = resources.retrieveSkeletonFileAsString("/resources/jcl/PDSCheck.jcl", parms); + String jcl = resources.retrieveSkeletonFileAsString("/jcl/PDSCheck.jcl", parms); return(batch.submitJob(jcl, null).waitForJob() == 0); } } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerIVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerIVT.java index c4fde4543..d4f032699 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerIVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerTSOCommandIVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerTSOCommandIVT.java index 41672ccab..948a03c05 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerTSOCommandIVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/java/dev/galasa/zos/manager/ivt/ZosManagerTSOCommandIVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/PDSCheck.jcl b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/PDSCheck.jcl similarity index 100% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/PDSCheck.jcl rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/PDSCheck.jcl diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/PDSDelete.jcl b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/PDSDelete.jcl similarity index 100% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/PDSDelete.jcl rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/PDSDelete.jcl diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/doNothing.jcl b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/doNothing.jcl similarity index 100% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/doNothing.jcl rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/doNothing.jcl diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/helloWorld.jcl b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/helloWorld.jcl similarity index 100% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/helloWorld.jcl rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/helloWorld.jcl diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/list.jcl b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/list.jcl similarity index 100% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/list.jcl rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/list.jcl diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/noSteps.jcl b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/noSteps.jcl similarity index 100% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/resources/jcl/noSteps.jcl rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager.ivt/src/main/resources/jcl/noSteps.jcl diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/build.gradle index 719f1f347..37eddc1d6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/build.gradle @@ -4,10 +4,24 @@ plugins { description = 'Galasa zOS Manager' -version = '0.25.0' +version = '0.34.0' dependencies { api project (':galasa-managers-comms-parent:dev.galasa.ipnetwork.manager') implementation 'io.prometheus:simpleclient:0.6.0' - implementation 'org.apache.commons:commons-lang3:3.8.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/settings.gradle index a041a484a..dc23bbc7d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zos.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zos.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosImage.java index 3777ff51a..454735a80 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosImage.java @@ -1,8 +1,12 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; +import java.nio.charset.Charset; + import javax.validation.constraints.NotNull; import dev.galasa.ICredentials; @@ -13,7 +17,7 @@ * *

Use a {@link ZosImage} annotation to populate this field with

* - * @author Michael Baylis + * * */ public interface IZosImage { @@ -49,6 +53,14 @@ public interface IZosImage { */ String getClusterID(); + /** + * Get the code page of this zOS Image. Defaults to 037 + * + * @return The EBCDIC code page, never null + */ + @NotNull + Charset getCodePage(); + /** * Get the default host name for this Image * @@ -61,7 +73,7 @@ public interface IZosImage { /** * Retrieve the default credentials for the zOS Image. * - * @return The default credentials - see {@link dev.galasa.framework.spi.creds.ICredentials} + * @return The default credentials - see {@link dev.galasa.ICredentials} * @throws ZosManagerException if the credentials are missing or there is a problem with the credentials store */ @NotNull diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosManager.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosManager.java index 263d2ddac..afa6c8b02 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosManager.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/IZosManager.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; /** * Provides the test code access to the zOS Manager * - * @author Michael Baylis + * * */ public interface IZosManager { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosImage.java index 2482abe45..e0b492270 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; @@ -17,7 +17,7 @@ * *

Used to populate a {@link IZosImage} field

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpHost.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpHost.java index b526a028d..eec9ac053 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpHost.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpHost.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; @@ -18,7 +18,7 @@ * *

Used to populate a {@link dev.galasa.ipnetwork.IIpHost} field

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpPort.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpPort.java index a89214636..f974dd10f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpPort.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosIpPort.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos; import java.lang.annotation.ElementType; @@ -16,7 +18,7 @@ * *

Used to populate a {@link dev.galasa.ipnetwork.IIpPort} field

* - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerException.java index e17f8f43b..c6c31055c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerField.java index 3f4a4069e..793347628 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/ZosManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/SlotResourceMonitor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/SlotResourceMonitor.java index 24681db6d..63860f358 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/SlotResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/SlotResourceMonitor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosBaseImageImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosBaseImageImpl.java index 11748c739..5356f03d7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosBaseImageImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosBaseImageImpl.java @@ -1,8 +1,12 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; +import java.nio.charset.Charset; + import javax.validation.constraints.NotNull; import dev.galasa.ICredentials; @@ -12,6 +16,7 @@ import dev.galasa.framework.spi.creds.ICredentialsService; import dev.galasa.zos.IZosImage; import dev.galasa.zos.ZosManagerException; +import dev.galasa.zos.internal.properties.ImageCodePage; import dev.galasa.zos.internal.properties.ImageSysname; public abstract class ZosBaseImageImpl implements IZosImage { @@ -25,6 +30,7 @@ public abstract class ZosBaseImageImpl implements IZosImage { private final String sysplexID; private final String defaultCredentialsId; private final ZosIpHostImpl ipHost; + private final Charset codePage; private final String runTemporaryUNIXPath; private final String javaHome; @@ -42,6 +48,7 @@ public ZosBaseImageImpl(ZosManagerImpl zosManager, String imageId, String cluste this.clusterId = clusterId; try { + this.codePage = ImageCodePage.get(this.imageId); this.sysname = ImageSysname.get(this.imageId); this.sysplexID = AbstractManager.nulled(this.cps.getProperty("image." + this.imageId, "sysplex")); this.defaultCredentialsId = AbstractManager.defaultString(this.cps.getProperty("image", "credentials", this.imageId), "ZOS"); @@ -92,6 +99,11 @@ public String getClusterID() { return this.clusterId; } + @Override + public @NotNull Charset getCodePage() { + return this.codePage; + } + @Override public @NotNull String getDefaultHostname() throws ZosManagerException { return this.ipHost.getHostname(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosDseImageImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosDseImageImpl.java index c1f00420f..449810527 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosDseImageImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosDseImageImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpHostImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpHostImpl.java index 7503c772b..d78fe8638 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpHostImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpHostImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import dev.galasa.framework.spi.creds.CredentialsException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpPortImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpPortImpl.java index a86c0f394..df8f5596a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpPortImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosIpPortImpl.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosManagerImpl.java index f47e5f177..d8970548d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosManagerImpl.java @@ -1,6 +1,8 @@ -/* -* Copyright contributors to the Galasa project -*/ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.io.IOException; @@ -283,6 +285,7 @@ protected IZosImage generateZosImage(String tag) throws ZosManagerException { } //*** Check to see if we have a DSE for this tag + logger.info("Searching for a zos DSE Image configured for tag " + tag); String imageID = DseImageIdForTag.get(tag); if (imageID != null) { logger.info("zOS DSE Image " + imageID + LOG_SELECTED_FOR_ZOS_TAG + tag + "'"); @@ -293,15 +296,16 @@ protected IZosImage generateZosImage(String tag) throws ZosManagerException { taggedImages.put(tag, selectedImage); return selectedImage; } - + + logger.info("Searching for a zos DSE Cluster configured for tag " + tag); String clusterId = DseClusterIdForTag.get(tag); ZosDseImageImpl image = new ZosDseImageImpl(this, imageID, clusterId); images.put(image.getImageID(), image); taggedImages.put(tag, image); return image; } - - + + logger.info("No DSE Image found, searching for specific zos image for tag " + tag); //*** See if the we need to run on a specific image, not DSE imageID = ImageIdForTag.get(tag); if (imageID != null) { @@ -322,8 +326,8 @@ protected IZosImage generateZosImage(String tag) throws ZosManagerException { DssUtils.incrementMetric(dss, "metrics.slots.insufficent"); throw new ZosManagerException("Unable to provision zOS Image tagged " + tag + " on " + imageID + " as there is insufficient capacity"); } - } - + } + logger.info("No specific image found for tag" + tag + " selecting image"); return selectNewImage(tag); } @@ -370,13 +374,16 @@ public IIpPort generateIpPort(Field field, List annotations) throws protected ZosProvisionedImageImpl selectNewImage(String tag) throws ZosManagerException { //*** Need the cluster we can allocate an image from + logger.info("Searching for cluster ID for tag " + tag); String clusterId = ClusterIdForTag.get(tag); if (clusterId == null) { + logger.info("No cluster ID found for tag " + tag + " assuming DEFAULT"); clusterId = "DEFAULT"; } clusterId = clusterId.toUpperCase(); //*** Find a list of images + logger.info("Searching for list of images for cluster " + clusterId); for(String definedImage : ClusterImages.get(clusterId)) { ZosProvisionedImageImpl image = new ZosProvisionedImageImpl(this, definedImage, clusterId); definedImages.add(new ImageUsage(image)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPoolPorts.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPoolPorts.java index 3861f0a71..541616425 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPoolPorts.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPoolPorts.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPortResourceMonitor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPortResourceMonitor.java index df44e7c8a..b3cdd2467 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPortResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosPortResourceMonitor.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.util.Map; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosProvisionedImageImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosProvisionedImageImpl.java index 1087a226e..118668d3f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosProvisionedImageImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosProvisionedImageImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosResourceManagement.java index 7b9afd3fe..13e97ba7e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/ZosResourceManagement.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.util.concurrent.TimeUnit; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/metrics/ZosMetrics.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/metrics/ZosMetrics.java index ef36e391d..9b8639c27 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/metrics/ZosMetrics.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/metrics/ZosMetrics.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.metrics; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/BatchExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/BatchExtraBundle.java index 6c18120ed..dd5c87628 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/BatchExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/BatchExtraBundle.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterIdForTag.java index 18e37bf9a..2fa430509 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterIdForTag.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterImages.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterImages.java index de91b611b..93761ca9a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterImages.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ClusterImages.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ConsoleExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ConsoleExtraBundle.java index a0b910f2c..5bb7721e9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ConsoleExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ConsoleExtraBundle.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseClusterIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseClusterIdForTag.java index 818cccaad..422cca1a6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseClusterIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseClusterIdForTag.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseImageIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseImageIdForTag.java index 45b5fd66c..2122b6110 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseImageIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/DseImageIdForTag.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/FileExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/FileExtraBundle.java index dcd8a2ef2..58fd74cf2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/FileExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/FileExtraBundle.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/HostId.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/HostId.java index 40b87020a..f3e9a1dfd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/HostId.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/HostId.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageCodePage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageCodePage.java new file mode 100644 index 000000000..79f65526d --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageCodePage.java @@ -0,0 +1,38 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos.internal.properties; + +import java.nio.charset.Charset; + +import dev.galasa.framework.spi.cps.CpsProperties; +import dev.galasa.zos.ZosManagerException; + +/** + * The code page for a zOS Image + * + * @galasa.cps.property + * + * @galasa.name zos.image.[tag].codepage + * + * @galasa.description The code page set for a zOS Image with the specified tag + * + * @galasa.required No + * + * @galasa.valid_values A valid java.nio.charset EBCDIC character encoding (e.g. 037, 1047) + * + * @galasa.default 037 + * + * @galasa.examples + * zos.image.[tag].codepage=1047
+ * + */ +public class ImageCodePage extends CpsProperties { + + public static Charset get(String imageId) throws ZosManagerException { + String codePage = getStringWithDefault(ZosPropertiesSingleton.cps(), "037", "image", "codepage", imageId); + return Charset.forName(codePage); + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageIdForTag.java index eb54e489c..338d4d1c2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageIdForTag.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageMaxSlots.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageMaxSlots.java index 7453392b5..ba81a5a4b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageMaxSlots.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageMaxSlots.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageSysname.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageSysname.java index d50a16b03..4396655dd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageSysname.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ImageSysname.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/JavaHome.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/JavaHome.java index cdddf8e54..e52881707 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/JavaHome.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/JavaHome.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import dev.galasa.framework.spi.ConfigurationPropertyStoreException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/LibertyInstallDir.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/LibertyInstallDir.java index 0fd5e2c8e..93921315c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/LibertyInstallDir.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/LibertyInstallDir.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import dev.galasa.framework.spi.ConfigurationPropertyStoreException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/PoolPorts.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/PoolPorts.java index a92380dbe..fd51bfc0f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/PoolPorts.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/PoolPorts.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunDatasetHLQ.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunDatasetHLQ.java index 7cc65ad43..f5c431815 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunDatasetHLQ.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunDatasetHLQ.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunUNIXPathPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunUNIXPathPrefix.java index 4fa0299b0..7788070b7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunUNIXPathPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/RunUNIXPathPrefix.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/TSOCommandExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/TSOCommandExtraBundle.java index 3b836f218..b01f53bf9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/TSOCommandExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/TSOCommandExtraBundle.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/UNIXCommandExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/UNIXCommandExtraBundle.java index 7d73ecad3..98f11f6f8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/UNIXCommandExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/UNIXCommandExtraBundle.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosConnectInstallDir.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosConnectInstallDir.java index 483882722..1e02ff625 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosConnectInstallDir.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosConnectInstallDir.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import dev.galasa.framework.spi.ConfigurationPropertyStoreException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosPropertiesSingleton.java index 6b0569702..1c0b6c8bf 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/ZosPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/package-info.java index 2c1d17084..a9655574a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/package-info.java index 44d61e0dc..ad61bb8ee 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * z/OS Manager diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/IZosManagerSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/IZosManagerSpi.java index dec1a370f..33c8ea892 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/IZosManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/IZosManagerSpi.java @@ -1,6 +1,8 @@ /* -* Copyright contributors to the Galasa project -*/ + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.spi; import java.nio.file.Path; @@ -44,7 +46,7 @@ public interface IZosManagerSpi extends IZosManager { /** * Returns a zOS Image for the specified image ID - * @param image the ID of the image + * @param imageId the ID of the image * @return the image, never null * @throws ZosManagerException */ @@ -53,7 +55,7 @@ public interface IZosManagerSpi extends IZosManager { /** * Returns a zOS Image for the specified image that may not have been provisioned so far - * @param image the ID of the image + * @param imageId the ID of the image * @return the image, never null * @throws ZosManagerException if there is no image defined */ @@ -62,7 +64,7 @@ public interface IZosManagerSpi extends IZosManager { /** * Returns the data set HLQ(s) for temporary data sets for the specified image - * @param the image + * @param image * @return the image, never null * @throws ZosManagerException */ @@ -71,7 +73,7 @@ public interface IZosManagerSpi extends IZosManager { /** * Returns the zOS UNIX path prefix for temporary file for the specified image - * @param the image + * @param image * @return the image, never null * @throws ZosManagerException */ @@ -112,7 +114,7 @@ public interface IZosManagerSpi extends IZosManager { /** * Provides other managers a {@link IZosBatchJobname} with a prefix defined by the zOS Batch {@code zosbatch.jobname.[imageid].prefix} property - * @param imageId + * @param image * @return * @throws ZosBatchException */ @@ -160,7 +162,7 @@ public interface IZosManagerSpi extends IZosManager { /** * Store an artifact in the results archive on behalf of another manager - * @param archivePath + * @param artifactPath * @param content * @param type */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/ZosImageDependencyField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/ZosImageDependencyField.java index 9ca1d48c1..0079ece7b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/ZosImageDependencyField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zos/spi/ZosImageDependencyField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos.spi; @@ -13,7 +13,7 @@ /** * Used to annotate annotations that are a dependency of a zosImage, requires a imageTag for the zOS Manager to automatically provision the zOS Image * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatch.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatch.java index 211918d36..48ce5f58f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatch.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatch.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; @@ -12,7 +12,7 @@ /** * Provides the test code access to zOS Batch jobs via the zOS Manager * - * @author Michael Baylis + * * */ public interface IZosBatch { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJob.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJob.java index 27103154e..b98ef2dcb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJob.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJob.java @@ -1,12 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; /** *

Represents a zOS Batch Job.

* - * @author Michael Baylis + * * */ public interface IZosBatchJob { @@ -64,7 +66,7 @@ public static JobStatus valueOfLabel(String jobStatus) { public String getOwner(); /** - * The type for this Job, i.e. JOB, STC or TSU. Returns "???" if no type has been associated + * The type for this Job, i.e. "JOB", "STC" or "TSU". Returns "???" if no type has been associated * * @return batch job type */ @@ -79,7 +81,7 @@ public static JobStatus valueOfLabel(String jobStatus) { /** * The batch job value as a {@link String}, e.g.
- * INPUT, ACTIVE, OUTPUT etc.
+ * "INPUT", "ACTIVE", "OUTPUT" etc.
* Returns "????????" if the job has not been submitted *

* N.B. Values are implementation dependent @@ -90,7 +92,7 @@ public static JobStatus valueOfLabel(String jobStatus) { /** * The batch job completion return code, e.g.
- * CC 0000, CC 0020, JCL ERROR, ABEND S0C4/code> etc.
+ * "CC 0000", "CC 0020", "JCL ERROR", "ABEND S0C4" etc. * Returns "????" if the job has not been submitted * * @return @@ -99,7 +101,7 @@ public static JobStatus valueOfLabel(String jobStatus) { /** * Wait for a job to complete. Return the highest return code for the job. The method will wait for the default - * resource wait time before timing out. Returns {@link Integer.MIN_VALUE} if return code is non numeric. + * resource wait time before timing out. Returns {@link Integer#MIN_VALUE} if return code is non numeric. * Use {@link #getRetcode()} to get the {@link String} value * * @return highest CC @@ -109,7 +111,7 @@ public static JobStatus valueOfLabel(String jobStatus) { /** * Wait for a job to complete. Return the highest return code for the job. The method will wait for the default - * resource wait time before timing out. Returns {@link Integer.MIN_VALUE} if return code is non numeric. + * resource wait time before timing out. Returns {@link Integer#MIN_VALUE} if return code is non numeric. * Use {@link #getRetcode()} to get the {@link String} value * * @param timeout in seconds diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutput.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutput.java index 7f97ff128..4eb8cc7f6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutput.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutput.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutputSpoolFile.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutputSpoolFile.java index 18f0bf816..334dbf9bf 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutputSpoolFile.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobOutputSpoolFile.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch; /** @@ -66,6 +66,13 @@ public interface IZosBatchJobOutputSpoolFile { * @return the zOS batch job spool file content */ public String getRecords(); + + /** + * Set the records for this spool file, size is automatically updated + * with the size of the records + * @param records The records that make up this spool record + */ + public void setRecords(String records); /** * Save this zOS batch job spool file to the Results Archive Store. Will only store records retrieved since the {@link IZosBatchJobOutputSpoolFile} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobname.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobname.java index 4afde152a..fac73e972 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobname.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/IZosBatchJobname.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; @@ -10,7 +10,7 @@ * *

Use a {@link ZosBatchJobname} annotation to populate this field with

* - * @author Michael Baylis + * * */ public interface IZosBatchJobname { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatch.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatch.java index b8bcad3fd..016b3bf5b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatch.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatch.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchException.java index 29ee0329f..9113915ec 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchField.java index 338d3ae0c..1c6f58323 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobcard.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobcard.java index 792f4e511..33d9f8534 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobcard.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobcard.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; @@ -13,7 +15,7 @@ * * No validation is performed on the values that are set * - * @author Michael Baylis + * * */ public class ZosBatchJobcard { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobname.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobname.java index 5994ac665..dcd7f5a6b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobname.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchJobname.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchManagerException.java index 7ed5651d8..e908a3ed7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/ZosBatchManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputImpl.java index 51e104512..acb4b81f5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal; @@ -20,7 +20,7 @@ * Implementation of {@link IZosBatchJobOutput} * */ -public class ZosBatchJobOutputImpl implements IZosBatchJobOutputSpi, Iterable { +public class ZosBatchJobOutputImpl implements IZosBatchJobOutputSpi { private IZosBatchJob batchJob; private String jobname; @@ -41,6 +41,14 @@ public void addJcl(String jcl) { @Override public void addSpoolFile(String stepname, String procstep, String ddname, String id, String records) { + //the outline of the spool may already exist. BUT the content might not - if it exists then update it + for (IZosBatchJobOutputSpoolFile spool : spoolFiles) { + if (ddname.equals(spool.getDdname()) && (stepname != null && stepname.equals(spool.getStepname()))) { + spool.setRecords(records); + return; + } + } + //if we get here then the spool doesn't already exist so add it spoolFiles.add(new ZosBatchJobOutputSpoolFileImpl(batchJob, this.jobname, this.jobid, Objects.toString(stepname, ""), Objects.toString(procstep, ""), ddname, id, records)); } @@ -90,7 +98,7 @@ public IZosBatchJobOutputSpoolFile next() { @Override public void remove() { - throw new UnsupportedOperationException("Object can not be updated"); + throw new UnsupportedOperationException("Object cannot be updated"); } }; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputSpoolFileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputSpoolFileImpl.java index ae3bb14a3..cdab7602e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputSpoolFileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobOutputSpoolFileImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal; @@ -27,7 +27,6 @@ public class ZosBatchJobOutputSpoolFileImpl implements IZosBatchJobOutputSpoolFi /** * Constructor for creating spool file - * @param spoolFile * @param records * @param jobname * @param jobid @@ -41,12 +40,7 @@ public ZosBatchJobOutputSpoolFileImpl(IZosBatchJob batchJob, String jobname, Str this.procstep = procstep; this.ddname = ddname; this.id = id; - this.records = records; - if (this.records != null) { - this.size = this.records.length(); - } else { - this.size = 0; - } + this.setRecords(records); } @Override @@ -97,6 +91,16 @@ public String toString() { return "JOB=" + jobname + " JOBID=" + jobid + " STEP=" + stepname + " PROCSTEP=" + procstep + " DDNAME=" + ddname; } + @Override + public void setRecords(String records) { + this.records = records; + if (this.records != null) { + this.size = this.records.length(); + } else { + this.size = 0; + } + } + @Override public long retrieve() throws ZosBatchException { this.records = this.batchJob.getSpoolFile(this.ddname).getRecords(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobnameImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobnameImpl.java index 3d4fbd133..a8fe0e2dc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobnameImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/ZosBatchJobnameImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/BatchRestrictToImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/BatchRestrictToImage.java index e7509ccd5..32552ae5a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/BatchRestrictToImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/BatchRestrictToImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/InputClass.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/InputClass.java index 969f7d56e..6f345805f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/InputClass.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/InputClass.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobWaitTimeout.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobWaitTimeout.java index 459af2327..d78ecd6f5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobWaitTimeout.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobWaitTimeout.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobnamePrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobnamePrefix.java index be02a8fc0..38a89b99e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobnamePrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/JobnamePrefix.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgClass.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgClass.java index f17bbcaab..890c740d3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgClass.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgClass.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgLevel.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgLevel.java index 868f870cf..a67665f30 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgLevel.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/MsgLevel.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/TruncateJCLRecords.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/TruncateJCLRecords.java index b86523a1b..3c4b9178c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/TruncateJCLRecords.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/TruncateJCLRecords.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/UseSysaff.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/UseSysaff.java index c99fc6734..197838851 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/UseSysaff.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/UseSysaff.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/ZosBatchPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/ZosBatchPropertiesSingleton.java index e561df71d..aec4bf63c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/ZosBatchPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/ZosBatchPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/package-info.java index 13fc5e99f..091d89750 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/internal/properties/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Batch Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/package-info.java index dd26b9f11..9452f3dc4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * z/OS Batch Manager Batch interface diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchJobOutputSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchJobOutputSpi.java index fe4563e39..9161e1117 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchJobOutputSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchJobOutputSpi.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.spi; import dev.galasa.zosbatch.IZosBatchJobOutput; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchSpi.java index c526925ee..24fd9c932 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosbatch/spi/IZosBatchSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsole.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsole.java index e7b7bbdd4..aef4cb81c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsole.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsole.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsoleCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsoleCommand.java index 55e033283..f9b0d7110 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsoleCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/IZosConsoleCommand.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsole.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsole.java index 039a38c0f..b101f2406 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsole.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsole.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; @@ -18,21 +18,26 @@ * @galasa.annotation * * @galasa.description The {@literal @}ZosConsole annotation requests the z/OS Manager to provide a - * z/OS Console instance associated with a z/OS image. - * The test can request multiple z/OS Console instances, with the default being associated with the primary z/OS image.
+ * z/OS Console instance associated with a z/OS image. + * + * The test can request multiple z/OS Console instances, with the default being associated with the primary z/OS image. * * @galasa.examples + * * {@literal @}ZosImage(imageTag="A")
* public IZosImage zosImageA;
* {@literal @}ZosConsole(imageTag="A")
- * public IZosConsole zosConsoleA;
+ * public IZosConsole zosConsoleA;
+ *
* * @galasa.extra - * The IZosConsole interface has two methods, {@link IZosConsole#issueCommand(String)} and - * {@link IZosConsole#issueCommand(String, String)} to issue a command to the z/OS console and returns a IZosConsoleCommand - * instance.

- * See {@link ZosConsole}, {@link IZosConsole} and {@link IZosConsoleCommand} to find out more. + * The {@link IZosConsole} interface has two methods, {@link IZosConsole#issueCommand(String)} and + * {@link IZosConsole#issueCommand(String, String)} to issue a command to the z/OS console and + * returns a {@link IZosConsoleCommand} instance. * + * @see ZosConsole + * @see IZosConsole + * @see IZosConsoleCommand */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD}) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleException.java index 341caf1cd..6d8f26024 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleField.java index 004b30acd..a1176ee14 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleManagerException.java index c3998535e..0db4911b7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/ZosConsoleManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ConsoleRestrictToImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ConsoleRestrictToImage.java index 90b9a899d..856d77c7f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ConsoleRestrictToImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ConsoleRestrictToImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ZosConsolePropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ZosConsolePropertiesSingleton.java index 478af39af..64bcc35fb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ZosConsolePropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/internal/properties/ZosConsolePropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/package-info.java index abc63b216..a7b40987c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * z/OS Manager Console interface */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/spi/IZosConsoleSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/spi/IZosConsoleSpi.java index f4df7592c..4752f12ad 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/spi/IZosConsoleSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosconsole/spi/IZosConsoleSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosDataset.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosDataset.java index 00145b7b3..002233313 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosDataset.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosDataset.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; @@ -374,7 +376,7 @@ public static DatasetDataType valueOfLabel(String label) { * primary and secondary extents to allocate. * * @param spaceUnit - * @param primaryExtent + * @param primaryExtents * @param secondaryExtents */ public void setSpace(SpaceUnit spaceUnit, int primaryExtents, int secondaryExtents); @@ -414,13 +416,13 @@ public static DatasetDataType valueOfLabel(String label) { /** * Set the storage class of the data set - * @param managementClass + * @param storageClass */ public void setStorageClass(String storageClass); /** * Set the data class of the data set - * @param managementClass + * @param dataClass */ public void setDataClass(String dataClass); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosFileHandler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosFileHandler.java index 7f092638b..ed183d4da 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosFileHandler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosFileHandler.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; @@ -20,7 +22,7 @@ *
  • IVSAMDataset
  • * * Typical usage would be to instantiate one of these using the newXXX(...) - * methods (e.g.: {@link #newDataset(String)}), then to call methods on that + * methods (e.g.: {@link #newDataset(String, IZosImage)}), then to call methods on that * object to configure it, and then to call methods on this manager to * manipulate it. *

    @@ -55,9 +57,7 @@ public interface IZosFileHandler { /** * Instantiate a new {@link IZosVSAMDataset} object with the given name. The * object returned is a 'blank-slate' and will require configuring before it - * can be defined or stored. See {@link #newESDS(String)}, - * {@link #newKSDS(String)} or {@link #newRRDS(String)} for pre-configured - * VSAM objects. + * can be defined or stored. * * @param dsname * @return diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosUNIXFile.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosUNIXFile.java index 72af4d943..c312d8ffb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosUNIXFile.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosUNIXFile.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; @@ -123,7 +125,7 @@ public String toString() { /** * Write content to the zOS UNIX file on the zOS image in Binary mode - *

    See {@link #setDataType(DatasetDataType)} + *

    See {@link #setDataType(UNIXFileDataType)} * @param content * @throws ZosUNIXFileException */ @@ -131,14 +133,14 @@ public String toString() { /** * Retrieve the content of the zOS UNIX file from the zOS image in Text mode - *

    See {@link #setDataType(DatasetDataType)} + *

    See {@link #setDataType(UNIXFileDataType)} * @throws ZosUNIXFileException */ public String retrieveAsText() throws ZosUNIXFileException; /** * Retrieve content of the zOS UNIX file from the zOS image in Binary mode - *

    See {@link #setDataType(DatasetDataType)} + *

    See {@link #setDataType(UNIXFileDataType)} * @return data set content * @throws ZosUNIXFileException */ @@ -174,7 +176,7 @@ public String toString() { /** * Set the data type ({@link UNIXFileDataType}) for store and retrieve of the zOS UNIX file content - * @param fileType + * @param dataType */ public void setDataType(UNIXFileDataType dataType); @@ -189,19 +191,16 @@ public String toString() { /** * Return the zOS UNIX file type ({@link UNIXFileType}) - * @param fileType */ public UNIXFileType getFileType(); /** * Return the data type ({@link UNIXFileDataType}) for store and retrieve of the zOS UNIX file content - * @param fileType */ public UNIXFileDataType getDataType(); /** * Return the path of the zOS UNIX file or directory - * @param fileType */ public String getUnixPath(); @@ -261,7 +260,7 @@ public String toString() { public boolean shouldCleanup(); /** - * Convert {@link Set}<{@link PosixFilePermission}> to Symbolic Notation (e.g. rwxwrxrwx) + * Convert {@link Set}<{@link PosixFilePermission}> to Symbolic Notation (e.g. rwxwrxrwx) * @param accessPermissions * @return a {@link String} containing the file permissions in Symbolic Notation */ @@ -305,7 +304,7 @@ public static String posixFilePermissionsToSymbolicNotation(Set to Numeric Notation (e.g. 777) + * Convert {@link Set}<{@link PosixFilePermission}> to Numeric Notation (e.g. 777) * @param accessPermissions * @return a {@link String} containing the file permissions in Numeric Notation */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosVSAMDataset.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosVSAMDataset.java index b5dcb52ba..638a3d5fe 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosVSAMDataset.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/IZosVSAMDataset.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; @@ -683,7 +685,7 @@ public enum WriteCheckOption { /** * Get the IDCAMS REPRO command - * @param infile + * @param indatasetName * @return * @throws ZosVSAMDatasetException */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosDatasetException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosDatasetException.java index 9fa1b1029..ec77d0de2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosDatasetException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosDatasetException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileField.java index a2cb9b697..3be5a0ede 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileHandler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileHandler.java index 726ab1911..7290681a7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileHandler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileHandler.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileManagerException.java index 5b1a6f315..14aa0c8d7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosFileManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosUNIXFileException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosUNIXFileException.java index eca89e8aa..79fcd5423 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosUNIXFileException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosUNIXFileException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosVSAMDatasetException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosVSAMDatasetException.java index 19276e22b..d4ac649d9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosVSAMDatasetException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/ZosVSAMDatasetException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/DirectoryListMaxItems.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/DirectoryListMaxItems.java index 20c5d1c98..76f8f5f4f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/DirectoryListMaxItems.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/DirectoryListMaxItems.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/FileRestrictToImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/FileRestrictToImage.java index 6efcbf34e..cb7e527eb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/FileRestrictToImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/FileRestrictToImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/UnixFilePermissions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/UnixFilePermissions.java index fa0798dc7..8f3eb6080 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/UnixFilePermissions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/UnixFilePermissions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/ZosFilePropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/ZosFilePropertiesSingleton.java index 3dae08166..d42474f8a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/ZosFilePropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/ZosFilePropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/package-info.java index f48e574df..fe78b5937 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS File zOSMF Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/package-info.java index 58c2e18a9..4f1729fd3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * z/OS Manager File interface */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/spi/IZosFileSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/spi/IZosFileSpi.java index 391bfd8a0..8f7fa9488 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/spi/IZosFileSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosfile/spi/IZosFileSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.spi; @@ -10,14 +10,12 @@ import dev.galasa.zosfile.IZosFileHandler; import dev.galasa.zosfile.ZosFileManagerException; -/** - * SPI interface to {@link IZosFile} - */ + public interface IZosFileSpi { /** * Returns a zOS File Handler instance - * @return an {@link IZosFileHandler} implementation instance + * @return an {@link dev.galasa.zosfile.IZosFileHandler} implementation instance */ @NotNull public IZosFileHandler getZosFileHandler() throws ZosFileManagerException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/IZosTSOCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/IZosTSOCommand.java index 1230b2575..9da99b588 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/IZosTSOCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/IZosTSOCommand.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommand.java index 5e57f16ed..13cf5b36a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommand.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand; @@ -19,19 +19,21 @@ * * @galasa.description The {@literal @}ZosTSOCommand annotation requests the z/OS Manager to provide a * z/OS TSO Command instance associated with a z/OS image. - * The test can request multiple z/OS TSO Command instances, with the default being associated with the primary z/OS image.
    + * The test can request multiple z/OS TSO Command instances, with the default being associated with the primary z/OS image. * * @galasa.examples + * * {@literal @}ZosImage(imageTag="A")
    * public IZosImage zosImageA;
    * {@literal @}ZosTSOCommand(imageTag="A")
    - * public IZosTSOCpmmand zosTSOA;
    + * public IZosTSOCpmmand zosTSOA;
    + * * * @galasa.extra * The IZosTSOCommand interface provides the methods {@link IZosTSOCommand#issueCommand(String)} and {@link IZosTSOCommand#issueCommand(String, long)} - * to issue a command to z/OS TSO Command and returns a String.

    - * See {@link IZosTSOCommand} to find out more. - * + * to issue a command to z/OS TSO Command and returns a String. + * + * @see IZosTSOCommand */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD}) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandException.java index bf605a87e..34093e5a2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandField.java index 209ad1eb3..e8b6408e7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandManagerException.java index 2744f52dc..f2be58c14 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/ZosTSOCommandManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/package-info.java index f23fdc2ef..75f5823fc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * z/OS Manager TSO interface */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/spi/IZosTSOCommandSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/spi/IZosTSOCommandSpi.java index c8eca6387..377d21234 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/spi/IZosTSOCommandSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zostsocommand/spi/IZosTSOCommandSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/IZosUNIXCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/IZosUNIXCommand.java index 5c0c6f7b0..512d77690 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/IZosUNIXCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/IZosUNIXCommand.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommand.java index 35d8d512f..117f31a51 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommand.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand; @@ -22,10 +22,12 @@ * The test can request multiple z/OS UNIX Command instances, with the default being associated with the primary z/OS image.
    * * @galasa.examples + * * {@literal @}ZosImage(imageTag="A")
    * public IZosImage zosImageA;
    * {@literal @}ZosUNIXCommand(imageTag="A")
    - * public IZosUNIXCommand zosUNIXCommandA;
    + * public IZosUNIXCommand zosUNIXCommandA;
    + * * * @galasa.extra * The IZosUNIXCommand interface provides the methods {@link IZosUNIXCommand#issueCommand(String)} and {@link IZosUNIXCommand#issueCommand(String, long)} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandAuthFailException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandAuthFailException.java index 3c48ca11e..46e88863c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandAuthFailException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandAuthFailException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandException.java index b43846ff7..da976efbc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandField.java index 9bebf7bed..632d961aa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandManagerException.java index 73ade538f..b85b61e52 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/ZosUNIXCommandManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/package-info.java index 0d2f4ea81..061bc84c4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * z/OS Manager UNIX Command interface */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/spi/IZosUNIXCommandSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/spi/IZosUNIXCommandSpi.java index cbe24642c..a11cda5f2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/spi/IZosUNIXCommandSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/main/java/dev/galasa/zosunixcommand/spi/IZosUNIXCommandSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/TestZosManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/TestZosManagerException.java index a949019a7..b04a648a2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/TestZosManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/TestZosManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestSlotResourceMonitor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestSlotResourceMonitor.java index 2738bf5e5..5a4d7b1a3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestSlotResourceMonitor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestSlotResourceMonitor.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosBaseImageImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosBaseImageImpl.java index 36bf66f6e..e7b37a766 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosBaseImageImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosBaseImageImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosDseImageImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosDseImageImpl.java index 647b36ac8..47c4276b1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosDseImageImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosDseImageImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosIpHostImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosIpHostImpl.java index b5f0114cd..dc1f46505 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosIpHostImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosIpHostImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosManagerImpl.java index 5ac113507..522576f9e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosProvisionedImageImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosProvisionedImageImpl.java index 29848c99d..5f03bda77 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosProvisionedImageImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosProvisionedImageImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosResourceManagement.java index 9c96cec00..f621782fb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/TestZosResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal; import java.util.Random; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/metrics/TestZosMetrics.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/metrics/TestZosMetrics.java index 585e234f3..78432f879 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/metrics/TestZosMetrics.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/metrics/TestZosMetrics.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.metrics; import java.util.Random; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestBatchExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestBatchExtraBundle.java index fe931c35a..013d3e966 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestBatchExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestBatchExtraBundle.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterIdForTag.java index af20237c5..d0ae9b561 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterIdForTag.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterImages.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterImages.java index 3f4582122..d6909035a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterImages.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestClusterImages.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestConsoleExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestConsoleExtraBundle.java index 9f4f22f72..0e72cce2a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestConsoleExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestConsoleExtraBundle.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseClusterIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseClusterIdForTag.java index bc2b1816f..6bb3357a1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseClusterIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseClusterIdForTag.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseImageIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseImageIdForTag.java index c4775e203..c25c4fd13 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseImageIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestDseImageIdForTag.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestFileExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestFileExtraBundle.java index 27d6892ec..16de6f30b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestFileExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestFileExtraBundle.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestHostId.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestHostId.java index d1464cdd9..fed9388d9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestHostId.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestHostId.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageIdForTag.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageIdForTag.java index 5686ca95b..c69e6819c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageIdForTag.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageIdForTag.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageMaxSlots.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageMaxSlots.java index 74aab8c68..2a2931b86 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageMaxSlots.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageMaxSlots.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageSysname.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageSysname.java index 005afc11a..1c7390070 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageSysname.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestImageSysname.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestJavaHome.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestJavaHome.java index 7ebe7cadc..dec539307 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestJavaHome.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestJavaHome.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestLibertyInstallDir.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestLibertyInstallDir.java index 6f0aa56dc..6887c1dc8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestLibertyInstallDir.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestLibertyInstallDir.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunDatasetHLQ.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunDatasetHLQ.java index df0a670a2..525d72d4d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunDatasetHLQ.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunDatasetHLQ.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunUNIXPathPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunUNIXPathPrefix.java index fba1a48a7..6fef80640 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunUNIXPathPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestRunUNIXPathPrefix.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestTSOCommandExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestTSOCommandExtraBundle.java index bd9049cdc..3f1b415c9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestTSOCommandExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestTSOCommandExtraBundle.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestUNIXCommandExtraBundle.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestUNIXCommandExtraBundle.java index 58eec7439..05c1a58e4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestUNIXCommandExtraBundle.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestUNIXCommandExtraBundle.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosConnectInstallDir.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosConnectInstallDir.java index dfff27e15..bf7eef047 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosConnectInstallDir.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosConnectInstallDir.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosPropertiesSingleton.java index 52e1a4cd0..76ff4d163 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zos/internal/properties/TestZosPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchEnumsAndExceptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchEnumsAndExceptions.java index e9c882950..f8c2b136e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchEnumsAndExceptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchEnumsAndExceptions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchJobcard.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchJobcard.java index efa41bd70..5d935f654 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchJobcard.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/TestZosBatchJobcard.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputImpl.java index 1733d90b2..90f48f020 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputImpl.java @@ -1,13 +1,16 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.internal; import java.util.Iterator; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -21,82 +24,137 @@ @RunWith(MockitoJUnitRunner.class) public class TestZosBatchJobOutputImpl { - + @Mock private IZosBatchJob zosBatchJobMock; - - private ZosBatchJobOutputImpl zosBatchJobOutput; + + private ZosBatchJobOutputImpl zosBatchJobOutput; private static final String JOBNAME = "jobname"; private static final String JOBID = "jobid"; - + private static final String STEPNAME = "stepname"; - + private static final String PROCSTEP = "procstep"; - + private static final String DDNAME = "ddname"; - + private static final String ID = "id"; private static final String RECORDS = "records"; - + @Before public void setup() throws ZosBatchManagerException { zosBatchJobOutput = new ZosBatchJobOutputImpl(zosBatchJobMock, JOBNAME, JOBID); } - + @Test - public void testAddJcl() throws ZosBatchException { + public void testAddJclCreatesSpoolFileWithGivenRecords() throws ZosBatchException { zosBatchJobOutput.addJcl(RECORDS); - Assert.assertEquals("getJobname() should return the supplied value", JOBNAME, zosBatchJobOutput.getJobname()); - Assert.assertEquals("getJobid() should return the supplied value", JOBID, zosBatchJobOutput.getJobid()); - Assert.assertEquals("toString() should return the supplied values of JOBNAME_JOBID", JOBNAME + "_" + JOBID, zosBatchJobOutput.toString()); + + List spoolFiles = zosBatchJobOutput.getSpoolFiles(); + assertThat(spoolFiles).hasSize(1); + + IZosBatchJobOutputSpoolFile expectedSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, JOBNAME, + JOBID, "", "", "JESJCLIN", "JCL", RECORDS); + assertThat(spoolFiles.get(0)).usingRecursiveComparison().isEqualTo(expectedSpoolFile); } @Test - public void testAdd() throws ZosBatchException { + public void testAddSingleSpoolFileAppendsNewSpoolFile() throws ZosBatchException { zosBatchJobOutput.addSpoolFile(STEPNAME, PROCSTEP, DDNAME, ID, RECORDS); - Assert.assertEquals("getJobname() should return the supplied value", JOBNAME, zosBatchJobOutput.getJobname()); - Assert.assertEquals("getJobid() should return the supplied value", JOBID, zosBatchJobOutput.getJobid()); - Assert.assertEquals("toString() should return the supplied values of JOBNAME_JOBID", JOBNAME + "_" + JOBID, zosBatchJobOutput.toString()); + + List spoolFiles = zosBatchJobOutput.getSpoolFiles(); + assertThat(spoolFiles).hasSize(1); + + IZosBatchJobOutputSpoolFile expectedSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, JOBNAME, + JOBID, STEPNAME, PROCSTEP, DDNAME, ID, RECORDS); + assertThat(spoolFiles.get(0)).usingRecursiveComparison().isEqualTo(expectedSpoolFile); } + @Test - public void testGetSpoolFiles() throws ZosBatchException { - zosBatchJobOutput.addJcl("JCL"); - Assert.assertNotNull("getSpoolFiles() should not return null", zosBatchJobOutput.getSpoolFiles()); + public void testAddDifferentSpoolFilesAppendsMultipleSpoolFiles() throws ZosBatchException { + zosBatchJobOutput.addSpoolFile("STEP1", "PROCSTEP1", "DD1", "ID1", RECORDS); + zosBatchJobOutput.addSpoolFile("STEP2", "PROCSTEP2", "DD2", "ID2", RECORDS); + + List spoolFiles = zosBatchJobOutput.getSpoolFiles(); + assertThat(spoolFiles).hasSize(2); + + IZosBatchJobOutputSpoolFile expectedFirstSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, + JOBNAME, JOBID, "STEP1", "PROCSTEP1", "DD1", "ID1", RECORDS); + assertThat(spoolFiles.get(0)).usingRecursiveComparison().isEqualTo(expectedFirstSpoolFile); + + IZosBatchJobOutputSpoolFile expectedSecondSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, + JOBNAME, JOBID, "STEP2", "PROCSTEP2", "DD2", "ID2", RECORDS); + assertThat(spoolFiles.get(1)).usingRecursiveComparison().isEqualTo(expectedSecondSpoolFile); } - + @Test - public void testToList() throws ZosBatchException { + public void testAddSpoolFilesWithSameDDNameAppendsSpoolFiles() throws ZosBatchException { + zosBatchJobOutput.addSpoolFile("STEP1", PROCSTEP, DDNAME, ID, RECORDS); + zosBatchJobOutput.addSpoolFile("STEP2", PROCSTEP, DDNAME, ID, RECORDS); + + List spoolFiles = zosBatchJobOutput.getSpoolFiles(); + assertThat(spoolFiles).hasSize(2); + + IZosBatchJobOutputSpoolFile expectedFirstSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, + JOBNAME, JOBID, "STEP1", PROCSTEP, DDNAME, ID, RECORDS); + assertThat(spoolFiles.get(0)).usingRecursiveComparison().isEqualTo(expectedFirstSpoolFile); + + IZosBatchJobOutputSpoolFile expectedSecondSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, + JOBNAME, JOBID, "STEP2", PROCSTEP, DDNAME, ID, RECORDS); + assertThat(spoolFiles.get(1)).usingRecursiveComparison().isEqualTo(expectedSecondSpoolFile); + } + + @Test + public void testAddSpoolFilesWithSameDDNameAndStepNameUpdatesExistingSpoolFile() throws ZosBatchException { + zosBatchJobOutput.addSpoolFile(STEPNAME, PROCSTEP, DDNAME, ID, ""); + zosBatchJobOutput.addSpoolFile(STEPNAME, PROCSTEP, DDNAME, ID, RECORDS); + + List spoolFiles = zosBatchJobOutput.getSpoolFiles(); + assertThat(spoolFiles).hasSize(1); + + IZosBatchJobOutputSpoolFile expectedSpoolFile = new ZosBatchJobOutputSpoolFileImpl(zosBatchJobMock, JOBNAME, + JOBID, STEPNAME, PROCSTEP, DDNAME, ID, RECORDS); + assertThat(spoolFiles.get(0)).usingRecursiveComparison().isEqualTo(expectedSpoolFile); + } + + @Test + public void testToListReturnsAListOfAllSpoolFileContents() throws ZosBatchException { zosBatchJobOutput.addJcl("JCL"); - Assert.assertNotNull("toList() should return a value", zosBatchJobOutput.toList()); + assertThat(zosBatchJobOutput.toList()).isNotNull(); } - + @Test - public void testIterator() throws ZosBatchException { + public void testIteratorCreatesAnIteratorOverExistingSpoolFiles() throws ZosBatchException { zosBatchJobOutput.addJcl("JCL"); Iterator iterator = zosBatchJobOutput.iterator(); - - Assert.assertTrue("hasNext() should return true", iterator.hasNext()); - - Assert.assertNotNull("next() should return a value", iterator.next()); - - String expectedMessage = "Object can not be updated"; - UnsupportedOperationException expectedException = Assert.assertThrows("expected exception should be thrown", UnsupportedOperationException.class, ()->{ - iterator.remove(); - }); - Assert.assertEquals("exception should contain expected message", expectedMessage, expectedException.getMessage()); + + assertThat(iterator.hasNext()).isTrue(); + + assertThat(iterator.next()).isNotNull(); + + String expectedMessage = "Object cannot be updated"; + assertThatThrownBy(() -> iterator.remove()) + .isInstanceOf(UnsupportedOperationException.class) + .hasMessageContaining(expectedMessage); } - + @Test - public void testSize() throws ZosBatchException { + public void testSizeReturnsTheNumberOfSpoolFilesThatExist() throws ZosBatchException { zosBatchJobOutput.addJcl("JCL"); - Assert.assertEquals("size() should return a 1", 1, zosBatchJobOutput.size()); + assertThat(zosBatchJobOutput.size()).isEqualTo(1); } - + @Test - public void testIsEmpty() throws ZosBatchException { - Assert.assertTrue("isEmpty() should return a true", zosBatchJobOutput.isEmpty()); + public void testIsEmptyShouldReturnTrueWhenNoSpoolFilesExist() throws ZosBatchException { + assertThat(zosBatchJobOutput.isEmpty()).isTrue(); + } + + @Test + public void testIsEmptyShouldReturnFalseWhenSpoolFilesExist() throws ZosBatchException { + zosBatchJobOutput.addJcl("JCL"); + assertThat(zosBatchJobOutput.isEmpty()).isFalse(); } } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputSpoolFileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputSpoolFileImpl.java index 66a62bff8..1aa7719bb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputSpoolFileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobOutputSpoolFileImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobnameImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobnameImpl.java index 3d76f4d7e..cf9bad5f8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobnameImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/TestZosBatchJobnameImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestBatchRestrictToImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestBatchRestrictToImage.java index d06735ee1..3939ce7f2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestBatchRestrictToImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestBatchRestrictToImage.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestInputClass.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestInputClass.java index 1219c2d55..6002082f1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestInputClass.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestInputClass.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobWaitTimeout.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobWaitTimeout.java index d1469e0d0..309cc354b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobWaitTimeout.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobWaitTimeout.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobnamePrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobnamePrefix.java index cb7f86eab..0229d2380 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobnamePrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestJobnamePrefix.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgClass.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgClass.java index 4b296412f..bfacb9a81 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgClass.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgClass.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgLevel.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgLevel.java index b1cca9014..0d8104f21 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgLevel.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestMsgLevel.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestTruncateJCLRecords.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestTruncateJCLRecords.java index 2e3ab49d2..3dabffda4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestTruncateJCLRecords.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestTruncateJCLRecords.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestUseSysaff.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestUseSysaff.java index c84a5a9f0..55ee960fd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestUseSysaff.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestUseSysaff.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestZosBatchZosmfPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestZosBatchZosmfPropertiesSingleton.java index f98208a7e..8120f4375 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestZosBatchZosmfPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosbatch/internal/properties/TestZosBatchZosmfPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/TestZosConsoleExceptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/TestZosConsoleExceptions.java index c3f2a6abe..ec5d11bd0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/TestZosConsoleExceptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/TestZosConsoleExceptions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestRestrictToImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestRestrictToImage.java index a250338e6..5b635b735 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestRestrictToImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestRestrictToImage.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestZosConsoleZosmfPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestZosConsoleZosmfPropertiesSingleton.java index 8cc6e8090..a18cd7878 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestZosConsoleZosmfPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosconsole/internal/properties/TestZosConsoleZosmfPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/TestZosFileEnumsAndExceptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/TestZosFileEnumsAndExceptions.java index 676f47c7c..afb9ad72e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/TestZosFileEnumsAndExceptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/TestZosFileEnumsAndExceptions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestDirectoryListMaxItems.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestDirectoryListMaxItems.java index 37a60c59e..fee65ebfc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestDirectoryListMaxItems.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestDirectoryListMaxItems.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestFileRestrictToImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestFileRestrictToImage.java index 328898eaf..91740339a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestFileRestrictToImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestFileRestrictToImage.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestUnixFilePermissions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestUnixFilePermissions.java index 9cf60da71..23f48d55a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestUnixFilePermissions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestUnixFilePermissions.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestZosFileZosmfPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestZosFileZosmfPropertiesSingleton.java index 140148d97..ed1d79879 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestZosFileZosmfPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosfile/internal/properties/TestZosFileZosmfPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zostsocommand/TestZosTSOCommandExceptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zostsocommand/TestZosTSOCommandExceptions.java index 85e3634aa..6e10629f8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zostsocommand/TestZosTSOCommandExceptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zostsocommand/TestZosTSOCommandExceptions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosunixcommand/TestZosUNIXCommandEnumsAndExceptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosunixcommand/TestZosUNIXCommandEnumsAndExceptions.java index 41ff01c60..bdd504b8e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosunixcommand/TestZosUNIXCommandEnumsAndExceptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos.manager/src/test/java/dev/galasa/zosunixcommand/TestZosUNIXCommandEnumsAndExceptions.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosunixcommand; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/bnd.bnd b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/bnd.bnd index 2da9be594..7f272676c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/bnd.bnd +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/bnd.bnd @@ -1,5 +1,8 @@ -snapshot: ${tstamp} Bundle-Name: Galasa zOS 3270 Terminal Manager - Common Packages -Export-Package: dev.galasa.zos3270.common.screens -Import-Package: javax.validation.constraints;resolution:=optional +Export-Package: dev.galasa.zos3270.common.screens,\ + dev.galasa.zos3270.common.screens.json +Import-Package: javax.validation.constraints;resolution:=optional,\ + javax.imageio,\ + dev.galasa.framework.spi diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/build.gradle index 965fd220b..441394474 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/build.gradle @@ -4,8 +4,22 @@ plugins { description = 'Galasa zOS 3270 Terminal Manager - Common Packages' -version = '0.21.0' +version = '0.32.0' dependencies { - testImplementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/settings.gradle index cc562e746..1edd341a6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.zos3270.common' \ No newline at end of file +rootProject.name = 'dev.galasa.zos3270.common' diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/FieldContents.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/FieldContents.java index 861bd9296..e2e05c891 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/FieldContents.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/FieldContents.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.common.screens; @@ -10,7 +10,7 @@ /** * Pojo to contain the onscreen contents. May contain nulls. * - * @author Michael Baylis + * * */ public class FieldContents { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/Terminal.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/Terminal.java index 77029e893..884ad585b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/Terminal.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/Terminal.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.common.screens; @@ -17,7 +17,7 @@ * These pojos are stored in a local directory for inflight tests, and in the * RAS. * - * @author Michael Baylis + * * */ public class Terminal { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalField.java index a8941cca3..afda43c64 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.common.screens; @@ -11,7 +11,7 @@ /** * Pojo to represent a Field on the terminal screen. * - * @author Michael Baylis + * * */ public class TerminalField { @@ -26,6 +26,10 @@ public class TerminalField { private final boolean fieldIntenseDisplay; private final boolean fieldSelectorPen; private final boolean fieldModifed; + + private final Character foregroundColour; + private final Character backgroundColour; + private final Character highlight; private final List contents = new ArrayList<>(); @@ -43,7 +47,8 @@ public class TerminalField { * @param fieldModifed Field has been modified */ public TerminalField(int row, int column, boolean unformatted, boolean fieldProtected, boolean fieldNumeric, - boolean fieldDisplay, boolean fieldIntenseDisplay, boolean fieldSelectorPen, boolean fieldModifed) { + boolean fieldDisplay, boolean fieldIntenseDisplay, boolean fieldSelectorPen, boolean fieldModifed, + Character foregroundColour, Character backgroundColour, Character highlight) { this.row = row; this.column = column; this.unformatted = unformatted; @@ -53,6 +58,9 @@ public TerminalField(int row, int column, boolean unformatted, boolean fieldProt this.fieldIntenseDisplay = fieldIntenseDisplay; this.fieldSelectorPen = fieldSelectorPen; this.fieldModifed = fieldModifed; + this.foregroundColour = foregroundColour; + this.backgroundColour = backgroundColour; + this.highlight = highlight; } /** @@ -135,6 +143,18 @@ public boolean isFieldSelectorPen() { public boolean isFieldModifed() { return fieldModifed; } + + public Character getForegroundColour() { + return this.foregroundColour; + } + + public Character getBackgroundColour() { + return this.backgroundColour; + } + + public Character getHighlight() { + return this.highlight; + } /** * Fetch the field contents diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalImage.java index 4b1aae730..cfab1dab8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.common.screens; @@ -14,7 +14,7 @@ * Pojo to represent a screen image as received or sent from the client. Inbound * means received by the client. * - * @author Michael Baylis + * * */ public class TerminalImage { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalSize.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalSize.java index 479b6012e..e029a24de 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalSize.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/TerminalSize.java @@ -1,14 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.common.screens; /** * Represents the terminal screen size * - * @author Michael Baylis + * * */ public class TerminalSize { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/json/TerminalJsonTransform.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/json/TerminalJsonTransform.java new file mode 100644 index 000000000..3b5af677a --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/main/java/dev/galasa/zos3270/common/screens/json/TerminalJsonTransform.java @@ -0,0 +1,40 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.common.screens.json; + + +import com.google.gson.Gson; +import com.google.gson.JsonObject; + +import dev.galasa.framework.spi.utils.GalasaGsonBuilder; +import dev.galasa.zos3270.common.screens.Terminal; + +/** + * Handles the writing of a terminal into a json string or json object. + */ +public class TerminalJsonTransform { + + private Gson gson ; + + public TerminalJsonTransform( boolean isPrettyPrinting ) { + this.gson = new GalasaGsonBuilder(isPrettyPrinting).getGson(); + } + + public JsonObject toJsonObject(Terminal terminal) { + JsonObject json = (JsonObject) gson.toJsonTree(terminal); + return json; + } + + public String toJsonString(Terminal terminal) { + JsonObject jsonObj = toJsonObject(terminal); + String jsonString = gson.toJson(jsonObj); + return jsonString; + } + + public Terminal toTerminal(String tempJson) { + return gson.fromJson(tempJson, Terminal.class); + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/test/java/dev/galasa/zos3270/common/TestJson.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/test/java/dev/galasa/zos3270/common/screens/json/TerminalJsonTransformTest.java similarity index 87% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/test/java/dev/galasa/zos3270/common/TestJson.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/test/java/dev/galasa/zos3270/common/screens/json/TerminalJsonTransformTest.java index b19878ab5..54c91b7af 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/test/java/dev/galasa/zos3270/common/TestJson.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.common/src/test/java/dev/galasa/zos3270/common/screens/json/TerminalJsonTransformTest.java @@ -1,32 +1,28 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package dev.galasa.zos3270.common; +package dev.galasa.zos3270.common.screens.json; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; - import dev.galasa.zos3270.common.screens.FieldContents; import dev.galasa.zos3270.common.screens.Terminal; import dev.galasa.zos3270.common.screens.TerminalField; import dev.galasa.zos3270.common.screens.TerminalImage; import dev.galasa.zos3270.common.screens.TerminalSize; -public class TestJson { +public class TerminalJsonTransformTest { /** * Check that the pjos can be serialised to json and back again */ @Test public void testWriteAndReadJson() { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String terminalID = "bob"; int terminalSequence = 3345; @@ -59,7 +55,7 @@ public void testWriteAndReadJson() { terminal.addImage( new TerminalImage(imageSequence + 1, imageID, true, imageType, aid, altSize, cursorCol, cursorRow)); - TerminalField field = new TerminalField(posRow, posColumn, false, true, false, true, true, true, true); + TerminalField field = new TerminalField(posRow, posColumn, false, true, false, true, true, true, true, null, null, null); image.getFields().add(field); Character[] data = new Character[] { 'a', 'c', 'b' }; @@ -67,10 +63,11 @@ public void testWriteAndReadJson() { FieldContents contents = new FieldContents(data); field.getContents().add(contents); - JsonObject intermediateJson = (JsonObject) gson.toJsonTree(terminal); - String tempJson = gson.toJson(intermediateJson); + TerminalJsonTransform transform = new TerminalJsonTransform(true); + + String tempJson = transform.toJsonString(terminal); - Terminal testTerminal = gson.fromJson(tempJson, Terminal.class); + Terminal testTerminal = transform.toTerminal(tempJson); assertThat(testTerminal.getId()).isEqualTo(terminalID); assertThat(testTerminal.getRunId()).isEqualTo(runid); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/build.gradle index 8b7ca314d..f4958df06 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/build.gradle @@ -10,3 +10,17 @@ dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zos3270.manager') implementation project(':galasa-managers-core-parent:dev.galasa.core.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = false +ext.includeInIsolated = true +ext.includeInCodeCoverage = false +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/settings.gradle index df864bb62..960486fe5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zos3270.manager.ivt' \ No newline at end of file +rootProject.name = 'dev.galasa.zos3270.manager.ivt' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVT.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVT.java index 8a2924501..8effa8077 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVT.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVT.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.manager.ivt; @@ -9,10 +9,13 @@ import org.apache.commons.logging.Log; +import dev.galasa.ICredentialsUsernamePassword; import dev.galasa.Test; import dev.galasa.core.manager.CoreManager; +import dev.galasa.core.manager.CoreManagerException; import dev.galasa.core.manager.ICoreManager; import dev.galasa.core.manager.Logger; +import dev.galasa.core.manager.RunName; import dev.galasa.core.manager.TestProperty; import dev.galasa.zos.IZosImage; import dev.galasa.zos.ZosImage; @@ -25,6 +28,8 @@ import dev.galasa.zos3270.TimeoutException; import dev.galasa.zos3270.Zos3270Exception; import dev.galasa.zos3270.Zos3270Terminal; +import dev.galasa.zos3270.spi.Colour; +import dev.galasa.zos3270.spi.Highlight; import dev.galasa.zos3270.spi.NetworkException; @Test @@ -42,23 +47,18 @@ public class Zos3270IVT { @CoreManager public ICoreManager coreManager; - @TestProperty(prefix = "IVT.RUN",suffix = "NAME", required = false) - public String providedRunName; - private String runName = new String(); + @RunName + public String runName; + private String credentialsId = "PRIMARY"; private String applid = "IYK2ZNB5"; + @TestProperty(prefix = "IVT.REGION", suffix = "APPLID", required = false) + public String cbsaApplid; + @Test public void checkInjection() { - assertThat(logger).as("Logger Field").isNotNull(); - assertThat(image).as("zOS Image Field").isNotNull(); - assertThat(terminal).as("zOS 3270 Terminal Field").isNotNull(); assertThat(terminal.isConnected()).isTrue(); - if (providedRunName != null) { - runName = providedRunName; - } else { - runName = coreManager.getRunName(); - } logger.info("Using Run ID of: " + runName); } @@ -167,8 +167,45 @@ public void driveWaitForTextInField() throws TextNotFoundException, ErrorTextFou logger.info("No text found exception correctly thrown"); assertThat(tnfe.getMessage()).contains("Unable to find a field containing any of the request text"); } - - } - + + // TODO: Re-enable colour support IVTs once CBSA is installed on a region provisioned for the tests + // @Test + // public void cursorColourTest() throws Zos3270Exception, CoreManagerException { + // ICredentialsUsernamePassword credentials = (ICredentialsUsernamePassword) coreManager.getCredentials(credentialsId); + // coreManager.registerConfidentialText(credentials.getPassword(), "password"); + // terminal.disconnect(); + // terminal.connect(); + + // terminal.wfk().type("logon applid(" + cbsaApplid + ")").enter().wfk().waitForTextInField("Signon to CICS"); + // terminal.wfk().type(credentials.getUsername()).tab().tab().type(credentials.getPassword()).enter().wfk(); + + // // access CBSA and look up customer with ID 1 + // terminal.type("OMEN").enter().wfk().waitForTextInField("CICS Bank Sample Application"); + // terminal.type("1").enter().wfk().type("1").enter().wfk(); + + // terminal.reportExtendedScreen(true, true, true, false, false, false, false); + // assertThat(terminal.retrieveColourAtCursor()).isNull(); + + // terminal.positionCursorToFieldContaining("CUSTOMER NUMBER").cursorRight(); + // assertThat(terminal.retrieveColourAtCursor()).isEqualTo(Colour.TURQUOISE); + + // terminal.positionCursorToFieldContaining("CICS Bank Sample Application").cursorRight(); + // assertThat(terminal.retrieveColourAtCursor()).isEqualTo(Colour.RED); + + // terminal.positionCursorToFieldContaining("Sort Code").cursorRight(); + // assertThat(terminal.retrieveColourAtCursor()).isEqualTo(Colour.NEUTRAL); + // } + + // @Test + // public void cursorHighlightingTest() throws Zos3270Exception { + // // press f10 to switch to the view used to update customer information in CBSA + // terminal.pf10().wfk(); + // terminal.reportExtendedScreen(true, true, true, false, false, false, false); + // assertThat(terminal.retrieveHighlightAtCursor()).isEqualTo(Highlight.UNDERSCORE); + + // // the "Customer Number" field cannot be modified, so it is not highlighted + // terminal.positionCursorToFieldContaining("Customer Number"); + // assertThat(terminal.retrieveHighlightAtCursor()).isNull(); + // } } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVTSimframe.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVTSimframe.java index 9f38bbc13..c43e1b895 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVTSimframe.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager.ivt/src/main/java/dev/galasa/zos3270/manager/ivt/Zos3270IVTSimframe.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.manager.ivt; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/README.md b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/README.md index c57783d74..9876a2f06 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/README.md +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/README.md @@ -17,15 +17,19 @@ NOTE, the spacing and capitalisation must be exact at this time. We will try to There are 4 flavours to the "given a terminal". you can specify an ID for a terminal so that a feature file can operate multiple terminals in the same feature file. You can also specify a zOS image tag to influence which image the terminal connects to. -The default ID is A and the default tag is PRIMARY. +The default ID is `A` and the default tag is `PRIMARY`. -In all the following statements, where you see `terminal` you can leave as default ID of A or code `terminal B` to point to a different terminal. +In all the following statements, where you see `terminal` you can leave as default ID of `A` or code `terminal B` to point to a different terminal. ### Move Cursor `AND move terminal cursor to field "xxxxxx"` -Where xxxxxx is the text in an protected or unprotected field on the screen. +Where `xxxxxx` is the text in an protected or unprotected field on the screen. + +`AND move terminal A cursor to field "xxxxxx"` + +As above, but for the terminal with an id of `A` ### Terminal keys @@ -35,26 +39,41 @@ Where xxxxxx is the text in an protected or unprotected field on the screen. `AND press terminal key ENTER` -`AND press terminal key PFxx` where xx is the PF number +`AND press terminal key BACKTAB` + +`AND press terminal key PFxx` where `xx` is the PF number + +`AND press terminal A key ENTER` where `A` is the id of the terminal to use. ### Type something -`AND type "xxxxxx" on terminal` where xxxxx is what you want to type where the cursor is +`AND type "xxxxxx" on terminal` where `xxxxx` is what you want to type where the cursor is + +`AND type "xxxxxx" on terminal A` where `A` is the id of the terminal to use. -`AND type "xxxxxx" on terminal in field labelled "yyyyyy"` where xxxxxx is the what you want to type, yyyyyy is the field label. WARNING, this will move the cursor. It will locate ANY text yyyyyy and then press TAB and then type. +`AND type "xxxxxx" on terminal in field labelled "yyyyyy"` where `xxxxxx` is the what you want to type, `yyyyyy` is the field label. WARNING, this will move the cursor. It will locate ANY text `yyyyyy` and then press TAB and then type. + +`AND type "xxxxxx" on terminal A in field labelled "yyyyyy"` where `A` is the id of the terminal to use. ### Wait for the keyboard to unlock `AND wait for terminal keyboard` +`AND wait for terminal A keyboard` + ### Wait for text on the screen `THEN wait for "xxxxxx" in any terminal field` This will wait for the text to appear on the screen on any screen update. WARNING, the keyboard may not be unlocked when this statement finishes. +`THEN wait for "xxxxxx" in any terminal A field` where `A` is the id of the terminal to use. + ### Check single text on screen `THEN check "xxxxxx" appears only once on terminal` -This will search the screen for text xxxxxx and ensure it occurs once. This is immediate, will not wait for updates. +This will search the screen for text `xxxxxx` and ensure it occurs once. This is immediate, will not wait for updates. + +`THEN check "xxxxxx" appears only once on terminal A` where `A` is the id of the terminal to use. + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/build.gradle index ea6405420..797b95d78 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/build.gradle @@ -4,14 +4,27 @@ plugins { description = 'Galasa zOS 3270 Terminal Manager' -version = '0.25.0' +version = '0.36.0' dependencies { api project(':galasa-managers-zos-parent:dev.galasa.zos3270.common') api project(':galasa-managers-zos-parent:dev.galasa.zos.manager') api project(':galasa-managers-core-parent:dev.galasa.textscan.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'commons-codec:commons-codec:1.15' - implementation 'commons-io:commons-io:2.9.0' - + implementation 'commons-io:commons-io:2.16.1' + implementation project (':galasa-managers-common-parent:dev.galasa.common') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/settings.gradle index e3b2c860a..086d34a4d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.zos3270.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zos3270.manager' diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/AttentionIdentification.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/AttentionIdentification.java index 7f599cb4a..729f03783 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/AttentionIdentification.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/AttentionIdentification.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ErrorTextFoundException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ErrorTextFoundException.java index d7fe207be..778328910 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ErrorTextFoundException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ErrorTextFoundException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/FieldNotFoundException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/FieldNotFoundException.java index 3122f9231..7d7c88899 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/FieldNotFoundException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/FieldNotFoundException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IDatastreamListener.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IDatastreamListener.java index 5958cd3c8..7a5e9f053 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IDatastreamListener.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IDatastreamListener.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270; public interface IDatastreamListener { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IScreenUpdateListener.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IScreenUpdateListener.java index 5a4fa1d48..3dd29ce4e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IScreenUpdateListener.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IScreenUpdateListener.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ITerminal.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ITerminal.java index d1da42e53..5507b07cd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ITerminal.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/ITerminal.java @@ -1,10 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; import javax.validation.constraints.NotNull; +import dev.galasa.zos3270.spi.Colour; +import dev.galasa.zos3270.spi.Highlight; import dev.galasa.zos3270.spi.NetworkException; public interface ITerminal { @@ -56,7 +60,7 @@ ITerminal positionCursorToFieldContaining(@NotNull String searchText) * The returned boolean will depend on if the amount of occurrences is found. * * @param text - * @param occurances + * @param occurrences * @return if the text was found */ boolean searchText(String text, int occurrences); @@ -200,6 +204,22 @@ ITerminal positionCursorToFieldContaining(@NotNull String searchText) ITerminal reportScreenWithCursor(); + /** + * Report to the log the current state of the terminal with optional extended datastream settings + * + * @param printCursor - report cursor position + * @param printColour - report the colour + * @param printHighlight - report highlighting + * @param printIntensity - report intensity + * @param printProtected - report field protection + * @param printNumeric - report numeric restrictions + * @param printModified - report field modification + * @return the ITerminal for fluent API + * @throws Zos3270Exception + */ + ITerminal reportExtendedScreen(boolean printCursor, boolean printColour, boolean printHighlight, + boolean printIntensity, boolean printProtected, boolean printNumeric, boolean printModified) throws Zos3270Exception; + String retrieveScreen(); /** @@ -251,11 +271,46 @@ ITerminal positionCursorToFieldContaining(@NotNull String searchText) * If there are not enough characters on the row to satisfy the length requirement, the retrieve will wrap to the next * row, unless it is the last row, in which case an exception will be thrown. * - * @param length * @param length - The number of characters to extract * @return The contents extracted * @throws Zos3270Exception - If the length causes the extract to overflow the end of the screen buffer */ String retrieveTextAtCursor(int length) throws Zos3270Exception; + /** + * Return the colour of the character at the cursor position + * + * @return - if position is not in an extended field, null us returned + */ + Colour retrieveColourAtCursor(); + + /** + * Return the colour of the character at the cursor position + * + * @param row of the screen, index 1 based + * @param col of the screen, index 1 based + * @return - if position is not in an extended field, null us returned + * @throws Zos3270Exception + */ + Colour retrieveColourAtPosition(int row, int col) throws Zos3270Exception; + + /** + * Return the highlighting of the character at the cursor position + * + * @return - if position is not in an extended field, null us returned + */ + Highlight retrieveHighlightAtCursor(); + + /** + * Return the highlighting of the character at the cursor position + * + * @param row of the screen, index 1 based + * @param col of the screen, index 1 based + * @return - if position is not in an extended field, null us returned + * @throws Zos3270Exception + */ + Highlight retrieveHighlightAtPosition(int row, int col) throws Zos3270Exception; + + + } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IZos3270Manager.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IZos3270Manager.java index 53ac76f12..b30820f45 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IZos3270Manager.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/IZos3270Manager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/KeyboardLockedException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/KeyboardLockedException.java index 94eb7ee1d..a2d517329 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/KeyboardLockedException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/KeyboardLockedException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TerminalInterruptedException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TerminalInterruptedException.java index 6961ea16a..f02538306 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TerminalInterruptedException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TerminalInterruptedException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TextNotFoundException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TextNotFoundException.java index 5ddec7c1f..566fe36e8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TextNotFoundException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TextNotFoundException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TimeoutException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TimeoutException.java index ce8efc9c5..92d36bce7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TimeoutException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/TimeoutException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Exception.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Exception.java index 7a9b6038a..448f9a8ef 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Exception.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Exception.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270ManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270ManagerException.java index 37635e0e0..b5615c1ce 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270ManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270ManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Terminal.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Terminal.java index e5635cf0b..ad54d67f9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Terminal.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/Zos3270Terminal.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270; @@ -20,7 +20,7 @@ * Used to populate a {@link ITerminal} field *

    * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerField.java index ef8b60651..2009beb9e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal; @@ -14,7 +14,7 @@ * Used to annotate annotations that are to be used for Test Class fields. To be * populated by the Manager. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerImpl.java index 4914c58b5..3a3b8f4cc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/Zos3270ManagerImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal; @@ -7,6 +9,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +import java.util.Map; import javax.validation.constraints.NotNull; @@ -25,6 +28,8 @@ import dev.galasa.framework.spi.IGherkinManager; import dev.galasa.framework.spi.IManager; import dev.galasa.framework.spi.ResourceUnavailableException; +import dev.galasa.framework.spi.Result; +import dev.galasa.framework.spi.language.GalasaMethod; import dev.galasa.framework.spi.language.GalasaTest; import dev.galasa.ipnetwork.IIpHost; import dev.galasa.textscan.spi.ITextScannerManagerSpi; @@ -35,6 +40,7 @@ import dev.galasa.zos3270.TerminalInterruptedException; import dev.galasa.zos3270.Zos3270ManagerException; import dev.galasa.zos3270.Zos3270Terminal; +import dev.galasa.zos3270.common.screens.TerminalSize; import dev.galasa.zos3270.internal.gherkin.Gherkin3270Coordinator; import dev.galasa.zos3270.internal.properties.ExtraBundles; import dev.galasa.zos3270.internal.properties.Zos3270PropertiesSingleton; @@ -48,7 +54,6 @@ public class Zos3270ManagerImpl extends AbstractGherkinManager implements IZos32 private static final Log logger = LogFactory.getLog(Zos3270ManagerImpl.class); - private IConfigurationPropertyStoreService cps; private IDynamicStatusStoreService dss; private IZosManagerSpi zosManager; @@ -94,7 +99,30 @@ public void initialise(@NotNull IFramework framework, @NotNull List al } } - + + @Override + public Result endOfTestMethod(@NotNull GalasaMethod galasaMethod, @NotNull Result currentResult, Throwable currentException) + throws ManagerException { + + super.endOfTestMethod(galasaMethod, currentResult, currentException); + + if (galasaMethod.isGherkin()) { + // The end of a test method in gherkin equates to the end of the scenario. + // So we need to free up terminals so their state doesn't leech into the next scenario. + // A scenario equates to a java method. + disconnectAllTerminals(); + } + + return currentResult; + } + + private void disconnectAllTerminals() throws Zos3270ManagerException { + for( Zos3270TerminalImpl terminal: terminals) { + if (terminal.isConnected()) { + disconnectTerminal(terminal); + } + } + } @Override public List extraBundles(@NotNull IFramework framework) throws ManagerException { @@ -150,11 +178,14 @@ public ITerminal generateTerminal(Field field, List annotations) thr String tag = defaultString(terminalAnnotation.imageTag(), "PRIMARY").toUpperCase(); // *** Default the tag to primary boolean autoConnect = terminalAnnotation.autoConnect(); + + TerminalSize primaryTerminalSize = new TerminalSize(terminalAnnotation.primaryColumns(), terminalAnnotation.primaryRows()); + TerminalSize alternateTerminalSize = new TerminalSize(terminalAnnotation.alternateColumns(), terminalAnnotation.alternateRows()); - return generateTerminal(tag, autoConnect, terminalAnnotation.primaryColumns(), terminalAnnotation.primaryRows(), terminalAnnotation.alternateColumns(), terminalAnnotation.alternateRows()); + return generateTerminal(tag, autoConnect, primaryTerminalSize, alternateTerminalSize); } - public Zos3270TerminalImpl generateTerminal(String imageTag, boolean autoConnect, int primaryColumns, int primaryRows, int alternateColumns, int alternateRows) throws Zos3270ManagerException { + public Zos3270TerminalImpl generateTerminal(String imageTag, boolean autoConnect, TerminalSize primarySize, TerminalSize alternateSize) throws Zos3270ManagerException { // *** Ask the zosManager for the image for the Tag try { IZosImage image = this.zosManager.provisionImageForTag(imageTag); @@ -164,7 +195,7 @@ public Zos3270TerminalImpl generateTerminal(String imageTag, boolean autoConnect String terminaId = "term" + (terminalCount); Zos3270TerminalImpl terminal = new Zos3270TerminalImpl(terminaId, host.getHostname(), host.getTelnetPort(), - host.isTelnetPortTls(), getFramework(), autoConnect, image,primaryColumns, primaryRows, alternateColumns, alternateRows, textScannerManager); + host.isTelnetPortTls(), getFramework(), autoConnect, image, primarySize, alternateSize, textScannerManager); this.terminals.add(terminal); logger.info("Generated a terminal for zOS Image tagged " + imageTag); @@ -201,18 +232,25 @@ public void provisionStart() throws ManagerException, ResourceUnavailableExcepti public void provisionStop() { logger.trace("Disconnecting terminals"); for (Zos3270TerminalImpl terminal : terminals) { - try { - terminal.flushTerminalCache(); - terminal.disconnect(); - } catch (TerminalInterruptedException e) { - logger.warn("Thread interrupted whilst disconnecting terminals", e); - Thread.currentThread().interrupt(); - } + disconnectTerminal(terminal); } } - protected IConfigurationPropertyStoreService getCps() { - return this.cps; + private void disconnectTerminal(Zos3270TerminalImpl terminal) { + String terminalId = terminal.getId(); + logger.info("Disconnecting terminal "+terminalId); + try { + terminal.writeRasOutput(); + terminal.flushTerminalCache(); + terminal.disconnect(); + } catch (TerminalInterruptedException e) { + logger.warn("Thread interrupted whilst disconnecting terminals", e); + Thread.currentThread().interrupt(); + } + } + + protected IConfigurationPropertyStoreService getCps() throws Zos3270ManagerException { + return Zos3270PropertiesSingleton.cps(); } protected IDynamicStatusStoreService getDss() { @@ -222,4 +260,49 @@ protected IDynamicStatusStoreService getDss() { public IZosManagerSpi getZosManager() { return this.zosManager; } + + /** + * Get a CPS property from the zos3270 namespace. + * + * The Gherkin sister-classes need to be able to retrieve properties from the CPS. + * + * @param fullPropertyName the name of the property you want. Including the namespace, which must + * match {@link Zos3270ManagerImpl#NAMESPACE} + */ + public String getCpsProperty(String fullPropertyName) throws Zos3270ManagerException { + + String propertyValue; + + if (!fullPropertyName.startsWith(Zos3270ManagerImpl.NAMESPACE+".")) { + // This manager can only get properties from the zos3270 namespace. + throw new Zos3270ManagerException( + "Program logic error. CPS property name must start with '"+Zos3270ManagerImpl.NAMESPACE+".' for the Zos3270 manager to access it."+ + " Property"+fullPropertyName+" cannot be retrieved."); + } + + try { + + // We get something like "zos3270.gherkin.terminal.rows" as input. + // The cps we are using is already pinned to the zos3270 namespace, so we don't need to + // pass that. It is implicitly given. + + + String[] propNameParts = fullPropertyName.split("\\."); + // Skip the namespace zos3270 part. + String prefix = propNameParts[1]; + String suffix = propNameParts[propNameParts.length-1]; + // allocate space for the infixes. + String [] infixes = new String[propNameParts.length-3]; + System.arraycopy( propNameParts, 2, infixes, 0, propNameParts.length-3 ); + + propertyValue = getCps().getProperty(prefix, suffix, infixes); + logger.info("Property requested:"+fullPropertyName+" value:"+propertyValue); + + } catch (ConfigurationPropertyStoreException ex) { + throw new Zos3270ManagerException("Failed to retrieve the CPS property "+fullPropertyName , ex ); + } + + return propertyValue; + } + } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Inbound3270Message.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Inbound3270Message.java index 0d994adab..93750c855 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Inbound3270Message.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Inbound3270Message.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.comms; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Network.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Network.java index a52573ed8..b49a98c7b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Network.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/Network.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.comms; @@ -21,6 +21,8 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; +import dev.galasa.common.SSLTLSContextNameSelector; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -48,6 +50,8 @@ public class Network { private boolean basicTelnet = false; + private SSLTLSContextNameSelector nameSelector = new SSLTLSContextNameSelector(); + public Network(String host, int port, String terminalId) { this(host, port, false, terminalId); } @@ -113,13 +117,8 @@ public Socket createSocket() throws IOException, NoSuchAlgorithmException, KeyMa if (!ssl) { newSocket = new Socket(this.host, this.port); } else { - boolean ibmJdk = System.getProperty("java.vendor").contains("IBM"); - SSLContext sslContext; - if (ibmJdk) { - sslContext = SSLContext.getInstance("SSL_TLSv2"); - } else { - sslContext = SSLContext.getInstance("TLSv1.2"); - } + String contextName = nameSelector.getSelectedSSLContextName(); + SSLContext sslContext = SSLContext.getInstance(contextName); sslContext.init(null, new TrustManager[] { new TrustAllCerts() }, new java.security.SecureRandom()); newSocket = sslContext.getSocketFactory().createSocket(this.host, this.port); ((SSLSocket) newSocket).startHandshake(); @@ -153,13 +152,8 @@ public InputStream getInputStream() { public Socket startTls() throws NetworkException { try { - boolean ibmJdk = System.getProperty("java.vendor").contains("IBM"); - SSLContext sslContext; - if (ibmJdk) { - sslContext = SSLContext.getInstance("SSL_TLSv2"); - } else { - sslContext = SSLContext.getInstance("TLSv1.2"); - } + String contextName = nameSelector.getSelectedSSLContextName(); + SSLContext sslContext = SSLContext.getInstance(contextName); sslContext.init(null, new TrustManager[] { new TrustAllCerts() }, new java.security.SecureRandom()); Socket tlsSocket = sslContext.getSocketFactory().createSocket(socket, this.host, this.port, false); ((SSLSocket) tlsSocket).startHandshake(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkServer.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkServer.java index 6a12ccd88..91b0500fe 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkServer.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkServer.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.comms; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkThread.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkThread.java index 84241c7ae..e3b0c965e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkThread.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/NetworkThread.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.comms; @@ -28,6 +30,7 @@ import dev.galasa.zos3270.internal.datastream.OrderFormFeed; import dev.galasa.zos3270.internal.datastream.OrderGraphicsEscape; import dev.galasa.zos3270.internal.datastream.OrderInsertCursor; +import dev.galasa.zos3270.internal.datastream.OrderModifyField; import dev.galasa.zos3270.internal.datastream.OrderNewLine; import dev.galasa.zos3270.internal.datastream.OrderRepeatToAddress; import dev.galasa.zos3270.internal.datastream.OrderSetAttribute; @@ -194,10 +197,20 @@ public void processMessage(InputStream messageStream) throws IOException, Networ if (tn3270eHeader == DT_BIND_IMAGE) { logger.trace("BIND_IMAGE received"); return; - } else if (tn3270eHeader == DT_UNBIND) { + } + if (tn3270eHeader == DT_UNBIND) { logger.trace("UNBIND_IMAGE received"); return; - } else if (tn3270eHeader != 0) { + } + + if (tn3270eHeader == DT_SSCP_LU_DATA) { + logger.trace("SSCP_LU_DATA received"); + logger.trace("Received message header: " + reportCommandSoFar()); + logger.trace("Received message buffer: " + Hex.encodeHexString(buffer)); + return; + } + + if (tn3270eHeader != DT_3270_DATA) { throw new NetworkException("Was expecting a TN3270E datastream header of zeros - " + reportCommandSoFar()); } @@ -205,7 +218,6 @@ public void processMessage(InputStream messageStream) throws IOException, Networ Inbound3270Message inbound3270Message = process3270Data(buffer); this.screen.processInboundMessage(inbound3270Message); - return; } } @@ -836,13 +848,13 @@ public Inbound3270Message process3270Data(ByteBuffer buffer) throws NetworkExcep AbstractCommandCode commandCode = AbstractCommandCode.getCommandCode(buffer.get()); if (commandCode instanceof CommandWriteStructured) { - return processStructuredFields((CommandWriteStructured) commandCode, buffer); + return processStructuredFields((CommandWriteStructured) commandCode, buffer, screen.getCodePage()); } else { - return process3270Datastream(commandCode, buffer); + return process3270Datastream(commandCode, buffer, screen.getCodePage()); } } - public static Inbound3270Message process3270Datastream(AbstractCommandCode commandCode, ByteBuffer buffer) + public static Inbound3270Message process3270Datastream(AbstractCommandCode commandCode, ByteBuffer buffer, Charset codePage) throws DatastreamException { if (!buffer.hasRemaining()) { @@ -851,12 +863,12 @@ public static Inbound3270Message process3270Datastream(AbstractCommandCode comma WriteControlCharacter writeControlCharacter = new WriteControlCharacter(buffer.get()); - List orders = processOrders(buffer); + List orders = processOrders(buffer, codePage); return new Inbound3270Message(commandCode, writeControlCharacter, orders); } - public static List processOrders(ByteBuffer buffer) throws DatastreamException { + public static List processOrders(ByteBuffer buffer, Charset codePage) throws DatastreamException { OrderText orderText = null; ArrayList orders = new ArrayList<>(); @@ -872,7 +884,7 @@ public static List processOrders(ByteBuffer buffer) throws Datast order = new OrderSetBufferAddress(buffer); break; case OrderRepeatToAddress.ID: - order = new OrderRepeatToAddress(buffer); + order = new OrderRepeatToAddress(buffer, codePage); break; case OrderStartField.ID: order = new OrderStartField(buffer); @@ -883,6 +895,9 @@ public static List processOrders(ByteBuffer buffer) throws Datast case OrderSetAttribute.ID: order = new OrderSetAttribute(buffer); break; + case OrderModifyField.ID: + order = new OrderModifyField(buffer); + break; case OrderInsertCursor.ID: order = new OrderInsertCursor(); break; @@ -907,12 +922,12 @@ public static List processOrders(ByteBuffer buffer) throws Datast default: String byteHex = Hex.encodeHexString(new byte[] { orderByte }); logger.trace("Invalid byte detected in datastream, unrecognised byte order or text byte - 0x" + byteHex); - order = new OrderText(" "); + order = new OrderText(" ", codePage); } orders.add(order); } else { if (orderText == null) { - orderText = new OrderText(); + orderText = new OrderText(codePage); orders.add(orderText); } orderText.append(orderByte); @@ -921,7 +936,7 @@ public static List processOrders(ByteBuffer buffer) throws Datast return orders; } - public static Inbound3270Message processStructuredFields(CommandWriteStructured commandCode, ByteBuffer buffer) + public static Inbound3270Message processStructuredFields(CommandWriteStructured commandCode, ByteBuffer buffer, Charset codePage) throws NetworkException { ArrayList structuredFields = new ArrayList<>(); @@ -937,7 +952,7 @@ public static Inbound3270Message processStructuredFields(CommandWriteStructured byte[] sfData = new byte[length - 2]; buffer.get(sfData); - structuredFields.add(StructuredField.getStructuredField(sfData)); + structuredFields.add(StructuredField.getStructuredField(sfData, codePage)); } return new Inbound3270Message(commandCode, structuredFields); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/package-info.java index c77eb0a26..cf2d19196 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/comms/package-info.java @@ -1,7 +1,7 @@ /* - *Licensed Materials - Property of IBM + * Copyright contributors to the Galasa project * - *(c) Copyright IBM Corp. 2019. + * SPDX-License-Identifier: EPL-2.0 */ /** * zOS 3270 Terminal Manager - Internal Communications diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractCommandCode.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractCommandCode.java index 74b942003..cd6bbb0b7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractCommandCode.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractCommandCode.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractOrder.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractOrder.java index d6fcef38a..fda5da5e9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractOrder.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractOrder.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractQueryReply.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractQueryReply.java index 007964a4c..119f1ece5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractQueryReply.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AbstractQueryReply.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeBackgroundColour.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeBackgroundColour.java index a96c6c01b..cb922e895 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeBackgroundColour.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeBackgroundColour.java @@ -1,23 +1,28 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; import java.nio.ByteBuffer; +import dev.galasa.zos3270.spi.Colour; +import dev.galasa.zos3270.spi.DatastreamException; + public class AttributeBackgroundColour implements IAttribute { public static final byte ATTRIBUTE_ID = 0x45; - private final byte colour; + private final Colour colour; - public AttributeBackgroundColour(ByteBuffer buffer) { - this.colour = buffer.get(); + public AttributeBackgroundColour(ByteBuffer buffer) throws DatastreamException { + byte code = buffer.get(); + + this.colour = Colour.getColour(code); } - public byte getColour() { + public Colour getColour() { return colour; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeCharacterSet.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeCharacterSet.java index ce9520446..e7ad39dba 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeCharacterSet.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeCharacterSet.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeExtendedHighlighting.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeExtendedHighlighting.java index 5e56e8d42..963ced688 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeExtendedHighlighting.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeExtendedHighlighting.java @@ -1,24 +1,29 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; import java.nio.ByteBuffer; +import dev.galasa.zos3270.spi.DatastreamException; +import dev.galasa.zos3270.spi.Highlight; + public class AttributeExtendedHighlighting implements IAttribute { public static final byte ATTRIBUTE_ID = 0x41; - private final byte colour; + private final Highlight highlight; - public AttributeExtendedHighlighting(ByteBuffer buffer) { - this.colour = buffer.get(); + public AttributeExtendedHighlighting(ByteBuffer buffer) throws DatastreamException { + byte code = buffer.get(); + + this.highlight = Highlight.getHighlight(code); } - public byte getColour() { - return colour; + public Highlight getHighlight() { + return this.highlight; } } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldOutlining.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldOutlining.java index 6ee9b32d7..bfaf56b90 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldOutlining.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldOutlining.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldValidation.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldValidation.java index 387b97388..dc0654af0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldValidation.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeFieldValidation.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeForegroundColour.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeForegroundColour.java index 712c00cd1..e86bc754d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeForegroundColour.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeForegroundColour.java @@ -1,23 +1,28 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; import java.nio.ByteBuffer; +import dev.galasa.zos3270.spi.Colour; +import dev.galasa.zos3270.spi.DatastreamException; + public class AttributeForegroundColour implements IAttribute { public static final byte ATTRIBUTE_ID = 0x42; - private final byte colour; + private final Colour colour; - public AttributeForegroundColour(ByteBuffer buffer) { - this.colour = buffer.get(); + public AttributeForegroundColour(ByteBuffer buffer) throws DatastreamException { + byte code = buffer.get(); + + this.colour = Colour.getColour(code); } - public byte getColour() { + public Colour getColour() { return colour; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeResetAllAttributes.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeResetAllAttributes.java index eb4601470..c4e08ee70 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeResetAllAttributes.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeResetAllAttributes.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeTransparency.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeTransparency.java index 691b23287..6b8577035 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeTransparency.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/AttributeTransparency.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/BufferAddress.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/BufferAddress.java index 3accf2f50..2d5ac5e92 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/BufferAddress.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/BufferAddress.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWrite.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWrite.java index 0e38b32ed..4149a933a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWrite.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWrite.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWriteAlternate.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWriteAlternate.java index 297f4bbf8..19f0c1404 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWriteAlternate.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandEraseWriteAlternate.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadBuffer.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadBuffer.java index 1c50ce0ee..434decc13 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadBuffer.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadBuffer.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModified.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModified.java index 5b54e6658..2d83cbb72 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModified.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModified.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModifiedAll.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModifiedAll.java index 4b3910553..2ce22ae17 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModifiedAll.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandReadModifiedAll.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWrite.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWrite.java index 3680151b6..b0e5777c2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWrite.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWrite.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWriteStructured.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWriteStructured.java index 11e4f53d9..b33dfa5f6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWriteStructured.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/CommandWriteStructured.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/IAttribute.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/IAttribute.java index 5e3ad6d21..a7a28d391 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/IAttribute.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/IAttribute.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderCarrageReturn.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderCarrageReturn.java index 2991950a0..a1cad71be 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderCarrageReturn.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderCarrageReturn.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEndOfMedium.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEndOfMedium.java index 235cea6fa..879cd6d46 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEndOfMedium.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEndOfMedium.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEraseUnprotectedToAddress.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEraseUnprotectedToAddress.java index 75790db75..0c75812b0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEraseUnprotectedToAddress.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderEraseUnprotectedToAddress.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderFormFeed.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderFormFeed.java index b9fcd87c0..a23b31d1a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderFormFeed.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderFormFeed.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderGraphicsEscape.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderGraphicsEscape.java index 36b9fd2be..6f21f601d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderGraphicsEscape.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderGraphicsEscape.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderInsertCursor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderInsertCursor.java index 368ddb746..505d23ae8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderInsertCursor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderInsertCursor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderModifyField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderModifyField.java new file mode 100644 index 000000000..8a2f25b3f --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderModifyField.java @@ -0,0 +1,93 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.internal.datastream; + +import java.nio.ByteBuffer; + +import dev.galasa.zos3270.spi.DatastreamException; + +public class OrderModifyField extends AbstractOrder { + + public static final byte ID = 0x2c; + + private OrderStartField orderStartField = null; + @SuppressWarnings("unused") + private AttributeFieldValidation attributeFieldValidation = null; + @SuppressWarnings("unused") + private AttributeFieldOutlining attributeFieldOutlining = null; + private AttributeExtendedHighlighting attributeExtendedHighlighting = null; + @SuppressWarnings("unused") + private AttributeCharacterSet attributeCharacterSet = null; + private AttributeForegroundColour attributeForegroundColour = null; + private AttributeBackgroundColour attributeBackgroundColour = null; + @SuppressWarnings("unused") + private AttributeTransparency attributeTransparency = null; + + public OrderModifyField(ByteBuffer buffer) throws DatastreamException { + byte[] rep = new byte[4]; + rep[0] = 0; + rep[1] = 0; + rep[2] = 0; + rep[3] = buffer.get(); + + ByteBuffer countBuffer = ByteBuffer.wrap(rep); + int fieldAttributeCount = countBuffer.getInt(); + + for (int i = 0; i < fieldAttributeCount; i++) { + byte attributeId = buffer.get(); + switch (attributeId) { + case OrderStartField.ATTRIBUTE_ID: + orderStartField = new OrderStartField(buffer); + break; + case AttributeFieldValidation.ATTRIBUTE_ID: + attributeFieldValidation = new AttributeFieldValidation(buffer); + break; + case AttributeFieldOutlining.ATTRIBUTE_ID: + attributeFieldOutlining = new AttributeFieldOutlining(buffer); + break; + case AttributeExtendedHighlighting.ATTRIBUTE_ID: + attributeExtendedHighlighting = new AttributeExtendedHighlighting(buffer); + break; + case AttributeForegroundColour.ATTRIBUTE_ID: + attributeForegroundColour = new AttributeForegroundColour(buffer); + break; + case AttributeCharacterSet.ATTRIBUTE_ID: + attributeCharacterSet = new AttributeCharacterSet(buffer); + break; + case AttributeBackgroundColour.ATTRIBUTE_ID: + attributeBackgroundColour = new AttributeBackgroundColour(buffer); + break; + case AttributeTransparency.ATTRIBUTE_ID: + attributeTransparency = new AttributeTransparency(buffer); + break; + default: + throw new DatastreamException("Unrecognised attribute in MF, '" + attributeId + "'"); + } + } + } + + @Override + public byte[] getBytes() { + throw new UnsupportedOperationException("Not available yet"); + } + + public OrderStartField getOrderStartField() { + return orderStartField; + } + + public AttributeExtendedHighlighting getHighlight() { + return attributeExtendedHighlighting; + } + + public AttributeForegroundColour getForegroundColour() { + return this.attributeForegroundColour; + } + + public AttributeBackgroundColour getBackgroundColor() { + return this.attributeBackgroundColour; + } + +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderNewLine.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderNewLine.java index 7def53434..1cbc4623f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderNewLine.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderNewLine.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderRepeatToAddress.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderRepeatToAddress.java index 60141a74a..8adc614e8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderRepeatToAddress.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderRepeatToAddress.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; @@ -12,7 +12,7 @@ public class OrderRepeatToAddress extends AbstractOrder { - private static final Charset ebcdic = Charset.forName("Cp037"); + private final Charset ebcdic; public static final byte ID = 0x3c; @@ -20,7 +20,8 @@ public class OrderRepeatToAddress extends AbstractOrder { private final char repeatChar; - public OrderRepeatToAddress(ByteBuffer buffer) throws DatastreamException { + public OrderRepeatToAddress(ByteBuffer buffer, Charset codePage) throws DatastreamException { + this.ebcdic = codePage; this.bufferAddress = new BufferAddress(buffer); byte[] charByte = new byte[] { buffer.get() }; @@ -31,7 +32,8 @@ public OrderRepeatToAddress(ByteBuffer buffer) throws DatastreamException { repeatChar = ebcdic.decode(ByteBuffer.wrap(charByte)).array()[0]; } - public OrderRepeatToAddress(char repeatChar, BufferAddress bufferAddress) { + public OrderRepeatToAddress(char repeatChar, BufferAddress bufferAddress, Charset codePage) { + this.ebcdic = codePage; this.bufferAddress = bufferAddress; this.repeatChar = repeatChar; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetAttribute.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetAttribute.java index 208a0f6a0..ffd26586b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetAttribute.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetAttribute.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetBufferAddress.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetBufferAddress.java index 94637dd67..1d0635723 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetBufferAddress.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderSetBufferAddress.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartField.java index f0fc9ae68..d6d5b71b3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartFieldExtended.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartFieldExtended.java index cc8d1b288..03368318e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartFieldExtended.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderStartFieldExtended.java @@ -1,13 +1,11 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; import dev.galasa.zos3270.spi.DatastreamException; @@ -15,7 +13,18 @@ public class OrderStartFieldExtended extends AbstractOrder { public static final byte ID = 0x29; - private final ArrayList attributes = new ArrayList<>(); + private OrderStartField orderStartField = null; + @SuppressWarnings("unused") + private AttributeFieldValidation attributeFieldValidation = null; + @SuppressWarnings("unused") + private AttributeFieldOutlining attributeFieldOutlining = null; + private AttributeExtendedHighlighting attributeExtendedHighlighting = null; + @SuppressWarnings("unused") + private AttributeCharacterSet attributeCharacterSet = null; + private AttributeForegroundColour attributeForegroundColour = null; + private AttributeBackgroundColour attributeBackgroundColour = null; + @SuppressWarnings("unused") + private AttributeTransparency attributeTransparency = null; public OrderStartFieldExtended(ByteBuffer buffer) throws DatastreamException { byte[] rep = new byte[4]; @@ -31,28 +40,28 @@ public OrderStartFieldExtended(ByteBuffer buffer) throws DatastreamException { byte attributeId = buffer.get(); switch (attributeId) { case OrderStartField.ATTRIBUTE_ID: - attributes.add(new OrderStartField(buffer)); + orderStartField = new OrderStartField(buffer); break; case AttributeFieldValidation.ATTRIBUTE_ID: - attributes.add(new AttributeFieldValidation(buffer)); + attributeFieldValidation = new AttributeFieldValidation(buffer); break; case AttributeFieldOutlining.ATTRIBUTE_ID: - attributes.add(new AttributeFieldOutlining(buffer)); + attributeFieldOutlining = new AttributeFieldOutlining(buffer); break; case AttributeExtendedHighlighting.ATTRIBUTE_ID: - attributes.add(new AttributeExtendedHighlighting(buffer)); + attributeExtendedHighlighting = new AttributeExtendedHighlighting(buffer); break; case AttributeForegroundColour.ATTRIBUTE_ID: - attributes.add(new AttributeForegroundColour(buffer)); + attributeForegroundColour = new AttributeForegroundColour(buffer); break; case AttributeCharacterSet.ATTRIBUTE_ID: - attributes.add(new AttributeCharacterSet(buffer)); + attributeCharacterSet = new AttributeCharacterSet(buffer); break; case AttributeBackgroundColour.ATTRIBUTE_ID: - attributes.add(new AttributeBackgroundColour(buffer)); + attributeBackgroundColour = new AttributeBackgroundColour(buffer); break; case AttributeTransparency.ATTRIBUTE_ID: - attributes.add(new AttributeTransparency(buffer)); + attributeTransparency = new AttributeTransparency(buffer); break; default: throw new DatastreamException("Unrecognised attribute in SFE, '" + attributeId + "'"); @@ -65,8 +74,20 @@ public byte[] getBytes() { throw new UnsupportedOperationException("Not available yet"); } - public List getAttributes() { - return attributes; + public OrderStartField getOrderStartField() { + return orderStartField; + } + + public AttributeExtendedHighlighting getHighlight() { + return attributeExtendedHighlighting; + } + + public AttributeForegroundColour getForegroundColour() { + return this.attributeForegroundColour; + } + + public AttributeBackgroundColour getBackgroundColor() { + return this.attributeBackgroundColour; } } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderText.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderText.java index f21bb8e31..756a94025 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderText.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/OrderText.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; @@ -10,14 +10,16 @@ public class OrderText extends AbstractOrder { - public static final Charset ebcdic = Charset.forName("Cp037"); + private final Charset ebcdic; private StringBuilder text = new StringBuilder(); - public OrderText() { + public OrderText(Charset codePage) { + this.ebcdic = codePage; } - public OrderText(String newText) { + public OrderText(String newText, Charset codePage) { + this.ebcdic = codePage; this.text.append(newText); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyCharactersets.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyCharactersets.java index dad4b169a..5c191b075 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyCharactersets.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyCharactersets.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyColor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyColor.java index 3d041582a..9c1b29992 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyColor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyColor.java @@ -1,12 +1,14 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; import java.nio.ByteBuffer; +import dev.galasa.zos3270.spi.Colour; + public class QueryReplyColor extends AbstractQueryReply { private static final byte COLOR = (byte) 0x86; @@ -21,14 +23,14 @@ public byte[] toByte() { buffer.put((byte)8); // Number of color combinations - putColor(buffer, (byte)0, (byte)0xf4); - putColor(buffer, (byte)0xf1, (byte)0xf1); - putColor(buffer, (byte)0xf2, (byte)0xf2); - putColor(buffer, (byte)0xf3, (byte)0xf3); - putColor(buffer, (byte)0xf4, (byte)0xf4); - putColor(buffer, (byte)0xf5, (byte)0xf5); - putColor(buffer, (byte)0xf6, (byte)0xf6); - putColor(buffer, (byte)0xf7, (byte)0xf7); + putColor(buffer, Colour.DEFAULT.getCode(), Colour.GREEN.getCode()); + putColor(buffer, Colour.BLUE.getCode(), Colour.BLUE.getCode()); + putColor(buffer, Colour.RED.getCode(), Colour.RED.getCode()); + putColor(buffer, Colour.PINK.getCode(), Colour.PINK.getCode()); + putColor(buffer, Colour.GREEN.getCode(), Colour.GREEN.getCode()); + putColor(buffer, Colour.TURQUOISE.getCode(), Colour.TURQUOISE.getCode()); + putColor(buffer, Colour.YELLOW.getCode(), Colour.YELLOW.getCode()); + putColor(buffer, Colour.NEUTRAL.getCode(), Colour.NEUTRAL.getCode()); return buffer.array(); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyHighlite.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyHighlite.java index fc6723b0d..8635467b5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyHighlite.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyHighlite.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyImplicitPartition.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyImplicitPartition.java index 63be3101b..58afd7de0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyImplicitPartition.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyImplicitPartition.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyNull.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyNull.java index d710c03d0..ca6307108 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyNull.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyNull.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM + * Copyright contributors to the Galasa project * - * (c) Copyright IBM Corp. 2020. + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplySummary.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplySummary.java index e671ef9ee..ba64606da 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplySummary.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplySummary.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyUsableArea.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyUsableArea.java index 125f1b9b2..4fb1f070f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyUsableArea.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/QueryReplyUsableArea.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField.java index 4d9ae5d1a..78d4815f7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField.java @@ -1,10 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; +import java.nio.charset.Charset; + import dev.galasa.zos3270.spi.NetworkException; public class StructuredField { @@ -15,12 +17,12 @@ public class StructuredField { protected StructuredField() { } - public static StructuredField getStructuredField(byte[] sfData) throws NetworkException { + public static StructuredField getStructuredField(byte[] sfData, Charset codePage) throws NetworkException { switch (sfData[0]) { case SF_READ_PARTITION: return new StructuredFieldReadPartition(sfData); case SF_3270_DS: - return new StructuredField3270DS(sfData); + return new StructuredField3270DS(sfData, codePage); default: throw new NetworkException("Unknown Structured Field = " + sfData[0]); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField3270DS.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField3270DS.java index be4751a59..5c727aeba 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField3270DS.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredField3270DS.java @@ -1,11 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; import java.nio.ByteBuffer; +import java.nio.charset.Charset; import dev.galasa.zos3270.internal.comms.Inbound3270Message; import dev.galasa.zos3270.internal.comms.NetworkThread; @@ -16,7 +17,7 @@ public class StructuredField3270DS extends StructuredField { private Inbound3270Message inbound3270Message; - public StructuredField3270DS(byte[] structuredFieldData) throws NetworkException { + public StructuredField3270DS(byte[] structuredFieldData, Charset codePage) throws NetworkException { if (structuredFieldData.length < 3) { throw new DatastreamException("Structured Field 3270 DS length < 3 bytes"); } @@ -25,7 +26,7 @@ public StructuredField3270DS(byte[] structuredFieldData) throws NetworkException ByteBuffer buffer = ByteBuffer.wrap(structuredFieldData, 3, structuredFieldData.length - 3); - inbound3270Message = NetworkThread.process3270Datastream(commandCode, buffer); + inbound3270Message = NetworkThread.process3270Datastream(commandCode, buffer, codePage); } public Inbound3270Message getInboundMessage() { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredFieldReadPartition.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredFieldReadPartition.java index bc261848c..497785d24 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredFieldReadPartition.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/StructuredFieldReadPartition.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/WriteControlCharacter.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/WriteControlCharacter.java index bbc10237d..2622031f7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/WriteControlCharacter.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/WriteControlCharacter.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.datastream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/package-info.java index 086d17ec1..1c311cadf 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/datastream/package-info.java @@ -1,7 +1,7 @@ /* - *Licensed Materials - Property of IBM + * Copyright contributors to the Galasa project * - *(c) Copyright IBM Corp. 2019. + * SPDX-License-Identifier: EPL-2.0 */ /** * zOS 3270 Terminal Manager - Internal 3270 Datastream classes diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270CheckAppearsOnce.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270CheckAppearsOnce.java index f8ddfc49f..b27b3b0a6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270CheckAppearsOnce.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270CheckAppearsOnce.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -33,6 +38,9 @@ public void allocateTerminal(IGherkinExecutable executable, Map t } Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Coordinator.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Coordinator.java index f52dbeeaf..377e7a998 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Coordinator.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Coordinator.java @@ -1,11 +1,17 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; -import java.util.HashMap; +import java.util.*; import dev.galasa.ManagerException; import dev.galasa.framework.spi.AbstractManager; import dev.galasa.framework.spi.IGherkinExecutable; import dev.galasa.framework.spi.IStatementOwner; +import dev.galasa.framework.spi.language.gherkin.GherkinMethod; import dev.galasa.framework.spi.language.gherkin.GherkinTest; import dev.galasa.zos3270.Zos3270ManagerException; import dev.galasa.zos3270.internal.Zos3270ManagerImpl; @@ -13,27 +19,31 @@ public class Gherkin3270Coordinator { + // The manager that this Coordinator is a facade of. private final Zos3270ManagerImpl manager; - private final GherkinTest test; - + // The gherkin test is essentially a feature. + private final GherkinTest feature; + + // This coordinator keeps a reference of the terminals using the id that the gherkin scenario uses, + // which is different to the underlying terminal id. + // This is a mapping of the gherkin terminal id key to the terminal itself. private final HashMap terminals = new HashMap<>(); private final HashMap terminalImageTags = new HashMap<>(); public Gherkin3270Coordinator(Zos3270ManagerImpl manager, GherkinTest gherkinTest) { this.manager = manager; - this.test = gherkinTest; + this.feature = gherkinTest; } public boolean registerStatements() throws ManagerException { //*** Do we have any statements we need to support - if (!manager.registerStatements(this.test, getStatementOwners())) { + if (!manager.registerStatements(this.feature, getStatementOwners())) { return false; } return true; } - public IStatementOwner[] getStatementOwners() { return new IStatementOwner[] { new Gherkin3270GivenTerminal(this, this.manager), @@ -48,8 +58,9 @@ public IStatementOwner[] getStatementOwners() { new Gherkin3270TypeInField(this, this.manager)}; } - protected Zos3270TerminalImpl getTerminal(String id) { - return this.terminals.get(id); + protected Zos3270TerminalImpl getTerminal(String id) throws Zos3270ManagerException { + Zos3270TerminalImpl terminal = this.terminals.get(id); + return terminal ; } protected void registerTerminal(String id, Zos3270TerminalImpl terminal, String imageTag) { @@ -59,10 +70,16 @@ protected void registerTerminal(String id, Zos3270TerminalImpl terminal, String public void provisionGenerate() throws Zos3270ManagerException { // Provision any terminals that are Given - for(IGherkinExecutable executable : this.test.getAllExecutables()) { - Object owner = executable.getOwner(); - if (owner instanceof Gherkin3270GivenTerminal) { - ((Gherkin3270GivenTerminal)owner).provision(executable); + List methods = this.feature.getMethods(); + for( GherkinMethod method : methods ) { + + List executables = method.getExecutables(); + for(IGherkinExecutable executable : executables) { + Object owner = executable.getOwner(); + + if (owner instanceof Gherkin3270GivenTerminal) { + ((Gherkin3270GivenTerminal)owner).provision(executable); + } } } } @@ -71,7 +88,6 @@ protected String getImageTagForTerminal(String id) { return this.terminalImageTags.get(id); } - public static String defaultTerminaId(String id) { return AbstractManager.defaultString(id, "A").toUpperCase(); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Credentials.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Credentials.java index 8588321ac..d8cf177ab 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Credentials.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Credentials.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -37,6 +42,9 @@ public void typeUsername(IGherkinExecutable executable, Map testV String credentialsId = AbstractManager.nulled(groups.get(0)); Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } @@ -64,6 +72,9 @@ public void typePassword(IGherkinExecutable executable, Map testV String credentialsId = AbstractManager.nulled(groups.get(0)); Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminal.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminal.java index 04c348117..77b692234 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminal.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminal.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -6,26 +11,35 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import dev.galasa.framework.spi.AbstractManager; import dev.galasa.framework.spi.IGherkinExecutable; import dev.galasa.framework.spi.IStatementOwner; import dev.galasa.framework.spi.language.gherkin.ExecutionMethod; import dev.galasa.framework.spi.language.gherkin.GherkinKeyword; import dev.galasa.zos3270.Zos3270ManagerException; +import dev.galasa.zos3270.common.screens.TerminalSize; import dev.galasa.zos3270.internal.Zos3270ManagerImpl; +import dev.galasa.zos3270.spi.NetworkException; import dev.galasa.zos3270.spi.Zos3270TerminalImpl; public class Gherkin3270GivenTerminal implements IStatementOwner { + public static final int DEFAULT_TERMINAL_ROWS = 24; + public static final int DEFAULT_TERMINAL_COLUMNS = 80; + + public static final String DEFAULT_TERMINAL_ROWS_STR = Integer.toString(DEFAULT_TERMINAL_ROWS); + public static final String DEFAULT_TERMINAL_COLUMNS_STR = Integer.toString(DEFAULT_TERMINAL_COLUMNS); + private final static Log logger = LogFactory.getLog(Gherkin3270GivenTerminal.class); private final Gherkin3270Coordinator gerkinCoordinator; private final Zos3270ManagerImpl manager; - + public Gherkin3270GivenTerminal(Gherkin3270Coordinator gerkinCoordinator, Zos3270ManagerImpl manager) { this.gerkinCoordinator = gerkinCoordinator; this.manager = manager; } - @ExecutionMethod(keyword = GherkinKeyword.GIVEN, regex = "a terminal( with id of (\\w+))?( tagged (\\w+))?") + @ExecutionMethod(keyword = GherkinKeyword.GIVEN, regex = "a terminal( with id of (\\w+))?( tagged (\\w+))?( with (\\d+) rows and (\\d+) columns)?") public void allocateTerminal(IGherkinExecutable executable, Map testVariables) throws Zos3270ManagerException { // Ensure we have a connected terminal List groups = executable.getRegexGroups(); @@ -35,21 +49,91 @@ public void allocateTerminal(IGherkinExecutable executable, Map t if (terminal == null) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' was not provisioned!"); } + if (!terminal.isConnected()) { - throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected to the host system"); + try { + terminal.connect(); + } catch (NetworkException ex ) { + throw new Zos3270ManagerException("Cannot connect terminal to host system.",ex); + } } } public void provision(IGherkinExecutable executable) throws Zos3270ManagerException { List groups = executable.getRegexGroups(); + + // Extract the parameters from the step in the scenario. String terminalId = Gherkin3270Coordinator.defaultTerminaId(groups.get(1)); String imageTag = Gherkin3270Coordinator.defaultImageTag(groups.get(3)); + String rowsStepParameter = groups.get(5); + String columnsStepParameter = groups.get(6); + + // Log what we have collected. + { + StringBuffer msg = new StringBuffer(); + msg.append("Provisioning a terminal:"); + msg.append(" id="); + msg.append(terminalId); + msg.append(" imageTag="); + msg.append(imageTag); + msg.append(" rows="); + msg.append(rowsStepParameter); + msg.append(" columns="); + msg.append(columnsStepParameter); + logger.info(msg.toString()); + } Zos3270TerminalImpl newTerminal = this.gerkinCoordinator.getTerminal(terminalId); if (newTerminal == null) { - newTerminal = this.manager.generateTerminal(imageTag, true, 80, 24, 0, 0); + TerminalSize terminalSize = getPreferredTerminalSize(rowsStepParameter , columnsStepParameter); + TerminalSize alternateSize = new TerminalSize(0, 0); + + newTerminal = this.manager.generateTerminal(imageTag, true, terminalSize, alternateSize); this.gerkinCoordinator.registerTerminal(terminalId, newTerminal, imageTag); logger.info("zOS 3270 Terminal id '" + terminalId + "' as been provisioned for image tag '" + imageTag + "'"); - } + } + } + + protected TerminalSize getPreferredTerminalSize(String rowsStepParameter, String rowsColumnParameter) throws Zos3270ManagerException { + int columns ; + int rows ; + rows = getNumericCPSProperty("zos3270.gherkin.terminal.rows",DEFAULT_TERMINAL_ROWS,rowsStepParameter); + columns = getNumericCPSProperty("zos3270.gherkin.terminal.columns",DEFAULT_TERMINAL_COLUMNS,rowsColumnParameter); + logger.info("Preferred terminal size is "+Integer.toString(rows)+" x "+Integer.toString(columns)); + return new TerminalSize(columns, rows); + } + + private int getNumericCPSProperty(String propertyName, int defaultConstantValue , String stepDefParameterValue) throws Zos3270ManagerException { + String valueStr ; + int cpsPropValue ; + String notANumberMsg ; + + if (stepDefParameterValue==null || stepDefParameterValue.trim().equals("")) { + // The value wasn't specified in the stepdef, so get it from the CPS property. + valueStr = this.manager.getCpsProperty(propertyName); + notANumberMsg = "Error: CPS property '"+propertyName+"' does not contain a number. Current value is "+valueStr; + } else { + // The value was specified in the stepdef parameter, so use that in preference to the CPS or the default value. + valueStr = stepDefParameterValue ; + notANumberMsg = "Error: value from gherkin statement does not contain a number. Current value is "+valueStr; + } + + if (valueStr == null || valueStr.trim().isBlank()) { + // The property is not there, or it's blank. So use the default value. + cpsPropValue = defaultConstantValue ; + } else { + try { + cpsPropValue = Integer.parseInt(valueStr); + } catch(NumberFormatException ex) { + logger.error(notANumberMsg,ex); + throw new Zos3270ManagerException(notANumberMsg); + } + } + return cpsPropValue; } + + public static String defaultRows(String rows) { + return AbstractManager.defaultString(rows,DEFAULT_TERMINAL_ROWS_STR); + } + } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270MoveCursor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270MoveCursor.java index 4304f41dc..9ff65b5ab 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270MoveCursor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270MoveCursor.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -34,6 +39,9 @@ public void allocateTerminal(IGherkinExecutable executable, Map t Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressBasicKeys.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressBasicKeys.java index 60bf6f246..def0590d7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressBasicKeys.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressBasicKeys.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -22,7 +27,7 @@ public Gherkin3270PressBasicKeys(Gherkin3270Coordinator gerkinCoordinator, Zos32 this.gerkinCoordinator = gerkinCoordinator; } - @ExecutionMethod(keyword = GherkinKeyword.AND, regex = "press terminal( \\w+)? key (TAB|ENTER|CLEAR)") + @ExecutionMethod(keyword = GherkinKeyword.AND, regex = "press terminal( \\w+)? key (TAB|BACKTAB|ENTER|CLEAR)") public void pressBasicKey(IGherkinExecutable executable, Map testVariables) throws Zos3270ManagerException, Zos3270Exception, TextNotFoundException, TerminalInterruptedException { List groups = executable.getRegexGroups(); @@ -30,6 +35,9 @@ public void pressBasicKey(IGherkinExecutable executable, Map test String key = groups.get(1); Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } @@ -38,6 +46,9 @@ public void pressBasicKey(IGherkinExecutable executable, Map test case "TAB": terminal.tab(); break; + case "BACKTAB": + terminal.backTab(); + break; case "ENTER": terminal.enter(); break; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressPfKeys.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressPfKeys.java index 60450f285..1e5440938 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressPfKeys.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270PressPfKeys.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -30,6 +35,9 @@ public void pressPfKey(IGherkinExecutable executable, Map testVar String key = groups.get(1); Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Type.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Type.java index 9a261045c..da92a42f6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Type.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270Type.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -27,12 +32,15 @@ public void allocateTerminal(IGherkinExecutable executable, Map t List groups = executable.getRegexGroups(); String terminalId = Gherkin3270Coordinator.defaultTerminaId(groups.get(1)); - String text = groups.get(0); + String text = groups.get(0); if (text.isEmpty()) { return; } Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270TypeInField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270TypeInField.java index 13b0a316e..c89408268 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270TypeInField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270TypeInField.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -37,6 +42,9 @@ public void allocateTerminal(IGherkinExecutable executable, Map t } Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitKeyboard.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitKeyboard.java index 55fc9600d..1ac70cd70 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitKeyboard.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitKeyboard.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -29,6 +34,9 @@ public void allocateTerminal(IGherkinExecutable executable, Map t String terminalId = Gherkin3270Coordinator.defaultTerminaId(groups.get(0)); Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitTextField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitTextField.java index 19ee016e7..94a3159bf 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitTextField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270WaitTextField.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.gherkin; import java.util.List; @@ -33,6 +38,9 @@ public void allocateTerminal(IGherkinExecutable executable, Map t } Zos3270TerminalImpl terminal = this.gerkinCoordinator.getTerminal(terminalId); + if (terminal == null ) { + throw new Zos3270ManagerException("Unable to get terminal "+terminalId); + } if (!terminal.isConnected()) { throw new Zos3270ManagerException("Terminal '" + terminalId + "' is not connected"); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ApplyConfidentialTextFiltering.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ApplyConfidentialTextFiltering.java index 70d0bf9ed..cd810584b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ApplyConfidentialTextFiltering.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ApplyConfidentialTextFiltering.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.properties; @@ -23,7 +23,7 @@ * default value is true *

    * - * @author Michael Baylis + * * */ public class ApplyConfidentialTextFiltering extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ExtraBundles.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ExtraBundles.java index 8d4a42160..a58858da2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ExtraBundles.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/ExtraBundles.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zos3270.internal.properties; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LiveTerminalUrl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LiveTerminalUrl.java index c69fa1312..f7bbe063c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LiveTerminalUrl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LiveTerminalUrl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.properties; @@ -26,7 +26,7 @@ * to be done *

    * - * @author Michael Baylis + * * */ public class LiveTerminalUrl extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LogConsoleTerminals.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LogConsoleTerminals.java index 090744a54..059b39264 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LogConsoleTerminals.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/LogConsoleTerminals.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.properties; @@ -20,7 +20,7 @@ * default is TRUE *

    * - * @author Michael Baylis + * * */ public class LogConsoleTerminals extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/TerminalDeviceTypes.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/TerminalDeviceTypes.java index be8588b34..704e329f0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/TerminalDeviceTypes.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/TerminalDeviceTypes.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.properties; @@ -23,7 +23,7 @@ * default is IBM-DYNAMIC,IBM-3278-2 *

    * - * @author Michael Baylis + * * */ public class TerminalDeviceTypes extends CpsProperties { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/Zos3270PropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/Zos3270PropertiesSingleton.java index 4fe32ba08..9d9555299 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/Zos3270PropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/properties/Zos3270PropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/ScreenUpdateTextListener.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/ScreenUpdateTextListener.java index f946a4ef0..8ee740060 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/ScreenUpdateTextListener.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/ScreenUpdateTextListener.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.internal.terminal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/package-info.java index db125c0b6..3c9d3257c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/internal/terminal/package-info.java @@ -1,7 +1,7 @@ /* - *Licensed Materials - Property of IBM + * Copyright contributors to the Galasa project * - *(c) Copyright IBM Corp. 2019. + * SPDX-License-Identifier: EPL-2.0 */ /** * zOS 3270 Terminal Manager - Internal 3270 Terminal classes diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/package-info.java index 6f91ccf64..63dd27df6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/package-info.java @@ -1,7 +1,7 @@ - /* - *Licensed Materials - Property of IBM +/* + * Copyright contributors to the Galasa project * - *(c) Copyright IBM Corp. 2020. + * SPDX-License-Identifier: EPL-2.0 */ /** * zOS 3270 Terminal Manager - TPI diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferCarrageReturn.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferCarrageReturn.java index 77c1342df..3427e7d60 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferCarrageReturn.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferCarrageReturn.java @@ -1,10 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.nio.charset.Charset; + public class BufferCarrageReturn extends BufferChar { public BufferCarrageReturn() { @@ -27,7 +29,7 @@ public char getChar() { } @Override - public byte getFieldEbcdic() { + public byte getFieldEbcdic(Charset codePage) { return 0x0d; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferChar.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferChar.java index d9e16966c..37fc7783b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferChar.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferChar.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; @@ -9,8 +9,6 @@ public class BufferChar implements IBufferHolder { - private static final Charset ebcdic = Charset.forName("Cp037"); - private final char character; public BufferChar(char character) { @@ -39,14 +37,14 @@ public char getChar() { return this.character; } - public byte getFieldEbcdic() { + public byte getFieldEbcdic(Charset codePage) { if (this.character == 0) { return 0; } String value = new String(new char[] { this.character }); - return value.getBytes(ebcdic)[0]; + return value.getBytes(codePage)[0]; } } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferEndOfMedium.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferEndOfMedium.java index 60a3e4ed8..3a7400144 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferEndOfMedium.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferEndOfMedium.java @@ -1,10 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.nio.charset.Charset; + public class BufferEndOfMedium extends BufferChar { public BufferEndOfMedium() { @@ -27,7 +29,7 @@ public char getChar() { } @Override - public byte getFieldEbcdic() { + public byte getFieldEbcdic(Charset codePage) { return 0x19; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferFormFeed.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferFormFeed.java index 32e689b61..9109cad41 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferFormFeed.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferFormFeed.java @@ -1,10 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.nio.charset.Charset; + public class BufferFormFeed extends BufferChar { public BufferFormFeed() { @@ -27,7 +29,7 @@ public char getChar() { } @Override - public byte getFieldEbcdic() { + public byte getFieldEbcdic(Charset codePage) { return 0x0c; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferGraphicsEscape.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferGraphicsEscape.java index 80a8e6b76..7d593f05b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferGraphicsEscape.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferGraphicsEscape.java @@ -1,10 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.nio.charset.Charset; + import org.apache.commons.codec.binary.Hex; public class BufferGraphicsEscape extends BufferChar { @@ -35,7 +37,7 @@ public char getChar() { } @Override - public byte getFieldEbcdic() { + public byte getFieldEbcdic(Charset codePage) { return this.data; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferNewLine.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferNewLine.java index c194d0b88..1a03ccf05 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferNewLine.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferNewLine.java @@ -1,10 +1,12 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.nio.charset.Charset; + public class BufferNewLine extends BufferChar { public BufferNewLine() { @@ -27,7 +29,7 @@ public char getChar() { } @Override - public byte getFieldEbcdic() { + public byte getFieldEbcdic(Charset codePage) { return 0x15; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferStartOfField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferStartOfField.java index 283787cd8..8252f61f9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferStartOfField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/BufferStartOfField.java @@ -1,14 +1,22 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import dev.galasa.zos3270.internal.datastream.AttributeBackgroundColour; +import dev.galasa.zos3270.internal.datastream.AttributeCharacterSet; +import dev.galasa.zos3270.internal.datastream.AttributeExtendedHighlighting; +import dev.galasa.zos3270.internal.datastream.AttributeFieldOutlining; +import dev.galasa.zos3270.internal.datastream.AttributeFieldValidation; +import dev.galasa.zos3270.internal.datastream.AttributeForegroundColour; +import dev.galasa.zos3270.internal.datastream.AttributeTransparency; + /** * Create a Start of Field position, represents to SF order * - * @author Michael Baylis + * * */ public class BufferStartOfField implements IBufferHolder { @@ -20,6 +28,18 @@ public class BufferStartOfField implements IBufferHolder { private final boolean fieldSelectorPen; private boolean fieldModifed; + @SuppressWarnings("unused") + private AttributeFieldValidation attributeFieldValidation = null; + @SuppressWarnings("unused") + private AttributeFieldOutlining attributeFieldOutlining = null; + private AttributeExtendedHighlighting attributeExtendedHighlighting = null; + @SuppressWarnings("unused") + private AttributeCharacterSet attributeCharacterSet = null; + private AttributeForegroundColour attributeForegroundColour = null; + private AttributeBackgroundColour attributeBackgroundColour = null; + @SuppressWarnings("unused") + private AttributeTransparency attributeTransparency = null; + /** * Create the start of a field * @@ -34,6 +54,16 @@ public BufferStartOfField(int position, boolean fieldProtected, boolean fieldNum this.fieldSelectorPen = fieldSelectorPen; this.fieldModifed = fieldModifed; } + + public BufferStartOfField(int position, boolean fieldProtected, boolean fieldNumeric, boolean fieldDisplay, + boolean fieldIntenseDisplay, boolean fieldSelectorPen, boolean fieldModifed, + AttributeExtendedHighlighting extendedHighlighting, AttributeForegroundColour foregroundColour, AttributeBackgroundColour backgroundColour) { + this(position, fieldProtected, fieldNumeric, fieldDisplay, fieldIntenseDisplay, fieldSelectorPen, fieldModifed); + + this.attributeExtendedHighlighting = extendedHighlighting; + this.attributeForegroundColour = foregroundColour; + this.attributeBackgroundColour = backgroundColour; + } /* * (non-Javadoc) @@ -76,6 +106,39 @@ public void setFieldModified() { public void clearFieldModified() { this.fieldModifed = false; } + + public Highlight getHighlight() { + if (this.attributeExtendedHighlighting == null) { + return null; + } + return this.attributeExtendedHighlighting.getHighlight(); + } + + public Colour getForegroundColour() { + if (this.attributeForegroundColour == null) { + return null; + } + return this.attributeForegroundColour.getColour(); + } + + public Colour getBackgroundColour() { + if (this.attributeBackgroundColour == null) { + return null; + } + return this.attributeBackgroundColour.getColour(); + } + + public AttributeExtendedHighlighting getAttributeExtendedHighlighting() { + return this.attributeExtendedHighlighting; + } + + public AttributeForegroundColour getAttributeForegroundColour() { + return this.attributeForegroundColour; + } + + public AttributeBackgroundColour getAttributeBackgroundColour() { + return this.attributeBackgroundColour; + } @Override public String getStringWithoutNulls() { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Colour.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Colour.java new file mode 100644 index 000000000..2b162bca5 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Colour.java @@ -0,0 +1,45 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.spi; + +public enum Colour { + + DEFAULT ((byte)0x0, 'd'), + BLUE ((byte)0xf1, 'b'), + RED ((byte)0xf2, 'r'), + PINK ((byte)0xf3, 'p'), + GREEN ((byte)0xf4, 'g'), + TURQUOISE((byte)0xf5, 't'), + YELLOW ((byte)0xf6, 'y'), + NEUTRAL ((byte)0xf7, 'n'); + + private final byte code; + private final char letter; + + Colour(byte code, char letter) { + this.code = code; + this.letter = letter; + } + + public byte getCode() { + return this.code; + } + + public char getLetter() { + return this.letter; + } + + public static Colour getColour(byte code) throws DatastreamException { + for(Colour colour : Colour.values()) { + if (colour.code == code) { + return colour; + } + } + + throw new DatastreamException("Unrecognised colour code - " + code); + } + +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/DatastreamException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/DatastreamException.java index 0d8f51aa4..abc88fed9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/DatastreamException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/DatastreamException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Field.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Field.java index 72d283516..83836a83d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Field.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Field.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; @@ -22,6 +22,10 @@ public class Field { private final boolean fieldIntenseDisplay; private final boolean fieldSelectorPen; private final boolean fieldModifed; + + private final Colour foregroundColour; + private final Colour backgroundColour; + private final Highlight highlight; protected Field(int start, BufferStartOfField sf) { this.start = start; @@ -32,6 +36,10 @@ protected Field(int start, BufferStartOfField sf) { this.fieldSelectorPen = sf.isSelectorPen(); this.fieldModifed = sf.isFieldModifed(); this.text = new char[0]; + + this.foregroundColour = sf.getForegroundColour(); + this.backgroundColour = sf.getBackgroundColour(); + this.highlight = sf.getHighlight(); } public Field() { @@ -43,6 +51,9 @@ public Field() { this.fieldSelectorPen = false; this.fieldModifed = false; this.text = new char[0]; + this.foregroundColour = null; + this.backgroundColour = null; + this.highlight = null; } protected void appendChar(char newChar) { @@ -122,6 +133,18 @@ public boolean isUnformatted() { return (this.start == -1); } + public Colour getForegroundColour() { + return foregroundColour; + } + + public Colour getBackgroundColour() { + return backgroundColour; + } + + public Highlight getHighlight() { + return highlight; + } + public String getFieldWithoutNulls() { StringBuilder sb = new StringBuilder(); for (char c : text) { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Highlight.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Highlight.java new file mode 100644 index 000000000..c0b6f4df6 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Highlight.java @@ -0,0 +1,41 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.spi; + +public enum Highlight { + DEFAULT((byte)0x00, 'd'), + NORMAL((byte)0xf0, 'n'), + BLINK((byte)0xf1, 'b'), + REVERSE((byte)0xf2, 'r'), + UNDERSCORE((byte)0xf4, 'u'); + + private final byte code; + private final char letter; + + Highlight(byte code, char letter) { + this.code = code; + this.letter = letter; + } + + public byte getCode() { + return this.code; + } + + public char getLetter() { + return this.letter; + } + + public static Highlight getHighlight(byte code) throws DatastreamException { + for(Highlight highlight : Highlight.values()) { + if (highlight.code == code) { + return highlight; + } + } + + throw new DatastreamException("Unrecognised highlight code - " + code); + } + +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IBufferHolder.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IBufferHolder.java index ff42ac572..dc0879012 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IBufferHolder.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IBufferHolder.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IZos3270ManagerSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IZos3270ManagerSpi.java index 0aefe54ab..ce725469b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IZos3270ManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/IZos3270ManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/NetworkException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/NetworkException.java index 971d35137..3f718592c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/NetworkException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/NetworkException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Screen.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Screen.java index 8527828ff..8d29accfc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Screen.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Screen.java @@ -1,12 +1,13 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -27,6 +28,7 @@ import dev.galasa.zos3270.IDatastreamListener.DatastreamDirection; import dev.galasa.zos3270.IScreenUpdateListener; import dev.galasa.zos3270.IScreenUpdateListener.Direction; +import dev.galasa.zos3270.common.screens.TerminalSize; import dev.galasa.zos3270.KeyboardLockedException; import dev.galasa.zos3270.TerminalInterruptedException; import dev.galasa.zos3270.TextNotFoundException; @@ -37,6 +39,9 @@ import dev.galasa.zos3270.internal.datastream.AbstractCommandCode; import dev.galasa.zos3270.internal.datastream.AbstractOrder; import dev.galasa.zos3270.internal.datastream.AbstractQueryReply; +import dev.galasa.zos3270.internal.datastream.AttributeBackgroundColour; +import dev.galasa.zos3270.internal.datastream.AttributeExtendedHighlighting; +import dev.galasa.zos3270.internal.datastream.AttributeForegroundColour; import dev.galasa.zos3270.internal.datastream.BufferAddress; import dev.galasa.zos3270.internal.datastream.CommandEraseWrite; import dev.galasa.zos3270.internal.datastream.CommandEraseWriteAlternate; @@ -44,13 +49,13 @@ import dev.galasa.zos3270.internal.datastream.CommandReadModified; import dev.galasa.zos3270.internal.datastream.CommandReadModifiedAll; import dev.galasa.zos3270.internal.datastream.CommandWriteStructured; -import dev.galasa.zos3270.internal.datastream.IAttribute; import dev.galasa.zos3270.internal.datastream.OrderCarrageReturn; import dev.galasa.zos3270.internal.datastream.OrderEndOfMedium; import dev.galasa.zos3270.internal.datastream.OrderEraseUnprotectedToAddress; import dev.galasa.zos3270.internal.datastream.OrderFormFeed; import dev.galasa.zos3270.internal.datastream.OrderGraphicsEscape; import dev.galasa.zos3270.internal.datastream.OrderInsertCursor; +import dev.galasa.zos3270.internal.datastream.OrderModifyField; import dev.galasa.zos3270.internal.datastream.OrderNewLine; import dev.galasa.zos3270.internal.datastream.OrderRepeatToAddress; import dev.galasa.zos3270.internal.datastream.OrderSetAttribute; @@ -74,12 +79,14 @@ /** * Screen representation of the 3270 terminal * - * @author Michael Baylis + * * */ public class Screen { private static final String CANT_FIND_TEXT = "Unable to find a field containing '"; + + private final Charset codePage; private final Log logger = LogFactory.getLog(getClass()); @@ -108,16 +115,34 @@ public class Screen { private final LinkedList updateListeners = new LinkedList<>(); private AttentionIdentification lastAid = AttentionIdentification.NONE; + + private boolean detectedSetAttribute = false; + /** + * @deprecated use the {@link #Screen(TerminalSize primarySize, TerminalSize alternateSize, Network network, Charset codePage)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) public Screen() throws TerminalInterruptedException { this(80, 24, null); } + /** + * @deprecated use the {@link #Screen(TerminalSize primarySize, TerminalSize alternateSize, Network network, Charset codePage)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) public Screen(int columns, int rows, Network network) throws TerminalInterruptedException { this(columns, rows, 0, 0, network); } + /** + * @deprecated use the {@link #Screen(TerminalSize primarySize, TerminalSize alternateSize, Network network, Charset codePage)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) public Screen(int columns, int rows, int alternateColumns, int alternateRows, Network network) throws TerminalInterruptedException { + this.codePage = Charset.forName("Cp037"); this.network = network; this.primaryColumns = columns; this.primaryRows = rows; @@ -136,6 +161,30 @@ public Screen(int columns, int rows, int alternateColumns, int alternateRows, Ne lockKeyboard(); } + + public Screen(TerminalSize primarySize, TerminalSize alternateSize, Network network, Charset codePage) throws TerminalInterruptedException { + this.codePage = codePage; + this.network = network; + this.primaryColumns = primarySize.getColumns(); + this.primaryRows = primarySize.getRows(); + this.usingAlternate = false; + + int alternateRows = alternateSize.getRows(); + int alternateColumns = alternateSize.getColumns(); + if (alternateRows < 1 || alternateColumns < 1) { + this.hasAlternate = false; + this.alternateColumns = 0; + this.alternateRows = 0; + } else { + this.hasAlternate = true; + this.alternateColumns = alternateColumns; + this.alternateRows = alternateRows; + } + + erase(); + lockKeyboard(); + } + public synchronized void lockKeyboard() throws TerminalInterruptedException { if (!keyboardLockSet) { logger.trace("Locking keyboard"); @@ -217,10 +266,10 @@ private synchronized void processReadBuffer() throws DatastreamException { } else if (bh instanceof BufferGraphicsEscape) { BufferGraphicsEscape bc = (BufferGraphicsEscape) bh; outboundBuffer.write(OrderGraphicsEscape.ID); - outboundBuffer.write(bc.getFieldEbcdic()); + outboundBuffer.write(bc.getFieldEbcdic(this.codePage)); } else if (bh instanceof BufferChar) { BufferChar bc = (BufferChar) bh; - outboundBuffer.write(bc.getFieldEbcdic()); + outboundBuffer.write(bc.getFieldEbcdic(this.codePage)); } else if (bh instanceof BufferStartOfField) { BufferStartOfField sf = (BufferStartOfField) bh; OrderStartField osf = new OrderStartField(sf.isProtected(), sf.isNumeric(), sf.isDisplay(), sf.isIntenseDisplay(), sf.isSelectorPen(), sf.isFieldModifed()); @@ -318,13 +367,13 @@ private void readModifiedBuffer(ByteArrayOutputStream outboundBuffer) throws IOE BufferGraphicsEscape bc = (BufferGraphicsEscape) bh; if (fieldModified) { outboundBuffer.write(OrderGraphicsEscape.ID); - byte value = bc.getFieldEbcdic(); + byte value = bc.getFieldEbcdic(this.codePage); outboundBuffer.write(value); } } else if (bh instanceof BufferChar) { BufferChar bc = (BufferChar) bh; if (fieldModified) { - byte value = bc.getFieldEbcdic(); + byte value = bc.getFieldEbcdic(this.codePage); if (value != 0) { outboundBuffer.write(value); } @@ -358,15 +407,15 @@ private synchronized void processStructuredFields(List structur private synchronized void processReadPartition(StructuredFieldReadPartition readPartition) throws DatastreamException { switch (readPartition.getType()) { - case QUERY: - processReadPartitionQuery(); - return; - case QUERY_LIST: - processReadPartitionQueryList(readPartition); - return; - default: - throw new DatastreamException( - "Unsupported Read Partition Type - " + readPartition.getType().toString()); + case QUERY: + processReadPartitionQuery(); + return; + case QUERY_LIST: + processReadPartitionQueryList(readPartition); + return; + default: + throw new DatastreamException( + "Unsupported Read Partition Type - " + readPartition.getType().toString()); } } @@ -380,19 +429,19 @@ private synchronized void processReadPartitionQuery() throws DatastreamException private synchronized void processReadPartitionQueryList(StructuredFieldReadPartition readPartition) throws DatastreamException { switch (readPartition.getRequestType()) { - case StructuredFieldReadPartition.REQTYP_LIST: - List supportedReplies = getAllSupportedReplies(); - ArrayList replies = prepareQueryListResponse(supportedReplies, readPartition.getQcodes()); + case StructuredFieldReadPartition.REQTYP_LIST: + List supportedReplies = getAllSupportedReplies(); + ArrayList replies = prepareQueryListResponse(supportedReplies, readPartition.getQcodes()); - sendQueryReplies(new QueryReplySummary(supportedReplies), replies); - return; - case StructuredFieldReadPartition.REQTYP_ALL: - case StructuredFieldReadPartition.REQTYP_EQUIVALENT: - processReadPartitionQuery(); - return; - default: - throw new DatastreamException( - "Unsupported Read Partition Request Type code = " + readPartition.getRequestType()); + sendQueryReplies(new QueryReplySummary(supportedReplies), replies); + return; + case StructuredFieldReadPartition.REQTYP_ALL: + case StructuredFieldReadPartition.REQTYP_EQUIVALENT: + processReadPartitionQuery(); + return; + default: + throw new DatastreamException( + "Unsupported Read Partition Request Type code = " + readPartition.getRequestType()); } } @@ -462,6 +511,8 @@ public synchronized void processOrders(List orders, WriteControlC processSFE((OrderStartFieldExtended) order); } else if (order instanceof OrderSetAttribute) { processSA((OrderSetAttribute) order); + } else if (order instanceof OrderModifyField) { + processMF((OrderModifyField) order); } else if (order instanceof OrderInsertCursor) { this.screenCursor = this.workingCursor; } else if (order instanceof OrderEraseUnprotectedToAddress) { @@ -596,16 +647,31 @@ private void processSF(OrderStartField order) { } private void processSFE(OrderStartFieldExtended order) { - List attributes = order.getAttributes(); + OrderStartField sf = order.getOrderStartField(); + BufferStartOfField bsf = null; + + if (sf != null) { + bsf = new BufferStartOfField(this.workingCursor, sf.isFieldProtected(), sf.isFieldNumeric(), + sf.isFieldDisplay(), sf.isFieldIntenseDisplay(), sf.isFieldSelectorPen(), sf.isFieldModifed(), + order.getHighlight(), order.getForegroundColour(), order.getBackgroundColor()); + } + + if (bsf == null) { + bsf = new BufferStartOfField(this.workingCursor, false, false, true, false, false, false); + } + + this.buffer[this.workingCursor] = bsf; + incrementWorkingCursor(); + } + private void processMF(OrderModifyField order) { + OrderStartField sf = order.getOrderStartField(); BufferStartOfField bsf = null; - for (IAttribute attr : attributes) { - if (attr instanceof OrderStartField) { - OrderStartField sf = (OrderStartField) attr; - bsf = new BufferStartOfField(this.workingCursor, sf.isFieldProtected(), sf.isFieldNumeric(), - sf.isFieldDisplay(), sf.isFieldIntenseDisplay(), sf.isFieldSelectorPen(), sf.isFieldModifed()); - } - // TODO add processing for character attributes + + if (sf != null) { + bsf = new BufferStartOfField(this.workingCursor, sf.isFieldProtected(), sf.isFieldNumeric(), + sf.isFieldDisplay(), sf.isFieldIntenseDisplay(), sf.isFieldSelectorPen(), sf.isFieldModifed(), + order.getHighlight(), order.getForegroundColour(), order.getBackgroundColor()); } if (bsf == null) { @@ -685,7 +751,11 @@ private void processEUA(OrderEraseUnprotectedToAddress order) { private void processSA(OrderSetAttribute order) { - // TODO add processing for character attributes + if (!detectedSetAttribute) { + detectedSetAttribute = true; + + logger.warn("SetAttribute order has been received, please send a trace to the Galasa team"); + } } private void processNewLine() { @@ -783,10 +853,224 @@ public String printScreenTextWithCursor() { return screenSB.toString(); } - private String reportOperator() { + public String printExtendedScreen(boolean printCursor, boolean printColour, boolean printHighlight, boolean printIntensity, boolean printProtected, boolean printNumeric, boolean printModified) throws Zos3270Exception { int cursorRow = screenCursor / columns; int cursorCol = screenCursor % columns; + StringBuilder screenBuffer = new StringBuilder(); + StringBuilder intensityLine = new StringBuilder(); + StringBuilder protectedLine = new StringBuilder(); + StringBuilder numericLine = new StringBuilder(); + StringBuilder modifiedLine = new StringBuilder(); + StringBuilder foregroundLine = new StringBuilder(); + StringBuilder backgroundLine = new StringBuilder(); + StringBuilder highlightLine = new StringBuilder(); + + int row = 0; + int col = 0; + + // *** Check to see if the screen is wrapped or unformatted + BufferStartOfField currentBufferStartOfField = new BufferStartOfField(0, false, false, true, false, false, false); + if (!(this.buffer[0] instanceof BufferStartOfField)) { + for (int i = this.buffer.length - 1; i >= 0; i--) { + IBufferHolder bh = this.buffer[i]; + if (bh instanceof BufferStartOfField) { + currentBufferStartOfField = (BufferStartOfField) bh; + break; + } + } + } // no need for else as it will be picked up in the loop + + for (int i = 0; i < this.buffer.length; i++) { + // print row header + if (col == 0) { + screenBuffer.append("="); + screenBuffer.append(String.format("%03d", row+1)); + screenBuffer.append("|"); + } + + // Print actual text + IBufferHolder bufferHolder = this.buffer[i]; + if (bufferHolder == null) { + screenBuffer.append(" "); + } else { + screenBuffer.append(bufferHolder.getStringWithoutNulls()); + + if (bufferHolder instanceof BufferStartOfField) { + currentBufferStartOfField = (BufferStartOfField)bufferHolder; + } + } + + + if (bufferHolder == null || bufferHolder == currentBufferStartOfField) { + foregroundLine.append(" "); + backgroundLine.append(" "); + highlightLine.append(" "); + intensityLine.append(" "); + protectedLine.append(" "); + numericLine.append(" "); + modifiedLine.append(" "); + } else { + AttributeForegroundColour foregroundColour = currentBufferStartOfField.getAttributeForegroundColour(); + if (foregroundColour == null) { + foregroundLine.append(" "); + } else { + foregroundLine.append(foregroundColour.getColour().getLetter()); + } + + AttributeBackgroundColour backgroundColour = currentBufferStartOfField.getAttributeBackgroundColour(); + if (backgroundColour == null) { + backgroundLine.append(" "); + } else { + backgroundLine.append(backgroundColour.getColour().getLetter()); + } + + + + + + // Calculate Highlight + AttributeExtendedHighlighting extendedHighlighting = currentBufferStartOfField.getAttributeExtendedHighlighting(); + if (extendedHighlighting == null) { + highlightLine.append(" "); + } else { + switch(extendedHighlighting.getHighlight()) { + case BLINK: + highlightLine.append("b"); + break; + case NORMAL: + highlightLine.append("n"); + break; + case REVERSE: + highlightLine.append("r"); + break; + case UNDERSCORE: + highlightLine.append("u"); + break; + case DEFAULT: + highlightLine.append("d"); + break; + default: + highlightLine.append("?"); + break; + } + } + + // Calculate intensity + if (currentBufferStartOfField.isIntenseDisplay()) { + intensityLine.append("i"); + } else { + intensityLine.append(" "); + } + + // Calculate Protected + if (currentBufferStartOfField.isProtected()) { + protectedLine.append("p"); + } else { + protectedLine.append("u"); + } + + // Calculate Numeric + if (currentBufferStartOfField.isNumeric()) { + numericLine.append("n"); + } else { + numericLine.append(" "); + } + + // Calculate Modified + if (currentBufferStartOfField.isFieldModifed()) { + modifiedLine.append("m"); + } else { + modifiedLine.append(" "); + } + } + + // NOT doing selectable as very unlikely to be used + + + col++; + if (col >= columns) { + screenBuffer.append("|\n"); + + // Check this is the cursor row + if (printCursor) { + if (row == cursorRow) { + screenBuffer.append("^ |"); + for (int j = 0; j < cursorCol; j++) { + screenBuffer.append(" "); + } + screenBuffer.append("^"); + screenBuffer.append('\n'); + } + } + // if requested, print colour + if (printColour) { + screenBuffer.append("f |"); + screenBuffer.append(foregroundLine.toString()); + screenBuffer.append('\n'); + screenBuffer.append("b |"); + screenBuffer.append(backgroundLine.toString()); + screenBuffer.append('\n'); + } + // if requested, print intensity + if (printIntensity) { + screenBuffer.append("i |"); + screenBuffer.append(intensityLine.toString()); + screenBuffer.append('\n'); + } + // if requested, print highlight + if (printHighlight) { + screenBuffer.append("h |"); + screenBuffer.append(highlightLine.toString()); + screenBuffer.append('\n'); + } + // if requested, print protected + if (printProtected) { + screenBuffer.append("p |"); + screenBuffer.append(protectedLine.toString()); + screenBuffer.append('\n'); + } + // if requested, print numeric + if (printNumeric) { + screenBuffer.append("n |"); + screenBuffer.append(numericLine.toString()); + screenBuffer.append('\n'); + } + // if requested, print modifles + if (printModified) { + screenBuffer.append("m |"); + screenBuffer.append(modifiedLine.toString()); + screenBuffer.append('\n'); + } + + + // Reset for next row + col = 0; + row++; + + // Reset the report lines + intensityLine = new StringBuilder(); + protectedLine = new StringBuilder(); + numericLine = new StringBuilder(); + modifiedLine = new StringBuilder(); + foregroundLine = new StringBuilder(); + backgroundLine = new StringBuilder(); + highlightLine = new StringBuilder(); + } + } + + screenBuffer.append("! | "); + screenBuffer.append(reportOperator()); + screenBuffer.append("\n"); + + return screenBuffer.toString(); + } + + + private String reportOperator() { + int cursorRow = (screenCursor / columns) + 1; + int cursorCol = screenCursor % columns; + StringBuilder operator = new StringBuilder(); if (network.isConnected()) { @@ -944,8 +1228,8 @@ public int waitForTextInField(String text, long maxWait) throws TerminalInterrup public int waitForTextInField(String[] ok, String[] error, long timeoutInMilliseconds) throws TerminalInterruptedException, TextNotFoundException, ErrorTextFoundException, Zos3270Exception { int foundIndex = -1; - try { - foundIndex = ScreenUpdateTextListener.waitForText(this, ok, error, timeoutInMilliseconds); + try { + foundIndex = ScreenUpdateTextListener.waitForText(this, ok, error, timeoutInMilliseconds); if (foundIndex < 0) { if (ok != null && ok.length == 1 && error == null) { throw new TextNotFoundException(CANT_FIND_TEXT + ok[0] + "'"); @@ -1658,8 +1942,39 @@ public synchronized boolean isClearScreen() { return false; } } - + return true; } + public Colour getColourAtPosition(int pos) { + + Field[] fields = calculateFields(); + Field currentField = fields[0]; + for (int i = 1; i < fields.length; i++) { + if (fields[i].getStart() > pos) { + break; + } + currentField = fields[i]; + } + + return currentField.getForegroundColour(); + } + + public Highlight getHighlightAtPosition(int pos) { + Field[] fields = calculateFields(); + Field currentField = fields[0]; + for (int i = 1; i < fields.length; i++) { + if (fields[i].getStart() > pos) { + break; + } + currentField = fields[i]; + } + + return currentField.getHighlight(); + } + + public Charset getCodePage() { + return codePage; + } + } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Terminal.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Terminal.java index ec9c8c18a..d6c5ff121 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Terminal.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Terminal.java @@ -1,8 +1,11 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.nio.charset.Charset; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.List; @@ -24,6 +27,7 @@ import dev.galasa.zos3270.TextNotFoundException; import dev.galasa.zos3270.TimeoutException; import dev.galasa.zos3270.Zos3270Exception; +import dev.galasa.zos3270.common.screens.TerminalSize; import dev.galasa.zos3270.internal.comms.Network; import dev.galasa.zos3270.internal.comms.NetworkThread; @@ -44,20 +48,43 @@ public class Terminal implements ITerminal { private List deviceTypes; + /** + * @deprecated use the {@link #Terminal(String id, String host, int port, boolean ssl, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScan, Charset codePage)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) public Terminal(String id, String host, int port, ITextScannerManagerSpi textScan) throws TerminalInterruptedException { this(id, host, port, false, 80, 24, 0, 0, textScan); } + /** + * @deprecated use the {@link #Terminal(String id, String host, int port, boolean ssl, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScan, Charset codePage)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) public Terminal(String id, String host, int port, boolean ssl, ITextScannerManagerSpi textScan) throws TerminalInterruptedException { this(id, host, port, ssl, 80, 24, 0, 0, textScan); } + /** + * @deprecated use the {@link #Terminal(String id, String host, int port, boolean ssl, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScan, Charset codePage)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) public Terminal(String id, String host, int port, boolean ssl, int primaryColumns, int primaryRows, int alternateColumns, int alternateRows, ITextScannerManagerSpi textScan) throws TerminalInterruptedException { network = new Network(host, port, ssl, id); screen = new Screen(primaryColumns, primaryRows, alternateColumns, alternateRows, this.network); this.id = id; this.textScan = textScan; } + + + public Terminal(String id, String host, int port, boolean ssl, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScan, Charset codePage) throws TerminalInterruptedException { + network = new Network(host, port, ssl, id); + screen = new Screen(primarySize, alternateSize, this.network, codePage); + this.id = id; + this.textScan = textScan; + } public void setAutoReconnect(boolean newAutoReconnect) { this.autoReconnect = newAutoReconnect; @@ -531,6 +558,12 @@ public ITerminal reportScreenWithCursor() { return this; } + @Override + public ITerminal reportExtendedScreen(boolean printCursor, boolean printColour, boolean printHighlight, boolean printIntensity, boolean printProtected, boolean printNumeric, boolean printModified) throws Zos3270Exception { + logger.info("\n" + screen.printExtendedScreen(printCursor, printColour, printHighlight, printIntensity, printProtected, printNumeric, printModified)); + return this; + } + @Override public String getId() { return this.id; @@ -662,5 +695,40 @@ private void checkCursorPosition(int row, int col, int length) throws Zos3270Exc } + @Override + public Colour retrieveColourAtCursor() { + int pos = screen.getCursor(); + return screen.getColourAtPosition(pos); + } + + @Override + public Colour retrieveColourAtPosition(int row, int col) throws Zos3270Exception { + checkCursorPosition(row, col, 0 /* not worried about length */); + + row--; + col--; + int pos = (row * screen.getNoOfColumns()) + col; + + return screen.getColourAtPosition(pos); + } + + @Override + public Highlight retrieveHighlightAtCursor() { + int pos = screen.getCursor(); + return screen.getHighlightAtPosition(pos); + } + + @Override + public Highlight retrieveHighlightAtPosition(int row, int col) throws Zos3270Exception { + checkCursorPosition(row, col, 0 /* not worried about length */); + + row--; + col--; + + int pos = (row * screen.getNoOfColumns()) + col; + + return screen.getHighlightAtPosition(pos); + } + } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Zos3270TerminalImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Zos3270TerminalImpl.java index 2718a0797..d7d9b32e7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Zos3270TerminalImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/Zos3270TerminalImpl.java @@ -1,8 +1,11 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zos3270.spi; +import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; @@ -19,8 +22,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -30,8 +31,10 @@ import dev.galasa.SetContentType; import dev.galasa.framework.spi.IConfidentialTextService; import dev.galasa.framework.spi.IFramework; +import dev.galasa.framework.spi.utils.GalasaGson; import dev.galasa.textscan.spi.ITextScannerManagerSpi; import dev.galasa.zos.IZosImage; +import dev.galasa.zos.ZosManagerException; import dev.galasa.zos3270.AttentionIdentification; import dev.galasa.zos3270.IScreenUpdateListener; import dev.galasa.zos3270.TerminalInterruptedException; @@ -47,34 +50,47 @@ public class Zos3270TerminalImpl extends Terminal implements IScreenUpdateListener { - private Log logger = LogFactory.getLog(getClass()); + private Log logger = LogFactory.getLog(getClass()); - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); + private final GalasaGson gson = new GalasaGson(); - private final String terminalId; - private int updateId; - private final String runId; + private final String terminalId; + private int updateId; + private final String runId; private final IConfidentialTextService cts; - private final boolean applyCtf; + private final boolean applyCtf; private final ArrayList cachedImages = new ArrayList<>(); - private final Path terminalRasDirectory; - private int rasTerminalSequence; - private URL liveTerminalUrl; - private int liveTerminalSequence; - private boolean logConsoleTerminals; - private boolean autoConnect; - - public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, IZosImage image, ITextScannerManagerSpi textScanner) + private Path storedArtifactsRoot; + private final Path terminalRasDirectory; + private int rasTerminalSequence; + private URL liveTerminalUrl; + private int liveTerminalSequence; + private boolean logConsoleTerminals; + private boolean autoConnect; + + /** + * @deprecated use the {@link #Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, IZosImage image, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScanner)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) + public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, + IZosImage image, ITextScannerManagerSpi textScanner) throws Zos3270ManagerException, TerminalInterruptedException { this(id, host, port, tls, framework, autoConnect, image, 80, 24, 0, 0, textScanner); } - - - public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, IZosImage image, - int primaryColumns, int primaryRows, int alternateColumns, int alternateRows, ITextScannerManagerSpi textScanner) + + /** + * @deprecated use the {@link #Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, IZosImage image, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScanner)} + * constructor instead. + */ + @Deprecated(since = "0.28.0", forRemoval = true) + public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, + IZosImage image, + int primaryColumns, int primaryRows, int alternateColumns, int alternateRows, + ITextScannerManagerSpi textScanner) throws Zos3270ManagerException, TerminalInterruptedException { super(id, host, port, tls, primaryColumns, primaryRows, alternateColumns, alternateRows, textScanner); this.terminalId = id; @@ -86,9 +102,54 @@ public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFrame getScreen().registerScreenUpdateListener(this); - Path storedArtifactsRoot = framework.getResultArchiveStore().getStoredArtifactsRoot(); + storedArtifactsRoot = framework.getResultArchiveStore().getStoredArtifactsRoot(); terminalRasDirectory = storedArtifactsRoot.resolve("zos3270").resolve("terminals").resolve(this.terminalId); + URL propLiveTerminalUrl = LiveTerminalUrl.get(); + if (propLiveTerminalUrl == null) { + liveTerminalUrl = null; + } else { + try { + // *** Register the terminal to the UI which will own the terminal view + HttpURLConnection connection = (HttpURLConnection) propLiveTerminalUrl.openConnection(); + connection.setRequestMethod("HEAD"); + connection.addRequestProperty("zos3270-runid", this.runId); + connection.addRequestProperty("zos3270-terminalid", this.terminalId); + connection.setDoInput(true); + connection.setDoOutput(false); + connection.connect(); + if (connection.getResponseCode() != 200) { + logger.warn("Unable to activate live terminal due to " + connection.getResponseCode() + " - " + + connection.getResponseMessage()); + } else { + this.liveTerminalUrl = new URL( + propLiveTerminalUrl.toString() + "/" + this.runId + "/" + this.terminalId); + } + } catch (Exception e) { + throw new Zos3270ManagerException("Unable to create the live terminal directory", e); + } + } + + setDeviceTypes(TerminalDeviceTypes.get(image)); + + logConsoleTerminals = LogConsoleTerminals.get(); + } + + public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFramework framework, boolean autoConnect, + IZosImage image, TerminalSize primarySize, TerminalSize alternateSize, ITextScannerManagerSpi textScanner) + throws Zos3270ManagerException, TerminalInterruptedException, ZosManagerException { + super(id, host, port, tls, primarySize, alternateSize, textScanner, image.getCodePage()); + this.terminalId = id; + this.runId = framework.getTestRunName(); + this.autoConnect = autoConnect; + this.cts = framework.getConfidentialTextService(); + this.applyCtf = ApplyConfidentialTextFiltering.get(); + this.textScan = textScanner; + + getScreen().registerScreenUpdateListener(this); + + storedArtifactsRoot = framework.getResultArchiveStore().getStoredArtifactsRoot(); + terminalRasDirectory = storedArtifactsRoot.resolve("zos3270").resolve("terminals").resolve(this.terminalId); URL propLiveTerminalUrl = LiveTerminalUrl.get(); if (propLiveTerminalUrl == null) { liveTerminalUrl = null; @@ -113,7 +174,7 @@ public Zos3270TerminalImpl(String id, String host, int port, boolean tls, IFrame throw new Zos3270ManagerException("Unable to create the live terminal directory", e); } } - + setDeviceTypes(TerminalDeviceTypes.get(image)); logConsoleTerminals = LogConsoleTerminals.get(); @@ -154,6 +215,7 @@ public synchronized void screenUpdated(Direction direction, AttentionIdentificat terminalImage.getFields().addAll(buildTerminalFields(getScreen())); cachedImages.add(terminalImage); if (cachedImages.size() >= 10) { + writeRasOutput(); flushTerminalCache(); } @@ -162,16 +224,13 @@ public synchronized void screenUpdated(Direction direction, AttentionIdentificat liveTerminalSequence++; dev.galasa.zos3270.common.screens.Terminal liveTerminal = new dev.galasa.zos3270.common.screens.Terminal( this.terminalId, this.runId, liveTerminalSequence, terminalSize); - liveTerminal.getImages().add(terminalImage); + TerminalImage newTerminalImage = removeConfidentialTextFromTerminalImage(terminalImage); + liveTerminal.getImages().add(newTerminalImage); JsonObject intermediateJson = (JsonObject) gson.toJsonTree(liveTerminal); stripFalseBooleans(intermediateJson); String tempJson = gson.toJson(intermediateJson); - if (applyCtf) { - tempJson = cts.removeConfidentialText(tempJson); - } - HttpURLConnection connection = (HttpURLConnection) this.liveTerminalUrl.openConnection(); connection.setRequestMethod("PUT"); connection.addRequestProperty("Content-Type", "application/json"); @@ -205,45 +264,106 @@ public synchronized void screenUpdated(Direction direction, AttentionIdentificat } } - public synchronized void flushTerminalCache() { - if (cachedImages.isEmpty()) { + public synchronized void writeRasOutput() { + rasTerminalSequence++; + + try { + writeTerminalGzJson(); + } catch (Exception e) { + logger.error("Unable to write terminal cache to the RAS", e); + rasTerminalSequence--; return; } + } - rasTerminalSequence++; + /** + * This method creates JSON representations of the Terminal screens and writes them to the RAS + * @throws IOException + */ + private synchronized void writeTerminalGzJson() throws IOException { + if (this.cachedImages.isEmpty()) { + return; + } - try { - TerminalSize terminalSize = new TerminalSize(getScreen().getNoOfColumns(), getScreen().getNoOfRows()); // TODO - // sort - // out - // alt - // sizes - dev.galasa.zos3270.common.screens.Terminal rasTerminal = new dev.galasa.zos3270.common.screens.Terminal( - this.terminalId, this.runId, rasTerminalSequence, terminalSize); - rasTerminal.getImages().addAll(this.cachedImages); - - JsonObject intermediateJson = (JsonObject) gson.toJsonTree(rasTerminal); - stripFalseBooleans(intermediateJson); - String tempJson = gson.toJson(intermediateJson); + TerminalSize terminalSize = new TerminalSize(getScreen().getNoOfColumns(), getScreen().getNoOfRows()); + dev.galasa.zos3270.common.screens.Terminal rasTerminal = new dev.galasa.zos3270.common.screens.Terminal( + this.terminalId, this.runId, rasTerminalSequence, terminalSize); - if (applyCtf) { - tempJson = cts.removeConfidentialText(tempJson); - } + for (TerminalImage terminalImage : this.cachedImages){ + + TerminalImage newTerminalImage = removeConfidentialTextFromTerminalImage(terminalImage); + rasTerminal.getImages().add(newTerminalImage); + } + + JsonObject intermediateJson = (JsonObject) gson.toJsonTree(rasTerminal); + stripFalseBooleans(intermediateJson); + String tempJson = gson.toJson(intermediateJson); + + if (applyCtf) { + tempJson = cts.removeConfidentialText(tempJson); + } + + String terminalFilename = this.terminalId + "-" + String.format("%05d", rasTerminalSequence) + ".gz"; + Path terminalPath = terminalRasDirectory.resolve(terminalFilename); - String terminalFilename = this.terminalId + "-" + String.format("%05d", rasTerminalSequence) + ".gz"; - Path terminalPath = terminalRasDirectory.resolve(terminalFilename); + try (GZIPOutputStream gos = new GZIPOutputStream(Files.newOutputStream(terminalPath, + new SetContentType(new ResultArchiveStoreContentType("application/zos3270terminal")), + StandardOpenOption.CREATE))) { + IOUtils.write(tempJson, gos, "utf-8"); + gos.flush(); + gos.close(); + } + } - try (GZIPOutputStream gos = new GZIPOutputStream(Files.newOutputStream(terminalPath, - new SetContentType(new ResultArchiveStoreContentType("application/zos3270terminal")), - StandardOpenOption.CREATE))) { - IOUtils.write(tempJson, gos, "utf-8"); + /** + * Creates a copy of the original TerminalImage, iterates through it's TerminalFields and FieldContents, + * and creates a new TerminalImage with confidential text removed. + * @param terminalImage + * @return + */ + private TerminalImage removeConfidentialTextFromTerminalImage(TerminalImage terminalImage){ + // Create a new TerminalImage based on the one we are iterating on + TerminalImage newTerminalImage = new TerminalImage(terminalImage.getSequence(), terminalImage.getId(), + terminalImage.isInbound(), terminalImage.getType(), terminalImage.getAid(),terminalImage.getImageSize(), + terminalImage.getCursorColumn(), terminalImage.getCursorRow()); + + for (TerminalField terminalField : terminalImage.getFields()){ + + // Create a new TerminalField based on the one we are iterating on + TerminalField newTerminalField = new TerminalField(terminalField.getRow(), terminalField.getColumn(), + terminalField.isUnformatted(), terminalField.isFieldProtected(), terminalField.isFieldNumeric(), + terminalField.isFieldDisplay(), terminalField.isFieldIntenseDisplay(), terminalField.isFieldSelectorPen(), + terminalField.isFieldModifed(), terminalField.getForegroundColour(), terminalField.getBackgroundColour(), terminalField.getHighlight()); + + StringBuilder sb = new StringBuilder(); + for (FieldContents contents : terminalField.getContents()) { + + // Converting FieldContents to Strings and removing confidential text if required + for (Character c : contents.getChars()) { + if (c == null) { + sb.append(" "); + } else { + sb.append(c); + } + } + String fieldText = applyCtf ? cts.removeConfidentialText(sb.toString()) : sb.toString(); + + char[] fieldTextCharArray = fieldText.toCharArray(); + Character[] newArray = new Character[fieldTextCharArray.length]; + for (int i = 0; i < fieldTextCharArray.length; i++){ + newArray[i] = Character.valueOf(fieldTextCharArray[i]); + } + + // Create new FieldContents with the new Character[] with confidential text removed + FieldContents newFieldContents = new FieldContents(newArray); + newTerminalField.getContents().add(newFieldContents); } - } catch (Exception e) { - logger.error("Unable to write terminal cache to the RAS", e); - rasTerminalSequence--; - return; + newTerminalImage.getFields().add(newTerminalField); } + return newTerminalImage; + } + public synchronized void flushTerminalCache() { this.cachedImages.clear(); } @@ -255,13 +375,32 @@ private static List buildTerminalFields(Screen screen) { int row = screenField.getStart() / screen.getNoOfColumns(); int column = screenField.getStart() % screen.getNoOfColumns(); + Character cForegroundColour = null; + Character cBackgroundColour = null; + Character cHighlight = null; + + Colour foregroundColour = screenField.getForegroundColour(); + Colour backgroundColour = screenField.getBackgroundColour(); + Highlight highlight = screenField.getHighlight(); + + if (foregroundColour != null) { + cForegroundColour = foregroundColour.getLetter(); + } + if (backgroundColour != null) { + cBackgroundColour = backgroundColour.getLetter(); + } + if (highlight != null) { + cHighlight = highlight.getLetter(); + } + TerminalField terminalField = new TerminalField(row, column, screenField.isUnformatted(), screenField.isProtected(), screenField.isNumeric(), screenField.isDisplay(), - screenField.isIntenseDisplay(), screenField.isSelectorPen(), screenField.isFieldModifed()); + screenField.isIntenseDisplay(), screenField.isSelectorPen(), screenField.isFieldModifed(), + cForegroundColour, cBackgroundColour, cHighlight); Character[] chars = screenField.getFieldCharsWithNulls(); - terminalField.getContents().add(new FieldContents(chars)); // TODO needs to be expanded when we record - // extended attributes + terminalField.getContents().add(new FieldContents(chars)); // TODO, needs modifying when we know how to + // support SetAttribute order terminalFields.add(terminalField); } @@ -296,4 +435,4 @@ public static void stripFalseBooleans(JsonObject json) { } } -} +} \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/package-info.java index d4a8ba1d9..09d252fe1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/main/java/dev/galasa/zos3270/spi/package-info.java @@ -1,7 +1,7 @@ /* - *Licensed Materials - Property of IBM + * Copyright contributors to the Galasa project * - *(c) Copyright IBM Corp. 2020. + * SPDX-License-Identifier: EPL-2.0 */ /** * Zos3270Terminal Manager diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/commandcodes/ReadModifiedTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/commandcodes/ReadModifiedTest.java similarity index 89% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/commandcodes/ReadModifiedTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/commandcodes/ReadModifiedTest.java index 718f1ccd5..b3e6ba006 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/commandcodes/ReadModifiedTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/commandcodes/ReadModifiedTest.java @@ -1,4 +1,9 @@ -package test.zos3270.commandcodes; +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.commandcodes; import static org.assertj.core.api.Assertions.assertThat; @@ -24,12 +29,13 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; -import test.zos3270.util.DummySocket; -import test.zos3270.util.DummySocketImpl; +import dev.galasa.zos3270.util.DummySocket; +import dev.galasa.zos3270.util.DummySocketImpl; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class ReadModifiedTest { +public class ReadModifiedTest extends Zos3270TestBase { -// @Test + @Test public void testGoldenPath() throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -41,7 +47,7 @@ public Socket createSocket() throws UnknownHostException, IOException { } }; network.connectClient(); - Screen screen = new Screen(10, 2, network); + Screen screen = CreateTestScreen(10, 2, network); screen.erase(); NetworkThread networkThread = new NetworkThread(null, screen, network, network.getInputStream()); @@ -50,16 +56,16 @@ public Socket createSocket() throws UnknownHostException, IOException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(5))); orders.add(new OrderStartField(true, false, true, false, false, true)); // Modified - check we get protected fields as well - orders.add(new OrderText("5678")); + orders.add(new OrderText("5678", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, true)); //Modified - orders.add(new OrderText("ABCD")); + orders.add(new OrderText("ABCD", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(15))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("EFGH")); + orders.add(new OrderText("EFGH", ebcdic)); screen.processOrders(orders, writeControlCharacter); screen.testingSetLastAid(AttentionIdentification.ENTER); screen.setCursorPosition(0, 1); @@ -83,18 +89,18 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.get()).as("SBA Field 3").isEqualTo(OrderSetBufferAddress.ID); assertThat(bb.get()).as("Field pos 1").isEqualTo(new BufferAddress(6 /* SF + 1 */).getCharRepresentation()[0]); assertThat(bb.get()).as("Field pos 2").isEqualTo(new BufferAddress(6 /* SF + 1 */).getCharRepresentation()[1]); - assertThat(bb.get()).as("Field char 1").isEqualTo("5678".getBytes(OrderText.ebcdic)[0]); - assertThat(bb.get()).as("Field char 2").isEqualTo("5678".getBytes(OrderText.ebcdic)[1]); - assertThat(bb.get()).as("Field char 3").isEqualTo("5678".getBytes(OrderText.ebcdic)[2]); - assertThat(bb.get()).as("Field char 4").isEqualTo("5678".getBytes(OrderText.ebcdic)[3]); + assertThat(bb.get()).as("Field char 1").isEqualTo("5678".getBytes(ebcdic)[0]); + assertThat(bb.get()).as("Field char 2").isEqualTo("5678".getBytes(ebcdic)[1]); + assertThat(bb.get()).as("Field char 3").isEqualTo("5678".getBytes(ebcdic)[2]); + assertThat(bb.get()).as("Field char 4").isEqualTo("5678".getBytes(ebcdic)[3]); assertThat(bb.get()).as("SBA Field 3").isEqualTo(OrderSetBufferAddress.ID); assertThat(bb.get()).as("Field pos 1").isEqualTo(new BufferAddress(11 /* SF + 1 */).getCharRepresentation()[0]); assertThat(bb.get()).as("Field pos 2").isEqualTo(new BufferAddress(11 /* SF + 1 */).getCharRepresentation()[1]); - assertThat(bb.get()).as("Field char 1").isEqualTo("ABCD".getBytes(OrderText.ebcdic)[0]); - assertThat(bb.get()).as("Field char 2").isEqualTo("ABCD".getBytes(OrderText.ebcdic)[1]); - assertThat(bb.get()).as("Field char 3").isEqualTo("ABCD".getBytes(OrderText.ebcdic)[2]); - assertThat(bb.get()).as("Field char 4").isEqualTo("ABCD".getBytes(OrderText.ebcdic)[3]); + assertThat(bb.get()).as("Field char 1").isEqualTo("ABCD".getBytes(ebcdic)[0]); + assertThat(bb.get()).as("Field char 2").isEqualTo("ABCD".getBytes(ebcdic)[1]); + assertThat(bb.get()).as("Field char 3").isEqualTo("ABCD".getBytes(ebcdic)[2]); + assertThat(bb.get()).as("Field char 4").isEqualTo("ABCD".getBytes(ebcdic)[3]); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.IAC); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.EOR); @@ -102,7 +108,7 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.remaining()).as("Should be nothing left").isEqualTo(0); } -// @Test + @Test public void testWrappedfield() throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -114,7 +120,7 @@ public Socket createSocket() throws UnknownHostException, IOException { } }; network.connectClient(); - Screen screen = new Screen(10, 2, network); + Screen screen = CreateTestScreen(10, 2, network); screen.erase(); NetworkThread networkThread = new NetworkThread(null, screen, network, network.getInputStream()); @@ -122,16 +128,16 @@ public Socket createSocket() throws UnknownHostException, IOException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(5))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("5678")); + orders.add(new OrderText("5678", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("ABCD")); + orders.add(new OrderText("ABCD", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(15))); orders.add(new OrderStartField(true, false, true, false, false, true)); // WRAPPED modified field - orders.add(new OrderText("EFGH")); + orders.add(new OrderText("EFGH", ebcdic)); screen.processOrders(orders, writeControlCharacter); screen.testingSetLastAid(AttentionIdentification.ENTER); screen.setCursorPosition(0, 1); @@ -155,15 +161,15 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.get()).as("SBA Field 3").isEqualTo(OrderSetBufferAddress.ID); assertThat(bb.get()).as("Field pos 1").isEqualTo(new BufferAddress(16 /* SF + 1 */).getCharRepresentation()[0]); assertThat(bb.get()).as("Field pos 2").isEqualTo(new BufferAddress(16 /* SF + 1 */).getCharRepresentation()[1]); - assertThat(bb.get()).as("Field char 1").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[0]); - assertThat(bb.get()).as("Field char 2").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[1]); - assertThat(bb.get()).as("Field char 3").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[2]); - assertThat(bb.get()).as("Field char 4").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[3]); - assertThat(bb.get()).as("Field char 5").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[4]); - assertThat(bb.get()).as("Field char 6").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[5]); - assertThat(bb.get()).as("Field char 7").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[6]); - assertThat(bb.get()).as("Field char 8").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[7]); - assertThat(bb.get()).as("Field char 9").isEqualTo("EFGH12345".getBytes(OrderText.ebcdic)[8]); + assertThat(bb.get()).as("Field char 1").isEqualTo("EFGH12345".getBytes(ebcdic)[0]); + assertThat(bb.get()).as("Field char 2").isEqualTo("EFGH12345".getBytes(ebcdic)[1]); + assertThat(bb.get()).as("Field char 3").isEqualTo("EFGH12345".getBytes(ebcdic)[2]); + assertThat(bb.get()).as("Field char 4").isEqualTo("EFGH12345".getBytes(ebcdic)[3]); + assertThat(bb.get()).as("Field char 5").isEqualTo("EFGH12345".getBytes(ebcdic)[4]); + assertThat(bb.get()).as("Field char 6").isEqualTo("EFGH12345".getBytes(ebcdic)[5]); + assertThat(bb.get()).as("Field char 7").isEqualTo("EFGH12345".getBytes(ebcdic)[6]); + assertThat(bb.get()).as("Field char 8").isEqualTo("EFGH12345".getBytes(ebcdic)[7]); + assertThat(bb.get()).as("Field char 9").isEqualTo("EFGH12345".getBytes(ebcdic)[8]); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.IAC); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.EOR); @@ -171,7 +177,7 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.remaining()).as("Should be nothing left").isEqualTo(0); } -// @Test + @Test public void testUnformatted() throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -183,7 +189,7 @@ public Socket createSocket() throws UnknownHostException, IOException { } }; network.connectClient(); - Screen screen = new Screen(10, 2, network); + Screen screen = CreateTestScreen(10, 2, network); screen.erase(); NetworkThread networkThread = new NetworkThread(null, screen, network, network.getInputStream()); @@ -191,7 +197,7 @@ public Socket createSocket() throws UnknownHostException, IOException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); // make the first line nulls, should suppress - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); screen.processOrders(orders, writeControlCharacter); screen.testingSetLastAid(AttentionIdentification.ENTER); screen.setCursorPosition(0, 1); @@ -212,10 +218,10 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.get()).as("Cursor byte 1").isEqualTo((byte)0x40); assertThat(bb.get()).as("Cursor byte 2").isEqualTo((byte)0x4a); - assertThat(bb.get()).as("Unformatted char 1").isEqualTo("1234".getBytes(OrderText.ebcdic)[0]); - assertThat(bb.get()).as("Unformatted char 2").isEqualTo("1234".getBytes(OrderText.ebcdic)[1]); - assertThat(bb.get()).as("Unformatted char 3").isEqualTo("1234".getBytes(OrderText.ebcdic)[2]); - assertThat(bb.get()).as("Unformatted char 4").isEqualTo("1234".getBytes(OrderText.ebcdic)[3]); + assertThat(bb.get()).as("Unformatted char 1").isEqualTo("1234".getBytes(ebcdic)[0]); + assertThat(bb.get()).as("Unformatted char 2").isEqualTo("1234".getBytes(ebcdic)[1]); + assertThat(bb.get()).as("Unformatted char 3").isEqualTo("1234".getBytes(ebcdic)[2]); + assertThat(bb.get()).as("Unformatted char 4").isEqualTo("1234".getBytes(ebcdic)[3]); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.IAC); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.EOR); @@ -223,7 +229,7 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.remaining()).as("Should be nothing left").isEqualTo(0); } -// @Test + @Test public void testClear() throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -235,7 +241,7 @@ public Socket createSocket() throws UnknownHostException, IOException { } }; network.connectClient(); - Screen screen = new Screen(10, 2, network); + Screen screen = CreateTestScreen(10, 2, network); screen.erase(); NetworkThread networkThread = new NetworkThread(null, screen, network, network.getInputStream()); @@ -244,7 +250,7 @@ public Socket createSocket() throws UnknownHostException, IOException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); // make the first line nulls, should suppress - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); screen.processOrders(orders, writeControlCharacter); screen.testingSetLastAid(AttentionIdentification.CLEAR); screen.setCursorPosition(0, 1); @@ -282,7 +288,7 @@ public Socket createSocket() throws UnknownHostException, IOException { } }; network.connectClient(); - Screen screen = new Screen(10, 2, network); + Screen screen = CreateTestScreen(10, 2, network); screen.erase(); NetworkThread networkThread = new NetworkThread(null, screen, network, network.getInputStream()); @@ -290,7 +296,7 @@ public Socket createSocket() throws UnknownHostException, IOException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); // make the first line nulls, should suppress - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); screen.processOrders(orders, writeControlCharacter); screen.testingSetLastAid(AttentionIdentification.CLEAR); screen.setCursorPosition(0, 1); @@ -315,10 +321,10 @@ public Socket createSocket() throws UnknownHostException, IOException { assertThat(bb.get()).as("Cursor byte 2").isEqualTo((byte)0x4a); // because ALL was requested, the buffer is read anyway despite the CLEAR - assertThat(bb.get()).as("Unformatted char 1").isEqualTo("1234".getBytes(OrderText.ebcdic)[0]); - assertThat(bb.get()).as("Unformatted char 2").isEqualTo("1234".getBytes(OrderText.ebcdic)[1]); - assertThat(bb.get()).as("Unformatted char 3").isEqualTo("1234".getBytes(OrderText.ebcdic)[2]); - assertThat(bb.get()).as("Unformatted char 4").isEqualTo("1234".getBytes(OrderText.ebcdic)[3]); + assertThat(bb.get()).as("Unformatted char 1").isEqualTo("1234".getBytes(ebcdic)[0]); + assertThat(bb.get()).as("Unformatted char 2").isEqualTo("1234".getBytes(ebcdic)[1]); + assertThat(bb.get()).as("Unformatted char 3").isEqualTo("1234".getBytes(ebcdic)[2]); + assertThat(bb.get()).as("Unformatted char 4").isEqualTo("1234".getBytes(ebcdic)[3]); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.IAC); assertThat(bb.get()).as("End of stream").isEqualTo(NetworkThread.EOR); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/BackSpaceTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/BackSpaceTest.java similarity index 88% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/BackSpaceTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/BackSpaceTest.java index 9fa5c3069..6fd3aed28 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/BackSpaceTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/BackSpaceTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.cursor; +package dev.galasa.zos3270.cursor; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -22,14 +22,15 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the backSpace function * - * @author Michael Baylis + * * */ -public class BackSpaceTest { +public class BackSpaceTest extends Zos3270TestBase { /** * Test what happens in a empty screen with no fields, should position at 0 @@ -38,7 +39,7 @@ public class BackSpaceTest { */ @Test public void emptyScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -64,16 +65,16 @@ public void emptyScreen() throws Exception { @Test public void testGoldenPath() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("123456789")); + orders.add(new OrderText("123456789", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("ABCDEFGHI")); + orders.add(new OrderText("ABCDEFGHI", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -98,16 +99,16 @@ public void testGoldenPath() throws Exception { @Test public void testProtectedScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("123456789")); + orders.add(new OrderText("123456789", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("ABCDEFGHI")); + orders.add(new OrderText("ABCDEFGHI", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -143,13 +144,13 @@ public void testProtectedScreen() throws Exception { @Test public void testSingleField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("123456789ABCDEFGHIJ")); + orders.add(new OrderText("123456789ABCDEFGHIJ", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/BackTabTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/BackTabTest.java similarity index 92% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/BackTabTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/BackTabTest.java index 7a31ad5ff..05ed629a4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/BackTabTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/BackTabTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.cursor; +package dev.galasa.zos3270.cursor; import static org.assertj.core.api.Assertions.assertThat; @@ -19,14 +19,15 @@ import dev.galasa.zos3270.internal.datastream.OrderStartField; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the backTab function * - * @author Michael Baylis + * * */ -public class BackTabTest { +public class BackTabTest extends Zos3270TestBase { /** * Test what happens in a empty screen with no fields, should position at 0 @@ -35,7 +36,7 @@ public class BackTabTest { */ @Test public void emptyScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -60,7 +61,7 @@ public void emptyScreen() throws Exception { @Test public void testSameFieldCursorOffset() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -86,7 +87,7 @@ public void testSameFieldCursorOffset() throws Exception { @Test public void testSameFieldCursorAtBeginning() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -112,7 +113,7 @@ public void testSameFieldCursorAtBeginning() throws Exception { @Test public void testDifferentField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -140,7 +141,7 @@ public void testDifferentField() throws Exception { @Test public void testDifferentWrappedField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -168,7 +169,7 @@ public void testDifferentWrappedField() throws Exception { @Test public void testProtectedScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -196,7 +197,7 @@ public void testProtectedScreen() throws Exception { @Test public void testUnprotectedZeroLength() throws Exception { - Screen screen = new Screen(5, 1, null); + Screen screen = CreateTestScreen(5, 1, null); screen.erase(); ArrayList orders = new ArrayList<>(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/FieldOverflowTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/FieldOverflowTest.java similarity index 85% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/FieldOverflowTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/FieldOverflowTest.java index 6a1d7049c..d5a7e8289 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/FieldOverflowTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/FieldOverflowTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.cursor; +package dev.galasa.zos3270.cursor; import static org.assertj.core.api.Assertions.assertThat; @@ -20,14 +20,15 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Ensure if type over the end of a field, the cursor will skip to the next unprotected field * - * @author Michael Baylis + * * */ -public class FieldOverflowTest { +public class FieldOverflowTest extends Zos3270TestBase { /** * Test with two fields @@ -37,18 +38,18 @@ public class FieldOverflowTest { @Test public void testSameFieldCursorOffset() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText(" ")); + orders.add(new OrderText(" ", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(6))); orders.add(new OrderStartField(true, false, true, false, false, false)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText(" ")); + orders.add(new OrderText(" ", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(16))); orders.add(new OrderStartField(true, false, true, false, false, false)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/HomeTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/HomeTest.java similarity index 92% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/HomeTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/HomeTest.java index 60261e60c..0169dd3dc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/HomeTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/HomeTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.cursor; +package dev.galasa.zos3270.cursor; import static org.assertj.core.api.Assertions.assertThat; @@ -19,14 +19,15 @@ import dev.galasa.zos3270.internal.datastream.OrderStartField; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the home function * - * @author Michael Baylis + * * */ -public class HomeTest { +public class HomeTest extends Zos3270TestBase { /** * Test what happens in a empty screen with no fields, should position at 0 @@ -35,7 +36,7 @@ public class HomeTest { */ @Test public void emptyScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -60,7 +61,7 @@ public void emptyScreen() throws Exception { @Test public void testSameFieldCursorOffset() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -86,7 +87,7 @@ public void testSameFieldCursorOffset() throws Exception { @Test public void testSameFieldCursorAtBeginning() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -112,7 +113,7 @@ public void testSameFieldCursorAtBeginning() throws Exception { @Test public void testDifferentField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -140,7 +141,7 @@ public void testDifferentField() throws Exception { @Test public void testWrappedField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -166,7 +167,7 @@ public void testWrappedField() throws Exception { @Test public void testProtectedScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -194,7 +195,7 @@ public void testProtectedScreen() throws Exception { @Test public void testUnprotectedZeroLength() throws Exception { - Screen screen = new Screen(5, 1, null); + Screen screen = CreateTestScreen(5, 1, null); screen.erase(); ArrayList orders = new ArrayList<>(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/NewLineTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/NewLineTest.java similarity index 91% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/NewLineTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/NewLineTest.java index 0ae2fa0b8..5f3fc8d08 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/NewLineTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/NewLineTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.cursor; +package dev.galasa.zos3270.cursor; import static org.assertj.core.api.Assertions.assertThat; @@ -20,14 +20,15 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the newline function * - * @author Michael Baylis + * * */ -public class NewLineTest { +public class NewLineTest extends Zos3270TestBase { /** * Test what happens in a empty screen with no fields, should position to the next line @@ -36,7 +37,7 @@ public class NewLineTest { */ @Test public void emptyScreen() throws Exception { - Screen screen = new Screen(10, 4, null); + Screen screen = CreateTestScreen(10, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -60,7 +61,7 @@ public void emptyScreen() throws Exception { @Test public void testSameFieldStartingAtBegginningOfField() throws Exception { - Screen screen = new Screen(10, 4, null); + Screen screen = CreateTestScreen(10, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -87,7 +88,7 @@ public void testSameFieldStartingAtBegginningOfField() throws Exception { @Test public void testSameFieldStartingALineDown() throws Exception { - Screen screen = new Screen(10, 4, null); + Screen screen = CreateTestScreen(10, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -113,7 +114,7 @@ public void testSameFieldStartingALineDown() throws Exception { @Test public void testSameFieldStartingBottom() throws Exception { - Screen screen = new Screen(10, 4, null); + Screen screen = CreateTestScreen(10, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -139,22 +140,22 @@ public void testSameFieldStartingBottom() throws Exception { @Test public void testDifferentField() throws Exception { - Screen screen = new Screen(10, 4, null); + Screen screen = CreateTestScreen(10, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("UField1")); + orders.add(new OrderText("UField1", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("PField1")); + orders.add(new OrderText("PField1", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(20))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("UField2")); + orders.add(new OrderText("UField2", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(30))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("UField3")); + orders.add(new OrderText("UField3", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -175,7 +176,7 @@ public void testDifferentField() throws Exception { @Test public void testWrappedField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -201,7 +202,7 @@ public void testWrappedField() throws Exception { @Test public void testProtectedScreen() throws Exception { - Screen screen = new Screen(10, 4, null); + Screen screen = CreateTestScreen(10, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -229,7 +230,7 @@ public void testProtectedScreen() throws Exception { @Test public void testUnprotectedZeroLength() throws Exception { - Screen screen = new Screen(2, 4, null); + Screen screen = CreateTestScreen(2, 4, null); screen.erase(); ArrayList orders = new ArrayList<>(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/TabTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/TabTest.java similarity index 91% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/TabTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/TabTest.java index 0b8e8b87c..f2a719bcf 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/cursor/TabTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/cursor/TabTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.cursor; +package dev.galasa.zos3270.cursor; import static org.assertj.core.api.Assertions.assertThat; @@ -20,14 +20,15 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the tab function * - * @author Michael Baylis + * * */ -public class TabTest { +public class TabTest extends Zos3270TestBase { /** * Test what happens in a empty screen with no fields, should position at 0 @@ -36,7 +37,7 @@ public class TabTest { */ @Test public void emptyScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -61,16 +62,16 @@ public void emptyScreen() throws Exception { @Test public void testSameFieldCursorOffset() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("UField1")); + orders.add(new OrderText("UField1", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("UField2")); + orders.add(new OrderText("UField2", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -91,7 +92,7 @@ public void testSameFieldCursorOffset() throws Exception { @Test public void testSameFieldCursorAtBeginning() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -117,7 +118,7 @@ public void testSameFieldCursorAtBeginning() throws Exception { @Test public void testDifferentField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -145,7 +146,7 @@ public void testDifferentField() throws Exception { @Test public void testDifferentWrappedField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -173,7 +174,7 @@ public void testDifferentWrappedField() throws Exception { @Test public void testProtectedScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); @@ -201,7 +202,7 @@ public void testProtectedScreen() throws Exception { @Test public void testUnprotectedZeroLength() throws Exception { - Screen screen = new Screen(5, 1, null); + Screen screen = CreateTestScreen(5, 1, null); screen.erase(); ArrayList orders = new ArrayList<>(); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/ByteAddressTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/ByteAddressTest.java similarity index 96% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/ByteAddressTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/ByteAddressTest.java index 9680c000e..6d9518571 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/ByteAddressTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/ByteAddressTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import static org.junit.Assert.fail; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/CommandCodeTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/CommandCodeTest.java similarity index 93% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/CommandCodeTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/CommandCodeTest.java index 77bb7ef83..51a1f2c0f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/CommandCodeTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/CommandCodeTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import static org.junit.Assert.fail; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/EraseUnprotectedToAddressTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/EraseUnprotectedToAddressTest.java similarity index 83% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/EraseUnprotectedToAddressTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/EraseUnprotectedToAddressTest.java index e64f5a686..ea39828f5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/EraseUnprotectedToAddressTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/EraseUnprotectedToAddressTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import static org.assertj.core.api.Assertions.assertThat; @@ -21,9 +21,9 @@ import dev.galasa.zos3270.internal.datastream.OrderEraseUnprotectedToAddress; import dev.galasa.zos3270.internal.datastream.OrderSetBufferAddress; import dev.galasa.zos3270.spi.NetworkException; -import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class EraseUnprotectedToAddressTest { +public class EraseUnprotectedToAddressTest extends Zos3270TestBase { @Test public void testEraseAllUnprotected() throws IOException, DecoderException, NetworkException, TerminalInterruptedException { @@ -31,7 +31,7 @@ public void testEraseAllUnprotected() throws IOException, DecoderException, Netw byte[] stream = Hex.decodeHex(vampHex); ByteBuffer buffer = ByteBuffer.wrap(stream); - NetworkThread networkThread = new NetworkThread(null, new Screen(), null, null); + NetworkThread networkThread = new NetworkThread(null, CreateTestScreen(), null, null); List orders = networkThread.process3270Data(buffer).getOrders(); assertThat(orders.size()).as("Should have returned 2 orders, SBA, EUA").isEqualTo(2); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/GraphicsEscapeTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/GraphicsEscapeTest.java similarity index 83% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/GraphicsEscapeTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/GraphicsEscapeTest.java index 695bb36d3..9356ed8aa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/GraphicsEscapeTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/GraphicsEscapeTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import static org.assertj.core.api.Assertions.assertThat; @@ -21,9 +21,9 @@ import dev.galasa.zos3270.internal.datastream.OrderGraphicsEscape; import dev.galasa.zos3270.internal.datastream.OrderSetBufferAddress; import dev.galasa.zos3270.spi.NetworkException; -import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class GraphicsEscapeTest { +public class GraphicsEscapeTest extends Zos3270TestBase { @Test public void testEraseAllUnprotected() throws IOException, DecoderException, NetworkException, TerminalInterruptedException { @@ -31,7 +31,7 @@ public void testEraseAllUnprotected() throws IOException, DecoderException, Netw byte[] stream = Hex.decodeHex(vampHex); ByteBuffer buffer = ByteBuffer.wrap(stream); - NetworkThread networkThread = new NetworkThread(null, new Screen(), null, null); + NetworkThread networkThread = new NetworkThread(null, CreateTestScreen(), null, null); List orders = networkThread.process3270Data(buffer).getOrders(); assertThat(orders.size()).as("Should have returned 2 orders, SBA, GE").isEqualTo(2); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/InboundTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/InboundTest.java new file mode 100644 index 000000000..3de565643 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/InboundTest.java @@ -0,0 +1,54 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.datastream; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.apache.commons.codec.binary.Hex; +import org.junit.Test; + +import dev.galasa.zos3270.common.screens.TerminalSize; +import dev.galasa.zos3270.internal.comms.Inbound3270Message; +import dev.galasa.zos3270.internal.comms.Network; +import dev.galasa.zos3270.internal.comms.NetworkThread; +import dev.galasa.zos3270.spi.Screen; + +public class InboundTest { + + @Test + public void testSettingCodePageRendersSquareBracketsOK() throws Exception { + + // Given... + // A screen that looks like this: + // 0006 SQLTIMES + // 0007 SQLTIMES [0] 6622 + // 0008 SQLTIMES [1] 55339 + // 0009 SQLTIMES [2] 4589 + String inboundDataStream = "f1401102d0290342f541f2c000f0f0f0f61102d5290342f541f2c020404040e2d8d3e3c9d4c5e2404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040110320290342f541f2c000f0f0f0f7110325290342f541f2c020404040e2d8d3e3c9d4c5e240adf0bd40404040404040404040404040110342290342f541f2c000f6f6f2f2110347290342f541f2c02040404040404040404040404040404040404040404040404040404040404040404040404040404040110370290342f541f2c000f0f0f0f8110375290342f541f2c020404040e2d8d3e3c9d4c5e240adf1bd40404040404040404040404040110392290342f541f2c000f5f5f3f3f9110398290342f541f2c0204040404040404040404040404040404040404040404040404040404040404040404040404040401103c0290342f541f2c000f0f0f0f91103c5290342f541f2c020404040e2d8d3e3c9d4c5e240adf2bd404040404040404040404040401103e2290342f541f2c000f4f5f8f91103e7290342f541f2c02040404040404040404040404040404040404040404040404040404040404040404040404040404040110410290342f541f2c000"; + byte[] inboundAsBytes = Hex.decodeHex(inboundDataStream); + + Network network = new Network("here", 1, "a"); + + // Set the screen's code page to EBCDIC 1047 + Charset codePage = Charset.forName("1047"); + TerminalSize terminalSize = new TerminalSize(80, 24); + Screen screen = new Screen(terminalSize, new TerminalSize(0, 0), network, codePage); + + NetworkThread networkThread = new NetworkThread(null, screen, null, null); + ByteBuffer buffer = ByteBuffer.wrap(inboundAsBytes); + Inbound3270Message inboundMessage = networkThread.process3270Data(buffer); + + // When... + screen.processInboundMessage(inboundMessage); + System.out.println(screen.printScreen()); + + // Then... + assertThat(screen.printScreen()).contains("SQLTIMES", "[0]", "[1]", "[2]"); + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/OrderInsertCursorTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/OrderInsertCursorTest.java similarity index 78% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/OrderInsertCursorTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/OrderInsertCursorTest.java index 8a87b326d..a94ccbe58 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/OrderInsertCursorTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/OrderInsertCursorTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import org.junit.Assert; import org.junit.Test; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/OrderTextTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/OrderTextTest.java similarity index 74% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/OrderTextTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/OrderTextTest.java index a8471479b..65da8a688 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/OrderTextTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/OrderTextTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import java.nio.ByteBuffer; @@ -12,8 +12,9 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.spi.DatastreamException; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class OrderTextTest { +public class OrderTextTest extends Zos3270TestBase { @Test public void testText() throws DatastreamException { @@ -24,7 +25,7 @@ public void testText() throws DatastreamException { buffer.put((byte) 0x85); buffer.flip(); - OrderText orderText = new OrderText(); + OrderText orderText = new OrderText(ebcdic); orderText.append(buffer.get()); orderText.append(buffer.get()); orderText.append(buffer.get()); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/QueryReplySummaryTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/QueryReplySummaryTest.java similarity index 80% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/QueryReplySummaryTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/QueryReplySummaryTest.java index 1880185c2..eaa341e06 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/QueryReplySummaryTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/QueryReplySummaryTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import java.util.ArrayList; @@ -16,12 +16,13 @@ import dev.galasa.zos3270.internal.datastream.QueryReplySummary; import dev.galasa.zos3270.internal.datastream.QueryReplyUsableArea; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class QueryReplySummaryTest { +public class QueryReplySummaryTest extends Zos3270TestBase { @Test public void testGoldenPath() throws TerminalInterruptedException { - Screen screen = new Screen(80, 24, null); + Screen screen = CreateTestScreen(80, 24, null); QueryReplyUsableArea qrua = new QueryReplyUsableArea(screen); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/QueryReplyUsableAreaTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/QueryReplyUsableAreaTest.java similarity index 81% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/QueryReplyUsableAreaTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/QueryReplyUsableAreaTest.java index 60c8282a3..fd34563c7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/QueryReplyUsableAreaTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/QueryReplyUsableAreaTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import org.apache.commons.codec.binary.Hex; import org.junit.Assert; @@ -12,12 +12,13 @@ import dev.galasa.zos3270.TerminalInterruptedException; import dev.galasa.zos3270.internal.datastream.QueryReplyUsableArea; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class QueryReplyUsableAreaTest { +public class QueryReplyUsableAreaTest extends Zos3270TestBase { @Test public void testGoldenPath() throws TerminalInterruptedException { - Screen screen = new Screen(80, 24, null); + Screen screen = CreateTestScreen(80, 24, null); QueryReplyUsableArea qrua = new QueryReplyUsableArea(screen); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/RepeatToAddressTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/RepeatToAddressTest.java similarity index 65% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/RepeatToAddressTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/RepeatToAddressTest.java index 64376052f..f1d2fd85f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/RepeatToAddressTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/RepeatToAddressTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import java.nio.ByteBuffer; @@ -12,8 +12,9 @@ import dev.galasa.zos3270.internal.datastream.OrderRepeatToAddress; import dev.galasa.zos3270.spi.DatastreamException; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class RepeatToAddressTest { +public class RepeatToAddressTest extends Zos3270TestBase { @Test public void testRA() throws DatastreamException { @@ -23,7 +24,7 @@ public void testRA() throws DatastreamException { buffer.put((byte) 0xd4); buffer.flip(); - String result = new OrderRepeatToAddress(buffer).toString(); + String result = new OrderRepeatToAddress(buffer, ebcdic).toString(); String shouldbe = "RA(M,1919)"; Assert.assertEquals("RA not translating correct to " + shouldbe, shouldbe, result); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/SetBufferAddressTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/SetBufferAddressTest.java similarity index 84% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/SetBufferAddressTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/SetBufferAddressTest.java index c9eaf8ebd..5b3310509 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/SetBufferAddressTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/SetBufferAddressTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import java.nio.ByteBuffer; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/StartFieldTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/StartFieldTest.java similarity index 97% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/StartFieldTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/StartFieldTest.java index 1f4d0f9ef..8bc009b51 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/StartFieldTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/StartFieldTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import java.nio.ByteBuffer; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/VampScreenTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/VampScreenTest.java similarity index 77% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/VampScreenTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/VampScreenTest.java index fddbf3567..d695ad358 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/VampScreenTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/VampScreenTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import java.io.IOException; import java.net.URL; @@ -20,9 +20,9 @@ import dev.galasa.zos3270.internal.comms.NetworkThread; import dev.galasa.zos3270.internal.datastream.AbstractOrder; import dev.galasa.zos3270.spi.NetworkException; -import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class VampScreenTest { +public class VampScreenTest extends Zos3270TestBase { @Test public void testVampScreen() throws IOException, DecoderException, NetworkException, TerminalInterruptedException { @@ -31,7 +31,7 @@ public void testVampScreen() throws IOException, DecoderException, NetworkExcept byte[] stream = Hex.decodeHex(vampHex); ByteBuffer buffer = ByteBuffer.wrap(stream); - NetworkThread networkThread = new NetworkThread(null, new Screen(), null, null); + NetworkThread networkThread = new NetworkThread(null, CreateTestScreen(), null, null); List orders = networkThread.process3270Data(buffer).getOrders(); Assert.assertEquals("Count of orders is incorrect", 225, orders.size()); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/WriteControlCharacterTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/WriteControlCharacterTest.java similarity index 95% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/WriteControlCharacterTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/WriteControlCharacterTest.java index f62d32c5a..665ff210e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/WriteControlCharacterTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/WriteControlCharacterTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream; +package dev.galasa.zos3270.datastream; import org.junit.Assert; import org.junit.Test; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/extended/ExtendedDatastreamTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/extended/ExtendedDatastreamTest.java new file mode 100644 index 000000000..a78e1f538 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/extended/ExtendedDatastreamTest.java @@ -0,0 +1,166 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.datastream.extended; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.nio.ByteBuffer; +import java.util.ArrayList; + +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Hex; +import org.junit.Before; +import org.junit.Test; + +import dev.galasa.zos3270.TerminalInterruptedException; +import dev.galasa.zos3270.internal.comms.Inbound3270Message; +import dev.galasa.zos3270.internal.comms.Network; +import dev.galasa.zos3270.internal.datastream.AbstractOrder; +import dev.galasa.zos3270.internal.datastream.BufferAddress; +import dev.galasa.zos3270.internal.datastream.CommandEraseWrite; +import dev.galasa.zos3270.internal.datastream.OrderSetBufferAddress; +import dev.galasa.zos3270.internal.datastream.OrderStartField; +import dev.galasa.zos3270.internal.datastream.OrderStartFieldExtended; +import dev.galasa.zos3270.internal.datastream.OrderText; +import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; +import dev.galasa.zos3270.spi.Colour; +import dev.galasa.zos3270.spi.DatastreamException; +import dev.galasa.zos3270.spi.Highlight; +import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; + +public class ExtendedDatastreamTest extends Zos3270TestBase { + + private final String RED = "42f2"; + private final String GREEN = "42f4"; + private final String BLUE = "42f1"; + + private final String REVERSE = "41f2"; + private final String BLINK = "41f1"; + private final String NORMAL = "41f0"; + private final String UNDERSCORE = "41f4"; + + private final String CHARS = "c0f8"; + + private Screen screen; + + private ByteBuffer getBuffer(String data) throws DecoderException { + byte[] stream = Hex.decodeHex(data); + return ByteBuffer.wrap(stream); + } + + @Before + public void setUp() throws TerminalInterruptedException { + Network network = new Network("here", 1, "a"); + screen = CreateTestScreen(10, 2, network); + screen.erase(); + } + + @Test + public void testColourAndHighlighting() throws DecoderException, DatastreamException { + String redReverse = "03" + REVERSE + RED + CHARS; + String greenBlink = "03" + BLINK + GREEN + CHARS; + String blueNormal = "03" + NORMAL + BLUE + CHARS; + ByteBuffer redReverseBuffer = getBuffer(redReverse); + ByteBuffer greenBlinkBuffer = getBuffer(greenBlink); + ByteBuffer blueNormalBuffer = getBuffer(blueNormal); + + ArrayList orders = new ArrayList<>(); + orders.add(new OrderSetBufferAddress(new BufferAddress(0))); + orders.add(new OrderStartFieldExtended(redReverseBuffer)); + orders.add(new OrderText("1234", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(5))); + orders.add(new OrderStartFieldExtended(greenBlinkBuffer)); + orders.add(new OrderText("5678", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(10))); + orders.add(new OrderStartFieldExtended(blueNormalBuffer)); + orders.add(new OrderText("ABCD", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(15))); + orders.add(new OrderStartField(false, false, true, false, false, false)); + orders.add(new OrderText("EFGH", ebcdic)); + + screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), + new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); + + assertThat(screen.getColourAtPosition(2)).as("Field 1 should be red").isEqualTo(Colour.RED); + assertThat(screen.getHighlightAtPosition(2)).as("Field 1 should be reverse").isEqualTo(Highlight.REVERSE); + + assertThat(screen.getColourAtPosition(7)).as("Field 2 should be green").isEqualTo(Colour.GREEN); + assertThat(screen.getHighlightAtPosition(7)).as("Field 2 should be blinking").isEqualTo(Highlight.BLINK); + + assertThat(screen.getColourAtPosition(12)).as("Field 3 should be blue").isEqualTo(Colour.BLUE); + assertThat(screen.getHighlightAtPosition(12)).as("Field 3 should be normal").isEqualTo(Highlight.NORMAL); + + assertThat(screen.getColourAtPosition(17)).as("Field 4 should be standard field").isNull();; + assertThat(screen.getHighlightAtPosition(17)).as("Field 4 should be standard field").isNull(); + } + + @Test + public void testColourNoHighlighting() throws DecoderException, DatastreamException { + String red = "02" + RED + CHARS; + String green = "02" + GREEN + CHARS; + String blue = "02" + BLUE + CHARS; + ByteBuffer redBuffer = getBuffer(red); + ByteBuffer greenBuffer = getBuffer(green); + ByteBuffer blueBuffer = getBuffer(blue); + + ArrayList orders = new ArrayList<>(); + orders.add(new OrderSetBufferAddress(new BufferAddress(0))); + orders.add(new OrderStartFieldExtended(redBuffer)); + orders.add(new OrderText("1234", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(5))); + orders.add(new OrderStartFieldExtended(greenBuffer)); + orders.add(new OrderText("5678", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(10))); + orders.add(new OrderStartFieldExtended(blueBuffer)); + orders.add(new OrderText("ABCD", ebcdic)); + + screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), + new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); + + assertThat(screen.getColourAtPosition(2)).as("Field 1 should be red").isEqualTo(Colour.RED); + assertThat(screen.getHighlightAtPosition(2)).as("Field 1 should have no highlighting").isNull(); + + assertThat(screen.getColourAtPosition(7)).as("Field 2 should be green").isEqualTo(Colour.GREEN); + assertThat(screen.getHighlightAtPosition(7)).as("Field 2 should have no highlighting").isNull(); + + assertThat(screen.getColourAtPosition(12)).as("Field 3 should be blue").isEqualTo(Colour.BLUE); + assertThat(screen.getHighlightAtPosition(12)).as("Field 3 should have no highlighting").isNull(); + } + + @Test + public void testHighlightingNoColour() throws DecoderException, DatastreamException { + String normal = "02" + NORMAL + CHARS; + String blink = "02" + BLINK + CHARS; + String underscore = "02" + UNDERSCORE + CHARS; + ByteBuffer blinkBuffer = getBuffer(blink); + ByteBuffer underscoreBuffer = getBuffer(underscore); + ByteBuffer normalBuffer = getBuffer(normal); + + ArrayList orders = new ArrayList<>(); + orders.add(new OrderSetBufferAddress(new BufferAddress(0))); + orders.add(new OrderStartFieldExtended(blinkBuffer)); + orders.add(new OrderText("1234", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(5))); + orders.add(new OrderStartFieldExtended(underscoreBuffer)); + orders.add(new OrderText("5678", ebcdic)); + orders.add(new OrderSetBufferAddress(new BufferAddress(10))); + orders.add(new OrderStartFieldExtended(normalBuffer)); + orders.add(new OrderText("ABCD", ebcdic)); + + screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), + new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); + + assertThat(screen.getHighlightAtPosition(2)).as("Field 1 should be blinking").isEqualTo(Highlight.BLINK); + assertThat(screen.getColourAtPosition(2)).as("Field 1 should have no colour").isNull(); + + assertThat(screen.getHighlightAtPosition(7)).as("Field 2 should be underscore").isEqualTo(Highlight.UNDERSCORE); + assertThat(screen.getColourAtPosition(7)).as("Field 2 should have no colour").isNull(); + + assertThat(screen.getHighlightAtPosition(12)).as("Field 3 should be normal").isEqualTo(Highlight.NORMAL); + assertThat(screen.getColourAtPosition(12)).as("Field 3 should have no colour").isNull(); + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/structuredfields/ReadPartitionTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/structuredfields/ReadPartitionTest.java similarity index 91% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/structuredfields/ReadPartitionTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/structuredfields/ReadPartitionTest.java index 2af61a60f..e3e393cce 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/datastream/structuredfields/ReadPartitionTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/datastream/structuredfields/ReadPartitionTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.datastream.structuredfields; +package dev.galasa.zos3270.datastream.structuredfields; import static org.junit.Assert.fail; @@ -19,8 +19,10 @@ import dev.galasa.zos3270.internal.datastream.StructuredField; import dev.galasa.zos3270.internal.datastream.StructuredFieldReadPartition; import dev.galasa.zos3270.spi.NetworkException; +import dev.galasa.zos3270.util.Zos3270TestBase; + +public class ReadPartitionTest extends Zos3270TestBase { -public class ReadPartitionTest { @Test public void testGoldenPath() throws NetworkException { @@ -31,7 +33,7 @@ public void testGoldenPath() throws NetworkException { buffer.put(StructuredFieldReadPartition.QUERY); buffer.flip(); - Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer); + Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer, ebcdic); List fields = inbound.getStructuredFields(); Assert.assertEquals("Count of fields", 1, fields.size()); @@ -57,7 +59,7 @@ public void testQueryListEquivalent() throws NetworkException { buffer.put(qcodeList); buffer.flip(); - Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer); + Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer, ebcdic); List fields = inbound.getStructuredFields(); Assert.assertEquals("Count of fields", 1, fields.size()); @@ -84,7 +86,7 @@ public void testQueryListEquivalentNoList() throws NetworkException { buffer.put(StructuredFieldReadPartition.REQTYP_EQUIVALENT); buffer.flip(); - Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer); + Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer, ebcdic); List fields = inbound.getStructuredFields(); Assert.assertEquals("Count of fields", 1, fields.size()); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminalTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminalTest.java new file mode 100644 index 000000000..b1736760a --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/internal/gherkin/Gherkin3270GivenTerminalTest.java @@ -0,0 +1,154 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.internal.gherkin; + +import java.util.Map; + +import org.junit.Test; + +import dev.galasa.framework.spi.language.gherkin.GherkinTest; +import dev.galasa.zos3270.Zos3270ManagerException; +import dev.galasa.zos3270.common.screens.TerminalSize; +import dev.galasa.zos3270.internal.Zos3270ManagerImpl; + +import static org.assertj.core.api.Assertions.*; + +public class Gherkin3270GivenTerminalTest { + + + public class MockZos3270Manager extends Zos3270ManagerImpl { + private Map cpsProperties; + + public MockZos3270Manager(Map cpsProperties) { + this.cpsProperties = cpsProperties; + } + + public String getCpsProperty(String fullPropertyName) throws Zos3270ManagerException { + return cpsProperties.get(fullPropertyName); + } + } + + public class MockGherkinCoordinator extends Gherkin3270Coordinator { + public MockGherkinCoordinator(Zos3270ManagerImpl manager, GherkinTest gherkinTest) { + super(manager, gherkinTest); + } + } + + @Test + public void testGherkin3270GivenTerminalCanBeCreatedOk() { + + Map cpsProps = Map.of(); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + } + + @Test + public void testGherkin3270CanGetDefaultPreferredTerminalSizeEmptyCPS() throws Exception { + Map cpsProps = Map.of( + // "zos3270.gherkin.terminal.rows","24", + // "zos3270.gherkin.terminal.columns","80" + ); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + Gherkin3270GivenTerminal terminal = new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + TerminalSize preferredTerminalSize = terminal.getPreferredTerminalSize("",""); + + assertThat(preferredTerminalSize.getRows()).isEqualTo(Gherkin3270GivenTerminal.DEFAULT_TERMINAL_ROWS); + assertThat(preferredTerminalSize.getColumns()).isEqualTo(Gherkin3270GivenTerminal.DEFAULT_TERMINAL_COLUMNS); + } + + @Test + public void testGherkin3270CanGetDefaultPreferredTerminalSizeFromCPS() throws Exception { + Map cpsProps = Map.of( + "zos3270.gherkin.terminal.rows","25", + "zos3270.gherkin.terminal.columns","81" + ); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + Gherkin3270GivenTerminal terminal = new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + TerminalSize preferredTerminalSize = terminal.getPreferredTerminalSize("",""); + + assertThat(preferredTerminalSize.getRows()).isEqualTo(25); + assertThat(preferredTerminalSize.getColumns()).isEqualTo(81); + } + + @Test + public void testGherkin3270CanGetDefaultPreferredTerminalSizeFromGherkinStatement() throws Exception { + Map cpsProps = Map.of( + "zos3270.gherkin.terminal.rows","25", + "zos3270.gherkin.terminal.columns","81" + ); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + Gherkin3270GivenTerminal terminal = new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + TerminalSize preferredTerminalSize = terminal.getPreferredTerminalSize("48","64"); + + assertThat(preferredTerminalSize.getRows()).isEqualTo(48); + assertThat(preferredTerminalSize.getColumns()).isEqualTo(64); + } + + @Test + public void testGherkin3270GetDefaultPreferredTerminalSizeFailsIfCPSRowsPropNotANumber() throws Exception { + Map cpsProps = Map.of( + "zos3270.gherkin.terminal.rows","hello" + // "zos3270.gherkin.terminal.columns","81" + ); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + Gherkin3270GivenTerminal terminal = new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + + // When... + Zos3270ManagerException ex = catchThrowableOfType( + () -> terminal.getPreferredTerminalSize("",""), + Zos3270ManagerException.class ); + + assertThat(ex).hasMessageContaining("does not contain a number"); + } + + @Test + public void testGherkin3270GetDefaultPreferredTerminalSizeFailsIfGherkinStatementValueNotANumber() throws Exception { + Map cpsProps = Map.of( + "zos3270.gherkin.terminal.rows","25", + "zos3270.gherkin.terminal.columns","81" + ); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + Gherkin3270GivenTerminal terminal = new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + + // When... + Zos3270ManagerException ex = catchThrowableOfType( + () -> terminal.getPreferredTerminalSize("hello-notanumber","notanumber"), + Zos3270ManagerException.class ); + + assertThat(ex).hasMessageContaining("does not contain a number"); + } + + @Test + public void testGherkin3270GetDefaultPreferredTerminalSizeFailsIfCPSColumnsPropNotANumber() throws Exception { + Map cpsProps = Map.of( + "zos3270.gherkin.terminal.rows","24", + "zos3270.gherkin.terminal.columns","hello" + ); + MockZos3270Manager mockManager = new MockZos3270Manager(cpsProps); + MockGherkinCoordinator mockCoordinator = new MockGherkinCoordinator(mockManager, null); + + Gherkin3270GivenTerminal terminal = new Gherkin3270GivenTerminal(mockCoordinator, mockManager); + + // When... + Zos3270ManagerException ex = catchThrowableOfType( + () -> terminal.getPreferredTerminalSize("",""), + Zos3270ManagerException.class ); + + assertThat(ex).hasMessageContaining("does not contain a number"); + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/ConnectTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/ConnectTest.java similarity index 96% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/ConnectTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/ConnectTest.java index 200ff7dc2..f486248ef 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/ConnectTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/ConnectTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.network; +package dev.galasa.zos3270.network; import static org.junit.Assert.fail; @@ -17,8 +17,8 @@ import dev.galasa.zos3270.internal.comms.Network; import dev.galasa.zos3270.spi.NetworkException; -import test.zos3270.util.DummySocket; -import test.zos3270.util.DummySocketImpl; +import dev.galasa.zos3270.util.DummySocket; +import dev.galasa.zos3270.util.DummySocketImpl; public class ConnectTest { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/Message3270Test.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/Message3270Test.java similarity index 95% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/Message3270Test.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/Message3270Test.java index 71be8ceed..7eb3b92e6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/Message3270Test.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/Message3270Test.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.network; +package dev.galasa.zos3270.network; import static org.junit.Assert.fail; @@ -14,7 +14,6 @@ import org.junit.Assert; import org.junit.Test; -import dev.galasa.zos3270.internal.comms.Network; import dev.galasa.zos3270.internal.comms.NetworkThread; import dev.galasa.zos3270.spi.NetworkException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/NegotiationTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/NegotiationTest.java similarity index 94% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/NegotiationTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/NegotiationTest.java index 7726d535a..66c06be5a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/NegotiationTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/NegotiationTest.java @@ -1,13 +1,10 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.network; +package dev.galasa.zos3270.network; -import static org.junit.Assert.fail; - -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -15,13 +12,6 @@ import java.io.UnsupportedEncodingException; import java.net.Socket; -import org.junit.Assert; -import org.junit.Test; - -import dev.galasa.zos3270.internal.comms.Network; -import dev.galasa.zos3270.spi.NetworkException; -import test.zos3270.util.IOExceptionInputStream; - public class NegotiationTest { public static final byte IAC = -1; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/Network3270Test.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/Network3270Test.java similarity index 94% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/Network3270Test.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/Network3270Test.java index 99236f9ae..07d7d52fd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/network/Network3270Test.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/network/Network3270Test.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.network; +package dev.galasa.zos3270.network; import static org.junit.Assert.fail; @@ -23,9 +23,9 @@ import dev.galasa.zos3270.internal.datastream.AbstractCommandCode; import dev.galasa.zos3270.internal.datastream.OrderInsertCursor; import dev.galasa.zos3270.spi.NetworkException; -import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class Network3270Test { +public class Network3270Test extends Zos3270TestBase { @Mock private Network network; @@ -50,7 +50,7 @@ public void testProcessMessage() throws NetworkException, IOException, TerminalI ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - NetworkThread networkThread = new NetworkThread(null, new Screen(), null, bais); + NetworkThread networkThread = new NetworkThread(null, CreateTestScreen(), null, bais); networkThread.processMessage(bais); Assert.assertTrue("Will test the screen at this point, later", true); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/orders/EraseAllUnprotectedTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/orders/EraseAllUnprotectedTest.java similarity index 90% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/orders/EraseAllUnprotectedTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/orders/EraseAllUnprotectedTest.java index 5b9718679..a7f1e7df6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/orders/EraseAllUnprotectedTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/orders/EraseAllUnprotectedTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.orders; +package dev.galasa.zos3270.orders; import static org.assertj.core.api.Assertions.assertThat; @@ -22,15 +22,16 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the Erase All Unprotected order * - * @author Michael Baylis + * * */ -public class EraseAllUnprotectedTest { - +public class EraseAllUnprotectedTest extends Zos3270TestBase { + /** * Test with two fields * @@ -39,19 +40,19 @@ public class EraseAllUnprotectedTest { @Test public void testEuaGoldPath() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(6))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("ABC")); + orders.add(new OrderText("ABC", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("67890")); + orders.add(new OrderText("67890", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(16))); orders.add(new OrderStartField(true, false, true, false, false, false)); @@ -84,19 +85,19 @@ public void testEuaGoldPath() throws Exception { @Test public void testEuaFullScreen() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(6))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("ABC")); + orders.add(new OrderText("ABC", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("67890")); + orders.add(new OrderText("67890", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(16))); orders.add(new OrderStartField(true, false, true, false, false, false)); @@ -129,19 +130,19 @@ public void testEuaFullScreen() throws Exception { @Test public void testEuaMidField() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(6))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("ABC")); + orders.add(new OrderText("ABC", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("67890")); + orders.add(new OrderText("67890", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(16))); orders.add(new OrderStartField(true, false, true, false, false, false)); @@ -174,19 +175,19 @@ public void testEuaMidField() throws Exception { @Test public void testEuaWrap() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(6))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("ABC")); + orders.add(new OrderText("ABC", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("67890")); + orders.add(new OrderText("67890", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(16))); orders.add(new OrderStartField(true, false, true, false, false, false)); @@ -219,19 +220,19 @@ public void testEuaWrap() throws Exception { @Test public void testEuaProtected() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(6))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("ABC")); + orders.add(new OrderText("ABC", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("67890")); + orders.add(new OrderText("67890", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(16))); orders.add(new OrderStartField(true, false, true, false, false, false)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/orders/GraphicsEscapeTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/orders/GraphicsEscapeTest.java similarity index 82% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/orders/GraphicsEscapeTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/orders/GraphicsEscapeTest.java index 7d7982e9a..00cc171e1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/orders/GraphicsEscapeTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/orders/GraphicsEscapeTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.orders; +package dev.galasa.zos3270.orders; import static org.assertj.core.api.Assertions.assertThat; @@ -24,14 +24,15 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; /** * Test the Graphics Escape order * - * @author Michael Baylis + * * */ -public class GraphicsEscapeTest { +public class GraphicsEscapeTest extends Zos3270TestBase { /** * Test with two fields @@ -41,7 +42,7 @@ public class GraphicsEscapeTest { @Test public void testGeGoldenPath() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ByteBuffer geBuffer = ByteBuffer.wrap(new byte[] {0x50}); @@ -49,9 +50,9 @@ public void testGeGoldenPath() throws Exception { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); orders.add(new OrderGraphicsEscape(geBuffer)); - orders.add(new OrderText("6789ABCDEFGHIJ")); + orders.add(new OrderText("6789ABCDEFGHIJ", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -67,7 +68,7 @@ public void testGeGoldenPath() throws Exception { */ @Test public void testGeConvertToDatastream() throws Exception { - Screen screen = new Screen(6, 1, null); + Screen screen = CreateTestScreen(6, 1, null); screen.erase(); ByteBuffer geBuffer = ByteBuffer.wrap(new byte[] {0x50}); @@ -75,9 +76,9 @@ public void testGeConvertToDatastream() throws Exception { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, true)); // needs modified to ensure field written outbound - orders.add(new OrderText("12")); + orders.add(new OrderText("12", ebcdic)); orders.add(new OrderGraphicsEscape(geBuffer)); - orders.add(new OrderText("34")); + orders.add(new OrderText("34", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -89,7 +90,7 @@ public void testGeConvertToDatastream() throws Exception { System.out.println(hexDatastream); - assertThat(hexDatastream).as("Expected outbound datastream").isEqualTo("7D40401140C1F1F20850F3F4"); + assertThat(hexDatastream).as("Expected outbound datastream").isEqualTo("7D40401140C1F1F20850F3F4"); // expected output as a hex code, not a secret //pragma: allowlist secret } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/CursorTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/CursorTest.java similarity index 89% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/CursorTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/CursorTest.java index 113198d8e..9085044c3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/CursorTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/CursorTest.java @@ -1,7 +1,9 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.terminal; +package dev.galasa.zos3270.terminal; import static org.assertj.core.api.Assertions.assertThat; @@ -23,12 +25,13 @@ import dev.galasa.zos3270.spi.DatastreamException; import dev.galasa.zos3270.spi.Screen; import dev.galasa.zos3270.spi.Terminal; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class CursorTest { +public class CursorTest extends Zos3270TestBase { - //@Test + @Test public void goldenPath() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); setScreen(screen); @@ -39,9 +42,9 @@ public void goldenPath() throws KeyboardLockedException, Zos3270Exception { assertThat(bufferPos).as("Buffer position after setCursorPosition").isEqualTo(14); } - //@Test + @Test public void exceedsBuffer() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); setScreen(screen); @@ -61,9 +64,9 @@ public void exceedsBuffer() throws KeyboardLockedException, Zos3270Exception { } } - //@Test + @Test public void invalidPositions() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); setScreen(screen); @@ -100,10 +103,10 @@ private void setScreen(Screen screen) throws DatastreamException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, false, false, false, false)); - orders.add(new OrderText("abcd")); + orders.add(new OrderText("abcd", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, false, false, false, false)); - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/EraseInputTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/EraseInputTest.java similarity index 87% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/EraseInputTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/EraseInputTest.java index 927525cdf..4e2f8d166 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/EraseInputTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/EraseInputTest.java @@ -1,4 +1,9 @@ -package test.zos3270.terminal; +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.terminal; import static org.assertj.core.api.Assertions.assertThat; @@ -15,9 +20,10 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class EraseInputTest { +public class EraseInputTest extends Zos3270TestBase { /** * Test golden path with 4 fields @@ -27,22 +33,22 @@ public class EraseInputTest { @Test public void testGoldenPath() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(5))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("5678")); + orders.add(new OrderText("5678", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("ABCD")); + orders.add(new OrderText("ABCD", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(15))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("EFGH")); + orders.add(new OrderText("EFGH", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -68,22 +74,22 @@ public void testGoldenPath() throws Exception { @Test public void testProtected() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(5))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("5678")); + orders.add(new OrderText("5678", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("ABCD")); + orders.add(new OrderText("ABCD", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(15))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("EFGH")); + orders.add(new OrderText("EFGH", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -110,12 +116,12 @@ public void testProtected() throws Exception { @Test public void testUnformatted() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderText("1234567890ABCDEFGHIJ")); + orders.add(new OrderText("1234567890ABCDEFGHIJ", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -136,21 +142,21 @@ public void testUnformatted() throws Exception { @Test public void testWrapped() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderText("12345")); + orders.add(new OrderText("12345", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(5))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("5678")); + orders.add(new OrderText("5678", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("ABCD")); + orders.add(new OrderText("ABCD", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(15))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("EFGH")); + orders.add(new OrderText("EFGH", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/FindTextTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/FindTextTest.java similarity index 88% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/FindTextTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/FindTextTest.java index 9b38a08e4..2c2f74385 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/FindTextTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/FindTextTest.java @@ -1,4 +1,9 @@ -package test.zos3270.terminal; +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.terminal; import java.util.ArrayList; @@ -16,18 +21,19 @@ import dev.galasa.zos3270.internal.datastream.OrderText; import dev.galasa.zos3270.internal.datastream.WriteControlCharacter; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class FindTextTest { +public class FindTextTest extends Zos3270TestBase { @Test public void testSimple() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("Find this message here")); + orders.add(new OrderText("Find this message here", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -50,13 +56,13 @@ public void testSimple() throws Exception { @Test public void testOk() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("Find this message here")); + orders.add(new OrderText("Find this message here", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -79,13 +85,13 @@ public void testOk() throws Exception { @Test public void testError() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("Find this message here")); + orders.add(new OrderText("Find this message here", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -116,13 +122,13 @@ public void testError() throws Exception { @Test public void testMultiSearch() throws Exception { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, true, false, false, false)); - orders.add(new OrderText("Find this message here")); + orders.add(new OrderText("Find this message here", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/RetrieveTextTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/RetrieveTextTest.java similarity index 89% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/RetrieveTextTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/RetrieveTextTest.java index 709c335c3..61729f765 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/RetrieveTextTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/RetrieveTextTest.java @@ -1,7 +1,9 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.terminal; +package dev.galasa.zos3270.terminal; import static org.assertj.core.api.Assertions.assertThat; @@ -23,12 +25,13 @@ import dev.galasa.zos3270.spi.DatastreamException; import dev.galasa.zos3270.spi.Screen; import dev.galasa.zos3270.spi.Terminal; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class RetrieveTextTest { +public class RetrieveTextTest extends Zos3270TestBase { - //@Test + @Test public void goldenPathByPosition() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); setScreen(screen); @@ -42,9 +45,9 @@ public void goldenPathByPosition() throws KeyboardLockedException, Zos3270Except assertThat(text).as("Check all text in screen without nulls").isEqualTo(" abcd 1234 "); } - //@Test + @Test public void goldenPathByCursor() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); setScreen(screen); @@ -64,12 +67,13 @@ public void goldenPathByCursor() throws KeyboardLockedException, Zos3270Exceptio assertThat(text).as("Check all text in screen without nulls").isEqualTo(" abcd 1234 "); } - //@Test + @Test public void tooLongByPosition() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); - + setScreen(screen); + try { terminal.retrieveText(2, 1, 11); Assert.fail("Should have thrown an exception"); @@ -85,13 +89,13 @@ public void tooLongByPosition() throws KeyboardLockedException, Zos3270Exception } } - - //@Test + @Test public void tooLongByCursor() throws KeyboardLockedException, Zos3270Exception { - Terminal terminal = new Terminal("test", "", 0, false, 10, 2, 0, 0, null); + Terminal terminal = CreateTestTerminal(); Screen screen = terminal.getScreen(); - + setScreen(screen); + terminal.setCursorPosition(2, 1); try { terminal.retrieveTextAtCursor(11); @@ -109,15 +113,14 @@ public void tooLongByCursor() throws KeyboardLockedException, Zos3270Exception { } } - private void setScreen(Screen screen) throws DatastreamException { ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, false, false, false, false)); - orders.add(new OrderText("abcd")); + orders.add(new OrderText("abcd", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); orders.add(new OrderStartField(false, false, false, false, false, false)); - orders.add(new OrderText("1234")); + orders.add(new OrderText("1234", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/ScreenTest.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/ScreenTest.java similarity index 88% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/ScreenTest.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/ScreenTest.java index be5102958..c9332d600 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/terminal/ScreenTest.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/terminal/ScreenTest.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.terminal; +package dev.galasa.zos3270.terminal; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; @@ -35,18 +35,19 @@ import dev.galasa.zos3270.spi.DatastreamException; import dev.galasa.zos3270.spi.NetworkException; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class ScreenTest { +public class ScreenTest extends Zos3270TestBase { @Test public void testScreenSize() throws TerminalInterruptedException { - Assert.assertEquals("default screen size incorrect", 1920, new Screen().getScreenSize()); - Assert.assertEquals("small screen size incorrect", 20, new Screen(10, 2, null).getScreenSize()); + Assert.assertEquals("default screen size incorrect", 1920, CreateTestScreen().getScreenSize()); + Assert.assertEquals("small screen size incorrect", 20, CreateTestScreen(10, 2, null).getScreenSize()); } @Test public void testErase() throws TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); Assert.assertEquals("Erase fields are incorrect", @@ -57,10 +58,10 @@ public void testErase() throws TerminalInterruptedException { @Test public void testEraseUsingRA() throws DatastreamException, TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderRepeatToAddress((char) 0x00, new BufferAddress(0))); + orders.add(new OrderRepeatToAddress((char) 0x00, new BufferAddress(0), ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -72,19 +73,19 @@ public void testEraseUsingRA() throws DatastreamException, TerminalInterruptedEx @Test public void testOrders() throws DatastreamException, TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderText("Hello")); + orders.add(new OrderText("Hello", ebcdic)); orders.add(new OrderStartField(false, false, false, false, false, false)); orders.add(new OrderInsertCursor()); - orders.add(new OrderRepeatToAddress('X', new BufferAddress(10))); + orders.add(new OrderRepeatToAddress('X', new BufferAddress(10), ebcdic)); orders.add(new OrderStartField(true, false, true, false, false, false)); - orders.add(new OrderRepeatToAddress('y', new BufferAddress(14))); - orders.add(new OrderRepeatToAddress('z', new BufferAddress(17))); + orders.add(new OrderRepeatToAddress('y', new BufferAddress(14), ebcdic)); + orders.add(new OrderRepeatToAddress('z', new BufferAddress(17), ebcdic)); orders.add(new OrderStartField(true, false, true, false, false, false)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), @@ -101,11 +102,11 @@ public void testOrders() throws DatastreamException, TerminalInterruptedExceptio @Test public void testOrdersInsertAndTail() throws DatastreamException, TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderRepeatToAddress('x', new BufferAddress(19))); + orders.add(new OrderRepeatToAddress('x', new BufferAddress(19), ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(true, false, true, false, false, false)); orders.add(new OrderSetBufferAddress(new BufferAddress(19))); @@ -123,7 +124,7 @@ public void testOrdersInsertAndTail() throws DatastreamException, TerminalInterr @Test public void testOrdersJumbled() throws DatastreamException, TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); @@ -131,9 +132,9 @@ public void testOrdersJumbled() throws DatastreamException, TerminalInterruptedE orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, false, false, false, false)); orders.add(new OrderSetBufferAddress(new BufferAddress(11))); - orders.add(new OrderText("123456789")); + orders.add(new OrderText("123456789", ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(1))); - orders.add(new OrderText("abcdefghi")); + orders.add(new OrderText("abcdefghi", ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -147,15 +148,15 @@ public void testOrdersJumbled() throws DatastreamException, TerminalInterruptedE @Test public void testOrdersReplacedAll() throws DatastreamException, TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); screen.erase(); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); orders.add(new OrderStartField(false, false, false, false, false, false)); - orders.add(new OrderRepeatToAddress('X', new BufferAddress(20))); + orders.add(new OrderRepeatToAddress('X', new BufferAddress(20), ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderRepeatToAddress('X', new BufferAddress(20))); + orders.add(new OrderRepeatToAddress('X', new BufferAddress(20), ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -167,15 +168,15 @@ public void testOrdersReplacedAll() throws DatastreamException, TerminalInterrup @Test public void testOrderReplaceMiddle() throws DatastreamException, TerminalInterruptedException { - Screen screen = new Screen(10, 2, null); + Screen screen = CreateTestScreen(10, 2, null); ArrayList orders = new ArrayList<>(); orders.add(new OrderSetBufferAddress(new BufferAddress(0))); - orders.add(new OrderRepeatToAddress('X', new BufferAddress(10))); + orders.add(new OrderRepeatToAddress('X', new BufferAddress(10), ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(10))); - orders.add(new OrderRepeatToAddress('Y', new BufferAddress(20))); + orders.add(new OrderRepeatToAddress('Y', new BufferAddress(20), ebcdic)); orders.add(new OrderSetBufferAddress(new BufferAddress(5))); - orders.add(new OrderRepeatToAddress('Z', new BufferAddress(10))); + orders.add(new OrderRepeatToAddress('Z', new BufferAddress(10), ebcdic)); screen.processInboundMessage(new Inbound3270Message(new CommandEraseWrite(), new WriteControlCharacter(false, false, false, false, false, false, true, true), orders)); @@ -188,10 +189,10 @@ public void testOrderReplaceMiddle() throws DatastreamException, TerminalInterru // @Test public void testProcessReadPartitionQueryListEquivalent() throws TerminalInterruptedException, NetworkException { Network network = mock(Network.class); - Screen screen = new Screen(80, 24, network); + Screen screen = CreateTestScreen(80, 24, network); ByteBuffer buffer = createQueryListBuffer(StructuredFieldReadPartition.REQTYP_EQUIVALENT, (byte) 0x80, (byte) 0x81, (byte) 0xa6, (byte) 0x85); - Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer); + Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer, ebcdic); screen.processInboundMessage(inbound); @@ -201,11 +202,11 @@ public void testProcessReadPartitionQueryListEquivalent() throws TerminalInterru // @Test public void testProcessReadPartitionQueryListNoSupportedFunctions() throws TerminalInterruptedException, NetworkException { Network network = mock(Network.class); - Screen screen = new Screen(80, 24, network); + Screen screen = CreateTestScreen(80, 24, network); // query "Graphic Color" & "Graphic Symbol Sets" which are unsupported ByteBuffer buffer = createQueryListBuffer(StructuredFieldReadPartition.REQTYP_LIST, (byte) 0xb4, (byte) 0xb6); - Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer); + Inbound3270Message inbound = NetworkThread.processStructuredFields(new CommandWriteStructured(), buffer, ebcdic); screen.processInboundMessage(inbound); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/DummySocket.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/DummySocket.java similarity index 81% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/DummySocket.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/DummySocket.java index 600fad09e..d37a7f2ee 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/DummySocket.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/DummySocket.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.util; +package dev.galasa.zos3270.util; import java.io.IOException; import java.net.Socket; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/DummySocketImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/DummySocketImpl.java similarity index 95% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/DummySocketImpl.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/DummySocketImpl.java index 70063dc8a..fa59a888e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/DummySocketImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/DummySocketImpl.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.util; +package dev.galasa.zos3270.util; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/IOExceptionInputStream.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/IOExceptionInputStream.java similarity index 66% rename from galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/IOExceptionInputStream.java rename to galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/IOExceptionInputStream.java index d165ea708..e27f7b643 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/test/zos3270/util/IOExceptionInputStream.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/IOExceptionInputStream.java @@ -1,9 +1,9 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ -package test.zos3270.util; +package dev.galasa.zos3270.util; import java.io.IOException; import java.io.InputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/Zos3270TestBase.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/Zos3270TestBase.java new file mode 100644 index 000000000..768fa6e01 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/dev/galasa/zos3270/util/Zos3270TestBase.java @@ -0,0 +1,57 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zos3270.util; + +import java.nio.charset.Charset; + +import dev.galasa.textscan.ILogScanner; +import dev.galasa.textscan.ITextScanner; +import dev.galasa.textscan.TextScanManagerException; +import dev.galasa.textscan.internal.LogScannerImpl; +import dev.galasa.textscan.internal.TextScannerImpl; +import dev.galasa.textscan.spi.ITextScannerManagerSpi; +import dev.galasa.zos3270.TerminalInterruptedException; +import dev.galasa.zos3270.common.screens.TerminalSize; +import dev.galasa.zos3270.internal.comms.Network; +import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.spi.Terminal; + +public class Zos3270TestBase { + + protected static Charset ebcdic = Charset.forName("Cp037"); + + protected Terminal CreateTestTerminal() throws TerminalInterruptedException { + TerminalSize terminalSize = new TerminalSize(10, 2); + TerminalSize alternateTerminalSize = new TerminalSize(0, 0); + ITextScanner textScanner = new TextScannerImpl(); + ILogScanner logScanner = new LogScannerImpl(); + + ITextScannerManagerSpi mockTextScannerManager = new ITextScannerManagerSpi() { + + @Override + public ITextScanner getTextScanner() throws TextScanManagerException { + return textScanner; + } + + @Override + public ILogScanner getLogScanner() throws TextScanManagerException { + return logScanner; + } + }; + return new Terminal("test", "", 0, false, terminalSize, alternateTerminalSize, mockTextScannerManager, ebcdic); + } + + protected Screen CreateTestScreen() throws TerminalInterruptedException { + return CreateTestScreen(80, 24, null); + } + + protected static Screen CreateTestScreen(int columns, int rows, Network network) throws TerminalInterruptedException { + TerminalSize terminalSize = new TerminalSize(columns, rows); + TerminalSize alternateTerminalSize = new TerminalSize(0, 0); + + return new Screen(terminalSize, alternateTerminalSize, network, ebcdic); + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestColour.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestColour.java new file mode 100644 index 000000000..76282f600 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestColour.java @@ -0,0 +1,46 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package t; + +import java.nio.ByteBuffer; + +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Hex; + +import dev.galasa.zos3270.Zos3270Exception; +import dev.galasa.zos3270.internal.comms.Inbound3270Message; +import dev.galasa.zos3270.internal.comms.Network; +import dev.galasa.zos3270.internal.comms.NetworkThread; +import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; + +public class TestColour extends Zos3270TestBase { + + + public static void main(String[] args) throws DecoderException, Zos3270Exception { + + String inbound = "f5c2115b611311c2601df8d59699948193408689859384a211c5401df0d596999481931df8c995a38595a28511c6501d40e385a2a340c99597a4a3404040401df011c8f0290341f442f7c0f8c889878893898788a3899587114b50290341f242f2c0f0d9858440d985a58599a285290341f242f2c0f0d98584408187818995114c6f290341f242f1c0f0c293a48540d985a58599a285290341f242f3c0f0d789959240d985a58599a285290341f242f4c0f0c79985859540d985a58599a285290341f242f5c0f0e3a49998a49689a28540d985a58599a285114df0290341f242f7c0f0e68889a38540d985a58599a28511505e290341f442f6c0f0e885939396a640e4958485999389958511d27a290341f142f6c0f0e885939396a640c29389959211d55c290242f6c0f0e885939396a640d6a4a393899585114c60290341f242f6c0f0e885939396a640d985a58599a285114040290242f7c0f0e385a2a340c5a7a3859584858440c481a381a2a39985819440d4819711d550290242f2c0f0d9858440d6a4a39389958511d940290242f2c0f0d98584290242f1c0f0c293a485290242f3c0f0d7899592290242f4c0f0c799858595290242f5c0f0e3a49998a49689a285290242f6c0f0e885939396a6290242f7c0f0e68889a3851df0c4858681a493a3115a50290242f2c0f8d98584290242f1c0f8c293a485290242f3c0f8d7899592290242f4c0f8c799858595290242f5c0f8e3a49998a49689a285290242f6c0f8e885939396a6290242f7c0f8e68889a3851df8c4858681a493a311d2f0290341f142f2c0f0d9858440c293899592115050290341f442f2c0f0d9858440e49584859993899585115b60290341f442f4c0c1115c6f1df0"; // expected input as a hex code, not a secret //pragma: allowlist secret + byte[] inboundBytes = Hex.decodeHex(inbound); + + Network network = new Network("here", 1, "a"); + Screen screen = CreateTestScreen(80, 24, network); + NetworkThread networkThread = new NetworkThread(null, screen, network, null); + + ByteBuffer buffer = ByteBuffer.wrap(inboundBytes); + Inbound3270Message im = networkThread.process3270Data(buffer); + screen.processInboundMessage(im); + // System.out.println(screen.printScreenTextWithCursor()); + + System.out.println(screen.printExtendedScreen(false, true, true, false, false, false, false)); +// System.out.println(screen.printExtendedScreen(true, true, true, true, true, true, true)); + + // for(Field field : screen.calculateFields()) { + // System.out.println(field); + // } + + } + +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestInbound.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestInbound.java index d31fcc60e..9f8216bfa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestInbound.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zos3270.manager/src/test/java/t/TestInbound.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package t; import java.nio.ByteBuffer; @@ -7,27 +12,29 @@ import dev.galasa.zos3270.TerminalInterruptedException; import dev.galasa.zos3270.internal.comms.Inbound3270Message; +import dev.galasa.zos3270.internal.comms.Network; import dev.galasa.zos3270.internal.comms.NetworkThread; import dev.galasa.zos3270.spi.Field; import dev.galasa.zos3270.spi.NetworkException; import dev.galasa.zos3270.spi.Screen; +import dev.galasa.zos3270.util.Zos3270TestBase; -public class TestInbound { +public class TestInbound extends Zos3270TestBase { public static void main(String[] args) throws TerminalInterruptedException, NetworkException, DecoderException { // String inbound = "f5c01140c1131140401d004a54444a53303120776173207375636365737366756c2e204a534f4e20636f6e76657274656420746f20446174612e2020205472616e73666f726d20636f6d6d616e64207375636365737366756c2e1d00200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001d00200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001d00200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001d0020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - String inbound1 = "f5c311c5e41311405d290242f1c0f8c3e5c6d4e2f0f140e3c5e2e340d4c1d7e2c5e311c5d21d60c3e4e2e3d6d4c5d940d5e4d4c2c5d97a1dd1f1f1f1f1f1f11df011c7f6290242f1c060d7c1d9e340d5e4d4c2c5d97a1dd1f2f2f2f2f2f2f2f2f2f21df0114ad9290242f1c060d8e4c1d5e3c9e3e87a1dd1f3f3f3f340401df0115a50290242f2c061c3d6d5e3d9d6d340e3c5e2e34040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040"; + String inbound1 = "f5c311c5e41311405d290242f1c0f8c3e5c6d4e2f0f140e3c5e2e340d4c1d7e2c5e311c5d21d60c3e4e2e3d6d4c5d940d5e4d4c2c5d97a1dd1f1f1f1f1f1f11df011c7f6290242f1c060d7c1d9e340d5e4d4c2c5d97a1dd1f2f2f2f2f2f2f2f2f2f21df0114ad9290242f1c060d8e4c1d5e3c9e3e87a1dd1f3f3f3f340401df0115a50290242f2c061c3d6d5e3d9d6d340e3c5e2e34040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040"; // expected input as a hex code, not a secret //pragma: allowlist secret String inbound2 = "f140114040124040"; String inbound3 = "f1c611c26013"; byte[] inbound1Bytes = Hex.decodeHex(inbound1); byte[] inbound2Bytes = Hex.decodeHex(inbound2); byte[] inbound3Bytes = Hex.decodeHex(inbound3); - - Screen screen = new Screen(80, 24, null); + Network network = new Network("here", 1, "a"); + Screen screen = CreateTestScreen(80, 24, network); NetworkThread networkThread = new NetworkThread(null, screen, null, null); ByteBuffer buffer = ByteBuffer.wrap(inbound1Bytes); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/build.gradle index 2c6ab7b38..115888375 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/build.gradle @@ -4,10 +4,23 @@ plugins { description = 'Galasa zOS Batch Manager - RSE API Implementation' -version = '0.25.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zosrseapi.manager') - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'org.apache.commons:commons-lang3:3.14.0' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/settings.gradle index 3197bac73..4041670e8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosbatch.rseapi.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosbatch.rseapi.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiJobStatus.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiJobStatus.java new file mode 100644 index 000000000..3209c6fa6 --- /dev/null +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiJobStatus.java @@ -0,0 +1,58 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ +package dev.galasa.zosbatch.rseapi.manager.internal; + +/** + * An enum to hold the statuses of a batch job that can be returned from the RSE + * API. + */ +public enum RseapiJobStatus { + HOLD("HOLD"), + ACTIVE("ACTIVE"), + ABEND("ABEND", true), + COMPLETED("COMPLETED", true), + COMPLETION("COMPLETION", true), + NOTFOUND("NOT_FOUND", true), + UNKNOWN("UNKNOWN"); + + private String value; + private boolean isCompleteStatus; + + private RseapiJobStatus(String value) { + this.value = value; + this.isCompleteStatus = false; + } + + private RseapiJobStatus(String value, boolean isCompleteStatus) { + this.value = value; + this.isCompleteStatus = isCompleteStatus; + } + + /** + * Converts a given string into an RseapiJobStatus enum value. If no enum value + * matches, then the UNKNOWN value will be assigned. + * + * @param jobStatus the string to convert + * @return an RseapiJobStatus enum value + */ + public static RseapiJobStatus getJobStatusFromString(String jobStatus) { + for (RseapiJobStatus status : values()) { + if (status.toString().equals(jobStatus)) { + return status; + } + } + return RseapiJobStatus.UNKNOWN; + } + + public boolean isComplete() { + return this.isCompleteStatus; + } + + @Override + public String toString() { + return this.value; + } +} diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchImpl.java index 3bd28440a..f30f85c74 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.rseapi.manager.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchJobImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchJobImpl.java index ef4c3742f..7295f4207 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchJobImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchJobImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosbatch.rseapi.manager.internal; @@ -339,10 +341,10 @@ public IZosBatchJobOutputSpoolFile getSpoolFile(String ddname) throws ZosBatchEx @Override public void saveOutputToResultsArchive(String rasPath) throws ZosBatchException { - if (jobOutput().isEmpty()) { + if (!this.outputComplete) { retrieveOutput(); } - Path artifactPath = this.zosBatchManager.getArtifactsRoot().resolve(rasPath); + Path artifactPath = this.zosBatchManager.getArtifactsRoot().resolve(rasPath).resolve(jobOutput().getJobname()); logger.info("Archiving batch job " + this.toString() + " to " + artifactPath.toString()); Iterator iterator = jobOutput().iterator(); @@ -383,8 +385,6 @@ public void saveSpoolFileToResultsArchive(IZosBatchJobOutputSpoolFile spoolFile, protected void saveSpoolFile(IZosBatchJobOutputSpoolFile spoolFile, Path artifactPath) throws ZosBatchException { StringBuilder name = new StringBuilder(); - name.append(spoolFile.getJobname()); - name.append("_"); name.append(spoolFile.getJobid()); if (!spoolFile.getStepname().isEmpty()){ name.append("_"); @@ -457,7 +457,7 @@ protected void getOutput(boolean retrieveRecords) throws ZosBatchException { throw new ZosBatchException(displayMessage); } - if (this.jobComplete) { + if (this.jobComplete && retrieveRecords) { this.outputComplete = true; } } @@ -590,16 +590,18 @@ protected void updateJobStatus() throws ZosBatchException { this.owner = jsonNull(responseBody, PROP_OWNER); this.type = jsonNull(responseBody, PROP_TYPE); this.statusString = jsonNull(responseBody, PROP_STATUS); - if (this.statusString != null && "COMPLETION".equals(this.statusString) || - this.statusString != null && "ABEND".equals(this.statusString)) { - this.jobComplete = true; - } else if (this.statusString != null && "NOT_FOUND".equals(this.statusString)) { - logger.trace("JOBID=" + this.jobid + " JOBNAME=" + this.jobname.getName() + " NOT FOUND"); + + // Update the completion status of this batch job + RseapiJobStatus status = RseapiJobStatus.getJobStatusFromString(this.statusString); + this.jobComplete = status.isComplete(); + + if (status == RseapiJobStatus.NOTFOUND) { + logger.trace("JOBID=" + this.jobid + " JOBNAME=" + this.jobname.getName() + " NOT FOUND"); this.jobNotFound = true; this.status = JobStatus.NOTFOUND; - this.jobComplete = true; } setStatus(this.statusString); + String retcodeProperty = jsonNull(responseBody, PROP_RETCODE); if (retcodeProperty != null) { this.retcode = retcodeProperty; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchManagerImpl.java index 83153d628..a02064ebd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/RseapiZosBatchManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.rseapi.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/package-info.java index 2921354fc..3b332189d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/main/java/dev/galasa/zosbatch/rseapi/manager/internal/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * z/OS Batch Manager - RSE API Internal Implementation diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchImpl.java index 552577cd9..c64283ba4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.rseapi.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchJobImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchJobImpl.java index a9c857d1c..40183b140 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchJobImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchJobImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.rseapi.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchManagerImpl.java index a6fa7c615..0fe8402a1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.rseapi.manager/src/test/java/dev/galasa/zosbatch/rseapi/manager/internal/TestRseapiZosBatchManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.rseapi.manager.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/build.gradle index 1d7c5c745..f303d92f2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/build.gradle @@ -4,10 +4,24 @@ plugins { description = 'Galasa zOS Batch Manager - zOS/MF Implementation' -version = '0.25.0' +version = '0.34.0' dependencies { api project(':galasa-managers-zos-parent:dev.galasa.zosmf.manager') - implementation 'com.google.code.gson:gson:2.8.5' - implementation 'org.apache.commons:commons-lang3:3.8.1' + implementation 'com.google.code.gson:gson:2.10.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/settings.gradle index 8627b7e41..e5c60b217 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosbatch.zosmf.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosbatch.zosmf.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchImpl.java index 620f9d375..73ff7c556 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.zosmf.manager.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchJobImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchJobImpl.java index 279c29a37..50cb50aee 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchJobImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchJobImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.zosmf.manager.internal; import java.nio.file.Path; @@ -338,10 +340,11 @@ public IZosBatchJobOutputSpoolFile getSpoolFile(String ddname) throws ZosBatchEx @Override public void saveOutputToResultsArchive(String rasPath) throws ZosBatchException { - if (jobOutput().isEmpty()) { + if(!this.outputComplete){ retrieveOutput(); } - Path artifactPath = this.zosBatchManager.getArtifactsRoot().resolve(rasPath); + + Path artifactPath = this.zosBatchManager.getArtifactsRoot().resolve(rasPath).resolve(jobOutput().getJobname()); logger.info("Archiving batch job " + this.toString() + " to " + artifactPath.toString()); Iterator iterator = jobOutput().iterator(); @@ -382,8 +385,6 @@ public void saveSpoolFileToResultsArchive(IZosBatchJobOutputSpoolFile spoolFile, protected void saveSpoolFile(IZosBatchJobOutputSpoolFile spoolFile, Path artifactPath) throws ZosBatchException { StringBuilder name = new StringBuilder(); - name.append(spoolFile.getJobname()); - name.append("_"); name.append(spoolFile.getJobid()); if (!spoolFile.getStepname().isEmpty()){ name.append("_"); @@ -404,7 +405,6 @@ protected void saveSpoolFile(IZosBatchJobOutputSpoolFile spoolFile, Path artifac } protected void getOutput(boolean retrieveRecords) throws ZosBatchException { - if (!submitted()) { throw new ZosBatchException(LOG_JOB_NOT_SUBMITTED); } @@ -453,6 +453,7 @@ protected void getOutput(boolean retrieveRecords) throws ZosBatchException { if(this.jobOutput == null) { this.jobOutput = this.zosBatchManager.getZosManager().newZosBatchJobOutput(this, this.jobname.getName(), this.jobid); } + ((IZosBatchJobOutputSpi) this.jobOutput).addSpoolFile(stepname, procstep, ddname, id, records); } } else if (response.getStatusCode() == HttpStatus.SC_NOT_FOUND && getStatus().equals(JobStatus.ACTIVE)) { @@ -469,7 +470,7 @@ protected void getOutput(boolean retrieveRecords) throws ZosBatchException { getSpoolFileContent("JCL", null, null, null); } - if (this.jobComplete) { + if (this.jobComplete && retrieveRecords) { this.outputComplete = true; } } @@ -632,7 +633,7 @@ protected void updateJobStatus() throws ZosBatchException { } protected String getSpoolFileContent(String id, String stepname, String procstep, String ddname) throws ZosBatchException { - + String path = this.jobFilesPath + "/" + id + "/records"; HashMap headers = new HashMap<>(); headers.put(ZosmfCustomHeaders.X_CSRF_ZOSMF_HEADER.toString(), ""); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchManagerImpl.java index df0058cef..9a61d02ed 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/ZosmfZosBatchManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.zosmf.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/package-info.java index 902df6bf8..5197c301b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/main/java/dev/galasa/zosbatch/zosmf/manager/internal/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * z/OS Batch Manager - z/OS MF Internal Implementation diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchImpl.java index 5458bba85..1dfd52b22 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.zosmf.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchJobImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchJobImpl.java index f2184c1b9..3789b0be4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchJobImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchJobImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.zosmf.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchManagerImpl.java index 398a89ba0..81557addb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosbatch.zosmf.manager/src/test/java/dev/galasa/zosbatch/zosmf/manager/internal/TestZosmfZosBatchManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosbatch.zosmf.manager.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/build.gradle index c943091e1..8567a7282 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/build.gradle @@ -10,3 +10,19 @@ dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zos.manager') implementation project(':galasa-managers-zos-parent:dev.galasa.zosunixcommand.ssh.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false + + + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/settings.gradle index 19b0a3043..b5008420c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosconsole.oeconsol.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosconsole.oeconsol.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleCommandImpl.java index 6e83bede0..ae33eef7c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleCommandImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleImpl.java index 27b24e659..eea7c8828 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager; import dev.galasa.ICredentials; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleManagerImpl.java index 49f89e2d9..30bef7780 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/OeconsolZosConsoleManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPath.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPath.java index 39c3f1364..88f2638c3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPath.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPath.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole.oeconsol.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPropertiesSingleton.java index d5d3db9cb..134927b5f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/OeconsolPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosconsole.oeconsol.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/package-info.java index 9ee3c1567..9995e028d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** *zOS Console Manager - oeconsol Internal Implementation - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/package-info.java index 26b667786..f8d317ec4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/main/java/dev/galasa/zosconsole/oeconsol/manager/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Console Manager - oeconsol Internal Implementation * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleCommandImpl.java index 52792d205..f1edc3031 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleCommandImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleImpl.java index 0ca8376ec..e053f18a0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleManagerImpl.java index a80329d05..c670f24db 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/TestOeconsolZosConsoleManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPath.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPath.java index 1d9b4ba75..0ccb2f812 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPath.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPath.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPropertiesSingleton.java index df446dc0e..0ea58d732 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.oeconsol.manager/src/test/java/dev/galasa/zosconsole/oeconsol/manager/internal/properties/TestOeconsolPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.oeconsol.manager.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/build.gradle index a1c55e022..36e5362f7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'Galasa Console zOS/MF Manager' -version = '0.21.0' +version = '0.31.0' dependencies { api project(':galasa-managers-zos-parent:dev.galasa.zosmf.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/settings.gradle index 143c80dc7..cd259163c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosconsole.zosmf.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosconsole.zosmf.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleCommandImpl.java index 71abf35e6..718c3f7b8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleCommandImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.zosmf.manager.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleImpl.java index baf708333..cf31099d7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.zosmf.manager.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleManagerImpl.java index ce99a7854..26c2611c7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/ZosmfZosConsoleManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.zosmf.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/package-info.java index 80b44bb6a..88ce8f47f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/main/java/dev/galasa/zosconsole/zosmf/manager/internal/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Console Manager - zOSMF Internal Implementation * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleCommandImpl.java index 95e6502b4..118fe5e67 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleCommandImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.zosmf.manager.internal; import org.apache.http.HttpStatus; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleImpl.java index bac62720c..fd71612a7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.zosmf.manager.internal; import org.apache.http.HttpStatus; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleManagerImpl.java index 86e58fd68..058857eb4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosconsole.zosmf.manager/src/test/java/dev/galasa/zosconsole/zosmf/manager/internal/TestZosmfZosConsoleManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosconsole.zosmf.manager.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/build.gradle index dd7ad46f3..a9340ba66 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/build.gradle @@ -4,14 +4,25 @@ plugins { description = 'Galasa zOS File Manager - RSE API Implementation' -version = '0.25.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zosrseapi.manager') - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'org.apache.commons:commons-lang3:3.14.0' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'org.apache.commons:commons-collections4:4.4' - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'org.apache.commons:commons-collections4:4.4' - implementation 'commons-io:commons-io:2.9.0' + implementation 'commons-io:commons-io:2.16.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/settings.gradle index 55f5fb72c..7444c5c97 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosfile.rseapi.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosfile.rseapi.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetAttributesListdsi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetAttributesListdsi.java index cdc5c5a7c..93725a7e8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetAttributesListdsi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetAttributesListdsi.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.rseapi.manager.internal; @@ -56,7 +58,7 @@ public class RseapiZosDatasetAttributesListdsi { private static final String PROP_SYSCREATE = "syscreate"; private static final String PROP_SYSREFDATE = "sysrefdate"; private static final String PROP_SYSEXDATE = "sysexdate"; - private static final String PROP_SYSPASSWORD = "syspassword"; + private static final String PROP_SYSPASSWORD = "syspassword"; //Not a password but a pointer to a password //pragma: allowlist secret private static final String PROP_SYSRACFA = "sysracfa"; private static final String PROP_SYSUPDATED = "sysupdated"; private static final String PROP_SYSTRKSCYL = "systrkscyl"; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetImpl.java index d12089c2a..f6f58ba93 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.io.ByteArrayOutputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileHandlerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileHandlerImpl.java index ab6282ac4..549b50630 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileHandlerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileHandlerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.nio.file.Path; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileManagerImpl.java index 343f9932e..cb5435357 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosFileManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUNIXFileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUNIXFileImpl.java index 2e131431f..d9baa0f3d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUNIXFileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUNIXFileImpl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.rseapi.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUnixCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUnixCommand.java index 2cec838d0..34c0de5b5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUnixCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosUnixCommand.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosVSAMDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosVSAMDatasetImpl.java index ba1b1e113..916214f94 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosVSAMDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/RseapiZosVSAMDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.nio.file.Path; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/package-info.java index 496bb041d..1f54e47a4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/main/java/dev/galasa/zosfile/rseapi/manager/internal/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * z/OS File Manager - RSE API Internal Implementation diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetAttributesListdsi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetAttributesListdsi.java index 01d135695..2023db070 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetAttributesListdsi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetAttributesListdsi.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.io.BufferedReader; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetImpl.java index 69df839d1..c2559ed85 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileHandlerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileHandlerImpl.java index d60a0f721..04316551a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileHandlerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileHandlerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.nio.file.Path; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileManagerImpl.java index e84afbd46..f88560233 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosFileManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUNIXFileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUNIXFileImpl.java index 8ba93fac5..935f36bc9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUNIXFileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUNIXFileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUnixCommand.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUnixCommand.java index a06339620..7121be498 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUnixCommand.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosUnixCommand.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import org.apache.http.HttpStatus; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosVSAMDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosVSAMDatasetImpl.java index 9b91b325f..9b7fd7c56 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosVSAMDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.rseapi.manager/src/test/java/dev/galasa/zosfile/rseapi/manager/internal/TestRseapiZosVSAMDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.rseapi.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/build.gradle index d6089fcaa..34246f61e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/build.gradle @@ -4,11 +4,24 @@ plugins { description = 'Galasa zOS File Manager - zOS/MF Implementation' -version = '0.25.0' +version = '0.34.0' dependencies { api project(':galasa-managers-zos-parent:dev.galasa.zosmf.manager') - implementation 'com.google.code.gson:gson:2.8.5' - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'commons-io:commons-io:2.9.0' + implementation 'com.google.code.gson:gson:2.10.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' + implementation 'commons-io:commons-io:2.16.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/settings.gradle index f464b0e1d..0cc8a1566 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosfile.zosmf.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosfile.zosmf.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetAttributesListdsi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetAttributesListdsi.java index 6d03e5184..5dbee28ce 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetAttributesListdsi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetAttributesListdsi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosfile.zosmf.manager.internal; @@ -61,7 +61,7 @@ public class ZosmfZosDatasetAttributesListdsi { private static final String PROP_SYSCREATE = "syscreate"; private static final String PROP_SYSREFDATE = "sysrefdate"; private static final String PROP_SYSEXDATE = "sysexdate"; - private static final String PROP_SYSPASSWORD = "syspassword"; + private static final String PROP_SYSPASSWORD = "syspassword"; //Not a password but a pointer to a password //pragma: allowlist secret private static final String PROP_SYSRACFA = "sysracfa"; private static final String PROP_SYSUPDATED = "sysupdated"; private static final String PROP_SYSTRKSCYL = "systrkscyl"; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetImpl.java index dc207d5c9..5fcfdf349 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.ByteArrayOutputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileHandlerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileHandlerImpl.java index f9de4b1a9..635069eef 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileHandlerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileHandlerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.nio.file.Path; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileManagerImpl.java index 82f237099..f3e30f6bd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosFileManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosUNIXFileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosUNIXFileImpl.java index 509d5e74a..811b2eeab 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosUNIXFileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosUNIXFileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosVSAMDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosVSAMDatasetImpl.java index 471c92e18..8bae6e2cd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosVSAMDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/ZosmfZosVSAMDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.nio.file.Path; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/package-info.java index 3b0a511e0..8cfa5e090 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/main/java/dev/galasa/zosfile/zosmf/manager/internal/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * z/OS File Manager - zOS/MF Internal Implementation diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetAttributesListdsi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetAttributesListdsi.java index 6bd79c34f..f64919f82 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetAttributesListdsi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetAttributesListdsi.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.BufferedReader; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetImpl.java index 78387d95c..914e24af1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileHandlerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileHandlerImpl.java index c26ab0a43..d49105fca 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileHandlerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileHandlerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.nio.file.Path; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileManagerImpl.java index 546495a84..bb3e749e9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosFileManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosUNIXFileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosUNIXFileImpl.java index ed6c0ce42..a0249a27c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosUNIXFileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosUNIXFileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosVSAMDatasetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosVSAMDatasetImpl.java index 2e326c4ec..1c41a1797 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosVSAMDatasetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosfile/zosmf/manager/internal/TestZosmfZosVSAMDatasetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosfile.zosmf.manager.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java index dee8b928a..a445020c2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosfile.zosmf.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosunixcommand.ssh.manager.internal; import javax.validation.constraints.NotNull; @@ -7,6 +12,7 @@ import dev.galasa.zosunixcommand.IZosUNIXCommand; import dev.galasa.zosunixcommand.spi.IZosUNIXCommandSpi; + /** * Dummy interface for test */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/build.gradle index 051f455fc..206e779f3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/build.gradle @@ -4,9 +4,23 @@ plugins { description = 'Galasa zOS Liberty Angel Manager' -version = '0.21.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zos.manager') - implementation 'org.apache.commons:commons-lang3:3.8.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = false +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/settings.gradle index 115e6a7ee..f8392e271 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'dev.galasa.zosliberty.angel.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosliberty.angel.manager' + + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/IZosLibertyAngel.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/IZosLibertyAngel.java index 27e0c13ac..4545de03f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/IZosLibertyAngel.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/IZosLibertyAngel.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel; /** diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngel.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngel.java index 7a0a119d1..7985d9a8e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngel.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngel.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel; import java.lang.annotation.ElementType; @@ -20,10 +22,12 @@ * zOS Liberty Angel instance. * * @galasa.examples - * @galasa.examples {@literal @}ZosImage(imageTag="A")
    + * + * {@literal @}ZosImage(imageTag="A")
    * public IZosImage zosImageA;
    * {@literal @}ZosLibertyAngel(imageTag="A", name="ANGELA")
    - * public IZosLibertyAngel zosLibertyAngel;
    + * public IZosLibertyAngel zosLibertyAngel;
    + * * * @galasa.extra * The IZosLibertyAngel interface has a number of methods to manage a zOS Liberty Angel @@ -36,12 +40,12 @@ public @interface ZosLibertyAngel { /** - * The imageTag is used to identify the zOS image + * @return The imageTag is used to identify the zOS image */ String imageTag() default "primary"; /** - * The Liberty Named Angel name. If null, a name will be generated + * @return The Liberty Named Angel name. If null, a name will be generated */ String name() default ""; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelException.java index 6fdaa9399..9213c59b7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty.angel; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelManagerException.java index 30637421c..14ca2a51e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/ZosLibertyAngelManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty.angel; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelField.java index 69c54583e..0b001c09c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty.angel.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelImpl.java index 6aeb57d0a..1293a05be 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.internal; import java.time.LocalDateTime; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelManagerImpl.java index de545c741..961fd529f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/ZosLibertyAngelManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/package-info.java index 91f1af513..f0cdf5ba4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.internal; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/DefaultTimeout.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/DefaultTimeout.java index 965915090..4e783302b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/DefaultTimeout.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/DefaultTimeout.java @@ -1,7 +1,8 @@ -/* - /* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.internal.properties; import dev.galasa.framework.spi.cps.CpsProperties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/Procname.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/Procname.java index 797fb581c..2a31ea4f1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/Procname.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/Procname.java @@ -1,7 +1,8 @@ -/* - /* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.internal.properties; import dev.galasa.framework.spi.cps.CpsProperties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/ZosLibertyAngelPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/ZosLibertyAngelPropertiesSingleton.java index 2d16cd351..b1fa10248 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/ZosLibertyAngelPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/internal/properties/ZosLibertyAngelPropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty.angel.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/package-info.java index d98c9d89f..3a69c1cec 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/IZosLibertyAngelSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/IZosLibertyAngelSpi.java index 8e1d20305..a59fe1fdf 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/IZosLibertyAngelSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/IZosLibertyAngelSpi.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.spi; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/package-info.java index a27c6b5af..b0a396588 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.angel.manager/src/main/java/dev/galasa/zosliberty/angel/spi/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.angel.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/build.gradle index 51bb1f407..d6c356537 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/build.gradle @@ -4,7 +4,7 @@ plugins { description = 'Galasa zOS Liberty Manager' -version = '0.21.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zos.manager') @@ -12,7 +12,21 @@ dependencies { implementation project(':galasa-managers-cloud-parent:dev.galasa.liberty.manager') implementation project(':galasa-managers-core-parent:dev.galasa.textscan.manager') implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') - implementation 'org.apache.commons:commons-lang3:3.8.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' implementation 'org.apache.commons:commons-collections4:4.4' - implementation 'commons-io:commons-io:2.9.0' + implementation 'commons-io:commons-io:2.16.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/settings.gradle index a2dc1c348..d2553dc11 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosliberty.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosliberty.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLiberty.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLiberty.java index aa181f4a0..a2f786c94 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLiberty.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLiberty.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty; import dev.galasa.zos.IZosImage; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServer.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServer.java index 293c53114..ea8cbc58f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServer.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServer.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty; @@ -374,11 +376,11 @@ public String toString() { /** * Deploy an application to the Liberty server. This method copies the application archive file to the zOS UNIX file system and * creates an application element in the server.xml. - * @param testClass a {@link class} in the same bundle containing the application archive file, use this.getClass() + * @param testClass a class in the same bundle containing the application archive file, use this.getClass() * @param path the path in the bundle to the application archive file * @param targetLocation the location on the zOS UNIX file system to store the application archive file. If the value is null, * ${shared.app.dir}/fileName will be used - * @param type the application type {@see ApplicationType} + * @param type the application type {@link dev.galasa.zosliberty.IZosLibertyServer.ApplicationType} * @param name the name of the application * @param contextRoot the application context-root. Can be null * @throws ZosLibertyServerException @@ -387,7 +389,7 @@ public String toString() { /** * Deploy an application to the Liberty server dropins directory. This method copies the application archive file to the Liberty server dropins directory - * @param testClass a {@link class} in the same bundle containing the application archive file, use this.getClass() + * @param testClass a class in the same bundle containing the application archive file, use this.getClass() * @param path the path in the bundle to the application archive file * @throws ZosLibertyServerException */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLog.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLog.java index 30484596d..807910245 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLog.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLog.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty; @@ -135,7 +137,7 @@ public interface IZosLibertyServerLog { *
  • the failText is found;
  • *
  • the specified timeout is reached.
  • * - * @param searchString the text to search + * @param searchText the text to search * @param timeout timeout value in seconds * @return the string found or null * @throws ZosLibertyServerException @@ -149,8 +151,8 @@ public interface IZosLibertyServerLog { *
  • the failText is found;
  • *
  • the specified timeout is reached.
  • * - * @param searchString the text to search - * @param failString the failure text to search + * @param searchText the text to search + * @param failText the failure text to search * @param timeout timeout value in seconds * @return the string found or null * @throws ZosLibertyServerException diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLogs.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLogs.java index e373ff198..254726781 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLogs.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerLogs.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty; /** diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXml.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXml.java index 9487295f2..4de563721 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXml.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXml.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty; @@ -70,7 +72,7 @@ public interface IZosLibertyServerXml { public void store() throws ZosLibertyServerException; /** - * Update the content of the {@link IZosLibertyServerXml) with the content of the server.xml file from the zOS UNIX file system + * Update the content of the {@link IZosLibertyServerXml} with the content of the server.xml file from the zOS UNIX file system * @throws ZosLibertyServerException */ public void loadFromFileSystem() throws ZosLibertyServerException; @@ -175,7 +177,7 @@ public interface IZosLibertyServerXml { /** * Remove all XML elements with specified name and id from the Liberty server.xml Document object * @param elementName the XML element name - * @param elementId the XML element id + * @param id the XML element id * @throws ZosLibertyServerException */ public void removeElementsById(String elementName, String id) throws ZosLibertyServerException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXmlElementList.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXmlElementList.java index d8a3a5e53..f4d806266 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXmlElementList.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/IZosLibertyServerXmlElementList.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty; @@ -15,7 +17,7 @@ public interface IZosLibertyServerXmlElementList /** * Put an XML element in the element list * @param elementName - The name of the element to add - * @param attributes - A HashMap of attributes + * @param attributes - A HashMap of attributes */ public void add(String elementName, Map attributes); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLiberty.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLiberty.java index f415c540a..feeeeb0a0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLiberty.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLiberty.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty; import java.lang.annotation.ElementType; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyManagerException.java index fd912a8ef..3c307617b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyManagerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyServerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyServerException.java index 9853bc15c..38facebf3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyServerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/ZosLibertyServerException.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyField.java index 34b6f23de..574ba350f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyImpl.java index 686b3d175..0a1312ebd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyManagerImpl.java index e07725b41..dd9b5f1f7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerImpl.java index 478d074c6..4f718477f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogImpl.java index 02b0d8a02..5a5ef7b3b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogsImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogsImpl.java index 985672328..2cc1b9bae 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogsImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerLogsImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlElementListImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlElementListImpl.java index 5a6e8e62a..f80c7c66e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlElementListImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlElementListImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.util.Collection; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlImpl.java index d64d7b56d..cb6ae748d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/ZosLibertyServerXmlImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/package-info.java index 459ae805e..13e20b0c3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/DefaultTimeout.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/DefaultTimeout.java index fa9bfa3a4..d8d6d1680 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/DefaultTimeout.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/DefaultTimeout.java @@ -1,7 +1,8 @@ -/* - /* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.internal.properties; import dev.galasa.framework.spi.cps.CpsProperties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/ZosLibertyPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/ZosLibertyPropertiesSingleton.java index a6a6d4d61..b14cd8826 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/ZosLibertyPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/internal/properties/ZosLibertyPropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosliberty.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/package-info.java index 86d87819c..865c0985b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/IZosLibertySpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/IZosLibertySpi.java index cb1a57796..151c069bc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/IZosLibertySpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/IZosLibertySpi.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.spi; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/package-info.java index 49ee8cc48..f125e7f1e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosliberty.manager/src/main/java/dev/galasa/zosliberty/spi/package-info.java @@ -1,4 +1,6 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosliberty.spi; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/build.gradle index 821aa7512..d8773eb6b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/build.gradle @@ -4,12 +4,26 @@ plugins { description = 'Galasa zOS/MF Manager' -version = '0.21.0' +version = '0.34.0' dependencies { api project(':galasa-managers-zos-parent:dev.galasa.zos.manager') api project(':galasa-managers-comms-parent:dev.galasa.http.manager') - implementation 'commons-io:commons-io:2.8.0' - implementation 'org.apache.commons:commons-lang3:3.8.1' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'commons-io:commons-io:2.16.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/settings.gradle index 9fb465d13..1a438ede6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosmf.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosmf.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmf.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmf.java index c8129974d..be965eb12 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmf.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmf.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; @@ -22,14 +22,7 @@ public interface IZosmf { /** - * Enumeration of zOSMF request types: - *
  • {@link #POST}
  • - *
  • {@link #POST_JSON}
  • - *
  • {@link #GET}
  • - *
  • {@link #PUT}
  • - *
  • {@link #PUT_TEXT}
  • - *
  • {@link #PUT_JSON}
  • - *
  • {@link #DELETE}
  • + * Enumeration of zOSMF request types */ public enum ZosmfRequestType { /** @@ -67,15 +60,7 @@ public enum ZosmfRequestType { } /** - * Enumeration of zOSMF Custom HTTP headers: - *
  • {@link #X_IBM_ATTRIBUTES}
  • - *
  • {@link #X_IBM_DATA_TYPE}
  • - *
  • {@link #X_IBM_JOB_MODIFY_VERSION}
  • - *
  • {@link #X_IBM_LSTAT}
  • - *
  • {@link #X_IBM_MAX_ITEMS}
  • - *
  • {@link #X_IBM_OPTION}
  • - *
  • {@link #X_IBM_REQUESTED_METHOD}
  • - * + * Enumeration of zOSMF Custom HTTP headers */ public enum ZosmfCustomHeaders { /** @@ -149,7 +134,7 @@ public String toString() { * Issue an HTTP PUT request to the zOSMF server with no request body * * @param path identifies the zOSMF REST API - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @param convert is a data conversion required. If true, data will be converted betwen EBCDIC to ISO8859-1. If false, no data conversion will take place. * @return the zOSMF server response * @throws ZosmfException @@ -161,7 +146,7 @@ public String toString() { * * @param path identifies the zOSMF REST API * @param requestBody the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the zOSMF server response * @throws ZosmfException */ @@ -172,7 +157,7 @@ public String toString() { * * @param path identifies the zOSMF REST API * @param requestBody the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the zOSMF server response * @throws ZosmfException */ @@ -183,7 +168,7 @@ public String toString() { * * @param path identifies the zOSMF REST API * @param body the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the zOSMF server response * @throws ZosmfException */ @@ -194,7 +179,7 @@ public String toString() { * * @param path identifies the zOSMF REST API * @param body the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the zOSMF server response * @throws ZosmfException */ @@ -204,7 +189,7 @@ public String toString() { * Issue an HTTP DELETE request to the zOSMF server with no request body * * @param path identifies the zOSMF REST API - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the zOSMF server response * @throws ZosmfException */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfManager.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfManager.java index 50a586b14..1eb06c90c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfManager.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfResponse.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfResponse.java index 1b5174bd5..c68a41d2a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfResponse.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfRestApiProcessor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfRestApiProcessor.java index b329f64ce..524fb4bf1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfRestApiProcessor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/IZosmfRestApiProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/Zosmf.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/Zosmf.java index 56111c8d5..59f1a8847 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/Zosmf.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/Zosmf.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; @@ -23,14 +23,18 @@ * The test can request multiple z/OSMF instances, with the default being associated with the primary zOS image. * * @galasa.examples + * * {@literal @}ZosImage(imageTag="A")
    * public IZosImage zosImageA;
    * {@literal @}Zosmf(imageTag="A")
    - * public IZosmf zosmfA;
    + * public IZosmf zosmfA;
    + * * * @galasa.extra * The IZosmf interface has a number of methods to issue requests to the zOSMF REST API. - * See {@link Zosmf} and {@link IZosmf} to find out more. + * + * @see Zosmf + * @see IZosmf * */ @Retention(RetentionPolicy.RUNTIME) @@ -40,7 +44,7 @@ public @interface Zosmf { /** - * The tag of the zOS Image this variable is to be populated with + * @return The tag of the zOS Image with which this variable will to be populated */ String imageTag() default "PRIMARY"; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfException.java index a5ec59ba6..d70943e32 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfManagerException.java index b9ddc990f..7606f8ead 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/ZosmfManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfImpl.java index 6ec125142..b31e45ed2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal; import java.net.MalformedURLException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerField.java index 33072ce4a..a3fa38113 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerImpl.java index 6b780dcc2..b18322915 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfResponseImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfResponseImpl.java index e4baeabb8..7604911d2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfResponseImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfResponseImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfRestApiProcessor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfRestApiProcessor.java index e8cad743f..b8d007437 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfRestApiProcessor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/ZosmfRestApiProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/package-info.java index 7d4ee8b24..d43a4c5f4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOSMF Manager */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/Https.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/Https.java index 859e1cffc..6a8f2fc12 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/Https.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/Https.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ImageServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ImageServers.java index 22adeadf3..85420d53f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ImageServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ImageServers.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/RequestRetry.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/RequestRetry.java index 90c3e76cb..fa7ca0500 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/RequestRetry.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/RequestRetry.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerCreds.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerCreds.java index a41f165b4..210ce5d66 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerCreds.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerCreds.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerImage.java index 6b2b60f77..09b1f032a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerPort.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerPort.java index 89b2840a4..f33a9fbb1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerPort.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ServerPort.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/SysplexServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/SysplexServers.java index eeb3d5a18..9679bffd0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/SysplexServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/SysplexServers.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ZosmfPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ZosmfPropertiesSingleton.java index 3ceebcb6c..bc5502e26 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ZosmfPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/ZosmfPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/package-info.java index a69cb774f..a1047d9b0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOSMF Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/package-info.java index a0d35e94c..85a203163 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * zOS/MF Manager diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/IZosmfManagerSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/IZosmfManagerSpi.java index f63cf3cf4..8afe948d2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/IZosmfManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/IZosmfManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/package-info.java index 85deadd33..9efe32089 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/main/java/dev/galasa/zosmf/spi/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOSMF Manager - Internal SPI */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/TestEnumsAndExeptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/TestEnumsAndExeptions.java index 5e8439a5a..6b15a4b23 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/TestEnumsAndExeptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/TestEnumsAndExeptions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfImpl.java index dc26d1707..9803b6dab 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfManagerImpl.java index 6d03d23f9..fd3a24d0d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfResponseImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfResponseImpl.java index 0cd728dca..6abc22f96 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfResponseImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfResponseImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfRestApiProcessor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfRestApiProcessor.java index 8e8794e4d..801395762 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfRestApiProcessor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/TestZosmfRestApiProcessor.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestHttps.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestHttps.java index 8fe435e52..8a89042be 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestHttps.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestHttps.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestImageServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestImageServers.java index 659b2e888..812b70bb6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestImageServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestImageServers.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestRequestRetry.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestRequestRetry.java index b767b9678..2137c02a7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestRequestRetry.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestRequestRetry.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerCreds.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerCreds.java index f3d23ac71..04f944e70 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerCreds.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerCreds.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosmf.internal.properties; @@ -26,7 +28,7 @@ public class TestServerCreds { // // private static final String SERVER_ID = "server"; // -// private static final String CREDS = "creds"; +// private static final String CREDS = "creds"; commented out unit test //pragma: allowlist secret // // @Test // public void testConstructor() { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerImage.java index 0d9af8efa..3792b3f18 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerImage.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerPort.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerPort.java index 238012423..4963cb52a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerPort.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestServerPort.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestSysplexServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestSysplexServers.java index a4f5da29c..96d452b72 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestSysplexServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestSysplexServers.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import java.util.List; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestZosmfPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestZosmfPropertiesSingleton.java index 3a9cbbb47..a2ee47ee8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestZosmfPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosmf.manager/src/test/java/dev/galasa/zosmf/internal/properties/TestZosmfPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosmf.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/build.gradle index dcea4b55e..9553270f6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/build.gradle @@ -4,9 +4,22 @@ plugins { description = 'Galasa zOS Program Manager' -version = '0.21.0' +version = '0.25.0' dependencies { implementation project(':galasa-managers-core-parent:dev.galasa.artifact.manager') implementation project(':galasa-managers-zos-parent:dev.galasa.zos.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/settings.gradle index ea9d455a4..dce6efacd 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.zosprogram.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosprogram.manager' diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/IZosProgram.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/IZosProgram.java index a5fcb7feb..3784acc48 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/IZosProgram.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/IZosProgram.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgram.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgram.java index d9225bb3a..ae9c40b7b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgram.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgram.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram; @@ -23,14 +23,18 @@ * The test can request multiple z/OS Program instances * * @galasa.examples + * * {@literal @}ZosImage(imageTag="A")
    * public IZosImage zosImageA;
    * {@literal @}ZosProgram(imageTag="A")
    - * public IZosProgram zosProgramA;
    + * public IZosProgram zosProgramA;
    + * * * @galasa.extra * The IZosProgram interface has a number of methods to manage the zOS Program. - * See {@link ZosProgram} and {@link IZosProgram} to find out more. + * + * @see ZosProgram + * @see IZosProgram * */ @Retention(RetentionPolicy.RUNTIME) @@ -80,19 +84,19 @@ */ public enum Language { /** - * COBOL program with .cbl file extension + * COBOL program with ".cbl" file extension */ COBOL(".cbl"), /** - * C program with .c file extension + * C program with ".c" file extension */ C(".c"), /** - * PL1 program with .pl1 file extension + * PL1 program with ".pl1" file extension */ PL1(".pl1"), /** - * Assembler program with .asm<\code> file extension + * Assembler program with ".asm" file extension */ ASSEMBLER(".asm"), /** diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramException.java index 78e633886..f512e8bab 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramManagerException.java index 455f4d20e..4fe0c66f7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/ZosProgramManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/AbstractZosProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/AbstractZosProgramCompiler.java index b22e914e4..52bdfa5b9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/AbstractZosProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/AbstractZosProgramCompiler.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosAssemblerProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosAssemblerProgramCompiler.java index 63c15f263..3cdbbbe33 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosAssemblerProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosAssemblerProgramCompiler.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Collections; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCProgramCompiler.java index 1f9589a83..c134cfe9d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCProgramCompiler.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Collections; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCobolProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCobolProgramCompiler.java index 54d78b49d..cddac6c59 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCobolProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosCobolProgramCompiler.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Collections; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosPl1ProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosPl1ProgramCompiler.java index 91fce0777..5f382a6eb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosPl1ProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosPl1ProgramCompiler.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Collections; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramImpl.java index 51b7cfea5..beacd199a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerField.java index 36874e6b9..42ef65a31 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerImpl.java index 95803d2f2..fe9ce4695 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/ZosProgramManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.lang.annotation.Annotation; @@ -116,7 +116,7 @@ public void initialise(@NotNull IFramework framework, @NotNull List al throw new ZosProgramManagerException("Unable to request framework services", e); } - if(Boolean.TRUE.equals(galasaTest.isJava())) { + if(galasaTest.isJava()) { //*** Check to see if any of our annotations are present in the test class //*** If there is, we need to activate List ourFields = findAnnotatedFields(ZosProgramManagerField.class); diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/package-info.java index 28d238a47..f99d63d7e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Program Manager */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/CICSDatasetPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/CICSDatasetPrefix.java index fd15e613c..abf03402e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/CICSDatasetPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/CICSDatasetPrefix.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/LanguageEnvironmentDatasetPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/LanguageEnvironmentDatasetPrefix.java index 9f2a9ad91..0bacfe7ff 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/LanguageEnvironmentDatasetPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/LanguageEnvironmentDatasetPrefix.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageCompileSyslibs.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageCompileSyslibs.java index 7acdb3aad..33baef1e0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageCompileSyslibs.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageCompileSyslibs.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageDatasetPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageDatasetPrefix.java index e297558f1..2047338f8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageDatasetPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageDatasetPrefix.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageLinkSyslibs.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageLinkSyslibs.java index 5a63079d0..6fa4a41f2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageLinkSyslibs.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ProgramLanguageLinkSyslibs.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ZosProgramPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ZosProgramPropertiesSingleton.java index befd7f509..90931950f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ZosProgramPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/ZosProgramPropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/package-info.java index dd41e1125..565b79e17 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Program Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/package-info.java index 7115fb443..249bdc587 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * zOS Program Manager @@ -12,22 +12,22 @@ * * @galasa.description * - * This Manager allows Galasa tests to compile and link zOS Programs.

    + * This Manager allows Galasa tests to compile and link zOS Programs. * * The @ZosProgram annotation defines the program to the Galasa test. Program attributes, for * example, program name, programming language and source location are specified by using the annotation - * elements.

    + * elements. * The source for the program is stored as a resource, along with the test. The z/OS Program Manager processes * each @ZosProgram annotation before any of the test methods are executed. The Manager * retrieves the source from the test bundle, builds and submits the relevant compile and link JCL based on * the programs attributes and CPS properties. The batch job is saved with the test run archive. The * program can be executed in the test by retrieving the library containing the load module by using - * the getLoadLibrary() method.

    + * the getLoadLibrary() method. * * The Simbank tutorial BatchAccountsOpenTestBatchAccountsOpenTest - * contains an example of running a simulated z/OS program called SIMBANK by using the EXEC PGM=SIMBANK command.

    - *

    - * You can view the Javadoc documentation for the Manager here.

    + * contains an example of running a simulated z/OS program called SIMBANK by using the EXEC PGM=SIMBANK command. + * + * You can view the Javadoc documentation for the Manager here.

    * */ package dev.galasa.zosprogram; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/IZosProgramManagerSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/IZosProgramManagerSpi.java index bf790aa10..38770f420 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/IZosProgramManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/IZosProgramManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram.spi; @@ -22,7 +22,7 @@ public interface IZosProgramManagerSpi { * Returns a new zOS Program * @param image The zOS Image * @param name The program name - * @param programSource The program source in the bundle + * @param source The program source in the bundle * @param language The programming language. See {@link ZosProgram.Language} * @param cics Is a CICS program. * @param loadlib The load module data set name diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/package-info.java index 1f74031e4..68d39de1e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/main/java/dev/galasa/zosprogram/spi/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS Program Manager - Internal SPI */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/TestExeptionsAndEnums.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/TestExeptionsAndEnums.java index a2d6cfb80..f25ff29a1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/TestExeptionsAndEnums.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/TestExeptionsAndEnums.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosprogram; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestAbstractZosProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestAbstractZosProgramCompiler.java index 1bd30a27b..c267ca6d1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestAbstractZosProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestAbstractZosProgramCompiler.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosAssemblerProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosAssemblerProgramCompiler.java index ec8f3e21f..eb1200708 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosAssemblerProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosAssemblerProgramCompiler.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCProgramCompiler.java index 2353d5118..2d5748769 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCProgramCompiler.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCobolProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCobolProgramCompiler.java index 4578f0e0a..51f9f05cc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCobolProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosCobolProgramCompiler.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosPl1ProgramCompiler.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosPl1ProgramCompiler.java index b8f4a5737..e7cfded68 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosPl1ProgramCompiler.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosPl1ProgramCompiler.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramImpl.java index 2924ad08c..23b8077fa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramManagerImpl.java index bf9585a12..7fd49e08e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/TestZosProgramManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestCICSDatasetPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestCICSDatasetPrefix.java index 34e9daf37..ff62cc027 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestCICSDatasetPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestCICSDatasetPrefix.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestLanguageEnvironmentDatasetPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestLanguageEnvironmentDatasetPrefix.java index 2d7405a68..7a4e32125 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestLanguageEnvironmentDatasetPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestLanguageEnvironmentDatasetPrefix.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageCompileSyslibs.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageCompileSyslibs.java index 39627b0e3..30162d09d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageCompileSyslibs.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageCompileSyslibs.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageDatasetPrefix.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageDatasetPrefix.java index 48b6e8f1c..9ff8c2958 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageDatasetPrefix.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageDatasetPrefix.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageLinkSyslibs.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageLinkSyslibs.java index 3dcca797b..1036c3394 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageLinkSyslibs.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramLanguageLinkSyslibs.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramPropertiesSingleton.java index 9cf53628a..847535c2f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosprogram.manager/src/test/java/dev/galasa/zosprogram/internal/properties/TestProgramPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosprogram.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/build.gradle index d6eedb203..16e55e776 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/build.gradle @@ -4,11 +4,24 @@ plugins { description = 'Galasa RSE API Manager' -version = '0.21.0' +version = '0.34.0' dependencies { api project(':galasa-managers-zos-parent:dev.galasa.zos.manager') api project(':galasa-managers-comms-parent:dev.galasa.http.manager') - implementation 'commons-io:commons-io:2.9.0' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'commons-io:commons-io:2.16.1' + implementation 'com.google.code.gson:gson:2.10.1' } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/settings.gradle index 8d8c913be..313439015 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.zosrseapi.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosrseapi.manager' diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapi.java index 79041101d..5d4713256 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; @@ -9,6 +9,8 @@ import javax.validation.constraints.NotNull; +import java.net.HttpURLConnection; + import org.apache.http.HttpStatus; import com.google.gson.JsonObject; @@ -21,14 +23,10 @@ */ public interface IRseapi { + + /** - * Enumeration of RSE API request types: - *
  • {@link #GET}
  • - *
  • {@link #PUT_TEXT}
  • - *
  • {@link #PUT_JSON}
  • - *
  • {@link #POST}
  • - *
  • {@link #POST_JSON}
  • - *
  • {@link #DELETE}
  • + * Enumeration of RSE API request types */ public enum RseapiRequestType { /** @@ -85,7 +83,7 @@ public String getRequestType() { * Issue an HTTP PUT request to the RSE API server with no request body * * @param path identifies the RSE API REST API server - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @param convert is a data conversion required. If true, data will be converted betwen EBCDIC to ISO8859-1. If false, no data conversion will take place. * @return the RSE API server response * @throws RseapiException @@ -97,7 +95,7 @@ public String getRequestType() { * * @param path identifies the RSE API REST API server * @param body the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the RSE API server response * @throws RseapiException */ @@ -108,7 +106,7 @@ public String getRequestType() { * * @param path identifies the RSE API REST API server * @param body the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the RSE API server response * @throws RseapiException */ @@ -119,7 +117,7 @@ public String getRequestType() { * * @param path identifies the RSE API REST API server * @param body the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the RSE API server response * @throws RseapiException */ @@ -129,8 +127,7 @@ public String getRequestType() { * Issue an HTTP POST request to the RSE API server with no request body * * @param path identifies the RSE API REST API server - * @param requestBody the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the RSE API server response * @throws RseapiException */ @@ -141,7 +138,7 @@ public String getRequestType() { * * @param path identifies the RSE API REST API server * @param requestBody the request body - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the RSE API server response * @throws RseapiException */ @@ -151,7 +148,7 @@ public String getRequestType() { * Issue an HTTP DELETE request to the RSE API server with no request body * * @param path identifies the RSE API REST API server - * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus.HttpStatus.SC_OK} when null + * @param validStatusCodes a {@link List} of acceptable HTTP Status codes. Default to {@link HttpStatus#SC_OK} when null * @return the RSE API server response * @throws RseapiException */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiManager.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiManager.java index 17640ccb2..a57acf396 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiManager.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiManager.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiResponse.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiResponse.java index a557fb52a..fe72bd377 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiResponse.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiResponse.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiRestApiProcessor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiRestApiProcessor.java index 178ff187f..e030a7a86 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiRestApiProcessor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/IRseapiRestApiProcessor.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; @@ -24,7 +24,9 @@ public interface IRseapiRestApiProcessor { * @param validStatusCodes list HTTP status codes expected from this request. default of HTTP 200 when null * @param convert is a data conversion required. If true, data will be converted between EBCDIC to ISO8859-1. If false, no data conversion will take place. * @return the response {@link IRseapiResponse} - * @throws ZosBatchException + * @throws RseapiException */ - public @NotNull IRseapiResponse sendRequest(RseapiRequestType requestType, String path, Map headers, Object body, List validStatusCodes, boolean convert) throws RseapiException; + public @NotNull IRseapiResponse sendRequest(RseapiRequestType requestType, String path, + Map headers, Object body, List validStatusCodes, + boolean convert) throws RseapiException; } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/Rseapi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/Rseapi.java index 033b08f26..35357762c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/Rseapi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/Rseapi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; @@ -23,15 +23,18 @@ * The test can request multiple RSE API instances, with the default being associated with the primary zOS image. * * @galasa.examples + * * {@literal @}ZosImage(imageTag="A")
    * public IZosImage zosImageA;
    * {@literal @}Rseapi(imageTag="A")
    - * public IRseapi rseapiA;
    + * public IRseapi rseapiA;
    + *
    * * @galasa.extra * The IRseapi interface has a number of methods to issue requests to the RSE API REST API. - * See {@link Rseapi} and {@link IRseapi} to find out more. * + * @see Rseapi + * @see IRseapi */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD }) @@ -41,6 +44,7 @@ /** * The tag of the zOS Image this variable is to be populated with + * @return The tag name of the image */ String imageTag() default "PRIMARY"; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiException.java index c00d72746..98f3c88ee 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiManagerException.java index fc74b34ab..7a9bad3e6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/RseapiManagerException.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiImpl.java index 159d0ce54..6f98a803d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.net.MalformedURLException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerField.java index 076af517e..30a098922 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerField.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerImpl.java index 3b02851e8..df8afde98 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiManagerImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiResponseImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiResponseImpl.java index 8f3e85c5d..b05355aad 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiResponseImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiResponseImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.io.IOException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiRestApiProcessor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiRestApiProcessor.java index 01f581efe..e71a4c65b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiRestApiProcessor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/RseapiRestApiProcessor.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.util.ArrayList; @@ -50,13 +50,17 @@ public RseapiRestApiProcessor(Map rseapis) { * Send RSE API request * @param requestType * @param path - * @param body * @param headers + * @param body * @param validStatusCodes + * @param convert * @return - * @throws ZosBatchException + * @throws RseapiException */ - public @NotNull IRseapiResponse sendRequest(RseapiRequestType requestType, String path, Map headers, Object body, List validStatusCodes, boolean convert) throws RseapiException { + public @NotNull IRseapiResponse sendRequest(RseapiRequestType requestType, String path, + Map headers, Object body, List validStatusCodes, + boolean convert) throws RseapiException { + if (validStatusCodes == null) { validStatusCodes = new ArrayList<>(Arrays.asList(HttpStatus.SC_OK)); } diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/package-info.java index 497a6874e..ed7dace32 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * RSE API Manager */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/Https.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/Https.java index b8b5d3402..17897cb7c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/Https.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/Https.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ImageServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ImageServers.java index 629eb66a9..1e7162395 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ImageServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ImageServers.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RequestRetry.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RequestRetry.java index 0f234e817..1227e8134 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RequestRetry.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RequestRetry.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; @@ -23,7 +23,7 @@ * * @galasa.default 3 * - * @galasa.valid_values numerical value > 0 + * @galasa.valid_values numerical value > 0 * * @galasa.examples * rseapi.server.request.retry=5
    diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RseapiPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RseapiPropertiesSingleton.java index 88875fa67..99c2e403d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RseapiPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/RseapiPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerCreds.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerCreds.java index 1390e6237..c37894f7d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerCreds.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerCreds.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerImage.java index 2ff8c7fa9..9a890584a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerImage.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerPort.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerPort.java index e7f016333..76bfda8aa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerPort.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/ServerPort.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/SysplexServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/SysplexServers.java index 5536e6ad3..08f1450fb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/SysplexServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/SysplexServers.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019,2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/package-info.java index 5858f0884..8dde016a7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/internal/properties/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * RSE API Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/package-info.java index 88a273a04..d6c29920a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/package-info.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ /** * RSE API Manager diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/IRseapiManagerSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/IRseapiManagerSpi.java index 78c2de6ab..876754d8a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/IRseapiManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/IRseapiManagerSpi.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.spi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/package-info.java index 6131e9cf6..7d801054f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/main/java/dev/galasa/zosrseapi/spi/package-info.java @@ -1,3 +1,8 @@ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * RSE API Manager - Internal SPI */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/TestEnumsAndExeptions.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/TestEnumsAndExeptions.java index 1922e4a7f..81e2d9779 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/TestEnumsAndExeptions.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/TestEnumsAndExeptions.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiImpl.java index a4316f4bb..12bd90f02 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiManagerImpl.java index a209a5edf..5fddbf786 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.io.File; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiResponseImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiResponseImpl.java index 0587bbc26..c34fef8c2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiResponseImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiResponseImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiRestApiProcessor.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiRestApiProcessor.java index 2e816f936..e9d72c056 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiRestApiProcessor.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/TestRseapiRestApiProcessor.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestHttps.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestHttps.java index 41eb05ba4..37b807ccb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestHttps.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestHttps.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestImageServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestImageServers.java index bc121895d..a875fecd5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestImageServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestImageServers.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRequestRetry.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRequestRetry.java index 6f540d66e..68fc265c9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRequestRetry.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRequestRetry.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRseapiPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRseapiPropertiesSingleton.java index a458bb1b4..2e63f82d8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRseapiPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestRseapiPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerCreds.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerCreds.java index fd813ff31..98e256798 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerCreds.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerCreds.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosrseapi.internal.properties; @@ -26,7 +28,7 @@ public class TestServerCreds { // // private static final String SERVER_ID = "server"; // -// private static final String CREDS = "creds"; +// private static final String CREDS = "creds"; commented out unit test //pragma: allowlist secret // // @Test // public void testConstructor() { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerImage.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerImage.java index 59d4d7c58..126b310b2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerImage.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerImage.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerPort.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerPort.java index 5dfe0b31e..799b577b9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerPort.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestServerPort.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestSysplexServers.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestSysplexServers.java index 195640aac..92082c865 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestSysplexServers.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosrseapi.manager/src/test/java/dev/galasa/zosrseapi/internal/properties/TestSysplexServers.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosrseapi.internal.properties; import java.util.Arrays; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/build.gradle index 9b8e835f4..1280a8978 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/build.gradle @@ -4,28 +4,41 @@ plugins { description = 'Galasa zOS Security Manager' -version = '0.21.0' +version = '0.34.0' dependencies { implementation project(':galasa-managers-comms-parent:dev.galasa.http.manager') implementation project(':galasa-managers-zos-parent:dev.galasa.zos.manager') - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0' - implementation 'org.apache.commons:commons-lang3:3.8.1' + implementation 'org.apache.commons:commons-lang3:3.14.0' - implementation ('org.bouncycastle:bcpkix-jdk15on') { + implementation ('org.bouncycastle:bcpkix-jdk18on') { version { - strictly '1.69' + strictly '1.75' } } - implementation ('org.bouncycastle:bcprov-jdk15on') { + implementation ('org.bouncycastle:bcprov-jdk18on') { version { - strictly '1.69' + strictly '1.75' } } - implementation ('org.bouncycastle:bcutil-jdk15on') { + implementation ('org.bouncycastle:bcutil-jdk18on') { version { - strictly '1.69' + strictly '1.75' } } } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = true \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/settings.gradle index a1e273fd3..33faed94c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zossecurity.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zossecurity.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCertificate.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCertificate.java index 62d79e738..672c2d10a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCertificate.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCertificate.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -9,7 +11,7 @@ /** * Represents a Certificate that has been imported into RACF * - * @author Michael Baylis + * * */ public interface IZosCertificate { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsClassSet.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsClassSet.java index 495959f14..7d5100f6a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsClassSet.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsClassSet.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -14,7 +16,7 @@ * Represents a set of RACF Classes that is used to CICS security. A time of writing this is * 10 classes TxxxxTRN and GxxxxTRN etc. * - * @author Michael Baylis + * * */ public interface IZosCicsClassSet { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsProfile.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsProfile.java index 0f0a3e6f8..95ba7b17a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsProfile.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosCicsProfile.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; import dev.galasa.zossecurity.datatypes.ZosCicsClassResource; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosGroup.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosGroup.java index e3746b4be..2313e34b7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosGroup.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosGroup.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -7,7 +9,7 @@ /** * Represents a group * - * @author mikebyls + * * */ public interface IZosGroup { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosIdMap.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosIdMap.java index 6e347025a..a5b075284 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosIdMap.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosIdMap.java @@ -1,12 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; /** * Represents a Id Map that has been created. * - * @author Michael Baylis + * * */ public interface IZosIdMap { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKerberosPrincipal.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKerberosPrincipal.java index a13b0fe8d..5b87af221 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKerberosPrincipal.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKerberosPrincipal.java @@ -1,12 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; /** * Representation of a Kerberos Principal * - * @author James Bartlett + * * */ public interface IZosKerberosPrincipal { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKeyring.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKeyring.java index 70f2a67bf..64ab3e40c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKeyring.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosKeyring.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -9,7 +11,7 @@ /** * Represents a keyring that has been created. * - * @author Michael Baylis + * * */ public interface IZosKeyring { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosPreDefinedProfile.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosPreDefinedProfile.java index cc33e6239..1fdfa534e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosPreDefinedProfile.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosPreDefinedProfile.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -12,7 +14,7 @@ * * This can only be used with the v2 security manager * - * @author Michael Baylis + * * */ public interface IZosPreDefinedProfile { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosProfile.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosProfile.java index a6f8fb357..3c239d849 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosProfile.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosProfile.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -8,7 +10,7 @@ /** * Represents a profile created by this zossec security manager * - * @author Michael Baylis + * * */ public interface IZosProfile { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosSecurity.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosSecurity.java index 4c6729727..d831ca661 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosSecurity.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosSecurity.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -21,7 +23,7 @@ * To gain access to the ZosSecurityManager include a field of type IZosSecurity * in your Galasa class. * - * @author Michael Baylis + * * */ public interface IZosSecurity { @@ -83,8 +85,7 @@ public interface IZosSecurity { /** * Create a new profile on the specified image/sysplex. - * - * @param image - The image/sysplex + * @param className * @param name - The name of the profiles * @param uacc - The uacc to assign, or null * @param refresh - issue SETROPTS REFRESH @@ -98,6 +99,7 @@ public interface IZosSecurity { * Create a new profile on the specified image/sysplex. * * @param image - The image/sysplex + * @param className * @param name - The name of the profiles * @param uacc - The uacc to assign, or null * @return The profile @@ -122,6 +124,7 @@ public interface IZosSecurity { * Create a new profile on the specified image/sysplex. * * @param image - The image/sysplex + * @param className * @param name - The name of the profiles * @param uacc - The uacc to assign, or null * @param refresh - issue SETROPTS REFRESH @@ -387,7 +390,7 @@ public interface IZosSecurity { * Free this certificate. This will be performed automatically at the end of the * run * - * @param keyring + * @param certificate The certificate to free * @throws ZosSecurityManagerException */ public void freeCertificate(IZosCertificate certificate) throws ZosSecurityManagerException; @@ -397,7 +400,7 @@ public interface IZosSecurity { * best let the Resource Manager to clean this resource, so you run will perform * faster. * - * @param certificate + * @param certificate The certificate to delete * @throws ZosSecurityManagerException */ public void deleteCertificate(IZosCertificate certificate) throws ZosSecurityManagerException; @@ -517,7 +520,7 @@ public KeyStore generateSelfSignedCertificate(String alias, String distinguished /** * Create a Kerberos client principal. This will create the kerbname and the * required association with the passed in service principal (see - * {@link #createKerberosPrincipal(IZosUserid, IZosImage, String)} fr the passed + * {@link #createKerberosPrincipal(IZosUserid, String)} fr the passed * userid. * * @param servicePrincipal - service principal with which to associate this @@ -534,7 +537,8 @@ public KeyStore generateSelfSignedCertificate(String alias, String distinguished * * @param serviceUserid - zOS Userid for this principal * @param realm - realm to use, see - * {@link #getDefaultKerberosRealm(IZosImage)} + * {@link #getDefaultKerberosRealm()} + * * @return * @throws ZosSecurityManagerException */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosUserid.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosUserid.java index 922b66aea..83ca0d16a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosUserid.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/IZosUserid.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -8,7 +10,7 @@ /** * Represents a pooled userid * - * @author mikebyls + * * */ public interface IZosUserid { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosInitiator.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosInitiator.java index f26461921..d8bddff33 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosInitiator.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosInitiator.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -18,9 +20,6 @@ * {@link #create()} to create the security context. {@link #initiate()} will * then be called, (and potentially {@link #initiate(KerberosToken)} if further * initiation is required). - * - * @author James Bartlett - * */ public class KerberosInitiator { @@ -40,7 +39,6 @@ public class KerberosInitiator { /** * Construct with service client and kdc * - * @param logRepo * @param service * @param client * @param kdc diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosToken.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosToken.java index 8a2b3c567..5603ee5d4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosToken.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KerberosToken.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -8,7 +10,7 @@ /** * Object representing a Kerberos Token * - * @author James Bartlett + * * */ public class KerberosToken { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KeyringAlreadyExistsException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KeyringAlreadyExistsException.java index 56fdafbe1..a09deacbe 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KeyringAlreadyExistsException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/KeyringAlreadyExistsException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class KeyringAlreadyExistsException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileAlreadyExistsException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileAlreadyExistsException.java index 3c202f6ef..ae538ac48 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileAlreadyExistsException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileAlreadyExistsException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class ProfileAlreadyExistsException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileConfigurationException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileConfigurationException.java index d5fd4c159..d9d37ff7c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileConfigurationException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileConfigurationException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class ProfileConfigurationException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileNotFoundException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileNotFoundException.java index 8f7789808..6f58d4370 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileNotFoundException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ProfileNotFoundException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class ProfileNotFoundException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RacfSyntaxErrorException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RacfSyntaxErrorException.java index d8b021cc6..cae801ccb 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RacfSyntaxErrorException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RacfSyntaxErrorException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class RacfSyntaxErrorException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RestrictedResourceException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RestrictedResourceException.java index 1e4bd8625..d20a625ba 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RestrictedResourceException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/RestrictedResourceException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class RestrictedResourceException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/UseridNotFoundException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/UseridNotFoundException.java index c451ca3a5..a0ebf8942 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/UseridNotFoundException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/UseridNotFoundException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class UseridNotFoundException extends ZosSecurityManagerException { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosCicsClassSet.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosCicsClassSet.java index e8f9e9213..be325ad7f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosCicsClassSet.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosCicsClassSet.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -14,7 +16,7 @@ /** * Requests a CICS Security Class set to be allocated. Use allowAllAccess to have a default profile created in each of all the classes. * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosPreDefinedProfile.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosPreDefinedProfile.java index deddad8cc..7c7158c19 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosPreDefinedProfile.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosPreDefinedProfile.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -16,7 +18,7 @@ * * This can only be used with the v2 security manager * - * @author Michael Baylis + * * */ @Retention(RetentionPolicy.RUNTIME) diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurity.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurity.java index 8e7beb6c9..b1be7f532 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurity.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurity.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; import java.lang.annotation.ElementType; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityManagerException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityManagerException.java index 5ae8ccacb..862729d52 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityManagerException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityManagerException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; import dev.galasa.zos.ZosManagerException; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityProvisionException.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityProvisionException.java index 2cacf8a03..89f5d78b6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityProvisionException.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosSecurityProvisionException.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity; public class ZosSecurityProvisionException extends Exception { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosUserid.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosUserid.java index 52a252d6e..0b0f9564b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosUserid.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/ZosUserid.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity; @@ -15,7 +17,7 @@ * Requests a zOS Userid. Will not have any groups attached, a default password * set, no passphrase and no access to any resources. * - * @author Michael Baylis + * */ @Retention(RetentionPolicy.RUNTIME) @@ -44,8 +46,8 @@ public boolean runUser() default false; /** - * Set tag of {@link EnsZosClient} where user will be created. - * + + * @see #ensZosClient() * @return - the set symbolic */ public String ensZosClient() default ""; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/Action.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/Action.java index 7dd8931f7..1c8fc7fce 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/Action.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/Action.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.datatypes; public enum Action { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccess.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccess.java index 88693a3e2..9c419b310 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccess.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccess.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.datatypes; import jakarta.xml.bind.annotation.XmlElement; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccessType.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccessType.java index 7699e69a3..d38dfcb5d 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccessType.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFAccessType.java @@ -1,12 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.datatypes; /** * The RACF Access levels * - * @author Michael Baylis + * * */ public enum RACFAccessType { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateTrust.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateTrust.java index b9f647fb3..1f8863f26 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateTrust.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateTrust.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.datatypes; public enum RACFCertificateTrust { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateType.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateType.java index 421f73f8f..605f66b34 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateType.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/RACFCertificateType.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.datatypes; public enum RACFCertificateType { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassResource.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassResource.java index 5dd923f48..f351c75fa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassResource.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassResource.java @@ -1,12 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.datatypes; /** * This enum represents the different types of RACF classes that CICS uses for security * - * @author Michael Baylis + * * */ public enum ZosCicsClassResource { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassType.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassType.java index 4343fd897..1a13d4679 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassType.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/datatypes/ZosCicsClassType.java @@ -1,12 +1,14 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.datatypes; /** * Enum to differentiate between the Member RACF CICS Class and the grouping version * - * @author Michael Baylis + * * */ public enum ZosCicsClassType { diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/RACFMessages.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/RACFMessages.java index 1471ea2b0..e13400c82 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/RACFMessages.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/RACFMessages.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal; import java.util.HashSet; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosCicsClassSetField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosCicsClassSetField.java index 4c656df6a..6ab0e2759 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosCicsClassSetField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosCicsClassSetField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosPreDefinedProfileField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosPreDefinedProfileField.java index f2cbdde84..28f4a9e37 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosPreDefinedProfileField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosPreDefinedProfileField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityField.java index f761156c1..bdc6f07c3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityImpl.java index 63e938835..9532aeb01 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal; import java.io.ByteArrayInputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityManagerImpl.java index e29e2ac54..3a849aa3e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosSecurityManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosUseridField.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosUseridField.java index d83373e2c..6db0bc9e4 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosUseridField.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/ZosUseridField.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsClassSetMinimumFree.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsClassSetMinimumFree.java index b0976dfdd..2ff3f1121 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsClassSetMinimumFree.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsClassSetMinimumFree.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsSharedClassets.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsSharedClassets.java index aab3ba55a..0d388489e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsSharedClassets.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CicsSharedClassets.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ClassAllowedPrefixes.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ClassAllowedPrefixes.java index 6a952aac2..e8faf678a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ClassAllowedPrefixes.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ClassAllowedPrefixes.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CommandRac.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CommandRac.java index 7e648c528..966628c4e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CommandRac.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CommandRac.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CreateUserid.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CreateUserid.java index d6c34f854..95290e4ca 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CreateUserid.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/CreateUserid.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosDomainController.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosDomainController.java index 8f233789a..20e47dbfe 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosDomainController.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosDomainController.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosRealm.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosRealm.java index 5ccfa5dc0..da92fa78a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosRealm.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/KerberosRealm.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/OutputReporting.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/OutputReporting.java index a102adf2a..2be9044ea 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/OutputReporting.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/OutputReporting.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/PredefinedProfiles.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/PredefinedProfiles.java index 77ef09bb2..0db2b4b88 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/PredefinedProfiles.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/PredefinedProfiles.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ResourceReporting.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ResourceReporting.java index 20de2f518..509160126 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ResourceReporting.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ResourceReporting.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerApikey.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerApikey.java index 29a59db8c..9d44d7a2b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerApikey.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerApikey.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerUrl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerUrl.java index bb8c6ad96..488276590 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerUrl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ServerUrl.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/SetroptsDelay.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/SetroptsDelay.java index 600f3e57d..b1dbaecf1 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/SetroptsDelay.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/SetroptsDelay.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassCleanup.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassCleanup.java index 59540bcdb..543c9381c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassCleanup.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassCleanup.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassPassword.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassPassword.java index ada1264f1..99471a997 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassPassword.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridBypassPassword.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroup.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroup.java index 6836d7758..0861b6a08 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroup.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroup.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroups.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroups.java index 9042cf620..788c335d5 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroups.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultGroups.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultPassword.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultPassword.java index 24653b3cb..512209a85 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultPassword.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridDefaultPassword.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridMinimumFree.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridMinimumFree.java index f4c963921..424c742ed 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridMinimumFree.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridMinimumFree.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridPool.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridPool.java index 6f8d13103..b89f3ddb7 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridPool.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridPool.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridSysplexGroups.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridSysplexGroups.java index 7cc14e0f2..34a50c540 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridSysplexGroups.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/UseridSysplexGroups.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ZosSecurityPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ZosSecurityPropertiesSingleton.java index b87afa3cd..367468989 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ZosSecurityPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/properties/ZosSecurityPropertiesSingleton.java @@ -1,5 +1,7 @@ /* * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zossecurity.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCertificateResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCertificateResourceManagement.java index a488affa7..7535a7ea3 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCertificateResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCertificateResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_CERTIFICATE_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCicsClassSetResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCicsClassSetResourceManagement.java index 3c66e0f0a..3788254cc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCicsClassSetResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosCicsClassSetResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_CICS_CLASS_SET_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosIdMapResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosIdMapResourceManagement.java index 1aa6426e1..c7586aa25 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosIdMapResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosIdMapResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_ID_MAP_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKerberosPrincipalResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKerberosPrincipalResourceManagement.java index 396149991..e9034db94 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKerberosPrincipalResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKerberosPrincipalResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_KERBEROS_PRINCIPAL_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKeyringResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKeyringResourceManagement.java index 6948fd4c5..28d294e91 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKeyringResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosKeyringResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_KEYRING_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosPredefinedProfilePermitResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosPredefinedProfilePermitResourceManagement.java index 8e9f17fcf..6a6b44888 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosPredefinedProfilePermitResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosPredefinedProfilePermitResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_PRE_DEFINED_PROFILE_PERMIT_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosProfileResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosProfileResourceManagement.java index 5b1d987ae..f7ed4fdfe 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosProfileResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosProfileResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_PROFILE_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosSecurityResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosSecurityResourceManagement.java index 5c1e0a3ab..3902604aa 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosSecurityResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosSecurityResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosUseridResourceManagement.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosUseridResourceManagement.java index 5a66b2096..df27fada8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosUseridResourceManagement.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resourcemanagement/ZosUseridResourceManagement.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resourcemanagement; import static dev.galasa.zossecurity.internal.ZosSecurityImpl.ZOS_USERID_PATTERN; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/RacfOutputProcessing.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/RacfOutputProcessing.java index 25be0bd7b..638481b20 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/RacfOutputProcessing.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/RacfOutputProcessing.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.Set; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCertificateImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCertificateImpl.java index 3a81ea553..fef4a1281 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCertificateImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCertificateImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.io.ByteArrayOutputStream; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsClassSetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsClassSetImpl.java index 7d55debe8..06e3a763f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsClassSetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsClassSetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsProfileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsProfileImpl.java index daf9ac892..2b569ec99 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsProfileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsProfileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsSharedClassSetImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsSharedClassSetImpl.java index 1dca4269f..d61fb9a50 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsSharedClassSetImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosCicsSharedClassSetImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosGroupImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosGroupImpl.java index 60c0388c7..557ff5807 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosGroupImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosGroupImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import dev.galasa.zossecurity.IZosGroup; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosIdMapImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosIdMapImpl.java index e3458cc0d..48bff0630 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosIdMapImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosIdMapImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosClientPrincipalImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosClientPrincipalImpl.java index 5207887df..b223a1682 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosClientPrincipalImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosClientPrincipalImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import dev.galasa.zossecurity.IZosKerberosPrincipal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosPrincipalImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosPrincipalImpl.java index d7e4225db..ba2164eb0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosPrincipalImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKerberosPrincipalImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import org.apache.commons.logging.Log; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKeyringImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKeyringImpl.java index 12d02e7f0..54e1fcd60 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKeyringImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosKeyringImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPreDefinedProfileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPreDefinedProfileImpl.java index 33b7fa97f..a476495fc 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPreDefinedProfileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPreDefinedProfileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.io.BufferedReader; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPredefinedProfilePermitImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPredefinedProfilePermitImpl.java index 4df2192c0..ef5b1547a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPredefinedProfilePermitImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosPredefinedProfilePermitImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosProfileImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosProfileImpl.java index 3cc932f9c..5595baf8b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosProfileImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosProfileImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.HashMap; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosUseridImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosUseridImpl.java index a2d074df6..b26347fe2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosUseridImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/internal/resources/ZosUseridImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.internal.resources; import java.util.ArrayList; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/package-info.java index 2b37a2c74..0ad81c99a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/package-info.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * Galasa zOS Security Manager */ diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/spi/IZosSecurityManagerSpi.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/spi/IZosSecurityManagerSpi.java index c9af6cde8..21e683e08 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/spi/IZosSecurityManagerSpi.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zossecurity.manager/src/main/java/dev/galasa/zossecurity/spi/IZosSecurityManagerSpi.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zossecurity.spi; import javax.validation.constraints.NotNull; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/build.gradle index ea5317272..f7d97281f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/build.gradle @@ -10,3 +10,16 @@ dependencies { implementation project(':galasa-managers-zos-parent:dev.galasa.zos.manager') implementation project(':galasa-managers-zos-parent:dev.galasa.zosunixcommand.ssh.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/settings.gradle index c0eb4fc2d..420a114d0 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/settings.gradle @@ -1 +1 @@ -rootProject.name = 'dev.galasa.zostsocommand.ssh.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zostsocommand.ssh.manager' diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandImpl.java index 956e44e7f..4c1734eff 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand.ssh.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandManagerImpl.java index 824854740..a7985605e 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/ZosTSOCommandManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zostsocommand.ssh.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/package-info.java index c16f4738a..0fd00ec8c 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS TSO Command Manager - SSH Internal Implementation * @@ -13,8 +13,11 @@ * @galasa.description * * This Manager is the internal implementation of the zOS TSO Command Manager using SSH. - *

    See the zOS Manager for details of the z/OS TSO annotations and - * code snippets.

    You can view the Javadoc - * documentation for the Manager here.

    + * + * See the zOS Manager for details of the z/OS TSO annotations and + * code snippets. + * + * You can view the Javadoc + * documentation for the Manager here. */ package dev.galasa.zostsocommand.ssh.manager.internal; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TsocmdPath.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TsocmdPath.java index 71fb5a65d..33cf536a6 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TsocmdPath.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TsocmdPath.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand.ssh.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/ZosTSOCommandSshPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/ZosTSOCommandSshPropertiesSingleton.java index 18b6715ef..0c97e7149 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/ZosTSOCommandSshPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/ZosTSOCommandSshPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zostsocommand.ssh.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/package-info.java index f9c4a5d9d..a62209f3a 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/main/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS TSO Command Manager SSH implementation - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandImpl.java index 111f7d5d8..06a116545 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zostsocommand.ssh.manager.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandManagerImpl.java index 115fcf3c4..dfa8a67c2 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/TestZosTSOCommandManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zostsocommand.ssh.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestTsocmdPath.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestTsocmdPath.java index 5acb64e1d..44948d6d8 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestTsocmdPath.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestTsocmdPath.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zostsocommand.ssh.manager.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestZosTSOCommandSshPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestZosTSOCommandSshPropertiesSingleton.java index 0d12c762b..b1e86f470 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestZosTSOCommandSshPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zostsocommand.ssh.manager/src/test/java/dev/galasa/zostsocommand/ssh/manager/internal/properties/TestZosTSOCommandSshPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zostsocommand.ssh.manager.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/build.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/build.gradle index 6097d4413..95167ec31 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/build.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/build.gradle @@ -9,3 +9,16 @@ version = '0.21.0' dependencies { implementation project (':galasa-managers-zos-parent:dev.galasa.zos.manager') } + +// Note: These values are consumed by the parent build process +// They indicate which packages of functionality this OSGi bundle should be delivered inside, +// or referenced from. +// The settings here are gathered together by the build process to create a release.yaml file +// which gathers-up all the packaging metadata about all the OSGi bundles in this component. +ext.projectName=project.name +ext.includeInOBR = true +ext.includeInMVP = true +ext.includeInBOM = true +ext.includeInIsolated = true +ext.includeInCodeCoverage = true +ext.includeInJavadoc = false \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/settings.gradle b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/settings.gradle index 003ac9382..b3c2a9581 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/settings.gradle +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/settings.gradle @@ -1 +1,2 @@ -rootProject.name = 'dev.galasa.zosunixcommand.ssh.manager' \ No newline at end of file +rootProject.name = 'dev.galasa.zosunixcommand.ssh.manager' + diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandImpl.java index c7b6c8163..b5221ea76 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandImpl.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand.ssh.manager.internal; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java index de2ac41bf..5b2007692 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/ZosUNIXCommandManagerImpl.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020-2021. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosunixcommand.ssh.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/package-info.java index e063b3cc0..ca27a2718 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS UNIX Manager - SSH Internal Implementation * @@ -13,8 +13,11 @@ * @galasa.description * * This Manager is the internal implementation of the z/OS UNIX Command Manager using SSH. - *

    See the zOS Manager for details of the z/OS UNIX annotations and - * code snippets.

    You can view the Javadoc - * documentation for the Manager here.

    + * + * See the zOS Manager for details of the z/OS UNIX annotations and + * code snippets. + * + * You can view the Javadoc + * documentation for the Manager here */ package dev.galasa.zosunixcommand.ssh.manager.internal; \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/ZosUNIXCommandSshPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/ZosUNIXCommandSshPropertiesSingleton.java index fb8a102d3..f1c1b663b 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/ZosUNIXCommandSshPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/ZosUNIXCommandSshPropertiesSingleton.java @@ -1,7 +1,7 @@ /* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 */ package dev.galasa.zosunixcommand.ssh.manager.internal.properties; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/package-info.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/package-info.java index 88af09721..e709e7b83 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/package-info.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/main/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/package-info.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ /** * zOS UNIX SSH Manager - CPS Properties * diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandImpl.java index 86b7e761f..3b854daa9 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosunixcommand.ssh.manager.internal; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandManagerImpl.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandManagerImpl.java index 325eac0a0..2264afc57 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/TestZosUNIXCommandManagerImpl.java @@ -1,6 +1,8 @@ -/* - * Copyright contributors to the Galasa project - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosunixcommand.ssh.manager.internal; import java.lang.annotation.Annotation; diff --git a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/TestZosUNIXCommandSshPropertiesSingleton.java b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/TestZosUNIXCommandSshPropertiesSingleton.java index 506d9b889..d90e1f95f 100644 --- a/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/TestZosUNIXCommandSshPropertiesSingleton.java +++ b/galasa-managers-parent/galasa-managers-zos-parent/dev.galasa.zosunixcommand.ssh.manager/src/test/java/dev/galasa/zosunixcommand/ssh/manager/internal/properties/TestZosUNIXCommandSshPropertiesSingleton.java @@ -1,8 +1,8 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2020. - */ +/* + * Copyright contributors to the Galasa project + * + * SPDX-License-Identifier: EPL-2.0 + */ package dev.galasa.zosunixcommand.ssh.manager.internal.properties; import org.junit.Assert; diff --git a/galasa-managers-parent/galasa-uber-javadoc/pom.xml b/galasa-managers-parent/galasa-uber-javadoc/pom.xml deleted file mode 100644 index 9ed301a83..000000000 --- a/galasa-managers-parent/galasa-uber-javadoc/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - 4.0.0 - - - dev.galasa - galasa-managers-parent - 0.15.0 - - - galasa-uber-javadoc - jar - - - - dev.galasa - dev.galasa.uber.obr - 0.15.0 - obr - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - generate-sources - - unpack-dependencies - - - sources - ${project.build.directory}/sources - dev.galasa - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - javadoc-no-fork - - - - - false - ${project.build.directory}/sources - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-resources - generate-sources - - copy-resources - - - ${project.build.directory}/ - - - src/main/resources - - Dockerfile - - - - - - - - - - - \ No newline at end of file diff --git a/galasa-managers-parent/galasa-uber-javadoc/src/main/java/dummy/X.java b/galasa-managers-parent/galasa-uber-javadoc/src/main/java/dummy/X.java deleted file mode 100644 index 36ba11573..000000000 --- a/galasa-managers-parent/galasa-uber-javadoc/src/main/java/dummy/X.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Licensed Materials - Property of IBM - * - * (c) Copyright IBM Corp. 2019. - */ -package dummy; - -public class X { - -} diff --git a/galasa-managers-parent/galasa-uber-javadoc/src/main/resources/Dockerfile b/galasa-managers-parent/galasa-uber-javadoc/src/main/resources/Dockerfile deleted file mode 100644 index dc2a053a8..000000000 --- a/galasa-managers-parent/galasa-uber-javadoc/src/main/resources/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM httpd:2.4.29 - -RUN rm -v /usr/local/apache2/htdocs/* - -COPY apidocs/ /usr/local/apache2/htdocs/ \ No newline at end of file diff --git a/galasa-managers-parent/gradle.properties b/galasa-managers-parent/gradle.properties index e72fcbda6..d942f9ac5 100644 --- a/galasa-managers-parent/gradle.properties +++ b/galasa-managers-parent/gradle.properties @@ -1,9 +1,9 @@ org.gradle.jvmargs=-Xmx4096M -jacocoEnabled=false +jacocoEnabled= true -isRelease=false +isMainOrRelease= false -sourceMaven=http://repo.maven.apache.org/maven2/ +sourceMaven=https://repo.maven.apache.org/maven2/ centralMaven=https://repo.maven.apache.org/maven2/ targetMaven=https://repo.maven.apache.org/maven2/ diff --git a/galasa-managers-parent/settings.gradle b/galasa-managers-parent/settings.gradle index e965bcbf8..767ec2472 100644 --- a/galasa-managers-parent/settings.gradle +++ b/galasa-managers-parent/settings.gradle @@ -13,6 +13,8 @@ pluginManagement { rootProject.name = 'galasa-managers-parent' +// galasa-managers-common-parent +include 'galasa-managers-common-parent:dev.galasa.common' // galasa-managers-core-parent include 'galasa-managers-core-parent:dev.galasa.core.manager' include 'galasa-managers-core-parent:dev.galasa.artifact.manager' @@ -82,6 +84,8 @@ include 'galasa-managers-languages-parent:dev.galasa.java.windows.manager' // galasa-managers-testingtools-parent include 'galasa-managers-testingtools-parent:dev.galasa.jmeter.manager' include 'galasa-managers-testingtools-parent:dev.galasa.jmeter.manager.ivt' +include 'galasa-managers-testingtools-parent:dev.galasa.sdv.manager' +include 'galasa-managers-testingtools-parent:dev.galasa.sdv.manager.ivt' include 'galasa-managers-testingtools-parent:dev.galasa.selenium.manager' include 'galasa-managers-testingtools-parent:dev.galasa.selenium.manager.ivt' include 'galasa-managers-testingtools-parent:dev.galasa.vtp.manager' diff --git a/githubdocs.sh b/githubdocs.sh deleted file mode 100755 index a1561ff3d..000000000 --- a/githubdocs.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh +e - -echo "Checking for changes" -CHANGED=$(git status -s .) -echo $CHANGED - -if [ -z "$CHANGED" ]; then - echo "No changes detected" - exit 0 -fi - -echo "Configing user" -git config user.name '$DOC_USER' -git config user.email $DOC_EMAIL - -echo "Adding changes" -git add . - -echo "Committing changes" -git commit -m "Generated manager docs $BUILD_TAG" - -echo "Pushing branch" -git push -f origin $DOC_BRANCH - - -echo "Checking for Pull Request" -PR=$(hub pr list -h $DOC_BRANCH) -echo $PR -if [ ! -z "$PR" ]; then - echo 'Pull Request is open' - exit 0 -fi - -echo "No Pull Request exists, creating one" - -hub pull-request -b next -h $DOC_BRANCH -m "Autogenned Manager Documentation" -m "Jenkins run $BUILD_TAG" -r $DOC_REVIEWERS \ No newline at end of file diff --git a/release.yaml b/release.yaml index 5a530f265..4d282f72c 100644 --- a/release.yaml +++ b/release.yaml @@ -1,6 +1,16 @@ # # Copyright contributors to the Galasa project # + +# ----------------------------------------------------------- +# +# WARNING +# +# This file is periodically re-generated from the contents of +# the repository, so don't make changes here manually please. +# ----------------------------------------------------------- + + apiVersion: galasa.dev/v1alpha kind: Release metadata: @@ -11,500 +21,644 @@ managers: # # Manager -# +# - - artifact: dev.galasa.artifact.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true - codecoverage: true - - - artifact: dev.galasa.artifact.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - - - artifact: dev.galasa.cicsts.manager - version: 0.24.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true - codecoverage: true - - artifact: dev.galasa.cicsts.manager.ivt - version: 0.22.0 - obr: true - mvp: true - bom: true - isolated: true - - artifact: dev.galasa.cicsts.ceci.manager - version: 0.21.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true + version: 0.25.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - artifact: dev.galasa.cicsts.ceci.manager.ivt - version: 0.23.0 - obr: true - mvp: true - bom: true - isolated: true - + version: 0.25.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true + codecoverage: false + - artifact: dev.galasa.cicsts.ceda.manager - version: 0.21.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true + version: 0.29.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.cicsts.ceda.manager.ivt version: 0.22.0 - obr: true - mvp: true - isolated: true - + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + - artifact: dev.galasa.cicsts.cemt.manager - version: 0.21.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true + version: 0.25.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.cicsts.cemt.manager.ivt version: 0.22.0 - obr: true - mvp: true - isolated: true - - - artifact: dev.galasa.cicsts.resource.manager + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.cicsts.manager + version: 0.36.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true + codecoverage: true + + - artifact: dev.galasa.cicsts.manager.ivt version: 0.25.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + obr: true + mvp: true + bom: true + javadoc: false + isolated: false + codecoverage: false + + - artifact: dev.galasa.cicsts.resource.manager + version: 0.37.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.cloud.manager version: 0.22.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true - codecoverage: true - - - artifact: dev.galasa.core.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.core.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - - artifact: dev.galasa.db2.manager - version: 0.24.0 - obr: true - bom: true - javadoc: true - mvp: true - isolated: true - - - artifact: dev.galasa.db2.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - - artifact: dev.galasa.docker.manager - version: 0.23.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.docker.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - - - artifact: dev.galasa.elasticlog.manager - version: 0.21.0 - obr: true - bom: true - isolated: true + version: 0.25.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.kubernetes.manager + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.elasticlog.manager.ivt + + - artifact: dev.galasa.kubernetes.manager.ivt version: 0.21.0 - obr: true - isolated: true - - - artifact: dev.galasa.galasaecosystem.manager + obr: true + mvp: false + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.liberty.manager version: 0.21.0 - obr: true - bom: true - isolated: true + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - artifact: dev.galasa.galasaecosystem.manager.ivt - version: 0.21.0 - obr: true - isolated: true + - artifact: dev.galasa.openstack.manager + version: 0.36.0 + obr: true + mvp: false + bom: true + javadoc: false + isolated: true + codecoverage: true - - artifact: dev.galasa.githubissue.manager + - artifact: dev.galasa.common version: 0.25.0 - obr: true - mvp: false - bom: true - isolated: false - + obr: true + mvp: true + bom: true + javadoc: false + isolated: true + codecoverage: false + - artifact: dev.galasa.http.manager - version: 0.25.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.36.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.http.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - + version: 0.31.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + - artifact: dev.galasa.ipnetwork.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.25.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.mq.manager + version: 0.25.0 + obr: true + mvp: false + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.java.manager + + - artifact: dev.galasa.mq.manager.ivt version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: false + bom: true + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.artifact.manager + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.java.ubuntu.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + + - artifact: dev.galasa.artifact.manager.ivt + version: 0.25.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.core.manager + version: 0.31.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.java.windows.manager + + - artifact: dev.galasa.core.manager.ivt version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.textscan.manager + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.jmeter.manager + + - artifact: dev.galasa.db2.manager + version: 0.35.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true + codecoverage: false + + - artifact: dev.galasa.db2.manager.ivt + version: 0.34.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.eclipseruntime.manager + version: 0.18.0 + obr: false + mvp: false + bom: false + javadoc: false + isolated: false + codecoverage: false + + - artifact: dev.galasa.eclipseruntime.ubuntu.manager + version: 0.18.0 + obr: false + mvp: false + bom: false + javadoc: false + isolated: false + codecoverage: false + + - artifact: dev.galasa.sem.manager + version: 0.36.0 + obr: true + mvp: false + bom: true + javadoc: false + isolated: false + codecoverage: false + + - artifact: dev.galasa.java.manager version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: false + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.jmeter.manager.ivt + + - artifact: dev.galasa.java.ubuntu.manager version: 0.21.0 - obr: true - isolated: true - - - artifact: dev.galasa.kubernetes.manager - version: 0.22.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + obr: true + mvp: false + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.kubernetes.manager.ivt - version: 0.21.0 - obr: true - isolated: true - - - artifact: dev.galasa.liberty.manager + + - artifact: dev.galasa.java.windows.manager version: 0.21.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: false + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.linux.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + + - artifact: dev.galasa.elasticlog.manager + version: 0.32.0 + obr: true + mvp: false + bom: true + javadoc: false + isolated: true codecoverage: true - - - artifact: dev.galasa.linux.manager.ivt + + - artifact: dev.galasa.elasticlog.manager.ivt version: 0.21.0 - obr: true - isolated: true + obr: true + mvp: false + bom: false + javadoc: false + isolated: true + codecoverage: false - - artifact: dev.galasa.mq.manager - version: 0.25.0 - obr: true - javadoc: true - bom: true - isolated: true + - artifact: dev.galasa.phoenix2.manager + version: 0.31.0 + obr: true + mvp: false + bom: true + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.galasaecosystem.manager + version: 0.36.0 + obr: true + mvp: false + bom: true + javadoc: false + isolated: true codecoverage: true - - - artifact: dev.galasa.mq.manager.ivt - version: 0.21.0 - obr: true - bom: true - isolated: true - - - artifact: dev.galasa.openstack.manager + + - artifact: dev.galasa.galasaecosystem.manager.ivt version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: false + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.jmeter.manager + version: 0.25.0 + obr: true + mvp: false + bom: true + javadoc: true + isolated: true + codecoverage: false + + - artifact: dev.galasa.jmeter.manager.ivt + version: 0.25.0 + obr: true + mvp: false + bom: true + javadoc: true + isolated: true + codecoverage: false + + - artifact: dev.galasa.sdv.manager + version: 0.36.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.phoenix2.manager - version: 0.21.0 - obr: true - bom: true - isolated: true - + + - artifact: dev.galasa.sdv.manager.ivt + version: 0.35.0 + obr: false + mvp: false + bom: false + javadoc: false + isolated: false + codecoverage: false + - artifact: dev.galasa.selenium.manager - version: 0.25.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.selenium.manager.ivt version: 0.21.0 - obr: true - mvp: true - isolated: true - - - artifact: dev.galasa.sem.manager + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.vtp.manager version: 0.25.0 - obr: true - bom: true - isolated: true - - - artifact: dev.galasa.textscan.manager + obr: true + mvp: true + bom: true + javadoc: true + isolated: true + codecoverage: false + + - artifact: dev.galasa.vtp.manager.ivt + version: 0.21.0 + obr: false + mvp: false + bom: false + javadoc: false + isolated: false + codecoverage: false + + - artifact: dev.galasa.linux.manager version: 0.21.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: false + bom: true + javadoc: true + isolated: true codecoverage: true - + + - artifact: dev.galasa.linux.manager.ivt + version: 0.21.0 + obr: true + mvp: false + bom: false + javadoc: false + isolated: true + codecoverage: false + - artifact: dev.galasa.windows.manager version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true + obr: true + mvp: false + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.githubissue.manager + version: 0.31.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.zos.manager + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + + - artifact: dev.galasa.zos.manager.ivt + version: 0.28.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + + - artifact: dev.galasa.zos3270.common + version: 0.32.0 + obr: true + mvp: true + bom: false + javadoc: true + isolated: true + codecoverage: false + + - artifact: dev.galasa.zos3270.manager + version: 0.36.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true + codecoverage: true + + - artifact: dev.galasa.zos3270.manager.ivt + version: 0.21.0 + obr: true + mvp: true + bom: false + javadoc: false + isolated: true + codecoverage: false + - artifact: dev.galasa.zosbatch.rseapi.manager - version: 0.25.0 - obr: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - + - artifact: dev.galasa.zosbatch.zosmf.manager - version: 0.25.0 - obr: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - artifact: dev.galasa.zosconsole.oeconsol.manager version: 0.21.0 - obr: true - bom: true - mvp: true - isolated: true + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - + - artifact: dev.galasa.zosconsole.zosmf.manager - version: 0.21.0 - obr: true - bom: true - mvp: true - isolated: true + version: 0.31.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - + - artifact: dev.galasa.zosfile.rseapi.manager - version: 0.25.0 - obr: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - + - artifact: dev.galasa.zosfile.zosmf.manager - version: 0.25.0 - obr: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - - - artifact: dev.galasa.zosliberty.manager - version: 0.21.0 - obr: true - mvp: true - javadoc: true - bom: true - isolated: true - codecoverage: true - + - artifact: dev.galasa.zosliberty.angel.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - isolated: true - codecoverage: true - - - artifact: dev.galasa.zos.manager - version: 0.25.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: false + bom: true + javadoc: true + isolated: true codecoverage: true - - - artifact: dev.galasa.zos.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - - - artifact: dev.galasa.zosprogram.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + + - artifact: dev.galasa.zosliberty.manager + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.zosmf.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + + - artifact: dev.galasa.zosprogram.manager + version: 0.25.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true + codecoverage: true + - artifact: dev.galasa.zosrseapi.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.zossecurity.manager - version: 0.21.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + version: 0.34.0 + obr: true + mvp: true + bom: true + javadoc: true + isolated: true codecoverage: true - + - artifact: dev.galasa.zostsocommand.ssh.manager version: 0.21.0 - obr: true - bom: true - mvp: true - isolated: true + obr: true + mvp: true + bom: true + javadoc: false + isolated: true codecoverage: true - + - artifact: dev.galasa.zosunixcommand.ssh.manager version: 0.21.0 - obr: true - bom: true - mvp: true - isolated: true - codecoverage: true - - - artifact: dev.galasa.zos3270.common - version: 0.21.0 - obr: true - bom: true - mvp: true - isolated: true - codecoverage: true - - - artifact: dev.galasa.zos3270.manager - version: 0.25.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true - codecoverage: true - - - artifact: dev.galasa.zos3270.manager.ivt - version: 0.21.0 - obr: true - mvp: true - isolated: true - - - artifact: dev.galasa.vtp.manager - version: 0.25.0 - obr: true - javadoc: true - bom: true - mvp: true - isolated: true + obr: true + mvp: true + bom: true + javadoc: false + isolated: true + codecoverage: true \ No newline at end of file diff --git a/set-version.sh b/set-version.sh new file mode 100755 index 000000000..fa8da33ac --- /dev/null +++ b/set-version.sh @@ -0,0 +1,150 @@ +#! /usr/bin/env bash + +# +# Copyright contributors to the Galasa project +# +# SPDX-License-Identifier: EPL-2.0 +# +#----------------------------------------------------------------------------------------- +# +# Objectives: Sets the version number of this component. +# +# Environment variable over-rides: +# None +# +#----------------------------------------------------------------------------------------- + +# Where is this script executing from ? +BASEDIR=$(dirname "$0");pushd $BASEDIR 2>&1 >> /dev/null ;BASEDIR=$(pwd);popd 2>&1 >> /dev/null +# echo "Running from directory ${BASEDIR}" +export ORIGINAL_DIR=$(pwd) +# cd "${BASEDIR}" + +cd "${BASEDIR}/.." +WORKSPACE_DIR=$(pwd) + +set -o pipefail + + +#----------------------------------------------------------------------------------------- +# +# Set Colors +# +#----------------------------------------------------------------------------------------- +bold=$(tput bold) +underline=$(tput sgr 0 1) +reset=$(tput sgr0) +red=$(tput setaf 1) +green=$(tput setaf 76) +white=$(tput setaf 7) +tan=$(tput setaf 202) +blue=$(tput setaf 25) + +#----------------------------------------------------------------------------------------- +# +# Headers and Logging +# +#----------------------------------------------------------------------------------------- +underline() { printf "${underline}${bold}%s${reset}\n" "$@" +} +h1() { printf "\n${underline}${bold}${blue}%s${reset}\n" "$@" +} +h2() { printf "\n${underline}${bold}${white}%s${reset}\n" "$@" +} +debug() { printf "${white}%s${reset}\n" "$@" +} +info() { printf "${white}➜ %s${reset}\n" "$@" +} +success() { printf "${green}✔ %s${reset}\n" "$@" +} +error() { printf "${red}✖ %s${reset}\n" "$@" +} +warn() { printf "${tan}➜ %s${reset}\n" "$@" +} +bold() { printf "${bold}%s${reset}\n" "$@" +} +note() { printf "\n${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" +} + +#----------------------------------------------------------------------------------------- +# Functions +#----------------------------------------------------------------------------------------- +function usage { + h1 "Syntax" + cat << EOF +set-version.sh [OPTIONS] +Options are: +-v | --version xxx : Mandatory. Set the version number to something explicitly. + Re-builds the release.yaml based on the contents of sub-projects. + For example '--version 0.29.0' +EOF +} + +#----------------------------------------------------------------------------------------- +# Process parameters +#----------------------------------------------------------------------------------------- +component_version="" + +while [ "$1" != "" ]; do + case $1 in + -v | --version ) shift + export component_version=$1 + ;; + -h | --help ) usage + exit + ;; + * ) error "Unexpected argument $1" + usage + exit 1 + esac + shift +done + +if [[ -z $component_version ]]; then + error "Missing mandatory '--version' argument." + usage + exit 1 +fi + + +temp_dir=$BASEDIR/temp/version_bump +mkdir -p $temp_dir + +function upgrade_dependencies_on_framework { + h1 "Upgrading anything which references the framework component" + + source_path=${BASEDIR}/galasa-managers-parent/buildSrc/src/main/groovy/galasa.manager.gradle + temp_file=$temp_dir/dependency.gradle + # The line marked this: implementation 'dev.galasa:dev.galasa.framework:0.27.0' needs to change. + info "Upgrading version framework in file $source_path" + + cat $source_path | sed "s/implementation[ \t]*.'dev.galasa:dev.galasa.framework:.*'[ \t]*$/implementation 'dev.galasa:dev.galasa.framework:$component_version'/1" > $temp_file + rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to replace master version in file $source_path" ; exit 1 ; fi + + cp $temp_file $source_path + rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to replace master version file with the modified one." ; exit 1 ; fi + + success "Upgraded dependencies on framework." +} + +function upgrade_build_gradle { + h1 "Upgrading the component version number in the master gradle." + + source_path=$BASEDIR/galasa-managers-parent/build.gradle + info "File to change is at file$source_path" + + # The galasa-managers-parent/build.gradle file is where the 'master' version number + # of the this component lives. + # For example: version = "0.29.0" + + cat $source_path | sed "s/version[ ]*=.*/version = \"$component_version\"/1" > $temp_dir/managers-build.gradle + rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to replace master version in file $source_path" ; exit 1 ; fi + + cp $temp_dir/managers-build.gradle $source_path + rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to replace master version file with the modified one." ; exit 1 ; fi + + success "Upgraded build.gradle file OK." +} + +upgrade_build_gradle +upgrade_dependencies_on_framework \ No newline at end of file