// Path: dotTrace-common/src/main/java/jetbrains/buildServer/dotTrace/Constants.java
// public class Constants {
//     public static final String USE_VAR = "dot_trace";
//     public static final String PATH_VAR = "dot_trace_path";
//     public static final String THRESHOLDS_VAR = "dot_trace_thresholds";
//     public static final String MEASURE_TYPE_VAR = "dot_trace_measure_type";
//     public static final String PROFILE_CHILD_PROCESSES_VAR = "dot_trace_profile_child_processes";
//     public static final String PROCESS_FILTERS_VAR = "dot_trace_process_filters";
//     public static final String SNAPSHOTS_PATH_VAR = "dot_trace_snapshots_path";
// }
// 
// Path: dotTrace-common/src/main/java/jetbrains/buildServer/dotTrace/MeasureType.java
// public enum MeasureType {
//   SAMPLING("sampling", "Sampling", "Sampling"),
//   TRACING("tracing", "Tracing", ""),
//   LINE_BY_LINE("line-by-line", "Line-by-line", "TracingInject");
// 
//   private final String myValue;
//   private final String myDescription;
//   private final String myId;
// 
//   MeasureType(@NotNull final String value, @NotNull final String description, @NotNull final String id) {
//     myValue = value;
//     myDescription = description;
//     myId = id;
//   }
// 
//   @NotNull
//   public String getValue() {
//     return myValue;
//   }
// 
//   @NotNull
//   public String getDescription() {
//     return myDescription;
//   }
// 
//   @NotNull
//   @Override
//   public String toString() {
//     return myDescription;
//   }
// 
//   @NotNull
//   public String getId() {
//     return myId;
//   }
// }


import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import jetbrains.buildServer.dotNet.buildRunner.agent.*;
import jetbrains.buildServer.dotTrace.Constants;
import jetbrains.buildServer.dotTrace.MeasureType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.api.Invocation;
import org.jmock.lib.action.CustomAction;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
import static org.assertj.core.api.BDDAssertions.then;
  public void setUp()
  {
    myCtx = new Mockery();
    //noinspection unchecked
    myProcessFiltersParser = (TextParser<List<ProcessFilter>>)myCtx.mock(TextParser.class);
    myFileService = myCtx.mock(FileService.class);
    myXmlDocumentManager = myCtx.mock(XmlDocumentManager.class);
    myCommandLineArgumentsService = myCtx.mock(CommandLineArgumentsService.class);
    myRunnerParametersService = myCtx.mock(RunnerParametersService.class);
  }

  @DataProvider(name = "generateContentCases")
  public Object[][] getGenerateContentCases() {
    return new Object[][] {
      { "True", "True", null, Collections.emptyList(), "", null},
      { "False", "False", null, Collections.emptyList(), "", null},
      { "", "True", null, Collections.emptyList(), "" , null},
      { null, "True", null, Collections.emptyList(), "", null},
      { "True", "True", "nunit-console*", Arrays.asList(new ProcessFilter("nunit-console*")), "<Item/><Item><ProcessNameFilter>nunit-console*</ProcessNameFilter><Type>Deny</Type></Item>", null},
      { "True", "True", "nunit-console*" + ourlineSeparator + "Abc", Arrays.asList(new ProcessFilter("nunit-console*"), new ProcessFilter("Abc")), "<Item/><Item><ProcessNameFilter>nunit-console*</ProcessNameFilter><Type>Deny</Type></Item><Item><ProcessNameFilter>Abc</ProcessNameFilter><Type>Deny</Type></Item>", null},
    };
  }

  @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,
// Path: dotTrace-common/src/main/java/jetbrains/buildServer/dotTrace/Constants.java
// public class Constants {
//     public static final String USE_VAR = "dot_trace";
//     public static final String PATH_VAR = "dot_trace_path";
//     public static final String THRESHOLDS_VAR = "dot_trace_thresholds";
//     public static final String MEASURE_TYPE_VAR = "dot_trace_measure_type";
//     public static final String PROFILE_CHILD_PROCESSES_VAR = "dot_trace_profile_child_processes";
//     public static final String PROCESS_FILTERS_VAR = "dot_trace_process_filters";
//     public static final String SNAPSHOTS_PATH_VAR = "dot_trace_snapshots_path";
// }
// 
// Path: dotTrace-common/src/main/java/jetbrains/buildServer/dotTrace/MeasureType.java
// public enum MeasureType {
//   SAMPLING("sampling", "Sampling", "Sampling"),
//   TRACING("tracing", "Tracing", ""),
//   LINE_BY_LINE("line-by-line", "Line-by-line", "TracingInject");
// 
//   private final String myValue;
//   private final String myDescription;
//   private final String myId;
// 
//   MeasureType(@NotNull final String value, @NotNull final String description, @NotNull final String id) {
//     myValue = value;
//     myDescription = description;
//     myId = id;
//   }
// 
//   @NotNull
//   public String getValue() {
//     return myValue;
//   }
// 
//   @NotNull
//   public String getDescription() {
//     return myDescription;
//   }
// 
//   @NotNull
//   @Override
//   public String toString() {
//     return myDescription;
//   }
// 
//   @NotNull
//   public String getId() {
//     return myId;
//   }
// }


// Path: dotTrace-agent/src/test/java/jetbrains/buildServer/dotTrace/agent/ProjectGeneratorTest.java
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import jetbrains.buildServer.dotNet.buildRunner.agent.*;
import jetbrains.buildServer.dotTrace.Constants;
import jetbrains.buildServer.dotTrace.MeasureType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.api.Invocation;
import org.jmock.lib.action.CustomAction;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
import static org.assertj.core.api.BDDAssertions.then;

  public void setUp()
  {
    myCtx = new Mockery();
    //noinspection unchecked
    myProcessFiltersParser = (TextParser<List<ProcessFilter>>)myCtx.mock(TextParser.class);
    myFileService = myCtx.mock(FileService.class);
    myXmlDocumentManager = myCtx.mock(XmlDocumentManager.class);
    myCommandLineArgumentsService = myCtx.mock(CommandLineArgumentsService.class);
    myRunnerParametersService = myCtx.mock(RunnerParametersService.class);
  }

  @DataProvider(name = "generateContentCases")
  public Object[][] getGenerateContentCases() {
    return new Object[][] {
      { "True", "True", null, Collections.emptyList(), "", null},
      { "False", "False", null, Collections.emptyList(), "", null},
      { "", "True", null, Collections.emptyList(), "" , null},
      { null, "True", null, Collections.emptyList(), "", null},
      { "True", "True", "nunit-console*", Arrays.asList(new ProcessFilter("nunit-console*")), "<Item/><Item><ProcessNameFilter>nunit-console*</ProcessNameFilter><Type>Deny</Type></Item>", null},
      { "True", "True", "nunit-console*" + ourlineSeparator + "Abc", Arrays.asList(new ProcessFilter("nunit-console*"), new ProcessFilter("Abc")), "<Item/><Item><ProcessNameFilter>nunit-console*</ProcessNameFilter><Type>Deny</Type></Item><Item><ProcessNameFilter>Abc</ProcessNameFilter><Type>Deny</Type></Item>", null},
    };
  }

  @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) {