All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lesfurets.jenkins.unit.cps.MockPipelineScriptCPS.groovy Maven / Gradle / Ivy

There is a newer version: 1.1
Show newest version
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