Package ch.agent.crnickl.api

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


      assertEquals("t1v2", chro.getAttribute("prop1", true).get().toString());
     
      UpdatableSchema schema3 = db.getUpdatableSchemas("schema3").iterator().next();
      schema3.addAttribute(1);
      schema3.eraseAttribute(1);
      schema3.applyUpdates();
      assertEquals(null, schema3.getAttributeDefinition("prop1", false));
      // value still here because it's the default value, which is not in the chronicle
      assertEquals("t1v2", chro.getAttribute("prop1", true).get().toString());
    } catch (Exception e) {
      fail(e.getMessage());
View Full Code Here


 
  public void test_440_delete_schema_in_use() {
    try {
      UpdatableSchema schema1 = db.getSchemas("schema1a").iterator().next().edit();
      schema1.destroy();
      schema1.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30140);
    }
  }
View Full Code Here

      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());
    } catch (Exception e) {
      fail(e.getMessage());
View Full Code Here

      s.addSeries(1);
      s.setSeriesName(1, db.getNamingPolicy().split(SERIES)[1]);
      s.setSeriesType(1, SERIES_TYPE);
      s.setSeriesTimeDomain(1, SERIES_DOMAIN);
      s.setSeriesSparsity(1, isSparse());
      s.applyUpdates();
      return s.resolve();
    default:
      throw new IllegalArgumentException(SCHEMA + ": " + schemas.size());
    }
  }
View Full Code Here

      schema1.addSeries(3);
      schema1.setSeriesName(3, "foo");
      schema1.setSeriesDescription(3, "fully foo");
      schema1.setSeriesTimeDomain(3, Workday.DOMAIN);
      schema1.setSeriesType(3, db.getValueType("numeric"));
      schema1.applyUpdates();
      assertEquals(Workday.DOMAIN, schema1.getSeriesDefinition(3, true).getTimeDomain());
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

  public void test_rename_schema1_schema1a() {
    try {
      UpdatableSchema schema1 = db.getSchemas("schema1").iterator().next().edit();
      schema1.setName("schema1a");
      schema1.applyUpdates();
      assertEquals(1, db.getSchemas("schema1a").size());
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

  }
 
  public void test_create_schema3_for_base_of_schema1a() {
    try {
      UpdatableSchema schema3 = db.createSchema("schema3", null);
      schema3.applyUpdates();
      UpdatableSchema schema1 = db.getSchemas("schema1a").iterator().next().edit();
      schema1.setBase(schema3);
      schema1.applyUpdates();
      assertEquals(schema3, schema1.getBase());
    } catch (Exception e) {
View Full Code Here

    try {
      UpdatableSchema schema3 = db.createSchema("schema3", null);
      schema3.applyUpdates();
      UpdatableSchema schema1 = db.getSchemas("schema1a").iterator().next().edit();
      schema1.setBase(schema3);
      schema1.applyUpdates();
      assertEquals(schema3, schema1.getBase());
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

 
  public void test_reset_base_of_schema1a() {
    try {
      UpdatableSchema schema1 = db.getSchemas("schema1a").iterator().next().edit();
      schema1.setBase(null);
      schema1.applyUpdates();
      assertEquals(null, schema1.getBase());
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

      schema4.eraseAttribute(1);
      assertEquals(true, schema4.getAttributeDefinition(1, true).isErasing());
      assertEquals("fou", s.getSeriesDefinition(1, true).getName());
      schema4.setAttributeProperty(1, db.getProperty("prop1", true));
      schema4.setAttributeDefault(1, "t1v1");
      schema4.applyUpdates();
      schema1 = db.getSchemas("schema1a").iterator().next().edit();
      schema1.setBase(schema4);
      schema1.applyUpdates();
      expectException();
    } catch (Exception e) {
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.