Class GetTestDataMethodObject

java.lang.Object
hudson.plugins.junitattachments.GetTestDataMethodObject

public class GetTestDataMethodObject extends Object
This class is a helper for hudson.tasks.junit.TestDataPublisher.getTestData(AbstractBuild<?, ?>, Launcher, BuildListener, TestResult).
Author:
mfriedenhagen, Kohsuke Kawaguchi
  • Constructor Details

    • GetTestDataMethodObject

      @Deprecated public GetTestDataMethodObject(AbstractBuild<?,?> build, Launcher launcher, TaskListener listener, hudson.tasks.junit.TestResult testResult)
      Deprecated.
      Predates ArtifactManager-based publishing; attachments collected via this constructor are always written to the legacy, filesystem-based storage location on the controller.
      Parameters:
      build - see build
      testResult - see testResult
    • GetTestDataMethodObject

      public GetTestDataMethodObject(Run<?,?> build, @NonNull FilePath workspace, Launcher launcher, TaskListener listener, hudson.tasks.junit.TestResult testResult)
      Parameters:
      build - see build
      testResult - see testResult
  • Method Details

    • getEnclosingBlocks

      public List<String> getEnclosingBlocks()
    • getAttachments

      public Map<String,Map<String,List<String>>> getAttachments() throws IOException, InterruptedException
      Returns a Map of classname vs. the stored attachments in a directory named as the test class.

      As a side effect, any newly discovered attachments are staged on the agent and archived through the build's ArtifactManager (unless this instance was constructed via the deprecated constructor). The staging area is always removed before this method returns, regardless of success or failure.

      Returns:
      the map
      Throws:
      InterruptedException - when the thread is interrupted
      IOException - when an I/O operation fails (e.g. when copying attachments)