Package org.rssowl.ui.internal.dialogs.cleanup

Examples of org.rssowl.ui.internal.dialogs.cleanup.CleanUpModel


    /* Max Last Visit Age = 3 days && Max News Age = 3 days */
    CleanUpOperations ops = new CleanUpOperations(true, 3, false, 0, false, false, false, 0, true, 3, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here


    /* Max News Age = 3 days and Max Count = 1 */
    CleanUpOperations ops = new CleanUpOperations(false, 0, false, 0, false, false, true, 1, true, 3, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(3, groups.size());

      List<CleanUpTask> tasks1 = groups.get(1).getTasks();
View Full Code Here

    /* Last Visit Date = 3 days */
    CleanUpOperations ops = new CleanUpOperations(true, 3, false, 0, false, false, false, false, 0, false, 0, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> tasks = model.getTasks();

      /* Assert Empty (except default ops) */
      assertEquals(1, tasks.size());
    }

    bm3.setCreationDate(new Date(System.currentTimeMillis() - 5 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
      assertEquals(1, tasks.size());
      assertEquals(true, tasks.get(0) instanceof BookMarkTask);

      assertEquals(bm3, ((BookMarkTask) tasks.get(0)).getMark());
    }

    bm3.setCreationDate(new Date(System.currentTimeMillis() - 2 * DAY));
    bm1.setLastVisitDate(new Date(System.currentTimeMillis() - 2 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> tasks = model.getTasks();

      /* Assert Empty (except default ops) */
      assertEquals(1, tasks.size());
    }

    bm1.setLastVisitDate(new Date(System.currentTimeMillis() - 3 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> tasks = model.getTasks();

      /* Assert Empty (except default ops) */
      assertEquals(1, tasks.size());
    }

    bm1.setLastVisitDate(new Date(System.currentTimeMillis() - 4 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
      assertEquals(1, tasks.size());
      assertEquals(true, tasks.get(0) instanceof BookMarkTask);

      assertEquals(bm1, ((BookMarkTask) tasks.get(0)).getMark());
    }

    bm2.setLastVisitDate(new Date(System.currentTimeMillis() - 40 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here

    /* Last Update Date = 3 days */
    CleanUpOperations ops = new CleanUpOperations(false, 0, true, 3, false, false, false, false, 0, false, 0, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here

    /* Last Update Date = 3 days */
    CleanUpOperations ops = new CleanUpOperations(false, 0, false, 0, true, false, false, false, 0, false, 0, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here

    /* Delete Duplicates */
    CleanUpOperations ops = new CleanUpOperations(false, 0, false, 0, false, true, false, false, 0, false, 0, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here

    CleanUpOperations ops = new CleanUpOperations(true, 3, true, 3, false, false, false, false, 0, false, 0, false, false, false);

    bm3.setLastVisitDate(new Date(System.currentTimeMillis() - 4 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(3, groups.size());

      List<CleanUpTask> tasks1 = groups.get(1).getTasks();
      assertEquals(1, tasks1.size());
      assertEquals(true, tasks1.get(0) instanceof BookMarkTask);

      List<CleanUpTask> tasks2 = groups.get(2).getTasks();
      assertEquals(1, tasks2.size());
      assertEquals(true, tasks2.get(0) instanceof BookMarkTask);

      assertEquals(bm1, ((BookMarkTask) tasks2.get(0)).getMark());
      assertEquals(bm3, ((BookMarkTask) tasks1.get(0)).getMark());
    }

    bm1.setLastVisitDate(new Date(System.currentTimeMillis() - 4 * DAY));
    bm2.setLastVisitDate(new Date(System.currentTimeMillis() - 4 * DAY));

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks1 = groups.get(1).getTasks();
View Full Code Here

    /* Max News Count: 1 */
    CleanUpOperations ops = new CleanUpOperations(false, 0, false, 0, false, false, false, true, 1, false, 0, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
      assertEquals(1, tasks.size());
      assertEquals(true, tasks.get(0) instanceof NewsTask);

      assertEquals(news, ((NewsTask) tasks.get(0)).getNews().iterator().next().resolve());
    }

    /* Max News Count: 2 */
    ops = new CleanUpOperations(false, 0, false, 0, false, false, false, true, 2, false, 0, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Empty */
      assertEquals(1, groups.size());
    }
  }
View Full Code Here

    /* Max News Age = 3 days */
    CleanUpOperations ops = new CleanUpOperations(false, 0, false, 0, false, false, false, false, 0, true, 3, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
      assertEquals(1, tasks.size());
      assertEquals(true, tasks.get(0) instanceof NewsTask);

      assertEquals(news1, ((NewsTask) tasks.get(0)).getNews().iterator().next().resolve());
    }

    /* Max News Age = 1 days */
    ops = new CleanUpOperations(false, 0, false, 0, false, false, false, false, 0, true, 1, false, false, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here

    /* Max News Age = 3 days and keep unread */
    CleanUpOperations ops = new CleanUpOperations(false, 0, false, 0, false, false, false, false, 0, true, 3, false, true, false);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Empty */
      assertEquals(1, groups.size());
    }

    news1.setState(INews.State.READ);
    DynamicDAO.save(news1);

    {
      CleanUpModel model = new CleanUpModel(ops, marks);
      model.generate(new NullProgressMonitor());
      List<CleanUpGroup> groups = model.getTasks();

      /* Assert Filled */
      assertEquals(2, groups.size());

      List<CleanUpTask> tasks = groups.get(1).getTasks();
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.dialogs.cleanup.CleanUpModel

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.