Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.UpdatableChronicle.destroy()


    db = getContext().getDatabase();
    Chronicle testData = db.getChronicle(FULLNAME, false);
    if (testData != null) {
      Util.deleteChronicleCollection(testData);
      UpdatableChronicle upd = testData.edit();
      upd.destroy();
      upd.applyUpdates();
      db.commit();
    }
  }
 
View Full Code Here


  }
 
  public void test_030() {
    try {
      UpdatableChronicle testEntity = db.getChronicle(FULLNAME, true).edit();
      testEntity.destroy();
      testEntity.applyUpdates();
      assertFalse(testEntity.getSurrogate().getObject().isValid());
    } catch (Exception e) {
      fail(e.getMessage());
    }
View Full Code Here

    if (!clean) {
      Chronicle testData = db.getChronicle(FULLNAME, false);
      if (testData != null) {
        Util.deleteChronicleCollection(testData);
        UpdatableChronicle upd = testData.edit();
        upd.destroy();
        upd.applyUpdates();
      }
      db.getTopChronicle().edit().createChronicle(SIMPLENAME, false, "standalone test", null, null).applyUpdates();
      clean = true;
    }
View Full Code Here

      uc.applyUpdates();
      String su1 = uc.getSurrogate().toString();
      // access with "test" okay, because of non-strict mode
      String su2 = db.getChronicle("test", true).getSurrogate().toString();
      assertEquals(su1, su2);
      uc.destroy();
      uc.applyUpdates();
      uc = db.getTopChronicle().edit().createChronicle("test", false, "testing...", null, null);
      uc.applyUpdates();
      // DON'T commit... old version of system removed things from cache on commit
      String su3 = uc.getSurrogate().toString();
View Full Code Here

    db = getContext().getDatabase();
    Chronicle testData = db.getChronicle(FULLNAME, false);
    if (testData != null) {
      Util.deleteChronicleCollection(testData);
      UpdatableChronicle upd = testData.edit();
      upd.destroy();
      upd.applyUpdates();
      db.commit();
    }
  }
 
View Full Code Here

  }
 
  public void test3() {
    try {
      UpdatableChronicle testEntity = db.getChronicle(FULLNAME, true).edit();
      testEntity.destroy();
      testEntity.applyUpdates();
      assertFalse(testEntity.getSurrogate().getObject().isValid());
    } catch (Exception e) {
      fail(e.getMessage());
    }
View Full Code Here

    for (Chronicle e : chronicle.getMembers()) {
      deleteChronicle(e, false);
    }
    if (!keepTop) {
      UpdatableChronicle ue = chronicle.edit();
      ue.destroy();
      ue.applyUpdates();
    }
  }

  public static void deleteChronicles(Database db, String... chrons) throws Exception {
View Full Code Here

    if (!clean) {
      Chronicle testData = db.getChronicle(SIMPLENAME, false);
      if (testData != null) {
        Util.deleteChronicleCollection(testData);
        UpdatableChronicle upd = testData.edit();
        upd.destroy();
        upd.applyUpdates();
      }
      UpdatableChronicle ex = db.getTopChronicle().edit().createChronicle(SIMPLENAME, false, "standalone test", null, null);
      ex.applyUpdates();
      clean = true;
View Full Code Here

  }
 
  public void test002() {
    try {
      UpdatableChronicle e = db.getChronicle(FULLNAME, true).edit();
      e.destroy();
      e.applyUpdates();
      db.commit();
      assertEquals(db.getNamingPolicy().joinValueAndDescription(FULLNAME, "junit test 001"), tester.getEvent().getComment());
    } catch (Exception e) {
      fail(e.toString());
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.