@Override public boolean isBeforeGroupsConfiguration() { return testNGMethod.isBeforeGroupsConfiguration(); }
@Override public boolean isBeforeGroupsConfiguration() { return testNGMethod.isBeforeGroupsConfiguration(); }
private boolean belongToSameGroup(ITestResult result) { ITestNGMethod m = result.getMethod(); if (!m.isBeforeGroupsConfiguration()) { return false; } String[] mygroups = this.m_method.getGroups(); if (mygroups.length == 0 || m.getGroups().length ==0) { return false; } List<String> cfgMethodGroups = Arrays.asList(m.getGroups()); return Arrays.stream(mygroups).anyMatch(cfgMethodGroups::contains); }
boolean bs = tm.isBeforeSuiteConfiguration(); boolean as = tm.isAfterSuiteConfiguration(); boolean bg = tm.isBeforeGroupsConfiguration(); boolean ag = tm.isAfterGroupsConfiguration(); boolean setUp = tm.isBeforeMethodConfiguration();
boolean bs = tm.isBeforeSuiteConfiguration(); boolean as = tm.isAfterSuiteConfiguration(); boolean bg = tm.isBeforeGroupsConfiguration(); boolean ag = tm.isAfterGroupsConfiguration(); boolean setUp = tm.isBeforeMethodConfiguration();
/** * * 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 8; if(method.isBeforeGroupsConfiguration()) { return 7;
return "@BeforeClass"; if(method.isBeforeGroupsConfiguration()) { return "@BeforeGroups";
/** * 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 8; if (method.isBeforeGroupsConfiguration()) { return 7;
return "@BeforeClass"; if (method.isBeforeGroupsConfiguration()) { return "@BeforeGroups";
@Override public boolean isBeforeGroupsConfiguration() { return delegate.isBeforeGroupsConfiguration(); }
@Override public boolean isBeforeGroupsConfiguration() { return delegate.isBeforeGroupsConfiguration(); }
@Override public boolean isBeforeGroupsConfiguration() { return method.isBeforeGroupsConfiguration(); }
} else if (method.isBeforeClassConfiguration()) { buf.append("@BeforeClass "); } else if (method.isBeforeGroupsConfiguration()) { buf.append("@BeforeGroups "); } else if (method.isBeforeMethodConfiguration()) {
@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 ); }
} else if (method.isBeforeClassConfiguration()) { return BEFORE_CLASS; } else if (method.isBeforeGroupsConfiguration()) { return BEFORE_GROUPS; } else if (method.isBeforeMethodConfiguration()) {
/** * 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); }
return ConfigMethodType.BEFORE_CLASS; if (iTestResult.getMethod().isBeforeGroupsConfiguration()) { return ConfigMethodType.BEFORE_GROUPS;