Package org.sonar.api.checks

Examples of org.sonar.api.checks.NoSonarFilter


  @Test
  public void should_execute_if_js_files() {
    ModuleFileSystem fs = mock(ModuleFileSystem.class);
    project = new Project("key");

    JavaScriptSquidSensor sensor = new JavaScriptSquidSensor(mock(RulesProfile.class), fileLinesContextFactory, mock(ResourcePerspectives.class), fs, new NoSonarFilter());

    // no JS files -> do not execute
    when(fs.files(any(FileQuery.class))).thenReturn(Collections.<File>emptyList());
    assertThat(sensor.shouldExecuteOnProject(project)).isFalse();
View Full Code Here


    ImmutableList<File> files = ImmutableList.of(new File("src/test/resources/cpd/Person.js"));
    when(fs.files(any(FileQuery.class))).thenReturn(files);


    SensorContext context = mock(SensorContext.class);
    JavaScriptSquidSensor sensor = new JavaScriptSquidSensor(mock(RulesProfile.class), fileLinesContextFactory, mock(ResourcePerspectives.class), fs, new NoSonarFilter());

    sensor.analyse(project, context);

    verify(context).saveMeasure(any(Resource.class), eq(CoreMetrics.LINES), eq(32.0));
    verify(context).saveMeasure(any(Resource.class), eq(CoreMetrics.NCLOC), eq(18.0));
View Full Code Here

  public void test_to_string() {
    JavaScriptSquidSensor sensor = new JavaScriptSquidSensor(
      mock(RulesProfile.class),
      fileLinesContextFactory,
      mock(ResourcePerspectives.class),
      mock(ModuleFileSystem.class), new NoSonarFilter());

    assertThat(sensor.toString()).isNotNull();
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.checks.NoSonarFilter

Copyright © 2018 www.massapicom. 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.