public void readExternal(final Element element) throws InvalidDataException { PathMacroManager.getInstance(getProject()).expandPaths(element); super.readExternal(element); JavaRunConfigurationExtensionManager.getInstance().readExternal(this, element); readModule(element); DefaultJDOMExternalizer.readExternal(this, element); DefaultJDOMExternalizer.readExternal(getPersistentData(), element); EnvironmentVariablesComponent.readExternal(element, getPersistentData().getEnvs()); final Element patternsElement = element.getChild(PATTERNS_EL_NAME); if (patternsElement != null) { final Set<String> tests = new LinkedHashSet<String>(); for (Object o : patternsElement.getChildren(PATTERN_EL_NAME)) { Element patternElement = (Element) o; tests.add(patternElement.getAttributeValue(TEST_CLASS_ATT_NAME)); } myData.setPatterns(tests); } final Element forkModeElement = element.getChild("fork_mode"); if (forkModeElement != null) { final String mode = forkModeElement.getAttributeValue("value"); if (mode != null) { setForkMode(mode); } } final Element dirNameElement = element.getChild("dir"); if (dirNameElement != null) { final String dirName = dirNameElement.getAttributeValue("value"); getPersistentData().setDirName(FileUtil.toSystemDependentName(dirName)); } }
public void bePatternConfiguration(List<PsiClass> classes, PsiMethod method) { myData.TEST_OBJECT = TEST_PATTERN; final Set<String> patterns = new HashSet<String>(); final String methodSufiix; if (method != null) { myData.METHOD_NAME = method.getName(); methodSufiix = "," + myData.METHOD_NAME; } else { methodSufiix = ""; } for (PsiClass pattern : classes) { patterns.add(JavaExecutionUtil.getRuntimeQualifiedName(pattern) + methodSufiix); } myData.setPatterns(patterns); final Module module = PatternConfigurationProducer.findModule( this, getConfigurationModule().getModule(), patterns); if (module == null) { myData.setScope(TestSearchScope.WHOLE_PROJECT); setModule(null); } else { setModule(module); } setGeneratedName(); }