Package ch.agent.crnickl.api

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


      assertEquals("t1v1", chro.getAttribute("prop1", true).get().toString());
      Attribute<?> a = chro.getAttribute("prop1", true);
      a.scan("t1v2");
      assertEquals("t1v2", a.get().toString());
      chro.setAttribute(a);
      chro.applyUpdates();
      assertEquals("t1v2", chro.getAttribute("prop1", true).get().toString());
      schema.deleteAttribute(1);
      schema.applyUpdates();
      expectException();
    } catch (Exception e) {
View Full Code Here


 
  public void test_delete_chronicle_attribute_via_base_with_actual_values() {
    try {
      Schema schema3 = db.getSchemas("schema3").iterator().next();
      UpdatableChronicle chro = db.getTopChronicle().edit().createChronicle("schema3chro", false, "test chronicle", null, schema3);
      chro.applyUpdates();
      // use the attribute
      Attribute<?> a = chro.getAttribute("prop1", true);
      a.scan("t1v3");
      assertEquals("t1v3", a.get().toString());
      chro.setAttribute(a);
View Full Code Here

      // use the attribute
      Attribute<?> a = chro.getAttribute("prop1", true);
      a.scan("t1v3");
      assertEquals("t1v3", a.get().toString());
      chro.setAttribute(a);
      chro.applyUpdates();
      assertEquals("t1v3", chro.getAttribute("prop1", true).get().toString());
      // remove the attribute from the base schema of schema3 (should fail)
      UpdatableSchema schema1 = db.getUpdatableSchemas("schema1a").iterator().next();
      schema1.deleteAttribute(1);
      schema1.applyUpdates();
View Full Code Here

      assertEquals("t1v3", chro.getAttribute("prop1", true).get().toString());
      // use the attribute
      Attribute<?> a = chro.getAttribute("prop1", true);
      a.reset();
      chro.setAttribute(a);
      chro.applyUpdates();
      assertEquals("t1v2", chro.getAttribute("prop1", true).get().toString());
     
      UpdatableSchema schema3 = db.getUpdatableSchemas("schema3").iterator().next();
      schema3.addAttribute(1);
      schema3.eraseAttribute(1);
View Full Code Here

  public void test_set_chronicle_attribute_with_value_same_as_default() {
    try {
      Schema schema1 = db.getSchemas("schema1a").iterator().next();
      UpdatableChronicle chro = db.getTopChronicle().edit().createChronicle("schema1achro2", false, "test chronicle", null, schema1);
      chro.applyUpdates();
      // use the attribute
      Attribute<?> a = chro.getAttribute("prop1", true);
      assertEquals("t1v1", schema1.getAttributeDefinition("prop1", false).getValue().toString());
      a.scan("t1v1");
      chro.setAttribute(a);
View Full Code Here

      // use the attribute
      Attribute<?> a = chro.getAttribute("prop1", true);
      assertEquals("t1v1", schema1.getAttributeDefinition("prop1", false).getValue().toString());
      a.scan("t1v1");
      chro.setAttribute(a);
      chro.applyUpdates();
      assertEquals("t1v1", chro.getAttribute("prop1", true).get().toString());
      // now change the default
      UpdatableSchema uschema1 = schema1.edit();
      uschema1.setAttributeDefault(1, "t1v2");
      uschema1.applyUpdates();
View Full Code Here

   * when deleted. So test1 exercised two distinct but mutually exclusive bugs.
   */
  public void test1() {
    try {
      UpdatableChronicle uc = db.getTopChronicle().edit().createChronicle("test", false, "testing...", null, null);
      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();
View Full Code Here

      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();
      String su4 = db.getChronicle("test", true).getSurrogate().toString();
View Full Code Here

      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();
      String su4 = db.getChronicle("test", true).getSurrogate().toString();
      assertEquals(su3, su4);
      db.commit();
View Full Code Here

    Chronicle testData = db.getChronicle(FULLNAME, false);
    if (testData != null) {
      Util.deleteChronicleCollection(testData);
      UpdatableChronicle upd = testData.edit();
      upd.destroy();
      upd.applyUpdates();
      db.commit();
    }
  }
 
  @Override
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.