Class TailLog

java.lang.Object
org.jvnet.hudson.test.TailLog
All Implemented Interfaces:
AutoCloseable

public final class TailLog extends Object implements AutoCloseable
Utility to display the log of a build in real time. Unlike BuildWatcher, this works well with both RealJenkinsRule and LocalData. Use in a try-with-resources block, typically calling waitForCompletion() at the end.
  • Constructor Details

    • TailLog

      public TailLog(hudson.model.Run<?,?> b)
      Watch a build already loaded in the current JVM.
    • TailLog

      public TailLog(JenkinsRule jr, String job, int number)
      Watch a build expected to be loaded in the current JVM. Note: this constructor will not work for a branch project (child of MultiBranchProject).
      Parameters:
      job - a AbstractItem.getFullName()
    • TailLog

      public TailLog(RealJenkinsRule rjr, String job, int number)
      Watch a build expected to be loaded in a controller JVM. Note: this constructor will not work for a branch project (child of MultiBranchProject).
      Parameters:
      job - a AbstractItem.getFullName()
    • TailLog

      public TailLog(File buildDirectory, String job, int number)
      Watch a build expected to run at a specific file location.
      Parameters:
      buildDirectory - expected Run.getRootDir()
      job - a AbstractItem.getFullName()
  • Method Details