Search in sources :

Example 21 with VirtualChannel

use of hudson.remoting.VirtualChannel in project evosuite by EvoSuite.

the class ProjectAction method perform.

public void perform(AbstractMavenProject<?, ?> project, AbstractBuild<?, ?> build, BuildListener listener) throws InterruptedException, IOException {
    EnvVars env = build.getEnvironment(listener);
    env.overrideAll(build.getBuildVariables());
    VirtualChannel channel = build.getWorkspace().getChannel();
    MavenModuleSet prj = (MavenModuleSet) this.project;
    for (MavenModule module : prj.getModules()) {
        FilePath fp = new FilePath(channel, build.getWorkspace().getRemote() + File.separator + (module.getRelativePath().isEmpty() ? "" : module.getRelativePath() + File.separator) + Properties.CTG_DIR + File.separator + Properties.CTG_PROJECT_INFO);
        if (!fp.exists()) {
            listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "There is not any " + fp.getRemote() + " file for module " + module.getName());
            continue;
        }
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        fp.copyTo(out);
        ByteArrayInputStream projectXML = new ByteArrayInputStream(out.toByteArray());
        listener.getLogger().println(EvoSuiteRecorder.LOG_PREFIX + "Analysing " + Properties.CTG_PROJECT_INFO + " file from " + fp.getRemote());
        ModuleAction m = new ModuleAction(build, module.getName());
        if (!m.build(channel, projectXML, listener)) {
            continue;
        }
        this.modules.add(m);
    }
}
Also used : FilePath(hudson.FilePath) EnvVars(hudson.EnvVars) VirtualChannel(hudson.remoting.VirtualChannel) ByteArrayInputStream(java.io.ByteArrayInputStream) MavenModule(hudson.maven.MavenModule) ByteArrayOutputStream(java.io.ByteArrayOutputStream) MavenModuleSet(hudson.maven.MavenModuleSet)

Aggregations

VirtualChannel (hudson.remoting.VirtualChannel)21 IOException (java.io.IOException)14 File (java.io.File)9 LogRecord (java.util.logging.LogRecord)4 FilePath (hudson.FilePath)3 IOException2 (hudson.util.IOException2)3 FileInputStream (java.io.FileInputStream)3 StoreResultException (com.qasymphony.ci.plugin.exception.StoreResultException)2 Computer (hudson.model.Computer)2 TarInputStream (hudson.org.apache.tools.tar.TarInputStream)2 Channel (hudson.remoting.Channel)2 RemoteInputStream (hudson.remoting.RemoteInputStream)2 BufferedInputStream (java.io.BufferedInputStream)2 FileWriter (java.io.FileWriter)2 InputStream (java.io.InputStream)2 ObjectInputStream (java.io.ObjectInputStream)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ExecutionException (java.util.concurrent.ExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2