Enum TestMode
- java.lang.Object
-
- java.lang.Enum<TestMode>
-
- de.sormuras.junit.platform.maven.plugin.testing.TestMode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TestMode>
public enum TestMode extends java.lang.Enum<TestMode>
Test-run mode.Defined by the relation of one
mainand onetestmodule name.main plain main module main module --- foo bar test plain --- 0 2 2 test module foo 1 3 4 test module bar 1 4 3 0 = CLASSIC 1 = MAIN_CLASSIC_TEST_MODULE (black-box test) // CLASSIC_MODULAR_TEST 2 = MAIN_MODULE_TEST_CLASSIC (white-box test) // MODULAR_CLASSIC_TEST 3 = MAIN_MODULE_TEST_MODULE_SAME_NAME (white-box test) // MODULAR_PATCHED_TEST 4 = MODULAR (black-box test) // MODULAR_BLACKBOX_TEST- See Also:
- Access Modifier Table
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLASSICNo modules at all, fall-back to the class-path.MAIN_CLASSIC_TEST_MODULEMain module absent, test module present.MAIN_MODULE_TEST_CLASSICMain module present, test module absent.MAIN_MODULE_TEST_MODULE_SAME_NAMEMain module present, test module present: same module name.MODULARMain module present, test module present: different module name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TestModeof(java.lang.String main, java.lang.String test)Get test mode based on two module names.java.lang.StringtoString()static TestModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TestMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLASSIC
public static final TestMode CLASSIC
No modules at all, fall-back to the class-path.
-
MAIN_CLASSIC_TEST_MODULE
public static final TestMode MAIN_CLASSIC_TEST_MODULE
Main module absent, test module present.This mode is also to be selected when there is no main artifact available, i.e. main is empty.
Note: A classic non-empty main source set is not supported by `maven-compiler-plugin` at the moment.
Caused by: java.lang.UnsupportedOperationException: Can't compile test sources when main sources are missing a module descriptor at org.apache.maven.plugin.compiler.TestCompilerMojo.preparePaths (TestCompilerMojo.java:374) ...
-
MAIN_MODULE_TEST_CLASSIC
public static final TestMode MAIN_MODULE_TEST_CLASSIC
Main module present, test module absent.White-box testing by patching tests into the main module at test-runtime.
This mode intentionally by-passes the modular barrier to allow access to internal types.
-
MAIN_MODULE_TEST_MODULE_SAME_NAME
public static final TestMode MAIN_MODULE_TEST_MODULE_SAME_NAME
Main module present, test module present: same module name.White-box testing by patching main types into the test module at compile-runtime.
This mode intentionally by-passes the modular barrier to allow access to internal types.
-
MODULAR
public static final TestMode MODULAR
Main module present, test module present: different module name.Black-box testing the main module, adhering to its exported API.
-
-
Method Detail
-
values
public static TestMode[] 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 (TestMode c : TestMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TestMode 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
-
of
public static TestMode of(java.lang.String main, java.lang.String test)
Get test mode based on two module names.- Parameters:
main- name of the main moduletest- name of the test module- Returns:
- test mode constant based on both names
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<TestMode>
-
-