@Test(dataProvider = "generateContentCases") public void shouldGenerateContent( @Nullable final String profileChildProcesses, @NotNull final String profileChildProcessesXmlValue, @Nullable final String processFilters, @NotNull final List<ProcessFilter> processFiltersList, @NotNull final String processFiltersXmlValue, @Nullable MeasureType measureType) { if(measureType == null) { measureType = MeasureType.SAMPLING; } final MeasureType curMeasureType = measureType; String expectedContent = "<root>" + "<HostParameters type=\"LocalHostParameters\"/>" + "<Argument type=\"StandaloneArgument\">" + "<Arguments>arg1 arg2</Arguments>" + "<FileName>wd" + File.separator + "tool</FileName>" + "<ProfileChildProcesses>" + profileChildProcessesXmlValue + "</ProfileChildProcesses>" + "<WorkingDirectory>wd</WorkingDirectory>" + "<Scope>" + (!processFiltersXmlValue.equals("") ? "<ProcessFilters>" + processFiltersXmlValue + "</ProcessFilters>" : "<ProcessFilters/>") + "</Scope>" + "</Argument>" + "<Info type=\"PerformanceInfo\">" + "<MeasureType>" + curMeasureType.getDescription() + "</MeasureType>" + "<MeterKind>Rdtsc</MeterKind>" + "<InjectInfo>" + "<SymbolSearch>" + "<SearchPaths/>" + "</SymbolSearch>" + "<Scope>" + "<PatternFilters/>" + "<DenyAttributeFilters/>" + "</Scope>" + "</InjectInfo>" + "</Info>" + "</root>"; final CommandLineSetup setup = new CommandLineSetup( "wd" + File.separator + "tool", Arrays.asList( new CommandLineArgument("arg1", CommandLineArgument.Type.PARAMETER), new CommandLineArgument("arg2", CommandLineArgument.Type.PARAMETER)), Collections.<CommandLineResource>emptyList()); myCtx.checking(new Expectations() {{ oneOf(myXmlDocumentManager).createDocument(); will(returnValue(ourDocManager.createDocument())); oneOf(myXmlDocumentManager).convertDocumentToString(with(any(Document.class)), with(any(Map.class))); will(new CustomAction("doc") { @Override public Object invoke(Invocation invocation) throws Throwable { return ourDocManager.convertDocumentToString((Document)invocation.getParameter(0), (Map<String, String>)invocation.getParameter(1)); } }); oneOf(myCommandLineArgumentsService).createCommandLineString(setup.getArgs()); will(returnValue("arg1 arg2")); oneOf(myFileService).getCheckoutDirectory(); will(returnValue(new File("wd"))); oneOf(myRunnerParametersService).tryGetRunnerParameter(Constants.PROFILE_CHILD_PROCESSES_VAR); will(returnValue(profileChildProcesses)); oneOf(myRunnerParametersService).tryGetRunnerParameter(Constants.PROCESS_FILTERS_VAR); will(returnValue(processFilters)); allowing(myProcessFiltersParser).parse(processFilters); will(returnValue(processFiltersList)); oneOf(myRunnerParametersService).tryGetRunnerParameter(Constants.MEASURE_TYPE_VAR); will(returnValue(curMeasureType.getValue())); }}); final ProjectGenerator instance = createInstance(); final String content = instance.create(new Context(setup, new File("a"), new File("b"), new File("c"), new File("s"))); myCtx.assertIsSatisfied(); then(content.trim().replace("\n", "").replace("\r", "")).isEqualTo(expectedContent.trim().replace("\n", "").replace("\r", "")); }
@Override @NotNull public String create(@NotNull final Context ctx) { final Document doc = myDocumentManager.createDocument(); final Element rootElement = doc.createElement(ROOT_ELEMENT); final Element hostParametersElement = doc.createElement(HOST_PARAMETERS_ELEMENT); hostParametersElement.setAttribute(TYPE_ATTR, TYPE_LOCAL_HOST_PARAMETERS); rootElement.appendChild(hostParametersElement); final Element argumentElement = doc.createElement(ARGUMENT_ELEMENT); argumentElement.setAttribute(TYPE_ATTR, TYPE_STANDALONE_ARGUMENT); argumentElement.appendChild(createSimpleElement(doc, ARGUMENTS_ELEMENT, myCommandLineArgumentsService.createCommandLineString(ctx.getBaseSetup().getArgs()))); argumentElement.appendChild(createSimpleElement(doc, FILE_NAME_ELEMENT, ctx.getBaseSetup().getToolPath())); final String profileChildProcessesStr = myParametersService.tryGetRunnerParameter(Constants.PROFILE_CHILD_PROCESSES_VAR); final boolean profileChildProcesses = StringUtil.isEmptyOrSpaces(profileChildProcessesStr) || Boolean.parseBoolean(profileChildProcessesStr); argumentElement.appendChild(createSimpleElement(doc, PROFILE_CHILD_PROCESSES_ELEMENT, profileChildProcesses ? TRUE_VAL : FALSE_VAL)); argumentElement.appendChild(createSimpleElement(doc, WORKING_DIRECTORY_ELEMENT, myFileService.getCheckoutDirectory().getPath())); rootElement.appendChild(argumentElement); final Element argumentScopeElement = doc.createElement(SCOPE_ELEMENT); final Element processFiltersElement = doc.createElement(PROCESS_FILTERS_ELEMENT); final String processFiltersStr = myParametersService.tryGetRunnerParameter(Constants.PROCESS_FILTERS_VAR); if(!StringUtil.isEmptyOrSpaces(processFiltersStr)) { final List<ProcessFilter> filters = myProcessFiltersParser.parse(processFiltersStr); if(filters.size() > 0) { processFiltersElement.appendChild(createSimpleElement(doc, ITEM_ELEMENT, "")); for (ProcessFilter filter : filters) { final Element itemElement = doc.createElement(ITEM_ELEMENT); itemElement.appendChild(createSimpleElement(doc, PROCESS_NAME_FILTER_ELEMENT, filter.getMask())); itemElement.appendChild(createSimpleElement(doc, TYPE_ELEMENT, DENY_PROCESS_FILTER_VAL)); processFiltersElement.appendChild(itemElement); } } } argumentScopeElement.appendChild(processFiltersElement); argumentElement.appendChild(argumentScopeElement); final Element infoElement = doc.createElement(INFO_ELEMENT); infoElement.setAttribute(TYPE_ATTR, TYPE_PERFORMANCE_INFO); final String measureTypeStr = myParametersService.tryGetRunnerParameter(Constants.MEASURE_TYPE_VAR); MeasureType curMeasureType = MeasureType.SAMPLING; for(MeasureType measureType: MeasureType.values()) { if(measureType.getValue().equalsIgnoreCase(measureTypeStr)) { curMeasureType = measureType; break; } } if(!StringUtil.isEmptyOrSpaces(curMeasureType.getId())) { infoElement.appendChild(createSimpleElement(doc, MEASURE_TYPE_ELEMENT, curMeasureType.getId())); } infoElement.appendChild(createSimpleElement(doc, METER_KIND_ELEMENT, METER_KIND_RDTSC)); final Element injectInfoElement = doc.createElement(INJECT_INFO_ELEMENT); final Element symbolSearchElement = doc.createElement(SYMBOL_SEARCH_ELEMENT); symbolSearchElement.appendChild(createSimpleElement(doc, SEARCH_PATHS_ELEMENT, "")); injectInfoElement.appendChild(symbolSearchElement); final Element injectInfoScopeElement = doc.createElement(SCOPE_ELEMENT); injectInfoScopeElement.appendChild(createSimpleElement(doc, PATTERN_FILTERS_ELEMENT, "")); injectInfoScopeElement.appendChild(createSimpleElement(doc, DENY_ATTRIBUTE_FILTERS_ELEMENT, "")); injectInfoElement.appendChild(injectInfoScopeElement); infoElement.appendChild(injectInfoElement); rootElement.appendChild(infoElement); doc.appendChild(rootElement); return myDocumentManager.convertDocumentToString(doc, outDocumentProperties); }
ProjectGenerator implements ResourceGenerator<Context> { @Override @NotNull public String create(@NotNull final Context ctx) { final Document doc = myDocumentManager.createDocument(); final Element rootElement = doc.createElement(ROOT_ELEMENT); final Element hostParametersElement = doc.createElement(HOST_PARAMETERS_ELEMENT); hostParametersElement.setAttribute(TYPE_ATTR, TYPE_LOCAL_HOST_PARAMETERS); rootElement.appendChild(hostParametersElement); final Element argumentElement = doc.createElement(ARGUMENT_ELEMENT); argumentElement.setAttribute(TYPE_ATTR, TYPE_STANDALONE_ARGUMENT); argumentElement.appendChild(createSimpleElement(doc, ARGUMENTS_ELEMENT, myCommandLineArgumentsService.createCommandLineString(ctx.getBaseSetup().getArgs()))); argumentElement.appendChild(createSimpleElement(doc, FILE_NAME_ELEMENT, ctx.getBaseSetup().getToolPath())); final String profileChildProcessesStr = myParametersService.tryGetRunnerParameter(Constants.PROFILE_CHILD_PROCESSES_VAR); final boolean profileChildProcesses = StringUtil.isEmptyOrSpaces(profileChildProcessesStr) || Boolean.parseBoolean(profileChildProcessesStr); argumentElement.appendChild(createSimpleElement(doc, PROFILE_CHILD_PROCESSES_ELEMENT, profileChildProcesses ? TRUE_VAL : FALSE_VAL)); argumentElement.appendChild(createSimpleElement(doc, WORKING_DIRECTORY_ELEMENT, myFileService.getCheckoutDirectory().getPath())); rootElement.appendChild(argumentElement); final Element argumentScopeElement = doc.createElement(SCOPE_ELEMENT); final Element processFiltersElement = doc.createElement(PROCESS_FILTERS_ELEMENT); final String processFiltersStr = myParametersService.tryGetRunnerParameter(Constants.PROCESS_FILTERS_VAR); if(!StringUtil.isEmptyOrSpaces(processFiltersStr)) { final List<ProcessFilter> filters = myProcessFiltersParser.parse(processFiltersStr); if(filters.size() > 0) { processFiltersElement.appendChild(createSimpleElement(doc, ITEM_ELEMENT, "")); for (ProcessFilter filter : filters) { final Element itemElement = doc.createElement(ITEM_ELEMENT); itemElement.appendChild(createSimpleElement(doc, PROCESS_NAME_FILTER_ELEMENT, filter.getMask())); itemElement.appendChild(createSimpleElement(doc, TYPE_ELEMENT, DENY_PROCESS_FILTER_VAL)); processFiltersElement.appendChild(itemElement); } } } argumentScopeElement.appendChild(processFiltersElement); argumentElement.appendChild(argumentScopeElement); final Element infoElement = doc.createElement(INFO_ELEMENT); infoElement.setAttribute(TYPE_ATTR, TYPE_PERFORMANCE_INFO); final String measureTypeStr = myParametersService.tryGetRunnerParameter(Constants.MEASURE_TYPE_VAR); MeasureType curMeasureType = MeasureType.SAMPLING; for(MeasureType measureType: MeasureType.values()) { if(measureType.getValue().equalsIgnoreCase(measureTypeStr)) { curMeasureType = measureType; break; } } if(!StringUtil.isEmptyOrSpaces(curMeasureType.getId())) { infoElement.appendChild(createSimpleElement(doc, MEASURE_TYPE_ELEMENT, curMeasureType.getId())); } infoElement.appendChild(createSimpleElement(doc, METER_KIND_ELEMENT, METER_KIND_RDTSC)); final Element injectInfoElement = doc.createElement(INJECT_INFO_ELEMENT); final Element symbolSearchElement = doc.createElement(SYMBOL_SEARCH_ELEMENT); symbolSearchElement.appendChild(createSimpleElement(doc, SEARCH_PATHS_ELEMENT, "")); injectInfoElement.appendChild(symbolSearchElement); final Element injectInfoScopeElement = doc.createElement(SCOPE_ELEMENT); injectInfoScopeElement.appendChild(createSimpleElement(doc, PATTERN_FILTERS_ELEMENT, "")); injectInfoScopeElement.appendChild(createSimpleElement(doc, DENY_ATTRIBUTE_FILTERS_ELEMENT, "")); injectInfoElement.appendChild(injectInfoScopeElement); infoElement.appendChild(injectInfoElement); rootElement.appendChild(infoElement); doc.appendChild(rootElement); return myDocumentManager.convertDocumentToString(doc, outDocumentProperties); } }
ProjectGenerator implements ResourceGenerator<Context> { @Override @NotNull public String create(@NotNull final Context ctx) { final Document doc = myDocumentManager.createDocument(); final Element rootElement = doc.createElement(ROOT_ELEMENT); final Element hostParametersElement = doc.createElement(HOST_PARAMETERS_ELEMENT); hostParametersElement.setAttribute(TYPE_ATTR, TYPE_LOCAL_HOST_PARAMETERS); rootElement.appendChild(hostParametersElement); final Element argumentElement = doc.createElement(ARGUMENT_ELEMENT); argumentElement.setAttribute(TYPE_ATTR, TYPE_STANDALONE_ARGUMENT); argumentElement.appendChild(createSimpleElement(doc, ARGUMENTS_ELEMENT, myCommandLineArgumentsService.createCommandLineString(ctx.getBaseSetup().getArgs()))); argumentElement.appendChild(createSimpleElement(doc, FILE_NAME_ELEMENT, ctx.getBaseSetup().getToolPath())); final String profileChildProcessesStr = myParametersService.tryGetRunnerParameter(Constants.PROFILE_CHILD_PROCESSES_VAR); final boolean profileChildProcesses = StringUtil.isEmptyOrSpaces(profileChildProcessesStr) || Boolean.parseBoolean(profileChildProcessesStr); argumentElement.appendChild(createSimpleElement(doc, PROFILE_CHILD_PROCESSES_ELEMENT, profileChildProcesses ? TRUE_VAL : FALSE_VAL)); argumentElement.appendChild(createSimpleElement(doc, WORKING_DIRECTORY_ELEMENT, myFileService.getCheckoutDirectory().getPath())); rootElement.appendChild(argumentElement); final Element argumentScopeElement = doc.createElement(SCOPE_ELEMENT); final Element processFiltersElement = doc.createElement(PROCESS_FILTERS_ELEMENT); final String processFiltersStr = myParametersService.tryGetRunnerParameter(Constants.PROCESS_FILTERS_VAR); if(!StringUtil.isEmptyOrSpaces(processFiltersStr)) { final List<ProcessFilter> filters = myProcessFiltersParser.parse(processFiltersStr); if(filters.size() > 0) { processFiltersElement.appendChild(createSimpleElement(doc, ITEM_ELEMENT, "")); for (ProcessFilter filter : filters) { final Element itemElement = doc.createElement(ITEM_ELEMENT); itemElement.appendChild(createSimpleElement(doc, PROCESS_NAME_FILTER_ELEMENT, filter.getMask())); itemElement.appendChild(createSimpleElement(doc, TYPE_ELEMENT, DENY_PROCESS_FILTER_VAL)); processFiltersElement.appendChild(itemElement); } } } argumentScopeElement.appendChild(processFiltersElement); argumentElement.appendChild(argumentScopeElement); final Element infoElement = doc.createElement(INFO_ELEMENT); infoElement.setAttribute(TYPE_ATTR, TYPE_PERFORMANCE_INFO); final String measureTypeStr = myParametersService.tryGetRunnerParameter(Constants.MEASURE_TYPE_VAR); MeasureType curMeasureType = MeasureType.SAMPLING; for(MeasureType measureType: MeasureType.values()) { if(measureType.getValue().equalsIgnoreCase(measureTypeStr)) { curMeasureType = measureType; break; } } if(!StringUtil.isEmptyOrSpaces(curMeasureType.getId())) { infoElement.appendChild(createSimpleElement(doc, MEASURE_TYPE_ELEMENT, curMeasureType.getId())); } infoElement.appendChild(createSimpleElement(doc, METER_KIND_ELEMENT, METER_KIND_RDTSC)); final Element injectInfoElement = doc.createElement(INJECT_INFO_ELEMENT); final Element symbolSearchElement = doc.createElement(SYMBOL_SEARCH_ELEMENT); symbolSearchElement.appendChild(createSimpleElement(doc, SEARCH_PATHS_ELEMENT, "")); injectInfoElement.appendChild(symbolSearchElement); final Element injectInfoScopeElement = doc.createElement(SCOPE_ELEMENT); injectInfoScopeElement.appendChild(createSimpleElement(doc, PATTERN_FILTERS_ELEMENT, "")); injectInfoScopeElement.appendChild(createSimpleElement(doc, DENY_ATTRIBUTE_FILTERS_ELEMENT, "")); injectInfoElement.appendChild(injectInfoScopeElement); infoElement.appendChild(injectInfoElement); rootElement.appendChild(infoElement); doc.appendChild(rootElement); return myDocumentManager.convertDocumentToString(doc, outDocumentProperties); } ProjectGenerator(
    @NotNull final TextParser<List<ProcessFilter>> processFiltersParser,
    @NotNull final XmlDocumentManager documentManager,
    @NotNull final CommandLineArgumentsService commandLineArgumentsService,
    @NotNull final FileService fileService,
    @NotNull final RunnerParametersService parametersService); }
