diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java index 74e26173a..dc7b2ccc9 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/ICicsRegion.java @@ -105,6 +105,17 @@ public interface ICicsRegion { */ public void removeSit(@NotNull String sitParam) throws CicstsManagerException; + + /** + * This method adds a method to the DFHRPL concatenation in the CICS + * startup JCL. Not allowed for DSE CICS regions. + * + * @param library + * @throws CicstsManagerException + */ + public void addToDfhRpl(@NotNull String library) throws CicstsManagerException; + + /** * Allows a testcase to get a specific property about the region. * @@ -126,4 +137,5 @@ public interface ICicsRegion { public default String getRegionProperty( String propertyName ) throws CicstsManagerException { return null; } + } \ No newline at end of file diff --git a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java index d28a8c55a..1275b38e0 100644 --- a/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-cicsts-parent/dev.galasa.cicsts.manager/src/main/java/dev/galasa/cicsts/internal/dse/DseCicsImpl.java @@ -153,4 +153,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"); + + } } diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java index c1935df28..b02b026d6 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemCicsImpl.java @@ -558,6 +558,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 diff --git a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java index 820d4709d..a217cdc87 100644 --- a/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java +++ b/galasa-managers-parent/galasa-managers-internal-parent/dev.galasa.sem.manager/src/main/java/dev/galasa/sem/internal/SemManagerImpl.java @@ -32,7 +32,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; @@ -82,6 +84,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; @@ -99,6 +103,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; @@ -187,6 +192,11 @@ public void youAreRequired(@NotNull List allManagers, @NotNull List 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()) { + 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(); @@ -796,13 +824,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());