Examples of DefaultInputFile


Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testExecution() throws IOException {
    File deps = new File(baseDir, "src/foo.xoo.deps");
    FileUtils.write(deps, "src/foo2.xoo:2\nsrc2/foo3.xoo:6\n\n#comment");
    DefaultInputFile inputFile1 = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage("xoo");
    DefaultInputFile inputFile2 = new DefaultInputFile("foo", "src/foo2.xoo").setAbsolutePath(new File(baseDir, "src/foo2.xoo").getAbsolutePath()).setLanguage("xoo");
    DefaultInputFile inputFile3 = new DefaultInputFile("foo", "src2/foo3.xoo").setAbsolutePath(new File(baseDir, "src2/foo3.xoo").getAbsolutePath()).setLanguage("xoo");
    fileSystem.add(inputFile1);
    fileSystem.add(inputFile2);
    fileSystem.add(inputFile3);

    final SensorStorage sensorStorage = mock(SensorStorage.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    sensor.describe(new DefaultSensorDescriptor());
  }

  @Test
  public void testNoExecutionIfNoTestFile() {
    DefaultInputFile testFile = new DefaultInputFile("foo", "test/fooTest.xoo").setAbsolutePath(new File(baseDir, "test/fooTest.xoo").getAbsolutePath()).setLanguage("xoo")
      .setType(Type.TEST);
    fileSystem.add(testFile);
    sensor.execute(context);
  }
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testParsingOfOutput() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void shouldFailOnFileWithLocalModification() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testExecutionError() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testExecution() throws IOException {
    File testPlan = new File(baseDir, "test/fooTest.xoo.testplan");
    FileUtils.write(testPlan, "test1:UNIT:OK:::10\ntest2:INTEGRATION:ERROR:message:stack:15\n\n#comment");
    DefaultInputFile testFile = new DefaultInputFile("foo", "test/fooTest.xoo").setAbsolutePath(new File(baseDir, "test/fooTest.xoo").getAbsolutePath()).setLanguage("xoo")
      .setType(Type.TEST);
    fileSystem.add(testFile);

    final SensorStorage sensorStorage = mock(SensorStorage.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    sensor.describe(new DefaultSensorDescriptor());
  }

  @Test
  public void testNoExecutionIfExclusion() {
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage("xoo");
    fileSystem.add(inputFile);
    settings.setProperty(CoreProperties.CPD_EXCLUSIONS, "**/foo.xoo");
    sensor.execute(context);
    verify(context, never()).duplicationTokenBuilder(any(InputFile.class));
  }
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testExecution() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "token1 token2 token3\ntoken4");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage("xoo");
    fileSystem.add(inputFile);
    DuplicationTokenBuilder builder = mock(DuplicationTokenBuilder.class);
    when(context.duplicationTokenBuilder(inputFile)).thenReturn(builder);

    sensor.execute(context);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    sensor.describe(new DefaultSensorDescriptor());
  }

  @Test
  public void testNoExecutionIfCoveragePerTestFile() {
    DefaultInputFile testFile = new DefaultInputFile("foo", "test/fooTest.xoo").setAbsolutePath(new File(baseDir, "test/fooTest.xoo").getAbsolutePath()).setLanguage("xoo")
      .setType(Type.TEST);
    fileSystem.add(testFile);
    sensor.execute(context);
  }
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testExecution() throws IOException {
    File coverPerTest = new File(baseDir, "test/fooTest.xoo.coveragePerTest");
    FileUtils.write(coverPerTest, "test1:src/foo.xoo:1,2,3,4\ntest2:src/foo.xoo:5,6,7\n\n#comment");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage("xoo");
    DefaultInputFile testFile = new DefaultInputFile("foo", "test/fooTest.xoo").setAbsolutePath(new File(baseDir, "test/fooTest.xoo").getAbsolutePath()).setLanguage("xoo")
      .setType(Type.TEST);
    fileSystem.add(inputFile);
    fileSystem.add(testFile);

    final SensorStorage sensorStorage = mock(SensorStorage.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.