void (final XmlFile testngXML, final PsiClass psiClass) { final XmlTag rootTag = testngXML.getDocument().getRootTag(); if (rootTag != null && rootTag.getName().equals("suite")) { try { XmlTag testTag = rootTag.findFirstSubTag("test"); if (testTag == null) { testTag = (XmlTag)rootTag.add(rootTag.createChildTag("test", rootTag.getNamespace(), null, false)); testTag.setAttribute("name", psiClass.getName()); } XmlTag classesTag = testTag.findFirstSubTag("classes"); if (classesTag == null) { classesTag = (XmlTag)testTag.add(testTag.createChildTag("classes", testTag.getNamespace(), null, false)); } final XmlTag classTag = (XmlTag)classesTag.add(classesTag.createChildTag("class", classesTag.getNamespace(), null, false)); final String qualifiedName = psiClass.getQualifiedName(); LOG.assertTrue(qualifiedName != null); classTag.setAttribute("name", qualifiedName); } catch (IncorrectOperationException e) { LOG.error(e); } } }