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.