Enum TestMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TestMode>

    public enum TestMode
    extends java.lang.Enum<TestMode>
    Test-run mode.

    The test-run mode is defined by the relation of one main and one test module name.

    • C = CLASSIC

      no modules available

    • M = MODULAR

      main 'module foo' and test 'module bar' OR main lacks module and test 'module any'

    • A = MODULAR_PATCHED_TEST_COMPILE

      main 'module foo' and test 'module foo'

    • B = MODULAR_PATCHED_TEST_RUNTIME

      main 'module foo' and test lacks module

    
                          main plain    main module   main module
                             ---            foo           bar
     test plain  ---          C              B             B
     test module foo          M              A             M
     test module bar          M              M             A
     
    See Also:
    Testing In The Modular World
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLASSIC
      No modules at all, fall-back to the class-path.
      MODULAR
      Main module present or absent, test module present: different module name.
      MODULAR_PATCHED_TEST_COMPILE
      Main module present, test module present: same module name.
      MODULAR_PATCHED_TEST_RUNTIME
      Main module present, test module absent.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static TestMode of​(java.lang.String main, java.lang.String test)
      Returns the test mode constant based on two specified module names.
      static TestMode valueOf​(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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CLASSIC

        public static final TestMode CLASSIC
        No modules at all, fall-back to the class-path.

        Whether the main classes are treated as black or white box is undefined.

      • MODULAR

        public static final TestMode MODULAR
        Main module present or absent, test module present: different module name.

        Treating the main module as a black box, adhering to its exported API.

      • MODULAR_PATCHED_TEST_COMPILE

        public static final TestMode MODULAR_PATCHED_TEST_COMPILE
        Main module present, test module present: same module name.

        White-box testing by patching main types into the test module at test compile-time.

        This mode intentionally by-passes the modular barrier to allow access to internal types.

      • MODULAR_PATCHED_TEST_RUNTIME

        public static final TestMode MODULAR_PATCHED_TEST_RUNTIME
        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.

    • 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 name
        java.lang.NullPointerException - if the argument is null
      • of

        public static TestMode of​(java.lang.String main,
                                  java.lang.String test)
        Returns the test mode constant based on two specified module names.
        Parameters:
        main - name of the main module
        test - name of the test module
        Returns:
        test mode constant based on both names