Class ConfigInvoker

    • Field Detail

      • m_methodInvocationResults

        protected final java.util.Map<ITestNGMethod,​java.util.Set<java.lang.Object>> m_methodInvocationResults
        Test methods whose configuration methods have failed.
      • m_continueOnFailedConfiguration

        private final boolean m_continueOnFailedConfiguration
      • m_executedConfigMethods

        private final java.util.Set<ITestNGMethod> m_executedConfigMethods
      • m_beforegroupsFailures

        private final java.util.Map<java.lang.String,​java.lang.Boolean> m_beforegroupsFailures
        Group failures must be synced as the Invoker is accessed concurrently
    • Method Detail

      • hasConfigurationFailureFor

        public boolean hasConfigurationFailureFor​(ITestNGMethod testNGMethod,
                                                  java.lang.String[] groups,
                                                  IClass testClass,
                                                  java.lang.Object instance)
        Specified by:
        hasConfigurationFailureFor in interface IConfigInvoker
        Returns:
        false if this class has successfully run all its @Configuration method or true if at least one of these methods failed.
      • invokeConfigurationMethod

        private void invokeConfigurationMethod​(java.lang.Object targetInstance,
                                               ITestNGMethod tm,
                                               java.lang.Object[] params,
                                               ITestResult testResult)
                                        throws java.lang.reflect.InvocationTargetException,
                                               java.lang.IllegalAccessException
        Effectively invokes a configuration method on all passed in instances.
        Throws:
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException
      • throwConfigurationFailure

        private void throwConfigurationFailure​(ITestResult testResult,
                                               java.lang.Throwable ex)
      • runConfigurationListeners

        private void runConfigurationListeners​(ITestResult tr,
                                               boolean before)
      • hasConfigFailure

        private boolean hasConfigFailure​(ITestNGMethod currentTestMethod)
      • isConfigMethodEligibleForScrutiny

        private static boolean isConfigMethodEligibleForScrutiny​(ITestNGMethod tm)
      • classConfigurationFailed

        private boolean classConfigurationFailed​(java.lang.Class<?> cls,
                                                 java.lang.Object instance)
        Returns:
        true if this class or a parent class failed to initialize.
      • copyAttributesFromNativelyInjectedTestResult

        private static void copyAttributesFromNativelyInjectedTestResult​(java.lang.Object[] source,
                                                                         ITestResult target)
      • setMethodInvocationFailure

        private void setMethodInvocationFailure​(ITestNGMethod method,
                                                java.lang.Object instance)
      • setClassInvocationFailure

        private void setClassInvocationFailure​(java.lang.Class<?> clazz,
                                               java.lang.Object instance)
      • recordConfigurationInvocationFailed

        private void recordConfigurationInvocationFailed​(ITestNGMethod tm,
                                                         IClass testClass,
                                                         IConfigurationAnnotation annotation,
                                                         ITestNGMethod currentTestMethod,
                                                         java.lang.Object instance,
                                                         XmlSuite suite)
        Record internally the failure of a Configuration, so that we can determine later if @Test should be skipped.
      • computeInstance

        private static java.lang.Object computeInstance​(java.lang.Object instance,
                                                        java.lang.Object inst,
                                                        ITestNGMethod tm)
      • getInvocationResults

        private java.util.Set<java.lang.Object> getInvocationResults​(IClass testClass)