Skip to content

Commit efb594b

Browse files
committed
CONFIGROOT->USSCONFIG
1 parent ac9f862 commit efb594b

File tree

4 files changed

+160
-30
lines changed

4 files changed

+160
-30
lines changed

__tests__/__system__/cli/generate/__snapshots__/cli.generate.bundle.system.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ exports[`cics-deploy generate bundle paramters should customise port in generate
6565
6666
# Import the provisioned configuration file for this NODEJSAPP,
6767
# this file must be created before this Bundle can be installed in CICS
68-
INCLUDE=&CONFIGROOT;/nodejsapps/cics-nodejs-invoke.included.profile
68+
INCLUDE=&USSCONFIG;/nodejsapps/cics-nodejs-invoke.included.profile
6969
7070
# Set the PORT envionment variable, application code should reference this
7171
# value in preference to a hard-coded port number, the value references an
@@ -129,7 +129,7 @@ exports[`cics-deploy generate bundle should generate a bundle using defaults fro
129129
130130
# Import the provisioned configuration file for this NODEJSAPP,
131131
# this file must be created before this Bundle can be installed in CICS
132-
INCLUDE=&CONFIGROOT;/nodejsapps/cics-nodejs-invoke.included.profile
132+
INCLUDE=&USSCONFIG;/nodejsapps/cics-nodejs-invoke.included.profile
133133
134134
# Set the PORT envionment variable, application code should reference this
135135
# value in preference to a hard-coded port number, the value references an

__tests__/api/BundleContent/Nodejsapp.test.ts

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,30 @@ describe("NodejsappBundlePart01", () => {
1616
// Create a Nodejsapp
1717
const njs = new NodejsappBundlePart("__tests__/__resources__/ExampleBundle03", "NodeName", "__tests__/__resources__/ExampleBundle03/Artefact1", 1000);
1818

19-
// Check the bundle part as JSON
20-
expect(JSON.stringify(njs.getPart())).toMatch("{\"nodejsapp\":{\"xmlns\":\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\",\"name\":\"NodeName\",\"startscript\":\"Artefact1\",\"profile\":\"nodejsapps/NodeName.profile\",\"lerunopts\":\"DFHSJNRO\"}}");
21-
// Check the bundle part as XML
22-
expect(njs.getPartXML()).toMatch("<nodejsapp xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" name=\"NodeName\" startscript=\"Artefact1\" profile=\"nodejsapps/NodeName.profile\" lerunopts=\"DFHSJNRO\"></nodejsapp>");
23-
// Check the profile text
24-
expect(njs.getProfile()).toContain("INCLUDE=&CONFIGROOT;/nodejsapps/NodeName.included.profile");
25-
expect(njs.getProfile()).toContain("PORT=1000");
19+
expect(JSON.stringify(njs.getPart())).toMatchSnapshot();
20+
expect(njs.getPartXML()).toMatchSnapshot();
21+
expect(njs.getProfile()).toMatchSnapshot();
22+
expect(njs.getProfile()).toMatchSnapshot();
2623
});
2724
it("Create a NodejsappBundlePart with bad chars", () => {
2825

2926
// Create a Nodejsapp
3027
const njs = new NodejsappBundlePart("__tests__/__resources__/ExampleBundle03", "NodeName is invalid!!!", "__tests__/__resources__/ExampleBundle03/Artefact1", 1000);
3128

32-
// Check the bundle part as JSON
33-
expect(JSON.stringify(njs.getPart())).toMatch("{\"nodejsapp\":{\"xmlns\":\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\",\"name\":\"NodeNameXisXinvalidXXX\",\"startscript\":\"Artefact1\",\"profile\":\"nodejsapps/NodeNameXisXinvalidXXX.profile\",\"lerunopts\":\"DFHSJNRO\"}}");
34-
// Check the bundle part as XML
35-
expect(njs.getPartXML()).toMatch("<nodejsapp xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" name=\"NodeNameXisXinvalidXXX\" startscript=\"Artefact1\" profile=\"nodejsapps/NodeNameXisXinvalidXXX.profile\" lerunopts=\"DFHSJNRO\"></nodejsapp>");
36-
// Check the profile text
37-
expect(njs.getProfile()).toContain("INCLUDE=&CONFIGROOT;/nodejsapps/NodeNameXisXinvalidXXX.included.profile");
38-
expect(njs.getProfile()).toContain("PORT=1000");
29+
expect(JSON.stringify(njs.getPart())).toMatchSnapshot();
30+
expect(njs.getPartXML()).toMatchSnapshot();
31+
expect(njs.getProfile()).toMatchSnapshot();
32+
expect(njs.getProfile()).toMatchSnapshot();
3933
});
4034
it("Create a NodejsappBundlePart with long name", () => {
4135

4236
// Create a Nodejsapp
4337
const njs = new NodejsappBundlePart("__tests__/__resources__/ExampleBundle03", "123456789012345678901234567890123", "__tests__/__resources__/ExampleBundle03/Artefact1", 1000);
4438

45-
// Check the bundle part as JSON
46-
expect(JSON.stringify(njs.getPart())).toMatch("{\"nodejsapp\":{\"xmlns\":\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\",\"name\":\"12345678901234567890123456789012\",\"startscript\":\"Artefact1\",\"profile\":\"nodejsapps/12345678901234567890123456789012.profile\",\"lerunopts\":\"DFHSJNRO\"}}");
47-
// Check the bundle part as XML
48-
expect(njs.getPartXML()).toMatch("<nodejsapp xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" name=\"12345678901234567890123456789012\" startscript=\"Artefact1\" profile=\"nodejsapps/12345678901234567890123456789012.profile\" lerunopts=\"DFHSJNRO\"></nodejsapp>");
49-
// Check the profile text
50-
expect(njs.getProfile()).toContain("INCLUDE=&CONFIGROOT;/nodejsapps/12345678901234567890123456789012.included.profile");
51-
expect(njs.getProfile()).toContain("PORT=1000");
39+
expect(JSON.stringify(njs.getPart())).toMatchSnapshot();
40+
expect(njs.getPartXML()).toMatchSnapshot();
41+
expect(njs.getProfile()).toMatchSnapshot();
42+
expect(njs.getProfile()).toMatchSnapshot();
5243
});
5344
it("Create a NodejsappBundlePart with missing name parameter", () => {
5445

@@ -121,12 +112,10 @@ describe("NodejsappBundlePart01", () => {
121112
const njs = new NodejsappBundlePart("__tests__/__resources__/ExampleBundle03", "NodeName", "__tests__/__resources__/ExampleBundle03/Artefact1", undefined);
122113

123114
// Check the bundle part as JSON
124-
expect(JSON.stringify(njs.getPart())).toMatch("{\"nodejsapp\":{\"xmlns\":\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\",\"name\":\"NodeName\",\"startscript\":\"Artefact1\",\"profile\":\"nodejsapps/NodeName.profile\",\"lerunopts\":\"DFHSJNRO\"}}");
125-
// Check the bundle part as XML
126-
expect(njs.getPartXML()).toMatch("<nodejsapp xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" name=\"NodeName\" startscript=\"Artefact1\" profile=\"nodejsapps/NodeName.profile\" lerunopts=\"DFHSJNRO\"></nodejsapp>");
127-
// Check the profile text
128-
expect(njs.getProfile()).toContain("INCLUDE=&CONFIGROOT;/nodejsapps/NodeName.included.profile");
129-
expect(njs.getProfile()).toContain("PORT=&HTTP_PORT;");
115+
expect(JSON.stringify(njs.getPart())).toMatchSnapshot();
116+
expect(njs.getPartXML()).toMatchSnapshot();
117+
expect(njs.getProfile()).toMatchSnapshot();
118+
expect(njs.getProfile()).toMatchSnapshot();
130119
});
131120
it("Create a NodejsappBundlePart with missing name", () => {
132121

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart 1`] = `"{\\"nodejsapp\\":{\\"xmlns\\":\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\",\\"name\\":\\"NodeName\\",\\"startscript\\":\\"Artefact1\\",\\"profile\\":\\"nodejsapps/NodeName.profile\\",\\"lerunopts\\":\\"DFHSJNRO\\"}}"`;
4+
5+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart 2`] = `
6+
"<nodejsapp xmlns=\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\" name=\\"NodeName\\" startscript=\\"Artefact1\\" profile=\\"nodejsapps/NodeName.profile\\" lerunopts=\\"DFHSJNRO\\"></nodejsapp>
7+
"
8+
`;
9+
10+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart 3`] = `
11+
"# This is a profile for a CICS NODEJSAPP resource
12+
13+
# Import the provisioned configuration file for this NODEJSAPP,
14+
# this file must be created before this Bundle can be installed in CICS
15+
INCLUDE=&USSCONFIG;/nodejsapps/NodeName.included.profile
16+
17+
# Set the PORT envionment variable, application code should reference this
18+
# value in preference to a hard-coded port number, the value references an
19+
# environment variable that will be configured within the provisioned configuration file.
20+
PORT=1000
21+
"
22+
`;
23+
24+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart 4`] = `
25+
"# This is a profile for a CICS NODEJSAPP resource
26+
27+
# Import the provisioned configuration file for this NODEJSAPP,
28+
# this file must be created before this Bundle can be installed in CICS
29+
INCLUDE=&USSCONFIG;/nodejsapps/NodeName.included.profile
30+
31+
# Set the PORT envionment variable, application code should reference this
32+
# value in preference to a hard-coded port number, the value references an
33+
# environment variable that will be configured within the provisioned configuration file.
34+
PORT=1000
35+
"
36+
`;
37+
38+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with bad chars 1`] = `"{\\"nodejsapp\\":{\\"xmlns\\":\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\",\\"name\\":\\"NodeNameXisXinvalidXXX\\",\\"startscript\\":\\"Artefact1\\",\\"profile\\":\\"nodejsapps/NodeNameXisXinvalidXXX.profile\\",\\"lerunopts\\":\\"DFHSJNRO\\"}}"`;
39+
40+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with bad chars 2`] = `
41+
"<nodejsapp xmlns=\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\" name=\\"NodeNameXisXinvalidXXX\\" startscript=\\"Artefact1\\" profile=\\"nodejsapps/NodeNameXisXinvalidXXX.profile\\" lerunopts=\\"DFHSJNRO\\"></nodejsapp>
42+
"
43+
`;
44+
45+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with bad chars 3`] = `
46+
"# This is a profile for a CICS NODEJSAPP resource
47+
48+
# Import the provisioned configuration file for this NODEJSAPP,
49+
# this file must be created before this Bundle can be installed in CICS
50+
INCLUDE=&USSCONFIG;/nodejsapps/NodeNameXisXinvalidXXX.included.profile
51+
52+
# Set the PORT envionment variable, application code should reference this
53+
# value in preference to a hard-coded port number, the value references an
54+
# environment variable that will be configured within the provisioned configuration file.
55+
PORT=1000
56+
"
57+
`;
58+
59+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with bad chars 4`] = `
60+
"# This is a profile for a CICS NODEJSAPP resource
61+
62+
# Import the provisioned configuration file for this NODEJSAPP,
63+
# this file must be created before this Bundle can be installed in CICS
64+
INCLUDE=&USSCONFIG;/nodejsapps/NodeNameXisXinvalidXXX.included.profile
65+
66+
# Set the PORT envionment variable, application code should reference this
67+
# value in preference to a hard-coded port number, the value references an
68+
# environment variable that will be configured within the provisioned configuration file.
69+
PORT=1000
70+
"
71+
`;
72+
73+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with long name 1`] = `"{\\"nodejsapp\\":{\\"xmlns\\":\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\",\\"name\\":\\"12345678901234567890123456789012\\",\\"startscript\\":\\"Artefact1\\",\\"profile\\":\\"nodejsapps/12345678901234567890123456789012.profile\\",\\"lerunopts\\":\\"DFHSJNRO\\"}}"`;
74+
75+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with long name 2`] = `
76+
"<nodejsapp xmlns=\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\" name=\\"12345678901234567890123456789012\\" startscript=\\"Artefact1\\" profile=\\"nodejsapps/12345678901234567890123456789012.profile\\" lerunopts=\\"DFHSJNRO\\"></nodejsapp>
77+
"
78+
`;
79+
80+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with long name 3`] = `
81+
"# This is a profile for a CICS NODEJSAPP resource
82+
83+
# Import the provisioned configuration file for this NODEJSAPP,
84+
# this file must be created before this Bundle can be installed in CICS
85+
INCLUDE=&USSCONFIG;/nodejsapps/12345678901234567890123456789012.included.profile
86+
87+
# Set the PORT envionment variable, application code should reference this
88+
# value in preference to a hard-coded port number, the value references an
89+
# environment variable that will be configured within the provisioned configuration file.
90+
PORT=1000
91+
"
92+
`;
93+
94+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with long name 4`] = `
95+
"# This is a profile for a CICS NODEJSAPP resource
96+
97+
# Import the provisioned configuration file for this NODEJSAPP,
98+
# this file must be created before this Bundle can be installed in CICS
99+
INCLUDE=&USSCONFIG;/nodejsapps/12345678901234567890123456789012.included.profile
100+
101+
# Set the PORT envionment variable, application code should reference this
102+
# value in preference to a hard-coded port number, the value references an
103+
# environment variable that will be configured within the provisioned configuration file.
104+
PORT=1000
105+
"
106+
`;
107+
108+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with missing port number 1`] = `"{\\"nodejsapp\\":{\\"xmlns\\":\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\",\\"name\\":\\"NodeName\\",\\"startscript\\":\\"Artefact1\\",\\"profile\\":\\"nodejsapps/NodeName.profile\\",\\"lerunopts\\":\\"DFHSJNRO\\"}}"`;
109+
110+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with missing port number 2`] = `
111+
"<nodejsapp xmlns=\\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\\" name=\\"NodeName\\" startscript=\\"Artefact1\\" profile=\\"nodejsapps/NodeName.profile\\" lerunopts=\\"DFHSJNRO\\"></nodejsapp>
112+
"
113+
`;
114+
115+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with missing port number 3`] = `
116+
"# This is a profile for a CICS NODEJSAPP resource
117+
118+
# Import the provisioned configuration file for this NODEJSAPP,
119+
# this file must be created before this Bundle can be installed in CICS
120+
INCLUDE=&USSCONFIG;/nodejsapps/NodeName.included.profile
121+
122+
# Set the PORT envionment variable, application code should reference this
123+
# value in preference to a hard-coded port number, the value references an
124+
# environment variable that will be configured within the provisioned configuration file.
125+
PORT=&HTTP_PORT;
126+
"
127+
`;
128+
129+
exports[`NodejsappBundlePart01 Create a NodejsappBundlePart with missing port number 4`] = `
130+
"# This is a profile for a CICS NODEJSAPP resource
131+
132+
# Import the provisioned configuration file for this NODEJSAPP,
133+
# this file must be created before this Bundle can be installed in CICS
134+
INCLUDE=&USSCONFIG;/nodejsapps/NodeName.included.profile
135+
136+
# Set the PORT envionment variable, application code should reference this
137+
# value in preference to a hard-coded port number, the value references an
138+
# environment variable that will be configured within the provisioned configuration file.
139+
PORT=&HTTP_PORT;
140+
"
141+
`;

src/api/BundleContent/NodejsappBundlePart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class NodejsappBundlePart extends BundlePart {
189189
os.EOL +
190190
"# Import the provisioned configuration file for this NODEJSAPP," + os.EOL +
191191
"# this file must be created before this Bundle can be installed in CICS" + os.EOL +
192-
"INCLUDE=&CONFIGROOT;/nodejsapps/" + this.getPartData().name + ".included.profile" + os.EOL +
192+
"INCLUDE=&USSCONFIG;/nodejsapps/" + this.getPartData().name + ".included.profile" + os.EOL +
193193
os.EOL +
194194
"# Set the PORT envionment variable, application code should reference this" + os.EOL +
195195
"# value in preference to a hard-coded port number, the value references an" + os.EOL +

0 commit comments

Comments
 (0)