Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed start tso app and send tso app output formatting #2347

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- BugFix: Improved output formatting for `zowe zos-tso start app` and `zowe zos-tso send app`[#2347](https://github.com/zowe/zowe-cli/pull/2347)
jace-roell marked this conversation as resolved.
Show resolved Hide resolved

## `8.6.2`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`receive TSO app handler behavior should properly receive and parse data from receive TSO response 1`] = `
"{
\\"version\\": \\"0100\\",
\\"reused\\": false,
\\"timeout\\": false,
\\"servletKey\\": \\"ZOWEUSER-127-aabeaaag\\",
\\"queueID\\": null,
\\"tsoData\\": [
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"HELLOW exec processing has started.\\"
"
"
`;

exports[`receive TSO app handler behavior should properly receive and parse data from receive TSO response 2`] = `"HELLOW exec processing has started."`;

exports[`receive TSO app handler behavior should properly receive and parse data from receive TSO response 3`] = `"UNIX message queue id = 1048608"`;

exports[`receive TSO app handler behavior should properly receive and parse data from receive TSO response 4`] = `
Object {
"queueID": null,
"reused": false,
"servletKey": "ZOWEUSER-127-aabeaaag",
"timeout": false,
"tsoData": Array [
Object {
"DATA": "HELLOW exec processing has started.",
"VERSION": "0100",
},
Object {
"DATA": "UNIX message queue id = 1048608",
"VERSION": "0100",
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"UNIX message queue id = 1048608\\"
}
]
}"
],
"version": "0100",
}
`;
Original file line number Diff line number Diff line change
@@ -1,63 +1,105 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 1`] = `
"{
\\"reused\\": false,
\\"timeout\\": false,
\\"servletKey\\": \\"ZOWEUSER-123-aaaaaa\\",
\\"queueID\\": \\"983068\\",
\\"tsoData\\": [
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"HELLOW exec processing has started.\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"UNIX message queue id = 983068\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"Input message type = 32772\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"Output message type = 4\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"Reading application input from the UNIX message queue.\\"
}
]
}"
"
Servlet Key: ZOWEUSER-123-aaaaaa"
`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 2`] = `
"Queue ID: 983068
"
`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 3`] = `"HELLOW exec processing has started."`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 4`] = `"UNIX message queue id = 983068"`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 5`] = `"Input message type = 32772"`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 6`] = `"Output message type = 4"`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 7`] = `"Reading application input from the UNIX message queue."`;

