Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.UpdatableChronicle


    if (chronicleName == null) {
      throw T2DBMsg.exception(D.D50116, name);
    } else {
      Chronicle ent = getChronicle(chronicleName, mustExist);
      if (ent != null) {
        UpdatableChronicle updEnt = ent.edit();
        series = updEnt.updateSeries(seriesName);
        if (series == null && mustExist)
          series = updEnt.createSeries(seriesName);
      }
    }
    return series;
  }
View Full Code Here


    if (chronicleName == null) {
      throw T2DBMsg.exception(D.D50116, name);
    } else {
      Chronicle ent = getChronicle(chronicleName, mustExist);
      if (ent != null) {
        UpdatableChronicle updEnt = ent.edit();
        series = updEnt.updateSeries(seriesName);
        if (series == null && mustExist)
          series = updEnt.createSeries(seriesName);
      }
    }
    return series;
  }
View Full Code Here

  protected void firstSetUp() throws Exception {
    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

    Util.deleteChronicles(db, FULLNAME, FULLNAME_UPDATED);
  }

  public void test_010() {
    try {
      UpdatableChronicle testEntity = ((UpdatableChronicle)db.getTopChronicle()).createChronicle(SIMPLENAME, false, "test", null, null);
      testEntity.applyUpdates();
      assertEquals(FULLNAME, testEntity.getName(true));
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    }
  }
 
  public void test_020() {
    try {
      UpdatableChronicle testEntity = ((UpdatableChronicle)db.getTopChronicle()).createChronicle(SIMPLENAME, false, "test", null, null);
      testEntity.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D40126);
    }
  }
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

  }
 
  public void test_040() {
    // original bug: NPE when getting non-existing attribute of entity in construction
    try {
      UpdatableChronicle e = db.getTopChronicle().edit().createChronicle(SIMPLENAME, false, "junit test 001", null, null);
      Attribute<?> a = e.getAttribute("foo", false);
      assertNull(a);
      a = e.getAttribute("bar", true);
      expectException();
    } catch (Exception e) {
      assertException(e, D.D40114);
    }
  }
View Full Code Here

    }
  }
 
  public void test_050() {
    try {
      UpdatableChronicle e = db.getTopChronicle().edit().createChronicle(SIMPLENAME, false, "junit test 001", null, null);
      e.applyUpdates();
      Attribute<?> a = e.getAttribute("foo", false);
      assertNull(a);
      a = e.getAttribute("bar", true);
      expectException();
    } catch (Exception e) {
      assertException(e, D.D40114);
    }
  }
View Full Code Here

  }
 
  public void test_060() {
    // original bug: NPE when creating non-existing attribute of entity in construction
    try {
      UpdatableChronicle e = db.getChronicle(FULLNAME, true).edit();
      e.createSeries("foo");
      expectException();
    } catch (Exception e) {
      assertException(e, D.D40114);
    }
  }
View Full Code Here

    }
  }
 
  public void test_070_UpdateChronicleName() {
    try {
      UpdatableChronicle chron = db.getChronicle(FULLNAME, true).edit();
      chron.setName(SIMPLENAME_UPDATED);
      chron.applyUpdates();
      assertEquals(SIMPLENAME_UPDATED,  db.getChronicle(FULLNAME_UPDATED, true).getName(false));
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of ch.agent.crnickl.api.UpdatableChronicle

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.