Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.UpdatableChronicle


    }
  }
 
  public void test_080_UpdateChronicleNameToNull() {
    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 test_090_UpdateChronicleNameToIllegal() {
    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 test_100_UpdateChronicleNameToEmpty() {
    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 test_110_UpdateChronicleDescription() {
    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

  }
 
  public void test032_create_entity() {
    try {
      Schema schema = db.getSchemas("foo schema").iterator().next();
      UpdatableChronicle ent = db.getTopChronicle().edit().createChronicle("fooent", false, "foo entity", null, schema);
      ent.getAttribute("foo property", true);
      ent.applyUpdates();
      assertNotNull(ent.getAttribute("foo property", false));
      assertNull(ent.getAttribute("bar property", false));
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    }
  }

  public void test036_create_series_and_add_value() {
    try {
      UpdatableChronicle ent = db.getChronicle("bt.fooent", true).edit();
      UpdatableSeries<Double> s = ent.updateSeries("fooser");
      assertNull(s);
      s = db.getUpdatableSeries("bt.fooent.fooser", true);
      assertNotNull(s);
      s.setValue(Day.DOMAIN.time("2011-06-30"), 42.);
      s.applyUpdates();
View Full Code Here

    }
  }
 
  public void test040_create_series_and_delete_value() {
    try {
      UpdatableChronicle ent = db.getChronicle("bt.fooent", true).edit();
      UpdatableSeries<Double> s = ent.updateSeries("fooser");
      assertNotNull(s);
      s.setValue(Day.DOMAIN.time("2011-06-30"), Double.NaN);
      s.applyUpdates();
      // next should not throw an exception
      s.setValue(Day.DOMAIN.time("2011-06-30"), Double.NaN);
View Full Code Here

    }
  }
 
  public void test044_update_attribute() {
    try {
      UpdatableChronicle ent = db.getChronicle("bt.fooent", true).edit();
      Attribute<String> attr = ent.getAttribute("foo property", true).typeCheck(String.class);
      assertEquals("bar", attr.get());
      attr.set("baz");
      expectException();
    } catch (Exception e) {
      assertException(e, D.D20110, D.D10115);
View Full Code Here

    try {
      UpdatableProperty<String> prop = db.getProperty("foo property", true).typeCheck(String.class).edit();
      UpdatableValueType<String> vt = prop.getValueType().edit();
      vt.addValue("baz", "this is baz");
      vt.applyUpdates();
      UpdatableChronicle ent = db.getChronicle("bt.fooent", true).edit();
      Attribute<String> attr = ent.getAttribute("foo property", true).typeCheck(String.class);
      attr.set("baz");
      ent.setAttribute(attr);
      ent.applyUpdates();
      Attribute<String> a = ent.getAttribute("foo property", true).typeCheck(String.class);
      assertEquals("baz", a.get());
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    }
  }
 
  public void test049_update_attribute() {
    try {
      UpdatableChronicle ent = db.getChronicle("bt.fooent", true).edit();
      Attribute<String> attr = ent.getAttribute("foo property", true).typeCheck(String.class);
      assertEquals("baz", attr.get());
      attr.set("barf");
      ent.setAttribute(attr);
      ent.applyUpdates();
      attr.set("baz");
      ent.setAttribute(attr);
      ent.applyUpdates();
    } 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.