Package com.orientechnologies.orient.core.db.record

Examples of com.orientechnologies.orient.core.db.record.ODatabaseFlat


  public SchemaTest(String iURL) {
    url = iURL;
  }

  public void createSchema() throws IOException {
    database = new ODatabaseFlat(url);
    if (TestUtils.existsDatabase(database))
      database.open("admin", "admin");
    else
      database.create();
View Full Code Here


    database.close();
  }

  @Test(dependsOnMethods = "createSchema")
  public void checkSchema() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    assert schema != null;
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = "checkSchema")
  public void checkSchemaApi() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    try {
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = "checkSchemaApi")
  public void checkClusters() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    for (OClass cls : database.getMetadata().getSchema().getClasses()) {
      assert database.getClusterNameById(cls.getDefaultClusterId()) != null;
    }
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = "createSchema")
  public void checkDatabaseSize() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    Assert.assertTrue(database.getStorage().getSize() > 0);

    database.close();
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = "createSchema")
  public void checkTotalRecords() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    Assert.assertTrue(database.getStorage().countRecords() > 0);

    database.close();
View Full Code Here

    database.close();
  }

  @Test(expectedExceptions = OValidationException.class)
  public void checkErrorOnUserNoPasswd() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    database.getMetadata().getSecurity().createUser("error", null, null);

    database.close();
View Full Code Here

    database.close();
  }

  @Test
  public void testMultiThreadSchemaCreation() throws InterruptedException {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    Thread thread = new Thread(new Runnable() {

      public void run() {
View Full Code Here

  private ODatabaseFlat  database;
  private ORecordFlat    record;

  @Parameters(value = "url")
  public DictionaryTest(String iURL) {
    database = new ODatabaseFlat(iURL);
    record = database.newInstance();
  }
View Full Code Here

    url = iURL;
  }

  @Test
  public void testTransactionAtomic() throws IOException {
    ODatabaseFlat db1 = new ODatabaseFlat(url);
    db1.open("admin", "admin");

    ODatabaseFlat db2 = new ODatabaseFlat(url);
    db2.open("admin", "admin");

    ORecordFlat record1 = new ORecordFlat(db1);
    record1.value("This is the first version").save();

    // RE-READ THE RECORD
    record1.reload();
    ORecordFlat record2 = db2.load(record1.getIdentity());

    record2.value("This is the second version").save();
    record2.value("This is the third version").save();

    record1.reload(null, true);

    Assert.assertEquals(record1.value(), "This is the third version");

    db1.close();
    db2.close();
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.db.record.ODatabaseFlat

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.