@Override public boolean isAfterSuiteConfiguration() { return testNGMethod.isAfterSuiteConfiguration(); }
@Override public boolean isAfterSuiteConfiguration() { return testNGMethod.isAfterSuiteConfiguration(); }
boolean at = tm.isAfterTestConfiguration(); boolean bs = tm.isBeforeSuiteConfiguration(); boolean as = tm.isAfterSuiteConfiguration(); boolean bg = tm.isBeforeGroupsConfiguration(); boolean ag = tm.isAfterGroupsConfiguration();
boolean at = tm.isAfterTestConfiguration(); boolean bs = tm.isBeforeSuiteConfiguration(); boolean as = tm.isAfterSuiteConfiguration(); boolean bg = tm.isBeforeGroupsConfiguration(); boolean ag = tm.isAfterGroupsConfiguration();
/** * * A helper method that checks to see if a method is a configuration method or not. * @param method - A {@link ITestNGMethod} object which needs to be checked. * @param includeGroupConfigs - <code>true</code> if before/after group configuration annotations are also to * be taken into consideration. * @return - <code>true</code> if the method is a configuration method and false if its a test method. */ private static boolean isConfigurationMethod(ITestNGMethod method, boolean includeGroupConfigs) { boolean flag = method.isBeforeMethodConfiguration() || method.isAfterMethodConfiguration() || method.isBeforeTestConfiguration() || method.isAfterTestConfiguration() || method.isBeforeClassConfiguration() || method.isAfterClassConfiguration() || method.isBeforeSuiteConfiguration() || method.isAfterSuiteConfiguration(); if (includeGroupConfigs) { flag = flag || method.isBeforeGroupsConfiguration() || method.isAfterGroupsConfiguration(); } return flag; }
return 2; if(method.isAfterSuiteConfiguration()) { return 1;
return "@AfterTest"; if(method.isAfterSuiteConfiguration()) { return "@AfterSuite";
/** * A helper method that checks to see if a method is a configuration method or not. * * @param method - A {@link ITestNGMethod} object which needs to be checked. * @param includeGroupConfigs - <code>true</code> if before/after group configuration annotations * are also to be taken into consideration. * @return - <code>true</code> if the method is a configuration method and false if its a test * method. */ private static boolean isConfigurationMethod(ITestNGMethod method, boolean includeGroupConfigs) { boolean flag = method.isBeforeMethodConfiguration() || method.isAfterMethodConfiguration() || method.isBeforeTestConfiguration() || method.isAfterTestConfiguration() || method.isBeforeClassConfiguration() || method.isAfterClassConfiguration() || method.isBeforeSuiteConfiguration() || method.isAfterSuiteConfiguration(); if (includeGroupConfigs) { flag = flag || method.isBeforeGroupsConfiguration() || method.isAfterGroupsConfiguration(); } return flag; }
return "@AfterTest"; if (method.isAfterSuiteConfiguration()) { return "@AfterSuite";
return 2; if (method.isAfterSuiteConfiguration()) { return 1;
@Override public void afterInvocation(IInvokedMethod method, ITestResult testResult) { m_afterCount++; if (method.getTestMethod().isAfterSuiteConfiguration()) { suiteStatus = testResult.getStatus(); suiteThrowable = testResult.getThrowable(); } if (method.getTestMethod().isTest()) { methodStatus = testResult.getStatus(); methodThrowable = testResult.getThrowable(); } }
if (m.isBeforeSuiteConfiguration()) { cls = "configuration-suite before"; } else if (m.isAfterSuiteConfiguration()) { cls = "configuration-suite after"; } else if (m.isBeforeTestConfiguration()) {
if (m.isBeforeSuiteConfiguration()) { cls = "configuration-suite before"; } else if (m.isAfterSuiteConfiguration()) { cls = "configuration-suite after"; } else if (m.isBeforeTestConfiguration()) {
@Override public void afterInvocation(IInvokedMethod method, ITestResult testResult) { String methodName = method.getTestMethod().getMethodName(); if (method.isTestMethod()) { testMethods.add(methodName); } if (method.isConfigurationMethod()) { configurationMethods.add(methodName); } if (method.getTestMethod().isTest()) { testMethodsFromTM.add(methodName); } if (method.getTestMethod().isBeforeMethodConfiguration() || method.getTestMethod().isAfterMethodConfiguration() || method.getTestMethod().isBeforeTestConfiguration() || method.getTestMethod().isAfterTestConfiguration() || method.getTestMethod().isBeforeClassConfiguration() || method.getTestMethod().isAfterClassConfiguration() || method.getTestMethod().isBeforeSuiteConfiguration() || method.getTestMethod().isAfterSuiteConfiguration()) { configurationMethodsFromTM.add(methodName); } } }
@Override public boolean isAfterSuiteConfiguration() { return delegate.isAfterSuiteConfiguration(); }
@Override public boolean isAfterSuiteConfiguration() { return delegate.isAfterSuiteConfiguration(); }
@Override public boolean isAfterSuiteConfiguration() { return method.isAfterSuiteConfiguration(); }
@Override public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod testngMethod, boolean isTestMethod ) { return testngMethod.isBeforeClassConfiguration() || testngMethod.isBeforeGroupsConfiguration() || testngMethod.isBeforeMethodConfiguration() || testngMethod.isBeforeSuiteConfiguration() || testngMethod.isBeforeTestConfiguration() || testngMethod.isAfterClassConfiguration() || testngMethod.isAfterGroupsConfiguration() || testngMethod.isAfterMethodConfiguration() || testngMethod.isAfterSuiteConfiguration() || testngMethod.isAfterTestConfiguration() || shouldRun( testngMethod ); }
@Override public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod testngMethod, boolean isTestMethod ) { return testngMethod.isBeforeClassConfiguration() || testngMethod.isBeforeGroupsConfiguration() || testngMethod.isBeforeMethodConfiguration() || testngMethod.isBeforeSuiteConfiguration() || testngMethod.isBeforeTestConfiguration() || testngMethod.isAfterClassConfiguration() || testngMethod.isAfterGroupsConfiguration() || testngMethod.isAfterMethodConfiguration() || testngMethod.isAfterSuiteConfiguration() || testngMethod.isAfterTestConfiguration() || shouldRun( testngMethod ); }
@Override public void beforeConfiguration(ITestResult result) { super.beforeConfiguration(result); // remember active test phase to organize valid driver pool manipulation // process if (result.getMethod().isBeforeSuiteConfiguration()) { TestPhase.setActivePhase(Phase.BEFORE_SUITE); } if (result.getMethod().isBeforeClassConfiguration()) { TestPhase.setActivePhase(Phase.BEFORE_CLASS); } if (result.getMethod().isBeforeMethodConfiguration()) { TestPhase.setActivePhase(Phase.BEFORE_METHOD); } if (result.getMethod().isAfterMethodConfiguration()) { TestPhase.setActivePhase(Phase.AFTER_METHOD); } if (result.getMethod().isAfterClassConfiguration()) { TestPhase.setActivePhase(Phase.AFTER_CLASS); } if (result.getMethod().isAfterSuiteConfiguration()) { TestPhase.setActivePhase(Phase.AFTER_SUITE); } }