com.lesfurets.jenkins.unit.cps.MockPipelineScriptCPS.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jenkins-pipeline-unit Show documentation
Show all versions of jenkins-pipeline-unit Show documentation
Jenkins Pipeline Unit testing framework
package com.lesfurets.jenkins.unit.cps
import com.lesfurets.jenkins.unit.MockPipelineScript
abstract class MockPipelineScriptCPS extends MockPipelineScript implements Serializable {
private void writeObject(ObjectOutputStream oos) throws IOException {
// binding is defined in non-serializable Script class,
// so we need to persist that here
def variables = getBinding().getVariables().clone()
oos.writeObject(variables)
}
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
Map m = (Map)ois.readObject()
getBinding().getVariables().putAll(m)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy