Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.Schema.edit()


  public void test_20() {
    try {
      Chronicle chronicle = db.getChronicle(CHRONICLE, true);
      assertEquals(1, chronicle.getSchema(true).getSeriesDefinitions().size());
      Schema s0 = chronicle.getSchema(true);
      UpdatableSchema usch = s0.edit();
      usch.addSeries(4);
      usch.setSeriesName(4, "test4");
      usch.setSeriesType(4, "numeric");
      usch.setSeriesTimeDomain(4, Day.DOMAIN);
      assertEquals(2, usch.getSeriesDefinitions().size());
View Full Code Here


      chro.applyUpdates();
      UpdatableSeries<Double> ser = db.getUpdatableSeries("bt.schema1achro.fou", true);
      ser.setValue(Workday.DOMAIN.time("2011-06-30"), 42.);
      ser.applyUpdates();
      // erase the series from the schema (should fail, of course)
      UpdatableSchema sch1 = schema.edit();
      sch1.deleteSeries(1);
      sch1.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, null, "D30150");
View Full Code Here

    try {
      Schema schema = db.getSchemas("schema1a").iterator().next();
      Series<Double> ser = db.getSeries("bt.schema1achro.fou", true);
      assertEquals(42., ser.getValue(Workday.DOMAIN.time("2011-06-30")));
      // renaming the series should be okay
      UpdatableSchema sch1 = schema.edit();
      //sch1.setSeriesName(1, "fooo"); next line should be equivalent
      sch1.setAttributeDefault(1, 1, "fooo");
      sch1.applyUpdates();
      ser = db.getSeries("bt.schema1achro.fooo", true);
      assertEquals(42., ser.getValue(Workday.DOMAIN.time("2011-06-30")));
View Full Code Here

    try {
      Schema schema = db.getSchemas("schema1a").iterator().next();
      Series<Double> ser = db.getSeries("bt.schema1achro.fooo", true);
      assertEquals(42., ser.getValue(Workday.DOMAIN.time("2011-06-30")));
      // changing the time domain should fail
      UpdatableSchema sch1 = schema.edit();
      sch1.setSeriesTimeDomain(1, DateTime.DOMAIN);
      sch1.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30105, D.D30149);
View Full Code Here

 
  public void test_360_update_attribute_value_okay() {
    try {
      Schema schema = db.getSchemas("schema1a").iterator().next();
      Series<Double> ser = db.getSeries("bt.schema1achro.fooo", true);
      UpdatableSchema sch1 = schema.edit();
      sch1.addAttribute(7);
      sch1.setAttributeDefault(7, "foo");
      sch1.setAttributeProperty(7, db.getProperty("prop3", true));
      sch1.applyUpdates();
View Full Code Here

  }
 
  public void test_370_series_attribute_overrides_chronicle_attribute() {
    try {
      Schema schema = db.getSchemas("schema1a").iterator().next();
      UpdatableSchema sch1 = schema.edit();
      sch1.addAttribute(1, 5);
      sch1.setAttributeDefault(1, 5, "bar");
      sch1.setAttributeProperty(1, 5, db.getProperty("prop3", true));
      sch1.applyUpdates();
View Full Code Here

      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();
      // expect that the attribute value has changed because t1v1 above was not set, being the default
      Chronicle c = db.getChronicle("bt.schema1achro2", true);
      assertEquals("t1v1", c.getAttribute("prop1", true).get().toString());
View Full Code Here

      chro.applyUpdates();
      UpdatableSeries<Double> ser = db.getUpdatableSeries("bt.schema1achro.fou", true);
      ser.setValue(Workday.DOMAIN.time("2011-06-30"), 42.);
      ser.applyUpdates();
      // erase the series from the schema (should fail, of course)
      UpdatableSchema sch1 = schema.edit();
      sch1.deleteSeries(1);
      sch1.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, null, "D30150");
View Full Code Here

    try {
      Schema schema = db.getSchemas("schema1a").iterator().next();
      Series<Double> ser = db.getSeries("bt.schema1achro.fou", true);
      assertEquals(42., ser.getValue(Workday.DOMAIN.time("2011-06-30")));
      // renaming the series should be okay
      UpdatableSchema sch1 = schema.edit();
      //sch1.setSeriesName(1, "fooo"); next line should be equivalent
      sch1.setAttributeDefault(1, 1, "fooo");
      sch1.applyUpdates();
      ser = db.getSeries("bt.schema1achro.fooo", true);
      assertEquals(42., ser.getValue(Workday.DOMAIN.time("2011-06-30")));
View Full Code Here

    try {
      Schema schema = db.getSchemas("schema1a").iterator().next();
      Series<Double> ser = db.getSeries("bt.schema1achro.fooo", true);
      assertEquals(42., ser.getValue(Workday.DOMAIN.time("2011-06-30")));
      // changing the time domain should fail
      UpdatableSchema sch1 = schema.edit();
      sch1.setSeriesTimeDomain(1, DateTime.DOMAIN);
      sch1.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30105, D.D30149);
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.