private void init() { IAnnotation a = AnnotationHelper.findConfiguration(m_annotationFinder, m_method.getMethod()); IConfigurationAnnotation annotation = (IConfigurationAnnotation) a; if (a != null) { m_inheritGroupsFromTestClass = annotation.getInheritGroups(); setEnabled(annotation.getEnabled()); setDescription(annotation.getDescription()); } if (annotation != null && annotation.isFakeConfiguration()) { if (annotation.getBeforeSuite()) { initGroups(IBeforeSuite.class); } if (annotation.getAfterSuite()) { initGroups(IAfterSuite.class); } if (annotation.getBeforeTest()) { initGroups(IBeforeTest.class); } if (annotation.getAfterTest()) { initGroups(IAfterTest.class); } if (annotation.getBeforeGroups().length != 0) { initGroups(IBeforeGroups.class); } if (annotation.getAfterGroups().length != 0) { initGroups(IAfterGroups.class); } if (annotation.getBeforeTestClass()) { initGroups(IBeforeClass.class); } if (annotation.getAfterTestClass()) { initGroups(IAfterClass.class); } if (annotation.getBeforeTestMethod()) { initGroups(IBeforeMethod.class); } if (annotation.getAfterTestMethod()) { initGroups(IAfterMethod.class); } } else { initGroups(IConfigurationAnnotation.class); } // If this configuration method has inherit-groups=true, add the groups // defined in the @Test class if (inheritGroupsFromTestClass()) { ITestAnnotation classAnnotation = (ITestAnnotation) m_annotationFinder.findAnnotation(m_methodClass, ITestAnnotation.class); if (classAnnotation != null) { String[] groups = classAnnotation.getGroups(); Map<String, String> newGroups = Maps.newHashMap(); for (String g : getGroups()) { newGroups.put(g, g); } if (groups != null) { for (String g : groups) { newGroups.put(g, g); } setGroups(newGroups.values().toArray(new String[newGroups.size()])); } } } if (annotation != null) { setTimeOut(annotation.getTimeOut()); } }