コード例 #1
0
  @Test
  public void insertFirst() {
    coverage = new SonarCoverage();

    coverage.linkFileNameToFileId("a", "1");
    coverageCache.merge(coverage, MODULE_NAME);
    assertNotNull("should be valid object", coverage);
    assertEquals("should have one file", 1, coverage.getValues().size());
  }
コード例 #2
0
 @Test
 public void insertSecond() {
   coverage = new SonarCoverage();
   coverage.linkFileNameToFileId("a", "1");
   coverageCache.merge(coverage, MODULE_NAME);
   coverage = new SonarCoverage();
   coverage.linkFileNameToFileId("b", "2");
   coverageCache.merge(coverage, MODULE_NAME);
   SonarCoverage coverageGotten = coverageCache.get(MODULE_NAME);
   assertNotNull("should be valid object", coverageGotten);
   assertEquals("should have one file", 2, coverageGotten.getValues().size());
 }