Package org.sonar.api.database.model

Examples of org.sonar.api.database.model.Snapshot


  @Test
  public void testWithNoPreviousVersion() {
    setupData("no-previous-version");
    PastSnapshotFinderByPreviousVersion finder = new PastSnapshotFinderByPreviousVersion(getSession());

    Snapshot currentProjectSnapshot = getSession().getSingleResult(Snapshot.class, "id", 1003);
    PastSnapshot foundSnapshot = finder.findByPreviousVersion(currentProjectSnapshot);
    assertThat(foundSnapshot.getMode()).isEqualTo(CoreProperties.TIMEMACHINE_MODE_PREVIOUS_VERSION);
    assertThat(foundSnapshot.getProjectSnapshot()).isNull();
    assertThat(foundSnapshot.getModeParameter()).isNull();
  }
View Full Code Here


  @Test
  public void shouldFindDate() throws ParseException {
    setupData("shared");

    Snapshot projectSnapshot = getSession().getSingleResult(Snapshot.class, "id", 1010);
    PastSnapshotFinderByDate finder = new PastSnapshotFinderByDate(getSession());

    Date date = DATE_FORMAT.parse("2008-11-22");

    PastSnapshot pastSnapshot = finder.findByDate(projectSnapshot, date);
View Full Code Here

  @Test
  public void shouldFindNearestLaterDate() throws ParseException {
    setupData("shared");

    Snapshot projectSnapshot = getSession().getSingleResult(Snapshot.class, "id", 1010);
    PastSnapshotFinderByDate finder = new PastSnapshotFinderByDate(getSession());

    Date date = DATE_FORMAT.parse("2008-11-24");
  
    PastSnapshot pastSnapshot = finder.findByDate(projectSnapshot, date);
View Full Code Here

TOP

Related Classes of org.sonar.api.database.model.Snapshot

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.