class ConfigInvoker extends BaseInvoker implements IConfigInvoker
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Boolean> |
m_beforegroupsFailures
Group failures must be synced as the Invoker is accessed concurrently
|
private boolean |
m_continueOnFailedConfiguration |
private java.util.Set<ITestNGMethod> |
m_executedConfigMethods |
protected java.util.Map<ITestNGMethod,java.util.Set<java.lang.Object>> |
m_methodInvocationResults
Test methods whose configuration methods have failed.
|
m_classInvocationResults, m_configuration, m_notifier, m_suiteState, m_testContext
Constructor and Description |
---|
ConfigInvoker(ITestResultNotifier notifier,
java.util.Collection<IInvokedMethodListener> invokedMethodListeners,
ITestContext testContext,
SuiteRunState suiteState,
IConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
private boolean |
classConfigurationFailed(java.lang.Class<?> cls,
java.lang.Object instance) |
private IConfigurable |
computeConfigurableInstance(ConstructorOrMethod method,
java.lang.Object targetInstance) |
private static java.lang.Object |
computeInstance(java.lang.Object instance,
java.lang.Object inst,
ITestNGMethod tm) |
private static void |
copyAttributesFromNativelyInjectedTestResult(java.lang.Object[] source,
ITestResult target) |
private java.util.Set<java.lang.Object> |
getInvocationResults(IClass testClass) |
private void |
handleConfigurationFailure(java.lang.Throwable ite,
ITestNGMethod tm,
ITestResult testResult,
IConfigurationAnnotation annotation,
ITestNGMethod currentTestMethod,
java.lang.Object instance,
XmlSuite suite) |
private void |
handleConfigurationSkip(ITestNGMethod tm,
ITestResult testResult,
IConfigurationAnnotation annotation,
ITestNGMethod currentTestMethod,
java.lang.Object instance,
XmlSuite suite)
Marks the current
TestResult as skipped and invokes the listeners. |
private boolean |
hasConfigFailure(ITestNGMethod currentTestMethod) |
boolean |
hasConfigurationFailureFor(ITestNGMethod testNGMethod,
java.lang.String[] groups,
IClass testClass,
java.lang.Object instance) |
void |
invokeAfterGroupsConfigurations(GroupConfigMethodArguments arguments) |
void |
invokeBeforeGroupsConfigurations(GroupConfigMethodArguments arguments)
Filter all the beforeGroups methods and invoke only those that apply to the current test
method
|
private void |
invokeConfigurationMethod(java.lang.Object targetInstance,
ITestNGMethod tm,
java.lang.Object[] params,
ITestResult testResult)
Effectively invokes a configuration method on all passed in instances.
|
void |
invokeConfigurations(ConfigMethodArguments arguments) |
private static boolean |
isConfigMethodEligibleForScrutiny(ITestNGMethod tm) |
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.
|
private void |
runConfigurationListeners(ITestResult tr,
boolean before) |
private void |
setClassInvocationFailure(java.lang.Class<?> clazz,
java.lang.Object instance) |
private void |
setMethodInvocationFailure(ITestNGMethod method,
java.lang.Object instance) |
private void |
throwConfigurationFailure(ITestResult testResult,
java.lang.Throwable ex) |
annotationFinder, handleException, isSkipExceptionAndSkip, log, runInvokedMethodListeners
protected final java.util.Map<ITestNGMethod,java.util.Set<java.lang.Object>> m_methodInvocationResults
private final boolean m_continueOnFailedConfiguration
private final java.util.Set<ITestNGMethod> m_executedConfigMethods
private final java.util.Map<java.lang.String,java.lang.Boolean> m_beforegroupsFailures
public ConfigInvoker(ITestResultNotifier notifier, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, ITestContext testContext, SuiteRunState suiteState, IConfiguration configuration)
public boolean hasConfigurationFailureFor(ITestNGMethod testNGMethod, java.lang.String[] groups, IClass testClass, java.lang.Object instance)
hasConfigurationFailureFor
in interface IConfigInvoker
public void invokeBeforeGroupsConfigurations(GroupConfigMethodArguments arguments)
invokeBeforeGroupsConfigurations
in interface IConfigInvoker
arguments
- public void invokeAfterGroupsConfigurations(GroupConfigMethodArguments arguments)
invokeAfterGroupsConfigurations
in interface IConfigInvoker
public void invokeConfigurations(ConfigMethodArguments arguments)
invokeConfigurations
in interface IConfigInvoker
private void invokeConfigurationMethod(java.lang.Object targetInstance, ITestNGMethod tm, java.lang.Object[] params, ITestResult testResult) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
private void throwConfigurationFailure(ITestResult testResult, java.lang.Throwable ex)
private IConfigurable computeConfigurableInstance(ConstructorOrMethod method, java.lang.Object targetInstance)
private void runConfigurationListeners(ITestResult tr, boolean before)
private void handleConfigurationSkip(ITestNGMethod tm, ITestResult testResult, IConfigurationAnnotation annotation, ITestNGMethod currentTestMethod, java.lang.Object instance, XmlSuite suite)
TestResult
as skipped and invokes the listeners.private boolean hasConfigFailure(ITestNGMethod currentTestMethod)
private void handleConfigurationFailure(java.lang.Throwable ite, ITestNGMethod tm, ITestResult testResult, IConfigurationAnnotation annotation, ITestNGMethod currentTestMethod, java.lang.Object instance, XmlSuite suite)
private static boolean isConfigMethodEligibleForScrutiny(ITestNGMethod tm)
private boolean classConfigurationFailed(java.lang.Class<?> cls, java.lang.Object instance)
private static void copyAttributesFromNativelyInjectedTestResult(java.lang.Object[] source, ITestResult target)
private void setMethodInvocationFailure(ITestNGMethod method, java.lang.Object instance)
private void setClassInvocationFailure(java.lang.Class<?> clazz, java.lang.Object instance)
private void recordConfigurationInvocationFailed(ITestNGMethod tm, IClass testClass, IConfigurationAnnotation annotation, ITestNGMethod currentTestMethod, java.lang.Object instance, XmlSuite suite)
private static java.lang.Object computeInstance(java.lang.Object instance, java.lang.Object inst, ITestNGMethod tm)
private java.util.Set<java.lang.Object> getInvocationResults(IClass testClass)