warn
ETLUnit 3.9.6
Â
Draft in Progress
This document is a draft and is under development.
Â
Description
- Force a warning to be thrown from an ETLUnit test.
- The warning will show up in the CLI (Command Line Interface) as a 'W' result.
- The warning ID may show up in the report summary next to the method name.
Attributes
Â
message: - >> TYPE: string - - > REQUIRED
warning-id:Â - >> TYPE:Â string
Examples
Prerequisites
- etlunit-core dependency in POM.
Â
<dependencies> <dependency> <groupId>org.bitbucket.bradleysmithllc.etlunit</groupId> <artifactId>etlunit-core</artifactId> <version>${etlunit.project.version}</version> </dependency> </dependencies>
Â
warn()
Example
Â
Example of warn operation
class warn_operation
{
@Test
warnOnPurpose()
{
log(
message: 'failing by operation fail()',
log-file-name: 'log_my_fail.log',
log-classifier: 'anyClassifier'
);
Â
warn(
message: 'Warn message 123-ABC',
warning-id: 'AD-HOC_WARNING'
);
}
}
Â
- When you run this test, a 'W' appears in the CLI (Command Line Interface) results.
Â
userme > te #warnOnPurpose Processing [1] tests class experiment.warn_operation ------------------------------------------------ 1/1 .warnOnPurpose Passed P[1] W[1] Tests run: 1, Successes: 1, Warnings: 1, Time elapsed: 00.171 sec
Â
- The report summary may display the warning-id text next to the method name.
Â
userme > r
Â
Â
- The test method's log may include the message specified in the warn operation.
Â