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

Examples of com.orientechnologies.orient.core.db.record.ODatabaseFlat.open()


  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
View Full Code Here


  }

  @Test(expectedExceptions = OTransactionException.class)
  public void testTransactionPreListenerRollback() throws IOException {
    ODatabaseFlat db = new ODatabaseFlat(url);
    db.open("admin", "admin");

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

    db.registerListener(new ODatabaseListener() {
View Full Code Here

    super(url);
  }

  public void testDictionaryCreate() throws IOException {
    ODatabaseFlat database = new ODatabaseFlat(url);
    database.open("admin", "admin");
    ORecordFlat record = database.newInstance();

    database.getDictionary().put("key1", record.value("Dictionary test!"));

    database.close();
View Full Code Here

  }

  @Test(dependsOnMethods = "testDictionaryCreate")
  public void testDictionaryLookup() throws IOException {
    ODatabaseFlat database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    Assert.assertNotNull(database.getDictionary().get("key1"));
    Assert.assertTrue(((ORecordFlat) database.getDictionary().get("key1")).value().equals("Dictionary test!"));

    database.close();
View Full Code Here

  }

  @Test(dependsOnMethods = "testDictionaryLookup")
  public void testDictionaryUpdate() throws IOException {
    ODatabaseFlat database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    final long originalSize = database.getDictionary().size();

    database.getDictionary().put("key1", database.newInstance().value("Text changed"));
View Full Code Here

    final long originalSize = database.getDictionary().size();

    database.getDictionary().put("key1", database.newInstance().value("Text changed"));

    database.close();
    database.open("admin", "admin");

    Assert.assertEquals(((ORecordFlat) database.getDictionary().get("key1")).value(), "Text changed");
    Assert.assertEquals(database.getDictionary().size(), originalSize);

    database.close();
View Full Code Here

  }

  @Test(dependsOnMethods = "testDictionaryUpdate")
  public void testDictionaryDelete() throws IOException {
    ODatabaseFlat database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    final long originalSize = database.getDictionary().size();
    Assert.assertNotNull(database.getDictionary().remove("key1"));

    database.close();
View Full Code Here

    final long originalSize = database.getDictionary().size();
    Assert.assertNotNull(database.getDictionary().remove("key1"));

    database.close();
    database.open("admin", "admin");

    Assert.assertEquals(database.getDictionary().size(), originalSize - 1);

    database.close();
  }
View Full Code Here

  }

  @Test(dependsOnMethods = "testDictionaryDelete")
  public void testDictionaryMassiveCreate() throws IOException {
    ODatabaseFlat database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    final long originalSize = database.getDictionary().size();

    // ASSURE TO STORE THE PAGE-SIZE + 3 FORCING THE CREATION OF LEFT AND RIGHT
    final int total = 1000;
View Full Code Here

  }

  @Test(dependsOnMethods = "testDictionaryMassiveCreate")
  public void testDictionaryInTx() throws IOException {
    ODatabaseFlat database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    database.begin();
    database.getDictionary().put("tx-key", database.newInstance().value("tx-test-dictionary"));
    database.commit();
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.