@@ -288,12 +288,12 @@ describe("bundle Handler", () => {
288
288
await testTimeoutError ( 0 , "--timeout parameter is too small" ) ;
289
289
} ) ;
290
290
it ( "should complain with no cicshlq parameter" , async ( ) => {
291
- await testHLQError ( undefined , "--cicshlq parameter is not set" ) ;
291
+ await testCicsHLQError ( undefined , "--cicshlq parameter is not set" ) ;
292
292
} ) ;
293
293
it ( "should complain with invalid type for cicshlq parameter" , async ( ) => {
294
294
295
295
const params = Object . assign ( { } , ...[ DEFAULT_PARAMETERS ] ) ;
296
- setCommonParmsForHLQTests ( params ) ;
296
+ setCommonParmsForCicsHLQTests ( params ) ;
297
297
params . arguments . cicshlq = 7 ;
298
298
299
299
let err : Error ;
@@ -308,10 +308,36 @@ describe("bundle Handler", () => {
308
308
expect ( err . message ) . toContain ( "--cicshlq parameter is not a string" ) ;
309
309
} ) ;
310
310
it ( "should complain with overlong cicshlq parameter" , async ( ) => {
311
- await testHLQError ( "123456789012345678901234567890123456" , "--cicshlq parameter is too long" ) ;
311
+ await testCicsHLQError ( "123456789012345678901234567890123456" , "--cicshlq parameter is too long" ) ;
312
312
} ) ;
313
313
it ( "should complain with empty cicshlq parameter" , async ( ) => {
314
- await testHLQError ( "" , "--cicshlq parameter is empty" ) ;
314
+ await testCicsHLQError ( "" , "--cicshlq parameter is empty" ) ;
315
+ } ) ;
316
+ it ( "should complain with no cpsmhlq parameter" , async ( ) => {
317
+ await testCpsmHLQError ( undefined , "--cpsmhlq parameter is not set" ) ;
318
+ } ) ;
319
+ it ( "should complain with invalid type for cpsmhlq parameter" , async ( ) => {
320
+
321
+ const params = Object . assign ( { } , ...[ DEFAULT_PARAMETERS ] ) ;
322
+ setCommonParmsForCpsmHLQTests ( params ) ;
323
+ params . arguments . cpsmhlq = 7 ;
324
+
325
+ let err : Error ;
326
+ try {
327
+ const handler = new DeployBundleHandler . default ( ) ;
328
+ await handler . process ( params ) ;
329
+ } catch ( e ) {
330
+ err = e ;
331
+ }
332
+ expect ( err ) . toBeDefined ( ) ;
333
+ expect ( err ) . toBeInstanceOf ( ImperativeError ) ;
334
+ expect ( err . message ) . toContain ( "--cpsmhlq parameter is not a string" ) ;
335
+ } ) ;
336
+ it ( "should complain with overlong cpsmhlq parameter" , async ( ) => {
337
+ await testCpsmHLQError ( "123456789012345678901234567890123456" , "--cpsmhlq parameter is too long" ) ;
338
+ } ) ;
339
+ it ( "should complain with empty cpsmhlq parameter" , async ( ) => {
340
+ await testCpsmHLQError ( "" , "--cpsmhlq parameter is empty" ) ;
315
341
} ) ;
316
342
it ( "should complain with no jobcard parameter" , async ( ) => {
317
343
await testJobcardError ( undefined , "--jobcard parameter is not set" ) ;
@@ -377,6 +403,7 @@ function setCommonParmsForNameTests(parms: IHandlerParameters) {
377
403
parms . arguments . csdgroup = undefined ;
378
404
parms . arguments . timeout = undefined ;
379
405
parms . arguments . cicshlq = undefined ;
406
+ parms . arguments . cpsmhlq = undefined ;
380
407
}
381
408
382
409
async function testNameError ( name : string , result : string ) {
@@ -406,6 +433,7 @@ function setCommonParmsForBundledirTests(parms: IHandlerParameters) {
406
433
parms . arguments . csdgroup = undefined ;
407
434
parms . arguments . timeout = undefined ;
408
435
parms . arguments . cicshlq = undefined ;
436
+ parms . arguments . cpsmhlq = undefined ;
409
437
}
410
438
411
439
async function testBundledirError ( bundledir : string , result : string ) {
@@ -435,6 +463,7 @@ function setCommonParmsForProfileTests(parms: IHandlerParameters) {
435
463
parms . arguments . csdgroup = undefined ;
436
464
parms . arguments . timeout = undefined ;
437
465
parms . arguments . cicshlq = undefined ;
466
+ parms . arguments . cpsmhlq = undefined ;
438
467
}
439
468
440
469
async function testProfileError ( profile : string , result : string ) {
@@ -464,6 +493,7 @@ function setCommonParmsForCicsplexTests(parms: IHandlerParameters) {
464
493
parms . arguments . csdgroup = undefined ;
465
494
parms . arguments . timeout = undefined ;
466
495
parms . arguments . cicshlq = undefined ;
496
+ parms . arguments . cpsmhlq = undefined ;
467
497
}
468
498
469
499
async function testCicsplexError ( cicsplex : string , result : string ) {
@@ -493,6 +523,7 @@ function setCommonParmsForScopeTests(parms: IHandlerParameters) {
493
523
parms . arguments . csdgroup = undefined ;
494
524
parms . arguments . timeout = undefined ;
495
525
parms . arguments . cicshlq = undefined ;
526
+ parms . arguments . cpsmhlq = undefined ;
496
527
}
497
528
498
529
async function testScopeError ( scope : string , result : string ) {
@@ -522,6 +553,7 @@ function setCommonParmsForCsdgroupTests(parms: IHandlerParameters) {
522
553
parms . arguments . csdgroup = undefined ;
523
554
parms . arguments . timeout = undefined ;
524
555
parms . arguments . cicshlq = undefined ;
556
+ parms . arguments . cpsmhlq = undefined ;
525
557
}
526
558
527
559
async function testCsdgroupError ( csdgroup : string , result : string ) {
@@ -551,6 +583,7 @@ function setCommonParmsForResgroupTests(parms: IHandlerParameters) {
551
583
parms . arguments . csdgroup = undefined ;
552
584
parms . arguments . timeout = undefined ;
553
585
parms . arguments . cicshlq = undefined ;
586
+ parms . arguments . cpsmhlq = undefined ;
554
587
}
555
588
556
589
async function testResgroupError ( resgroup : string , result : string ) {
@@ -580,6 +613,7 @@ function setCommonParmsForTimeoutTests(parms: IHandlerParameters) {
580
613
parms . arguments . csdgroup = undefined ;
581
614
parms . arguments . timeout = undefined ;
582
615
parms . arguments . cicshlq = undefined ;
616
+ parms . arguments . cpsmhlq = undefined ;
583
617
}
584
618
585
619
async function testTimeoutError ( timeout : number , result : string ) {
@@ -599,7 +633,7 @@ async function testTimeoutError(timeout: number, result: string) {
599
633
expect ( err . message ) . toContain ( result ) ;
600
634
}
601
635
602
- function setCommonParmsForHLQTests ( parms : IHandlerParameters ) {
636
+ function setCommonParmsForCicsHLQTests ( parms : IHandlerParameters ) {
603
637
parms . arguments . name = "WIBBLE" ;
604
638
parms . arguments . bundledir = "wibble" ;
605
639
parms . arguments [ "cics-deploy-profile" ] = undefined ;
@@ -609,11 +643,12 @@ function setCommonParmsForHLQTests(parms: IHandlerParameters) {
609
643
parms . arguments . csdgroup = undefined ;
610
644
parms . arguments . timeout = undefined ;
611
645
parms . arguments . cicshlq = undefined ;
646
+ parms . arguments . cpsmhlq = undefined ;
612
647
}
613
648
614
- async function testHLQError ( cicshlq : string , result : string ) {
649
+ async function testCicsHLQError ( cicshlq : string , result : string ) {
615
650
const params = Object . assign ( { } , ...[ DEFAULT_PARAMETERS ] ) ;
616
- setCommonParmsForHLQTests ( params ) ;
651
+ setCommonParmsForCicsHLQTests ( params ) ;
617
652
params . arguments . cicshlq = cicshlq ;
618
653
619
654
let err : Error ;
@@ -628,9 +663,39 @@ async function testHLQError(cicshlq: string, result: string) {
628
663
expect ( err . message ) . toContain ( result ) ;
629
664
}
630
665
631
- function setCommonParmsForJobcardTests ( parms : IHandlerParameters ) {
632
- setCommonParmsForHLQTests ( parms ) ;
666
+ function setCommonParmsForCpsmHLQTests ( parms : IHandlerParameters ) {
667
+ parms . arguments . name = "WIBBLE" ;
668
+ parms . arguments . bundledir = "wibble" ;
669
+ parms . arguments [ "cics-deploy-profile" ] = undefined ;
670
+ parms . arguments . cicsplex = "Wibble" ;
671
+ parms . arguments . scope = "wibblE" ;
672
+ parms . arguments . resgroup = "wiBBle" ;
673
+ parms . arguments . csdgroup = undefined ;
674
+ parms . arguments . timeout = undefined ;
633
675
parms . arguments . cicshlq = "WIBB.LE" ;
676
+ parms . arguments . cpsmhlq = undefined ;
677
+ }
678
+
679
+ async function testCpsmHLQError ( cpsmhlq : string , result : string ) {
680
+ const params = Object . assign ( { } , ...[ DEFAULT_PARAMETERS ] ) ;
681
+ setCommonParmsForCpsmHLQTests ( params ) ;
682
+ params . arguments . cpsmhlq = cpsmhlq ;
683
+
684
+ let err : Error ;
685
+ try {
686
+ const handler = new DeployBundleHandler . default ( ) ;
687
+ await handler . process ( params ) ;
688
+ } catch ( e ) {
689
+ err = e ;
690
+ }
691
+ expect ( err ) . toBeDefined ( ) ;
692
+ expect ( err ) . toBeInstanceOf ( ImperativeError ) ;
693
+ expect ( err . message ) . toContain ( result ) ;
694
+ }
695
+
696
+ function setCommonParmsForJobcardTests ( parms : IHandlerParameters ) {
697
+ setCommonParmsForCpsmHLQTests ( parms ) ;
698
+ parms . arguments . cpsmhlq = "WI.BBLE" ;
634
699
}
635
700
636
701
async function testJobcardError ( jobcard : string , result : string ) {
0 commit comments