Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.UpdatableChronicle


    }
  }
 
  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


  }
 
  public void test4() {
    // 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 test5() {
    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 test6() {
    // 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 testUpdateChronicleName() {
    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

    }
  }
 
  public void testUpdateChronicleNameToNull() {
    try {
      UpdatableChronicle chron = db.getChronicle(FULLNAME_UPDATED, true).edit();
      chron.setName(null);
      chron.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D01103);
    }
  }
View Full Code Here

    }
  }
 
  public void testUpdateChronicleNameToIllegal() {
    try {
      UpdatableChronicle chron = db.getChronicle(FULLNAME_UPDATED, true).edit();
      chron.setName("!@#");
      chron.applyUpdates();
      System.out.println(chron.getName(true));
      expectException();
    } catch (Exception e) {
      assertException(e, D.D01104);
    }
  }
View Full Code Here

    }
  }
 
  public void testUpdateChronicleNameToEmpty() {
    try {
      UpdatableChronicle chron = db.getChronicle(FULLNAME_UPDATED, true).edit();
      chron.setName("");
      chron.applyUpdates();
      System.out.println(chron.getName(true));
      expectException();
    } catch (Exception e) {
      assertException(e, D.D01103);
    }
  }
View Full Code Here

    }
  }
 
  public void testUpdateChronicleDescription() {
    try {
      UpdatableChronicle chron = db.getChronicle(FULLNAME_UPDATED, true).edit();
      chron.setDescription("anything");
      chron.applyUpdates();
      assertEquals("anything",  db.getChronicle(FULLNAME_UPDATED, true).getDescription(false));
    } 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();
    }
  }
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.