Package ch.agent.crnickl.api

Examples of ch.agent.crnickl.api.UpdatableSchema


    }
  }
 
  public void test_090_create_schema_schema1f() {
    try {
      UpdatableSchema schema = db.createSchema("schema1f", null);
      schema.addSeries(1);
      schema.setSeriesName(1, "x");
      schema.setSeriesType(1, "numeric");
      schema.setSeriesTimeDomain(1, Day.DOMAIN);
      schema.applyUpdates();
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here


  }
 
  public void test_100_create_existing_schema_fails() {
    try {
      // adding an incomplete, non-erasing series attribute should fail
      UpdatableSchema schema = db.createSchema("schema1f", null);
      schema.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30108);
    }
  }
View Full Code Here

  }
 
  public void test_110_add_incomplete_series_attribute() {
    try {
      // adding an incomplete, non-erasing series attribute should fail
      UpdatableSchema schema = db.getUpdatableSchemas("schema1f").iterator().next();
      schema.addAttribute(1, 4);
      schema.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30105, D.D30113);
    }
  }
View Full Code Here

  }
 
  public void test_120_add_incomplete_series_attribute_value_required() {
    try {
      // adding an incomplete, non-erasing series attribute should fail
      UpdatableSchema schema = db.getUpdatableSchemas("schema1f").iterator().next();
      schema.addAttribute(1, 4);
      schema.setAttributeProperty(1, 4, db.getProperty("prop2", true));
      // default value is not set, but null is not okay for prop2
      schema.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30105, D.D30113);
    }
  }
View Full Code Here

    }
  }
 
  public void test_130_add_series_attribute() {
    try {
      UpdatableSchema schema = db.getUpdatableSchemas("schema1f").iterator().next();
      schema.addAttribute(1, 4);
      schema.setAttributeProperty(1, 4, db.getProperty("prop2", true));
      schema.setAttributeDefault(1, 4, "t2v2");
      schema.applyUpdates();
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    }
  }

  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();
    } catch (Exception e) {
      assertException(e, D.D30127);
    }
  }
View Full Code Here

    }
  }
 
  public void test_150_create_schema_failure_attribute_incomplete_after_edit() {
    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();
      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");
      schema.applyUpdates();
      schema.resolve();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D30151, D.D30130);
    }
  }
View Full Code Here

    }
  }
 
  public void test_170_create_empty_schema() {
    try {
      UpdatableSchema schema = db.createSchema("schema5", null);
      schema.applyUpdates();
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

  }
 
  public void test_180_create_chronicle_with_updatable_schema_fails() {
    try {
      // creating a chronicle with an updatable schema should be impossible
      UpdatableSchema schema = db.getUpdatableSchemas("schema5").iterator().next();
      UpdatableChronicle chro = db.getTopChronicle().edit().createChronicle("schema5chro", false, "test chronicle", null, schema);
      chro.applyUpdates();
      expectException();
    } catch (Exception e) {
      assertException(e, D.D40104);
View Full Code Here

TOP

Related Classes of ch.agent.crnickl.api.UpdatableSchema

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.