类 ProfileValueUtils

java.lang.Object
cn.taketoday.test.annotation.ProfileValueUtils

public abstract class ProfileValueUtils extends Object
General utility methods for working with profile values.
从以下版本开始:
4.0
作者:
Sam Brannen, Juergen Hoeller
另请参阅:
  • 字段详细资料

    • logger

      private static final cn.taketoday.logging.Logger logger
  • 构造器详细资料

    • ProfileValueUtils

      public ProfileValueUtils()
  • 方法详细资料

    • retrieveProfileValueSource

      public static ProfileValueSource retrieveProfileValueSource(Class<?> testClass)
      Retrieves the ProfileValueSource type for the specified test class as configured via the @ProfileValueSourceConfiguration annotation and instantiates a new instance of that type.

      If @ProfileValueSourceConfiguration is not present on the specified class or if a custom ProfileValueSource is not declared, the default SystemProfileValueSource will be returned instead.

      参数:
      testClass - the test class for which the ProfileValueSource should be retrieved
      返回:
      the configured (or default) ProfileValueSource for the specified class
      另请参阅:
    • isTestEnabledInThisEnvironment

      public static boolean isTestEnabledInThisEnvironment(Class<?> testClass)
      Determine if the supplied testClass is enabled in the current environment, as specified by the @IfProfileValue annotation at the class level.

      Defaults to true if no @IfProfileValue annotation is declared.

      参数:
      testClass - the test class
      返回:
      true if the test is enabled in the current environment
    • isTestEnabledInThisEnvironment

      public static boolean isTestEnabledInThisEnvironment(Method testMethod, Class<?> testClass)
      Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level. Class-level usage overrides method-level usage.

      Defaults to true if no @IfProfileValue annotation is declared.

      参数:
      testMethod - the test method
      testClass - the test class
      返回:
      true if the test is enabled in the current environment
    • isTestEnabledInThisEnvironment

      public static boolean isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, Method testMethod, Class<?> testClass)
      Determine if the supplied testMethod is enabled in the current environment, as specified by the @IfProfileValue annotation, which may be declared on the test method itself or at the class level. Class-level usage overrides method-level usage.

      Defaults to true if no @IfProfileValue annotation is declared.

      参数:
      profileValueSource - the ProfileValueSource to use to determine if the test is enabled
      testMethod - the test method
      testClass - the test class
      返回:
      true if the test is enabled in the current environment
    • isTestEnabledInThisEnvironment

      private static boolean isTestEnabledInThisEnvironment(ProfileValueSource profileValueSource, @Nullable IfProfileValue ifProfileValue)
      Determine if the value (or one of the values) in the supplied @IfProfileValue annotation is enabled in the current environment.
      参数:
      profileValueSource - the ProfileValueSource to use to determine if the test is enabled
      ifProfileValue - the annotation to introspect; may be null
      返回:
      true if the test is enabled in the current environment or if the supplied ifProfileValue is null