protected void initGroups(Class<? extends ITestOrConfiguration> annotationClass) {
//
// Init groups
//
{
ITestOrConfiguration annotation = getAnnotationFinder().findAnnotation(getMethod(), annotationClass);
ITestOrConfiguration classAnnotation = getAnnotationFinder().findAnnotation(getMethod().getDeclaringClass(), annotationClass);
setGroups(getStringArray(null != annotation ? annotation.getGroups() : null,
null != classAnnotation ? classAnnotation.getGroups() : null));
}
//
// Init groups depended upon
//
{
ITestOrConfiguration annotation = getAnnotationFinder().findAnnotation(getMethod(), annotationClass);
ITestOrConfiguration classAnnotation = getAnnotationFinder().findAnnotation(getMethod().getDeclaringClass(), annotationClass);
Map<String, Set<String>> xgd = calculateXmlGroupDependencies(m_xmlTest);
List<String> xmlGroupDependencies = Lists.newArrayList();
for (String g : getGroups()) {
Set<String> gdu = xgd.get(g);
if (gdu != null) {
xmlGroupDependencies.addAll(gdu);
}
}
setGroupsDependedUpon(
getStringArray(null != annotation ? annotation.getDependsOnGroups() : null,
null != classAnnotation ? classAnnotation.getDependsOnGroups() : null),
xmlGroupDependencies);
String[] methodsDependedUpon =
getStringArray(null != annotation ? annotation.getDependsOnMethods() : null,
null != classAnnotation ? classAnnotation.getDependsOnMethods() : null);
// Qualify these methods if they don't have a package
for (int i = 0; i < methodsDependedUpon.length; i++) {
String m = methodsDependedUpon[i];
if (m.indexOf(".") < 0) {
m = MethodHelper.calculateMethodCanonicalName(m_methodClass, methodsDependedUpon[i]);