Annotation Type EOL
-
@Target({FIELD,PARAMETER,METHOD,CONSTRUCTOR,TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Inherited public @interface EOL
EOL
can be used in combination withTestResource
to specify a specific line separator to use. This can be useful to create tests that work on different operating systems.The line separator to use is looked up in the following order:
- An
EOL
annotation on the field or parameter itself - For parameters, an
EOL
annotation on the constructor or method - An
EOL
annotation on the class defining the field, constructor or method - An
EOL
annotation on any declaring class - The default line separator that is defined via the "com.github.robtimus.junit.support.extension.testresource.lineSeparator" configuration parameter, which can be
supplied via the JUnit
Launcher
API, build tools (e.g., Gradle and Maven), a JVM system property, or the JUnit Platform configuration file (i.e., a file namedjunit-platform.properties
in the root of the class path). Consult the JUnit User Guide for further information.This configuration parameter can take a literal value, or one of the following pre-defined values:
LF
for\n
CR
for\r
CRLF
for\r\n
SYSTEM
forSystem.lineSeparator()
ORIGINAL
for line separators from the original file; this is the default settingNONE
for no line separators
- Author:
- Rob Spoor
- Since:
- 2.0
- An
-
-
Field Summary
Fields Modifier and Type Fields Description static String
CR
A single carriage return character (\r\n
).static String
CRLF
A carriage return followed by a line feed character (\r\n
).static String
DEFAULT_EOL_PROPERTY_NAME
The property that can be used to define the default line separator.static String
LF
A single line feed character (\n
).static String
NONE
No line separator.static String
ORIGINAL
A marker that indicates the line separators from the original file should be used.static String
SYSTEM
A marker that indicates the system line separator should be used.
-
-
-
Field Detail
-
LF
static final String LF
A single line feed character (\n
).
-
-
-
CR
static final String CR
A single carriage return character (\r\n
).
-
-
-
CRLF
static final String CRLF
A carriage return followed by a line feed character (\r\n
).
-
-
-
SYSTEM
static final String SYSTEM
A marker that indicates the system line separator should be used.
-
-
-
ORIGINAL
static final String ORIGINAL
A marker that indicates the line separators from the original file should be used. This can be useful in case an enclosing member or class defines a different line separator, or if
-
-
-
NONE
static final String NONE
No line separator. In other words, all lines are combined into one large line.
-
-
-
DEFAULT_EOL_PROPERTY_NAME
static final String DEFAULT_EOL_PROPERTY_NAME
The property that can be used to define the default line separator.
-
-
Element Detail
-
value
String value
The line separator to use.
-
-