ProjectGenerator implements ResourceGenerator<Context> { @Override @NotNull public String create(@NotNull final Context ctx) { final Document doc = myDocumentManager.createDocument(); final Element rootElement = doc.createElement(ROOT_ELEMENT); final Element hostParametersElement = doc.createElement(HOST_PARAMETERS_ELEMENT); hostParametersElement.setAttribute(TYPE_ATTR, TYPE_LOCAL_HOST_PARAMETERS); rootElement.appendChild(hostParametersElement); final Element argumentElement = doc.createElement(ARGUMENT_ELEMENT); argumentElement.setAttribute(TYPE_ATTR, TYPE_STANDALONE_ARGUMENT); argumentElement.appendChild(createSimpleElement(doc, ARGUMENTS_ELEMENT, myCommandLineArgumentsService.createCommandLineString(ctx.getBaseSetup().getArgs()))); argumentElement.appendChild(createSimpleElement(doc, FILE_NAME_ELEMENT, ctx.getBaseSetup().getToolPath())); final String profileChildProcessesStr = myParametersService.tryGetRunnerParameter(Constants.PROFILE_CHILD_PROCESSES_VAR); final boolean profileChildProcesses = StringUtil.isEmptyOrSpaces(profileChildProcessesStr) || Boolean.parseBoolean(profileChildProcessesStr); argumentElement.appendChild(createSimpleElement(doc, PROFILE_CHILD_PROCESSES_ELEMENT, profileChildProcesses ? TRUE_VAL : FALSE_VAL)); argumentElement.appendChild(createSimpleElement(doc, WORKING_DIRECTORY_ELEMENT, myFileService.getCheckoutDirectory().getPath())); rootElement.appendChild(argumentElement); final Element argumentScopeElement = doc.createElement(SCOPE_ELEMENT); final Element processFiltersElement = doc.createElement(PROCESS_FILTERS_ELEMENT); final String processFiltersStr = myParametersService.tryGetRunnerParameter(Constants.PROCESS_FILTERS_VAR); if(!StringUtil.isEmptyOrSpaces(processFiltersStr)) { final List<ProcessFilter> filters = myProcessFiltersParser.parse(processFiltersStr); if(filters.size() > 0) { processFiltersElement.appendChild(createSimpleElement(doc, ITEM_ELEMENT, "")); for (ProcessFilter filter : filters) { final Element itemElement = doc.createElement(ITEM_ELEMENT); itemElement.appendChild(createSimpleElement(doc, PROCESS_NAME_FILTER_ELEMENT, filter.getMask())); itemElement.appendChild(createSimpleElement(doc, TYPE_ELEMENT, DENY_PROCESS_FILTER_VAL)); processFiltersElement.appendChild(itemElement); } } } argumentScopeElement.appendChild(processFiltersElement); argumentElement.appendChild(argumentScopeElement); final Element infoElement = doc.createElement(INFO_ELEMENT); infoElement.setAttribute(TYPE_ATTR, TYPE_PERFORMANCE_INFO); final String measureTypeStr = myParametersService.tryGetRunnerParameter(Constants.MEASURE_TYPE_VAR); MeasureType curMeasureType = MeasureType.SAMPLING; for(MeasureType measureType: MeasureType.values()) { if(measureType.getValue().equalsIgnoreCase(measureTypeStr)) { curMeasureType = measureType; break; } } if(!StringUtil.isEmptyOrSpaces(curMeasureType.getId())) { infoElement.appendChild(createSimpleElement(doc, MEASURE_TYPE_ELEMENT, curMeasureType.getId())); } infoElement.appendChild(createSimpleElement(doc, METER_KIND_ELEMENT, METER_KIND_RDTSC)); final Element injectInfoElement = doc.createElement(INJECT_INFO_ELEMENT); final Element symbolSearchElement = doc.createElement(SYMBOL_SEARCH_ELEMENT); symbolSearchElement.appendChild(createSimpleElement(doc, SEARCH_PATHS_ELEMENT, "")); injectInfoElement.appendChild(symbolSearchElement); final Element injectInfoScopeElement = doc.createElement(SCOPE_ELEMENT); injectInfoScopeElement.appendChild(createSimpleElement(doc, PATTERN_FILTERS_ELEMENT, "")); injectInfoScopeElement.appendChild(createSimpleElement(doc, DENY_ATTRIBUTE_FILTERS_ELEMENT, "")); injectInfoElement.appendChild(injectInfoScopeElement); infoElement.appendChild(injectInfoElement); rootElement.appendChild(infoElement); doc.appendChild(rootElement); return myDocumentManager.convertDocumentToString(doc, outDocumentProperties); } ProjectGenerator(
    @NotNull final TextParser<List<ProcessFilter>> processFiltersParser,
    @NotNull final XmlDocumentManager documentManager,
    @NotNull final CommandLineArgumentsService commandLineArgumentsService,
    @NotNull final FileService fileService,
    @NotNull final RunnerParametersService parametersService); @Override @NotNull String create(@NotNull final Context ctx); }
