Class FailureDiagnostics
- java.lang.Object
-
- org.junit.rules.TestWatcher
-
- org.jenkinsci.test.acceptance.junit.FailureDiagnostics
-
- All Implemented Interfaces:
org.junit.rules.TestRule
@GlobalRule(priority=-2147483648) @TestScope public class FailureDiagnostics extends org.junit.rules.TestWatcher
Attach diagnostic file related to a test failure.The harness can attach any number of diagnostic files to be stored in /target/diagnostics/$TEST_NAME/. The same 'kind' of diagnostic information is expected to use the same file/subdir name.
- Author:
- ogondza
-
-
Constructor Summary
Constructors Constructor Description FailureDiagnostics(TestName test)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
failed(Throwable e, org.junit.runner.Description description)
File
mkdirs(String path)
protected void
succeeded(org.junit.runner.Description description)
File
touch(String filename)
Get ready for writing in diagnosis file.void
write(String filename, String content)
Write string in diagnostic file.
-
-
-
Constructor Detail
-
FailureDiagnostics
@Inject public FailureDiagnostics(TestName test)
-
-
Method Detail
-
write
public void write(String filename, String content)
Write string in diagnostic file.- Parameters:
filename
- Name of the filecontent
- Content to write.
-
succeeded
protected void succeeded(org.junit.runner.Description description)
- Overrides:
succeeded
in classorg.junit.rules.TestWatcher
-
failed
public void failed(Throwable e, org.junit.runner.Description description)
- Overrides:
failed
in classorg.junit.rules.TestWatcher
-
-