Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

ISS1078 - Adding LOAD library to DFHRPL on SEM build #802

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,13 @@ public interface ICicsRegion {
* @throws CicstsManagerException
*/
public void removeSit(@NotNull String sitParam) throws CicstsManagerException;

/**
lewisja1406 marked this conversation as resolved.
Show resolved Hide resolved
* This method adds a method to the DFHRPL concatenation in the CICS
* startup JCL
*
* @param library
* @throws CicstsManagerException
*/
public void addToDfhRpl(@NotNull String library) throws CicstsManagerException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,10 @@ public void alterSit(@NotNull String sitParam, String sitValue) throws CicstsMan
public void removeSit(@NotNull String sitParam) throws CicstsManagerException {
throw new CicstsManagerException("Remove SIT is not supported under DSE provisioning");
}

@Override
public void addToDfhRpl(@NotNull String library) throws CicstsManagerException {
throw new CicstsManagerException("Appending DFHRPL is not supported under DSE provisioning");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,20 @@ public void removeSit(@NotNull String sitParam) throws CicstsManagerException {
}
}
}

@Override
public void addToDfhRpl(String library) throws CicstsManagerException {
// Get the Galasa CICS object
ICicsRegion theCics = cicstsManager.locateCicsRegion(this.getTag());

// Find the SEM CICS object
for (CICSRegion cicsInComplex : complex.getCICS()) {
if (cicsInComplex.getApplid().equals(theCics.getApplid())) {
semManager.appendDfhRpl(cicsInComplex, library);
rebuildRuntimeJob(cicsInComplex);
}
}
}

/**
* Performs a rebuild of the given CICS job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.osgi.service.component.annotations.Component;

import com.ibm.hursley.cicsts.test.sem.complex.CICSRegion;
import com.ibm.hursley.cicsts.test.sem.complex.Complex;
import com.ibm.hursley.cicsts.test.sem.complex.DfhRpl;
import com.ibm.hursley.cicsts.test.sem.complex.RunOptions;
import com.ibm.hursley.cicsts.test.sem.complex.jcl.JCLException;
import com.ibm.hursley.cicsts.test.sem.complex.jcl.Job;
Expand Down Expand Up @@ -80,6 +82,8 @@
import dev.galasa.zosbatch.ZosBatchException;
import dev.galasa.zosbatch.spi.IZosBatchSpi;
import dev.galasa.zosconsole.spi.IZosConsoleSpi;
import dev.galasa.zosfile.IZosDataset;
import dev.galasa.zosfile.spi.IZosFileSpi;
import sem.DEFCICS;
import sem.Environment;
import sem.SemFactory;
Expand All @@ -97,6 +101,7 @@ public class SemManagerImpl extends AbstractManager implements ICicsRegionProvis
private IDynamicStatusStoreService dss;

private IZosManagerSpi zosManager;
private IZosFileSpi zosFileManager;
private IZosBatchSpi zosBatch;
private IZosConsoleSpi zosConsole;
private ICicstsManagerSpi cicsManager;
Expand Down Expand Up @@ -185,6 +190,11 @@ public void youAreRequired(@NotNull List<IManager> allManagers, @NotNull List<IM
if (this.zosManager == null) {
throw new SemManagerException("Unable to locate the zOS Manager, required for the SEM Manager");
}

this.zosFileManager = addDependentManager(allManagers, activeManagers, galasaTest, IZosFileSpi.class);
if (this.zosFileManager == null) {
throw new SemManagerException("Unable to locate the zOS File Manager, required for the SEM Manager");
}

this.zosBatch = addDependentManager(allManagers, activeManagers, galasaTest, IZosBatchSpi.class);
if (this.zosBatch == null) {
Expand Down Expand Up @@ -223,6 +233,10 @@ public boolean areYouProvisionalDependentOn(@NotNull IManager otherManager) {
if (otherManager == this.zosManager) {
return true;
}

if (otherManager == this.zosFileManager) {
return true;
}

if (otherManager == this.zosBatch) {
return true;
Expand Down Expand Up @@ -426,6 +440,20 @@ private void generateComplex() throws SemManagerException {
if (rc > 4) {
throw new SemManagerException("SEM complex generation failed, rc=" +rc);
}

String loadLibrary = zosManager.getRunDatasetHLQ(primaryZosImage) + "." + getFramework().getTestRunName() + ".LOAD";
IZosDataset loadLibaryDs = zosFileManager.getZosFileHandler().newDataset(loadLibrary, primaryZosImage);

// Add the run load library to DFHRPL
if (loadLibaryDs.exists()) {
lewisja1406 marked this conversation as resolved.
Show resolved Hide resolved
logger.debug("Found load library " + loadLibrary + " adding it to DFHRPL concatenation");
for (CICSRegion cics : this.complex.getCICS()) {
this.appendDfhRpl(cics, zosManager.getRunDatasetHLQ(primaryZosImage) + "." + getFramework().getTestRunName() + ".LOAD");
logger.trace("Added " + loadLibrary + " to DFHRPL in CICS region " + cics.getApplid());
}
} else {
logger.debug("Load library " + loadLibrary + " is missing. Not adding it to DFHRPL");
}

this.conrep = this.complex.generateConRepModel();

Expand Down Expand Up @@ -794,13 +822,12 @@ public void cicsProvisionDiscard() {

logger.info("SEM discard is complete");
}








public void appendDfhRpl(CICSRegion cics, String library) {
DfhRpl rplConcat = new DfhRpl();
rplConcat.getDSNS().add(library);
cics.getRpl().add(0, rplConcat);
}

public Environment convertModel(@NotNull String modelString) throws SemManagerException {
ByteArrayInputStream bais = new ByteArrayInputStream(modelString.getBytes());
Expand Down