Examples of PurgeableSnapshotDto


Examples of org.sonar.core.purge.PurgeableSnapshotDto

  private DbCleanerTestUtils() {
  }

  public static PurgeableSnapshotDto createSnapshotWithDate(long snapshotId, String date) {
    PurgeableSnapshotDto snapshot = new PurgeableSnapshotDto();
    snapshot.setSnapshotId(snapshotId);
    snapshot.setDate(DateUtils.parseDate(date));
    return snapshot;
  }
View Full Code Here

Examples of org.sonar.core.purge.PurgeableSnapshotDto

    snapshot.setDate(DateUtils.parseDate(date));
    return snapshot;
  }

  public static PurgeableSnapshotDto createSnapshotWithDateTime(long snapshotId, String datetime) {
    PurgeableSnapshotDto snapshot = new PurgeableSnapshotDto();
    snapshot.setSnapshotId(snapshotId);
    snapshot.setDate(DateUtils.parseDateTime(datetime));
    return snapshot;
  }
View Full Code Here

Examples of org.sonar.core.purge.PurgeableSnapshotDto

  static int calendarField(Interval interval, int field) {
    if (interval.count() == 0) {
      return -1;
    }

    PurgeableSnapshotDto first = interval.get().iterator().next();
    GregorianCalendar cal = new GregorianCalendar();
    cal.setTime(first.getDate());
    return cal.get(field);
  }
View Full Code Here

Examples of org.sonar.core.purge.PurgeableSnapshotDto

  @Test
  public void doClean() {
    PurgeDao dao = mock(PurgeDao.class);
    DbSession session = mock(DbSession.class);
    when(dao.selectPurgeableSnapshots(123L, session)).thenReturn(Arrays.asList(
      new PurgeableSnapshotDto().setSnapshotId(999L).setDate(new Date())));
    Filter filter1 = newLazyFilter();
    Filter filter2 = newLazyFilter();

    DefaultPeriodCleaner cleaner = new DefaultPeriodCleaner(dao, mock(Settings.class), mock(MyBatis.class));
    cleaner.doClean(123L, Arrays.asList(filter1, filter2), session);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.