Class ZosBatchJobnames

java.lang.Object
dev.galasa.zosbatch.ZosBatchJobnames

public final class ZosBatchJobnames extends Object
Creates IZosBatchJobname instances for jobnames chosen by the test.

By default the Manager provisions a unique jobname, either when IZosBatch.submitJob(String) is used (or a null jobname is passed to IZosBatch.submitJob(String, IZosBatchJobname)) or by using the ZosBatchJobname annotation. Use this class when the job must run under a particular jobname, for example to run a library member under its documented name.

A valid jobname is 1 to 8 characters. The first character must be a letter or one of #, $ or @, and the remaining characters must be letters, digits or #, $ or @. A name that is not valid is rejected with a ZosBatchException. Names are converted to upper case.

For example: IZosBatchJob batchJob = zosBatch.submitJob(jcl, ZosBatchJobnames.exact("PAYROLL"));

  • Method Details

    • exact

      public static IZosBatchJobname exact(String name) throws ZosBatchException
      Create a jobname with exactly the supplied name, converted to upper case.

      Parallel runs: Galasa does not make this name unique. If tests that run at the same time on the same z/OS system submit jobs with the same name, a search by name, such as IZosBatch.getJobs(String, String), returns the jobs of all of those tests. Each job still has its own job ID, which Galasa uses to track it. To avoid collisions, let the Manager provision the jobname, or use randomWithPrefix(String) to make a collision less likely.

      Parameters:
      name - the jobname, 1 to 8 characters
      Returns:
      the IZosBatchJobname
      Throws:
      ZosBatchException - if the name is null, empty, longer than 8 characters or contains invalid characters
    • randomWithPrefix

      public static IZosBatchJobname randomWithPrefix(String prefix) throws ZosBatchException
      Create a jobname that starts with the supplied prefix, converted to upper case, followed by random alphanumeric characters that make the jobname 8 characters long. For example, the prefix PAY produces a jobname such as PAYK3Z9X. A new random suffix is generated on every call.

      This is the same as the jobname provisioned by the Manager, except that the prefix is chosen by the test rather than from the zosbatch.jobname.[imageid].prefix property.

      The jobname is random, not guaranteed to be unique. The longer the prefix, the fewer the random characters and the greater the chance of a collision with another job. A 7 character prefix leaves only one random character.

      Parameters:
      prefix - the start of the jobname, 1 to 7 characters
      Returns:
      the IZosBatchJobname
      Throws:
      ZosBatchException - if the prefix is null, empty, longer than 7 characters or contains invalid characters