Package org.sonar.core.source.db

Examples of org.sonar.core.source.db.SnapshotDataDto


    Collection<SnapshotDataDto> selectSnapshotData = dao.selectSnapshotDataByComponentKey(
      projectKey,
      Arrays.asList(SnapshotDataTypes.FILE_HASHES)
      );
    if (!selectSnapshotData.isEmpty()) {
      SnapshotDataDto snapshotDataDto = selectSnapshotData.iterator().next();
      String data = snapshotDataDto.getData();
      map = KeyValueFormat.parse(data);
    }
    return map;
  }
View Full Code Here


    Snapshot previousSnapshot = mock(Snapshot.class);
    when(previousSnapshot.getId()).thenReturn(123);
    PastSnapshot pastSnapshot = new PastSnapshot("foo", new Date(), previousSnapshot);
    when(pastSnapshotFinder.findPreviousAnalysis(snapshot)).thenReturn(pastSnapshot);

    SnapshotDataDto snapshotDataDto = new SnapshotDataDto();
    snapshotDataDto.setData("src/main/java/foo/Bar.java=abcd1234");
    when(snapshotDataDao.selectSnapshotData(123, Arrays.asList(SnapshotDataTypes.FILE_HASHES)))
      .thenReturn(Arrays.asList(snapshotDataDto));

    Map<String, String> hashByRelativePath = loader.hashByRelativePath();
    assertThat(hashByRelativePath.get("src/main/java/foo/Bar.java")).isEqualTo("abcd1234");
View Full Code Here

      Collection<SnapshotDataDto> selectSnapshotData = dao.selectSnapshotData(
        pastSnapshot.getProjectSnapshot().getId().longValue(),
        Arrays.asList(SnapshotDataTypes.FILE_HASHES)
        );
      if (!selectSnapshotData.isEmpty()) {
        SnapshotDataDto snapshotDataDto = selectSnapshotData.iterator().next();
        String data = snapshotDataDto.getData();
        map = KeyValueFormat.parse(data);
      }
    }
    return map;
  }
View Full Code Here

        String componentKey = componentEntry.getKey();
        Snapshot snapshot = componentEntry.getValue();
        for (Cache.Entry<Data> dataEntry : data.entries(componentKey)) {
          Data value = dataEntry.value();
          if (value != null) {
            SnapshotDataDto dto = new SnapshotDataDto();
            dto.setSnapshotId(snapshot.getId());
            dto.setResourceId(snapshot.getResourceId());
            dto.setDataType(dataEntry.key()[1].toString());
            dto.setData(value.writeString());
            dao.insert(session, dto);
          }
        }
      }
      session.commit();
View Full Code Here

TOP

Related Classes of org.sonar.core.source.db.SnapshotDataDto

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.