Package ch.agent.crnickl.api

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


  }

  public void test_140_create_schema_failure_same_attribute_nr() {
    try {
      UpdatableSchema schema = db.createSchema("schema1", null);
      schema.addAttribute(1);
      schema.setAttributeProperty(1, db.getProperty("prop1", true));
      schema.setAttributeDefault(1, "t1v1");
      schema.addAttribute(1);
      schema.applyUpdates();
      expectException();
View Full Code Here


    try {
      UpdatableSchema schema = db.createSchema("schema1", null);
      schema.addAttribute(1);
      schema.setAttributeProperty(1, db.getProperty("prop1", true));
      schema.setAttributeDefault(1, "t1v1");
      schema.addAttribute(1);
      schema.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30127);
    }
View Full Code Here

    try {
      UpdatableSchema schema = db.createSchema("schema1", null);
      Collection<Schema> ss = db.getSchemas("schema1");
      assertEquals(0,  ss.size());

      schema.addAttribute(1);
      schema.setAttributeProperty(1, db.getProperty("prop1", true));
      schema.setAttributeDefault(1, "t1v1");
      schema.deleteAttribute(1);
      schema.addAttribute(1);
      schema.applyUpdates();
View Full Code Here

      schema.addAttribute(1);
      schema.setAttributeProperty(1, db.getProperty("prop1", true));
      schema.setAttributeDefault(1, "t1v1");
      schema.deleteAttribute(1);
      schema.addAttribute(1);
      schema.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30105, D.D30111);
    }
View Full Code Here

  }
 
  public void test_160_create_schema_failure_attribute_property_duplicate() {
    try {
      UpdatableSchema schema = db.createSchema("schema1", null);
      schema.addAttribute(1);
      schema.setAttributeProperty(1, db.getProperty("prop1", true));
      schema.setAttributeDefault(1, "t1v1");
      schema.addAttribute(2);
      schema.setAttributeProperty(2, db.getProperty("prop1", true));
      schema.setAttributeDefault(2, "t1v1");
View Full Code Here

    try {
      UpdatableSchema schema = db.createSchema("schema1", null);
      schema.addAttribute(1);
      schema.setAttributeProperty(1, db.getProperty("prop1", true));
      schema.setAttributeDefault(1, "t1v1");
      schema.addAttribute(2);
      schema.setAttributeProperty(2, db.getProperty("prop1", true));
      schema.setAttributeDefault(2, "t1v1");
      schema.applyUpdates();
      schema.resolve();
      expectException();
View Full Code Here

  }

  public void test_220_create_schema1_and_schema2() {
    try {
      UpdatableSchema schema1 = db.createSchema("schema1", null);
      schema1.addAttribute(1);
      schema1.setAttributeProperty(1, db.getProperty("prop1", true));
      schema1.setAttributeDefault(1, "t1v1");
      schema1.applyUpdates();
      UpdatableSchema schema2 = db.createSchema("schema2", "schema1");
      schema2.addAttribute(1);
View Full Code Here

      schema1.addAttribute(1);
      schema1.setAttributeProperty(1, db.getProperty("prop1", true));
      schema1.setAttributeDefault(1, "t1v1");
      schema1.applyUpdates();
      UpdatableSchema schema2 = db.createSchema("schema2", "schema1");
      schema2.addAttribute(1);
      schema2.setAttributeProperty(1, db.getProperty("prop1", true));
      schema2.setAttributeDefault(1, "t1v2");
      schema2.applyUpdates();
    } catch (Exception e) {
      fail(e.getMessage());
View Full Code Here

      schema1.addSeries(1);
      schema1.setSeriesName(1, "foo");
      schema1.setSeriesDescription(1, "foo series");
      schema1.setSeriesTimeDomain(1, Workday.DOMAIN);
      schema1.setSeriesType(1, db.getValueType("numeric"));
      schema1.addAttribute(1, 6);
      schema1.setAttributeProperty(1, 6, db.getProperty("prop2", true));
      schema1.setAttributeDefault(1, 6, "t2v2");
      schema1.applyUpdates();
      assertEquals("foo", schema1.getSeriesDefinition(1, true).getName());
      assertEquals("foo series", schema1.getSeriesDefinition(1, true).getDescription());
View Full Code Here

  }
 
  public void test_280_cannot_set_base_to_schema_in_construction() {
    try {
      UpdatableSchema schema4 = db.createSchema("schema4", null);
      schema4.addAttribute(1);
      schema4.setAttributeProperty(1, db.getProperty("prop1", true));
      schema4.setAttributeDefault(1, "t1v1");
//      schema4.applyUpdates();
      UpdatableSchema schema1 = db.getSchemas("schema1a").iterator().next().edit();
      schema1.setBase(schema4);
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.