Package net.caprazzi.keez.Keez

Examples of net.caprazzi.keez.Keez.Entry


  @Test
  public void upgradeFrom0To1_should_rollback_lists_if_update_story_fails() throws Exception {
    minimaDb = spy(new DbHelper(db));
   
    Entry[] entries = new Entry[] {
      new Entry("story0", 1, "somedata".getBytes()),
    };
   
    doAnswer(listFound(entries)).when(db).list(any(List.class));
   
    doThrow(new Exception()).when(minimaDb).upgradeEntry(entries[0]);
View Full Code Here


  @Test
  public void upgradeFrom0to1_should_upgrade_each_story() throws Exception {
    minimaDb = spy(new DbHelper(db));
   
    Entry[] entries = new Entry[] {
      new Entry("story1", 1, new Note("desc1","todo", 65536, false).toJson()),
      new Entry("story2", 2, new Note("desc2","todo", 65536, false).toJson())
    };
   
    doAnswer(listFound(entries)).when(db).list(any(List.class));
   
    minimaDb.upgradeFrom0to1();
View Full Code Here

  @Test
  public void upgradeFrom0to1_should_delete_old_stories_after_upgrade() throws Exception {
    minimaDb = spy(new DbHelper(db));
   
    Entry[] entries = new Entry[] {
      new Entry("story1", 1, new Note("desc1","todo", 65536, false).toJson()),
      new Entry("story2", 2, new Note("desc1","todo", 65536, false).toJson()),
    };
   
    doAnswer(listFound(entries)).when(db).list(any(List.class));
   
    minimaDb.upgradeFrom0to1();
View Full Code Here

  @Test
  public void upgradeFrom0To1_should_rollback_if_any_upgrade_fails_then_throw() throws Exception {
    minimaDb = spy(new DbHelper(db));
   
    Entry[] entries = new Entry[] {
      new Entry("story1", 1, new Note("desc1","todo", 65536, false).toJson()),
      new Entry("story2", 2, new Note("desc1","todo", 65536, false).toJson()),
      new Entry("story3", 2, new Note("desc1","todo", 65536, false).toJson()),
    };
   
    doAnswer(listFound(entries)).when(db).list(any(List.class));
   
    doThrow(new Exception()).when(minimaDb).upgradeEntry(entries[1]);
View Full Code Here

  @Test
  public void upgradeFrom0To1_rollback_keeps_going_if_rollback_fails_then_throw() throws Exception {
    minimaDb = spy(new DbHelper(db));
   
    Entry[] entries = new Entry[] {
      new Entry("story0", 0, new Note("desc1","todo", 65536, false).toJson()),
      new Entry("story1", 1, new Note("desc1","todo", 65536, false).toJson()),
      new Entry("story2", 2, new Note("desc1","todo", 65536, false).toJson())
    };
   
    doAnswer(listFound(entries)).when(db).list(any(List.class));
    doThrow(new Exception()).when(minimaDb).upgradeEntry(entries[1]);
    doThrow(new Exception()).when(minimaDb).rollbackUpgradeEntry(entries[0]);
View Full Code Here

    verify(db).delete(eq("listId"), any(Delete.class));
  }
 
  @Test
  public void rollbackUpgradeEntry_should_delete_new_entry_key() throws Exception {
    minimaDb.rollbackUpgradeEntry(new Entry("somekey", 0, null));
    verify(db).delete(eq("somekeyrx"), any(Delete.class));
  }
View Full Code Here

TOP

Related Classes of net.caprazzi.keez.Keez.Entry

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.