Skip to content

Commit 8b3c617

Browse files
Merge pull request #47 from pcoop/branch1
DEPLOY shouldn't auto undeploy
2 parents 0191da3 + a86e61f commit 8b3c617

File tree

12 files changed

+507
-95
lines changed

12 files changed

+507
-95
lines changed

__tests__/api/BundleDeploy/BundleDeployer.test.ts

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,55 @@ describe("BundleDeployer01", () => {
251251
"1234567890123456789012345678901234567890123456789012345";
252252
await testDeployJCL(parms);
253253
});
254-
it("should generate undeploy JCL for csdgroup", async () => {
254+
it("should generate deploy JCL for AVAILABLE", async () => {
255+
256+
let parms: IHandlerParameters;
257+
parms = DEFAULT_PARAMTERS;
258+
setCommonParmsForDeployTests(parms);
259+
parms.arguments.targetstate = "AVAILABLE";
260+
parms.arguments.resgroup = "12345678";
261+
await testDeployJCL(parms);
262+
});
263+
it("should generate deploy JCL for ENABLED", async () => {
264+
265+
let parms: IHandlerParameters;
266+
parms = DEFAULT_PARAMTERS;
267+
setCommonParmsForDeployTests(parms);
268+
parms.arguments.targetstate = "ENABLED";
269+
parms.arguments.resgroup = "12345678";
270+
await testDeployJCL(parms);
271+
});
272+
it("should generate deploy JCL for DISABLED", async () => {
255273

256274
let parms: IHandlerParameters;
257275
parms = DEFAULT_PARAMTERS;
258276
setCommonParmsForDeployTests(parms);
277+
parms.arguments.targetstate = "DISABLED";
278+
parms.arguments.resgroup = "12345678";
279+
await testDeployJCL(parms);
280+
});
281+
it("should generate deploy JCL for mixed case", async () => {
282+
283+
let parms: IHandlerParameters;
284+
parms = DEFAULT_PARAMTERS;
285+
setCommonParmsForDeployTests(parms);
286+
parms.arguments.targetstate = "disabled";
287+
parms.arguments.resgroup = "12345678";
288+
await testDeployJCL(parms);
289+
});
290+
it("should generate undeploy JCL for csdgroup", async () => {
291+
292+
let parms: IHandlerParameters;
293+
parms = DEFAULT_PARAMTERS;
294+
setCommonParmsForUndeployTests(parms);
259295
parms.arguments.csdgroup = "12345678";
260296
await testUndeployJCL(parms);
261297
});
262298
it("should generate undeploy JCL for csdgroup with timeout", async () => {
263299

264300
let parms: IHandlerParameters;
265301
parms = DEFAULT_PARAMTERS;
266-
setCommonParmsForDeployTests(parms);
302+
setCommonParmsForUndeployTests(parms);
267303
parms.arguments.csdgroup = "12345678";
268304
parms.arguments.timeout = 1500;
269305
await testUndeployJCL(parms);
@@ -272,19 +308,55 @@ describe("BundleDeployer01", () => {
272308

273309
let parms: IHandlerParameters;
274310
parms = DEFAULT_PARAMTERS;
275-
setCommonParmsForDeployTests(parms);
311+
setCommonParmsForUndeployTests(parms);
276312
parms.arguments.resgroup = "12345678";
277313
await testUndeployJCL(parms);
278314
});
279315
it("should generate undeploy JCL for resgroup with timeout", async () => {
280316

281317
let parms: IHandlerParameters;
282318
parms = DEFAULT_PARAMTERS;
283-
setCommonParmsForDeployTests(parms);
319+
setCommonParmsForUndeployTests(parms);
284320
parms.arguments.resgroup = "12345678";
285321
parms.arguments.timeout = 1500;
286322
await testUndeployJCL(parms);
287323
});
324+
it("should generate undeploy JCL for UNAVAILABLE", async () => {
325+
326+
let parms: IHandlerParameters;
327+
parms = DEFAULT_PARAMTERS;
328+
setCommonParmsForDeployTests(parms);
329+
parms.arguments.targetstate = "UNAVAILABLE";
330+
parms.arguments.resgroup = "12345678";
331+
await testUndeployJCL(parms);
332+
});
333+
it("should generate undeploy JCL for DISABLED", async () => {
334+
335+
let parms: IHandlerParameters;
336+
parms = DEFAULT_PARAMTERS;
337+
setCommonParmsForDeployTests(parms);
338+
parms.arguments.targetstate = "DISABLED";
339+
parms.arguments.resgroup = "12345678";
340+
await testUndeployJCL(parms);
341+
});
342+
it("should generate undeploy JCL for DISCARDED", async () => {
343+
344+
let parms: IHandlerParameters;
345+
parms = DEFAULT_PARAMTERS;
346+
setCommonParmsForDeployTests(parms);
347+
parms.arguments.targetstate = "DISCARDED";
348+
parms.arguments.resgroup = "12345678";
349+
await testUndeployJCL(parms);
350+
});
351+
it("should generate undeploy JCL for mixed case", async () => {
352+
353+
let parms: IHandlerParameters;
354+
parms = DEFAULT_PARAMTERS;
355+
setCommonParmsForDeployTests(parms);
356+
parms.arguments.targetstate = "discarded";
357+
parms.arguments.resgroup = "12345678";
358+
await testUndeployJCL(parms);
359+
});
288360
});
289361

290362
async function runDeployTestWithError() {
@@ -348,6 +420,7 @@ async function runUndeployTest() {
348420
function setCommonParmsForDeployTests(parms: IHandlerParameters) {
349421
setCommonParmsForUndeployTests(parms);
350422
parms.arguments.bundledir = "1234567890";
423+
parms.arguments.targetstate = "ENABLED";
351424
}
352425

353426
function setCommonParmsForUndeployTests(parms: IHandlerParameters) {
@@ -360,6 +433,7 @@ function setCommonParmsForUndeployTests(parms: IHandlerParameters) {
360433
parms.arguments.timeout = undefined;
361434
parms.arguments.name = "12345678";
362435
parms.arguments.jobcard = "//DFHDPLOY JOB DFHDPLOY,CLASS=A,MSGCLASS=X,TIME=NOLIMIT";
436+
parms.arguments.targetstate = "DISCARDED";
363437
}
364438

365439
async function testDeployJCL(parms: IHandlerParameters) {

0 commit comments

Comments
 (0)