Class AttachmentPublisher
java.lang.Object
hudson.model.AbstractDescribableImpl<hudson.tasks.junit.TestDataPublisher>
hudson.tasks.junit.TestDataPublisher
hudson.plugins.junitattachments.AttachmentPublisher
- All Implemented Interfaces:
ExtensionPoint, Describable<hudson.tasks.junit.TestDataPublisher>
public class AttachmentPublisher
extends hudson.tasks.junit.TestDataPublisher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the directory, relative to a build's artifact root, under which attachments published viaArtifactManagerare stored. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontributeTestData(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, hudson.tasks.junit.TestResult testResult) static FilePathgetAttachmentPath(FilePath root, String className, String testName) static FilePathgetAttachmentPath(Run<?, ?> build) Returns the legacy, filesystem-based root under which attachments were stored directly in the build's root directory before this plugin started publishing through the build'sArtifactManager.static VirtualFilegetAttachmentPath(VirtualFile root, String className, String testName) Resolves the directory for a given test class/test case underneath aVirtualFileroot, mirroringgetAttachmentPath(FilePath, String, String)for attachments stored through anArtifactManager.static StringgetStorageName(String name) The name of the directory that holds the attachments of the given test case.booleanbooleanvoidsetShowAttachmentsAtClassLevel(Boolean showAttachmentsAtClassLevel) voidsetShowAttachmentsInStdOut(Boolean showAttachmentsInStdOut) Methods inherited from class hudson.tasks.junit.TestDataPublisher
all, getTestDataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Describable
getDescriptor
-
Field Details
-
ARTIFACT_NAMESPACE
Name of the directory, relative to a build's artifact root, under which attachments published viaArtifactManagerare stored.Historical attachments predating this feature are instead stored directly under the build's root directory (see
getAttachmentPath(Run)) and are not affected.- See Also:
-
-
Constructor Details
-
AttachmentPublisher
@DataBoundConstructor public AttachmentPublisher()
-
-
Method Details
-
isShowAttachmentsAtClassLevel
public boolean isShowAttachmentsAtClassLevel() -
isShowAttachmentsInStdOut
public boolean isShowAttachmentsInStdOut() -
setShowAttachmentsAtClassLevel
-
setShowAttachmentsInStdOut
-
getAttachmentPath
Returns the legacy, filesystem-based root under which attachments were stored directly in the build's root directory before this plugin started publishing through the build'sArtifactManager.Retained so that historical attachments remain readable; new attachments are no longer written here.
-
getAttachmentPath
-
getAttachmentPath
Resolves the directory for a given test class/test case underneath aVirtualFileroot, mirroringgetAttachmentPath(FilePath, String, String)for attachments stored through anArtifactManager. -
getStorageName
The name of the directory that holds the attachments of the given test case.Attachments are stored under a sanitised form of the name, so any URL pointing at them has to be built from the same sanitised form rather than from the raw name.
- Parameters:
name- the raw test case name- Returns:
- the directory name used to store its attachments
-
contributeTestData
public AttachmentPublisher.Data contributeTestData(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, hudson.tasks.junit.TestResult testResult) throws IOException, InterruptedException- Overrides:
contributeTestDatain classhudson.tasks.junit.TestDataPublisher- Throws:
IOExceptionInterruptedException
-