@Override public boolean isAfterClassConfiguration() { return testNGMethod.isAfterClassConfiguration(); }
@Override public boolean isAfterClassConfiguration() { return testNGMethod.isAfterClassConfiguration(); }
boolean ac = tm.isAfterClassConfiguration(); boolean bt = tm.isBeforeTestConfiguration(); boolean at = tm.isAfterTestConfiguration();
boolean ac = tm.isAfterClassConfiguration(); boolean bt = tm.isBeforeTestConfiguration(); boolean at = tm.isAfterTestConfiguration();
/** * * 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 4; if(method.isAfterClassConfiguration()) { return 3;
return "@AfterGroups"; if(method.isAfterClassConfiguration()) { return "@AfterClass";
/** * 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 4; if (method.isAfterClassConfiguration()) { return 3;
return "@AfterGroups"; if (method.isAfterClassConfiguration()) { return "@AfterClass";
} else if (m.isBeforeClassConfiguration()) { cls = "configuration-class before"; } else if (m.isAfterClassConfiguration()) { cls = "configuration-class after"; } else if (m.isBeforeMethodConfiguration()) {
} else if (m.isBeforeClassConfiguration()) { cls = "configuration-class before"; } else if (m.isAfterClassConfiguration()) { cls = "configuration-class after"; } else if (m.isBeforeMethodConfiguration()) {
@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 isAfterClassConfiguration() { return delegate.isAfterClassConfiguration(); }
@Override public boolean isAfterClassConfiguration() { return delegate.isAfterClassConfiguration(); }
@Override public boolean isAfterClassConfiguration() { return method.isAfterClassConfiguration(); }
private boolean isValidAfterCondition(IInvokedMethod method) { return method.isTestMethod() || method.getTestMethod().isAfterClassConfiguration(); }
@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); } }