exports[`receive TSO app handler behavior should properly start TSO address space and run an application at the created address space 8`] = `
Object {
"queueID": "983068",
"reused": false,
"servletKey": "ZOWEUSER-123-aaaaaa",
"timeout": false,
"tsoData": Array [
Object {
"DATA": "HELLOW exec processing has started.",
"VERSION": "0100",
},
Object {
"DATA": "UNIX message queue id = 983068",
"VERSION": "0100",
},
Object {
"DATA": "Input message type = 32772",
"VERSION": "0100",
},
Object {
"DATA": "Output message type = 4",
"VERSION": "0100",
},
Object {
"DATA": "Reading application input from the UNIX message queue.",
"VERSION": "0100",
},
],
"version": undefined,
}
`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 1`] = `
"{
\\"reused\\": false,
\\"timeout\\": false,
\\"servletKey\\": \\"ZOWEUSER-123-aaaaaa\\",
\\"queueID\\": \\"983068\\",
\\"tsoData\\": [
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"HELLOW exec processing has started.\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"UNIX message queue id = 983068\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"Input message type = 32772\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"Output message type = 4\\"
},
{
\\"VERSION\\": \\"0100\\",
\\"DATA\\": \\"Reading application input from the UNIX message queue.\\"
}
]
}"
"
Servlet Key: ZOWEUSER-123-aaaaaa"
`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 2`] = `
"Queue ID: 983068
"
`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 3`] = `"HELLOW exec processing has started."`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 4`] = `"UNIX message queue id = 983068"`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 5`] = `"Input message type = 32772"`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 6`] = `"Output message type = 4"`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 7`] = `"Reading application input from the UNIX message queue."`;

exports[`receive TSO app handler behavior should properly start TSO address space at an existing TSO address space 8`] = `
Object {
"queueID": "983068",
"reused": false,
"servletKey": "ZOWEUSER-123-aaaaaa",
"timeout": false,
"tsoData": Array [
Object {
"DATA": "HELLOW exec processing has started.",
"VERSION": "0100",
},
Object {
"DATA": "UNIX message queue id = 983068",
"VERSION": "0100",
},
Object {
"DATA": "Input message type = 32772",
"VERSION": "0100",
},
Object {
"DATA": "Output message type = 4",
"VERSION": "0100",
},
Object {
"DATA": "Reading application input from the UNIX message queue.",
"VERSION": "0100",
},
],
"version": undefined,
}
`;
12 changes: 9 additions & 3 deletions packages/cli/src/zostso/send/as-app/SendASApp.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@

commandParameters.response.progress.endSpinner();

commandParameters.response.console.log(
JSON.stringify(response, null, 2)
);
commandParameters.response.console.log("\n");
response.tsoData.forEach((data) => {
if(typeof data === 'string') {
commandParameters.response.console.log(data);

Check warning on line 43 in packages/cli/src/zostso/send/as-app/SendASApp.handler.ts

View check run for this annotation

Codecov / codecov/patch

packages/cli/src/zostso/send/as-app/SendASApp.handler.ts#L43

Added line #L43 was not covered by tests
jace-roell marked this conversation as resolved.
Show resolved Hide resolved
} else if (data && data.DATA) {
commandParameters.response.console.log(data.DATA);
}
});
jace-roell marked this conversation as resolved.
Show resolved Hide resolved
commandParameters.response.data.setObj(response);
}
}
14 changes: 13 additions & 1 deletion packages/cli/src/zostso/start/as-app/StartASApp.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import { IHandlerParameters } from "@zowe/imperative";
import { ZosTsoBaseHandler, AddressSpaceApps } from "@zowe/zos-tso-for-zowe-sdk";
import chalk = require("chalk");

/**
* Handler to start app at an address space
Expand All @@ -32,6 +33,17 @@
},
this.mTsoStart
);
commandParameters.response.console.log(JSON.stringify(response,null,2));
commandParameters.response.console.log(chalk.yellow.bold("\n" + "Servlet Key: ") + response.servletKey);
jace-roell marked this conversation as resolved.
Show resolved Hide resolved
commandParameters.response.console.log(chalk.yellow.bold("Queue ID: ") + response.queueID + "\n");

response.tsoData.forEach((data) => {
if(typeof data === 'string') {
commandParameters.response.console.log(data);

Check warning on line 41 in packages/cli/src/zostso/start/as-app/StartASApp.handler.ts

View check run for this annotation

Codecov / codecov/patch

packages/cli/src/zostso/start/as-app/StartASApp.handler.ts#L41

Added line #L41 was not covered by tests
jace-roell marked this conversation as resolved.
Show resolved Hide resolved
} else if (data && data.DATA) {
commandParameters.response.console.log(data.DATA);
}
jace-roell marked this conversation as resolved.
Show resolved Hide resolved
});

commandParameters.response.data.setObj(response);
}
}
4 changes: 4 additions & 0 deletions packages/zosfiles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Zowe z/OS files SDK package will be documented in this file.

## Recent Changes

- BugFix: Improved output formatting for `zowe zos-tso start app` and `zowe zos-tso send app`[#2347](https://github.com/zowe/zowe-cli/pull/2347)

jace-roell marked this conversation as resolved.
Show resolved Hide resolved
## `8.6.2`

- BugFix: Resolved issue where encoding argument was missing from `FileToUss.handler.ts` options object. [#2234](https://github.com/zowe/zowe-cli/pull/2334)
Expand Down
Loading