diff --git a/GSECONF/DOGGOS/COBOL/DOGGOS.CBL b/GSECONF/DOGGOS/COBOL/DOGGOS.CBL index 442b51c..b5a8241 100644 --- a/GSECONF/DOGGOS/COBOL/DOGGOS.CBL +++ b/GSECONF/DOGGOS/COBOL/DOGGOS.CBL @@ -37,7 +37,7 @@ 01 BREED-INDEXES. 05 SHIBA-INDEX. 10 SHIBA-INDEX-VALUE PIC 9(1) VALUE 1. - 10 SHIBA-BREED-NAME PIC X(5) VALUE 'SHIBA'. + 10 SHIBA-BREED-NAME PIC X(5) VALUE 'SHIBA'. 05 SHNAUTZER-INDEX. 10 SHNAUTZER-INDEX-VALUE PIC 9(1) VALUE 2. 10 SHNAUTZER-BREED-NAME PIC X(9) VALUE 'SHNAUTZER'. @@ -183,7 +183,7 @@ EVALUATE INP-DOG-BREED WHEN SHIBA-BREED-NAME ADD INP-ADOPTED-AMOUNT - TO BREED-ADOPTIONS(SHIBA-INDEX-VALUE) + TO BREED-ADOPTIONS(SHIBA-INDEX-VALUE) WHEN SHNAUTZER-BREED-NAME ADD INP-ADOPTED-AMOUNT TO BREED-ADOPTIONS(SHNAUTZER-INDEX-VALUE) diff --git a/README.md b/README.md index 0414801..3858b43 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,13 @@ Once you have met the prerequisites, ### Running The Test Case -1. Navigate to the **test4z/test/doggos/doggos.test.ts** file and check the regression test codes. + +1. Run the following command to configure Test4z and deploy the input file to the mainframe, enter your username when + the command prompt asks: + + npm run configure + +1. Navigate to the **test/doggos/doggos.test.ts** file and check the regression test codes. 2. Run the test suite using the following command: npm run test @@ -57,18 +63,18 @@ Once you have met the prerequisites, ### Extending the test suite -1. Navigate to the **test4z/scripts/files/DOGGOS.INPUT** file. Add a new breed with a number of adoptions, or change +1. Navigate to the **scripts/files/DOGGOS.INPUT** file. Add a new breed with a number of adoptions, or change the number of adoptions for an existing breed. 2. Upload the new input dataset to the mainframe using the following command, enter your username when the command prompt asks: - npm run uploadFile + npm run uploadFile -3. Navigate to the **test4z/test/doggos/doggos.test.ts** file back, and run it using the following command: +3. Navigate to the **test/doggos/doggos.test.ts** file back, and run it using the following command: npm run test -4. Observe the failed test cases, update them according to your changes in the DOGGOS.INPUT file (from the 1st step). +4. Observe the failed test cases, update the test assertions according to your changes in the 1st step for the INPUT file. If you added a new breed, create a test suite for it by following the existing breed test cases. 5. Run the test suite again, and verify all the test cases are passing. diff --git a/package.json b/package.json index 0347add..1e46961 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,8 @@ "author": "Broadcom", "scripts": { "test": "jest", - "setup": "sh scripts/test-setup.sh", - "postinstall": "npm run setup && npm run uploadFile", - "uploadFile": "cd scripts && sh upload.sh" + "configure": "cd scripts && sh configure.sh", + "uploadFile": "cd scripts && sh upload-file.sh" }, "devDependencies": { "@types/jest": "^26.0.15", diff --git a/scripts/test-setup.sh b/scripts/configure.sh similarity index 52% rename from scripts/test-setup.sh rename to scripts/configure.sh index 79af5c6..a460b23 100644 --- a/scripts/test-setup.sh +++ b/scripts/configure.sh @@ -1,16 +1,28 @@ +#!/bin/bash set -e +source ./basescript.sh printf "\nConfiguring Test4z...\n\n" - printf "Enter username: " read USER_NAME - npx zowe config set profiles.lpar1.profiles.test4z.properties.hlq "$USER_NAME" npx zowe config set --secure profiles.lpar1.profiles.test4z.properties.user "$USER_NAME" npx zowe config set --secure profiles.lpar1.profiles.test4z.properties.password "$USER_NAME" - npx zowe config set --secure profiles.lpar1.profiles.zosmf.properties.user "$USER_NAME" npx zowe config set --secure profiles.lpar1.profiles.zosmf.properties.password "$USER_NAME" printf "\n#########################################" printf "\n#### Test4z configuration successful ####" -printf "\n#########################################" +printf "\n#########################################\n\n" + +printf "Deploying the input file to the Mainframe\n\n" + +hlq=$USER_NAME +tempDirectoryName="FILES_TEMP"; +DOGGOS_INPUT="DOGGOS.INPUT"; +DOGGOS_INPUT_NEW="DOGGOS.INPUT.NEW"; +DOGGOS_RUNAPP="DOGGOS.RUNAPP" +storageClass="CAEDS6"; +upload "$DOGGOS_INPUT" files/DOGGOS.INPUT DS N +printf "\n###########################################################" +printf "\n# Input dataset successfully deployed to the Z/OS system #" +printf "\n###########################################################\n" diff --git a/scripts/upload.sh b/scripts/upload-file.sh similarity index 77% rename from scripts/upload.sh rename to scripts/upload-file.sh index 3c38fd2..ee3a412 100644 --- a/scripts/upload.sh +++ b/scripts/upload-file.sh @@ -1,18 +1,15 @@ #!/bin/bash set -e source ./basescript.sh - -printf "\nDeploying the input file to the Mainframe\n\n" - printf "Enter username: " read hlq +printf "\nDeploying the input file to the Mainframe\n\n" tempDirectoryName="FILES_TEMP"; DOGGOS_INPUT="DOGGOS.INPUT"; DOGGOS_INPUT_NEW="DOGGOS.INPUT.NEW"; DOGGOS_RUNAPP="DOGGOS.RUNAPP" storageClass="CAEDS6"; upload "$DOGGOS_INPUT" files/DOGGOS.INPUT DS N -printf "Datasets successfully deployed to the Z/OS system\n\n"; printf "\n###########################################################" -printf "\n#### Datasets successfully deployed to the Z/OS system ####" +printf "\n# Input dataset successfully deployed to the Z/OS system #" printf "\n###########################################################\n"