コード例 #1
0
 @Test
 public void testAnalyseSourceCodeWithNoNoSonar() {
   File file = new File(this.getClass().getResource("/Math3.php").getPath());
   Source source = NoSonarAndCommentedOutLocSensor.analyseSourceCode(file);
   assertEquals(0, source.getNoSonarTagLines().size());
   assertEquals(5, source.getMeasure(Metric.COMMENTED_OUT_CODE_LINES));
 }
コード例 #2
0
  // TEST for SONARPLUGINS-662
  @Test
  public void testAnalyseSourceCodeWithMultiLineString() {
    File file = new File(this.getClass().getResource("/Math4.php").getPath());
    Source source = NoSonarAndCommentedOutLocSensor.analyseSourceCode(file);
    assertEquals(1, source.getNoSonarTagLines().size());
    assertEquals(91, (int) source.getNoSonarTagLines().iterator().next());

    assertEquals(5, source.getMeasure(Metric.COMMENTED_OUT_CODE_LINES));
  }