@@ -1043,6 +1043,13 @@ describe("BundlePusher01", () => {
1043
1043
zosmfProfile = { host : "wibble" , user : "user" } ;
1044
1044
sshProfile = { host : "wibble" , user : "user" } ;
1045
1045
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" } ;
1046
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1047
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1048
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1049
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/WIBBLE\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1050
+ "</manifest>" ;
1051
+ }
1052
+ } ) ;
1046
1053
cmciSpy . mockImplementation ( ( cicsSession : any , regionData : cmci . IResourceParms ) => {
1047
1054
if ( regionData . name === "CICSRegion" ) {
1048
1055
return { response : {
@@ -1112,7 +1119,14 @@ describe("BundlePusher01", () => {
1112
1119
sshProfile = { host : "wibble" , user : "user" } ;
1113
1120
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" } ;
1114
1121
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1115
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1122
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2055I" } ] ) ;
1123
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1124
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1125
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1126
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1127
+ "</manifest>" ;
1128
+ }
1129
+ } ) ;
1116
1130
cmciSpy . mockImplementation ( ( cicsSession : any , regionData : cmci . IResourceParms ) => {
1117
1131
if ( regionData . name === "CICSRegion" ) {
1118
1132
return { response : {
@@ -1186,7 +1200,14 @@ describe("BundlePusher01", () => {
1186
1200
sshProfile = { host : "wibble" , user : "user" } ;
1187
1201
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1188
1202
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1189
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1203
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1204
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1205
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1206
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1207
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1208
+ "</manifest>" ;
1209
+ }
1210
+ } ) ;
1190
1211
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1191
1212
if ( nodejsData . name === "CICSNodejsapp" ) {
1192
1213
throw new Error ( "Injected CMCI GET error" ) ;
@@ -1226,7 +1247,14 @@ describe("BundlePusher01", () => {
1226
1247
sshProfile = { host : "wibble" , user : "user" } ;
1227
1248
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1228
1249
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1229
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1250
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1251
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1252
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1253
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1254
+ "<define name=\"test\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1255
+ "</manifest>" ;
1256
+ }
1257
+ } ) ;
1230
1258
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1231
1259
if ( nodejsData . name === "CICSNodejsapp" ) {
1232
1260
return { } ;
@@ -1266,7 +1294,14 @@ describe("BundlePusher01", () => {
1266
1294
sshProfile = { host : "wibble" , user : "user" } ;
1267
1295
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1268
1296
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1269
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1297
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1298
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1299
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1300
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1301
+ "<define name=\"name\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1302
+ "</manifest>" ;
1303
+ }
1304
+ } ) ;
1270
1305
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1271
1306
if ( nodejsData . name === "CICSNodejsapp" ) {
1272
1307
return { response : {
@@ -1318,7 +1353,14 @@ describe("BundlePusher01", () => {
1318
1353
sshProfile = { host : "wibble" , user : "user" } ;
1319
1354
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1320
1355
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1321
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1356
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1357
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1358
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1359
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1360
+ "<define name=\"name\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1361
+ "</manifest>" ;
1362
+ }
1363
+ } ) ;
1322
1364
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1323
1365
if ( nodejsData . name === "CICSNodejsapp" ) {
1324
1366
return { response : {
@@ -1370,7 +1412,15 @@ describe("BundlePusher01", () => {
1370
1412
sshProfile = { host : "wibble" , user : "user" } ;
1371
1413
cicsProfile = { host : "wibble" , user : "user" , password : "thisIsntReal" , cicsPlex : "12345678" , regionName : "12345678" } ;
1372
1414
submitSpy = jest . spyOn ( SubmitJobs , "submitJclString" ) . mockImplementation ( ( ) =>
1373
- [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP" } ] ) ;
1415
+ [ { ddName : "SYSTSPRT" , stepName : "DFHDPLOY" , data : "DFHRL2012I" } ] ) ;
1416
+ readSpy = jest . spyOn ( fs , "readFileSync" ) . mockImplementation ( ( data : string ) => {
1417
+ if ( data . indexOf ( "cics.xml" ) > - 1 ) {
1418
+ return "<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\">" +
1419
+ "<define name=\"name\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1420
+ "<define name=\"name2\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/NODEJSAPP\" path=\"nodejsapps/test.nodejsapp\"></define>" +
1421
+ "</manifest>" ;
1422
+ }
1423
+ } ) ;
1374
1424
cmciSpy . mockImplementation ( ( cicsSession : any , nodejsData : cmci . IResourceParms ) => {
1375
1425
if ( nodejsData . name === "CICSNodejsapp" ) {
1376
1426
return { response : {
0 commit comments