@Override public boolean isAfterTestConfiguration() { return testNGMethod.isAfterTestConfiguration(); }
@Override public boolean isAfterTestConfiguration() { return testNGMethod.isAfterTestConfiguration(); }
boolean ac = tm.isAfterClassConfiguration(); boolean bt = tm.isBeforeTestConfiguration(); boolean at = tm.isAfterTestConfiguration(); boolean bs = tm.isBeforeSuiteConfiguration(); boolean as = tm.isAfterSuiteConfiguration();
boolean ac = tm.isAfterClassConfiguration(); boolean bt = tm.isBeforeTestConfiguration(); boolean at = tm.isAfterTestConfiguration(); boolean bs = tm.isBeforeSuiteConfiguration(); boolean as = tm.isAfterSuiteConfiguration();
/** * * 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 3; if(method.isAfterTestConfiguration()) { return 2;
return "@AfterClass"; if (method.isAfterTestConfiguration()) { return "@AfterTest";
/** * 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 3; if (method.isAfterTestConfiguration()) { return 2;
return "@AfterClass"; if (method.isAfterTestConfiguration()) { return "@AfterTest";
} else if (m.isBeforeTestConfiguration()) { cls = "configuration-test before"; } else if (m.isAfterTestConfiguration()) { cls = "configuration-test after"; } else if (m.isBeforeClassConfiguration()) {
} else if (m.isBeforeTestConfiguration()) { cls = "configuration-test before"; } else if (m.isAfterTestConfiguration()) { cls = "configuration-test after"; } else if (m.isBeforeClassConfiguration()) {
@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 isAfterTestConfiguration() { return delegate.isAfterTestConfiguration(); }
@Override public boolean isAfterTestConfiguration() { return delegate.isAfterTestConfiguration(); }
@Override public boolean isAfterTestConfiguration() { return method.isAfterTestConfiguration(); }
@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 ); }
return ConfigMethodType.AFTER_SUITE; if (iTestResult.getMethod().isAfterTestConfiguration()) { return ConfigMethodType.AFTER_TEST;
/** * Detect and save all test method types. * * @param method the method * @param methodResult the method result */ protected void saveMethodTypes(TestMethod method, ITestResult methodResult) { ITestNGMethod m = methodResult.getMethod(); if (m.isAfterClassConfiguration()) saveMethodType(method, EMethodType.AFTER_CLASS); if (m.isAfterGroupsConfiguration()) saveMethodType(method, EMethodType.AFTER_GROUP); if (m.isAfterMethodConfiguration()) saveMethodType(method, EMethodType.AFTER_METHOD); if (m.isAfterSuiteConfiguration()) saveMethodType(method, EMethodType.AFTER_SUITE); if (m.isAfterTestConfiguration()) saveMethodType(method, EMethodType.AFTER_TEST); if (m.isBeforeClassConfiguration()) saveMethodType(method, EMethodType.BEFORE_CLASS); if (m.isBeforeGroupsConfiguration()) saveMethodType(method, EMethodType.BEFORE_GROUP); if (m.isBeforeMethodConfiguration()) saveMethodType(method, EMethodType.BEFORE_METHOD); if (m.isBeforeSuiteConfiguration()) saveMethodType(method, EMethodType.BEFORE_SUITE); if (m.isBeforeTestConfiguration()) saveMethodType(method, EMethodType.BEFORE_TEST); }