Package de.skuzzle.test.snapshots
Enum SnapshotTestOptions.DiffLineNumbers
- java.lang.Object
-
- java.lang.Enum<SnapshotTestOptions.DiffLineNumbers>
-
- de.skuzzle.test.snapshots.SnapshotTestOptions.DiffLineNumbers
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SnapshotTestOptions.DiffLineNumbers>
- Enclosing class:
- SnapshotTestOptions
@API(status=EXPERIMENTAL, since="1.7.1") public static enum SnapshotTestOptions.DiffLineNumbers extends java.lang.Enum<SnapshotTestOptions.DiffLineNumbers>Defines whether an offset is added to the line numbers when rendering diffs in assertion failure messages.- Since:
- 1.7.1
- See Also:
SnapshotTestOptions.renderLineNumbers()
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCODRDING_TO_PERSISTED_SNAPSHOT_FILEAdds an offset according to the number of snapshot file header lines.ACCORDING_TO_RAW_DATANo offset will be added to line numbers.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SnapshotTestOptions.DiffLineNumbersvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SnapshotTestOptions.DiffLineNumbers[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ACCORDING_TO_RAW_DATA
public static final SnapshotTestOptions.DiffLineNumbers ACCORDING_TO_RAW_DATA
No offset will be added to line numbers. Line number 1 in rendered diffs maps directly to line number 1 in the raw serialized test output.Note: when using this mode, the line numbers reported in assertion failure message to not match the line numbers in persisted snapshot files.
-
ACCODRDING_TO_PERSISTED_SNAPSHOT_FILE
public static final SnapshotTestOptions.DiffLineNumbers ACCODRDING_TO_PERSISTED_SNAPSHOT_FILE
Adds an offset according to the number of snapshot file header lines. Line number 1 in rendered diffs maps to line number 1 in persisted snapshot files. Consequently, real snapshot data starts at 1 + Number of header lines + 1.Note: this option might be preferable over
ACCORDING_TO_RAW_DATAas line numbers reported in assertion failures directly map to physical lines within the persisted snapshot file.
-
-
Method Detail
-
values
public static SnapshotTestOptions.DiffLineNumbers[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SnapshotTestOptions.DiffLineNumbers c : SnapshotTestOptions.DiffLineNumbers.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SnapshotTestOptions.DiffLineNumbers valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-