ProjectGenerator implements ResourceGenerator<Context> { @Override @NotNull public String create(@NotNull final Context ctx) { final Document doc = myDocumentManager.createDocument(); final Element rootElement = doc.createElement(ROOT_ELEMENT); final Element hostParametersElement = doc.createElement(HOST_PARAMETERS_ELEMENT); hostParametersElement.setAttribute(TYPE_ATTR, TYPE_LOCAL_HOST_PARAMETERS); rootElement.appendChild(hostParametersElement); final Element argumentElement = doc.createElement(ARGUMENT_ELEMENT); argumentElement.setAttribute(TYPE_ATTR, TYPE_STANDALONE_ARGUMENT); argumentElement.appendChild(createSimpleElement(doc, ARGUMENTS_ELEMENT, myCommandLineArgumentsService.createCommandLineString(ctx.getBaseSetup().getArgs()))); argumentElement.appendChild(createSimpleElement(doc, FILE_NAME_ELEMENT, ctx.getBaseSetup().getToolPath())); final String profileChildProcessesStr = myParametersService.tryGetRunnerParameter(Constants.PROFILE_CHILD_PROCESSES_VAR); final boolean profileChildProcesses = StringUtil.isEmptyOrSpaces(profileChildProcessesStr) || Boolean.parseBoolean(profileChildProcessesStr); argumentElement.appendChild(createSimpleElement(doc, PROFILE_CHILD_PROCESSES_ELEMENT, profileChildProcesses ? TRUE_VAL : FALSE_VAL)); argumentElement.appendChild(createSimpleElement(doc, WORKING_DIRECTORY_ELEMENT, myFileService.getCheckoutDirectory().getPath())); rootElement.appendChild(argumentElement); final Element argumentScopeElement = doc.createElement(SCOPE_ELEMENT); final Element processFiltersElement = doc.createElement(PROCESS_FILTERS_ELEMENT); final String processFiltersStr = myParametersService.tryGetRunnerParameter(Constants.PROCESS_FILTERS_VAR); if(!StringUtil.isEmptyOrSpaces(processFiltersStr)) { final List<ProcessFilter> filters = myProcessFiltersParser.parse(processFiltersStr); if(filters.size() > 0) { processFiltersElement.appendChild(createSimpleElement(doc, ITEM_ELEMENT, "")); for (ProcessFilter filter : filters) { final Element itemElement = doc.createElement(ITEM_ELEMENT); itemElement.appendChild(createSimpleElement(doc, PROCESS_NAME_FILTER_ELEMENT, filter.getMask())); itemElement.appendChild(createSimpleElement(doc, TYPE_ELEMENT, DENY_PROCESS_FILTER_VAL)); processFiltersElement.appendChild(itemElement); } } } argumentScopeElement.appendChild(processFiltersElement); argumentElement.appendChild(argumentScopeElement); final Element infoElement = doc.createElement(INFO_ELEMENT); infoElement.setAttribute(TYPE_ATTR, TYPE_PERFORMANCE_INFO); final String measureTypeStr = myParametersService.tryGetRunnerParameter(Constants.MEASURE_TYPE_VAR); MeasureType curMeasureType = MeasureType.SAMPLING; for(MeasureType measureType: MeasureType.values()) { if(measureType.getValue().equalsIgnoreCase(measureTypeStr)) { curMeasureType = measureType; break; } } if(!StringUtil.isEmptyOrSpaces(curMeasureType.getId())) { infoElement.appendChild(createSimpleElement(doc, MEASURE_TYPE_ELEMENT, curMeasureType.getId())); } infoElement.appendChild(createSimpleElement(doc, METER_KIND_ELEMENT, METER_KIND_RDTSC)); final Element injectInfoElement = doc.createElement(INJECT_INFO_ELEMENT); final Element symbolSearchElement = doc.createElement(SYMBOL_SEARCH_ELEMENT); symbolSearchElement.appendChild(createSimpleElement(doc, SEARCH_PATHS_ELEMENT, "")); injectInfoElement.appendChild(symbolSearchElement); final Element injectInfoScopeElement = doc.createElement(SCOPE_ELEMENT); injectInfoScopeElement.appendChild(createSimpleElement(doc, PATTERN_FILTERS_ELEMENT, "")); injectInfoScopeElement.appendChild(createSimpleElement(doc, DENY_ATTRIBUTE_FILTERS_ELEMENT, "")); injectInfoElement.appendChild(injectInfoScopeElement); infoElement.appendChild(injectInfoElement); rootElement.appendChild(infoElement); doc.appendChild(rootElement); return myDocumentManager.convertDocumentToString(doc, outDocumentProperties); } ProjectGenerator(
    @NotNull final TextParser<List<ProcessFilter>> processFiltersParser,
    @NotNull final XmlDocumentManager documentManager,
    @NotNull final CommandLineArgumentsService commandLineArgumentsService,
    @NotNull final FileService fileService,
    @NotNull final RunnerParametersService parametersService); @Override @NotNull String create(@NotNull final Context ctx);  }