Package com.orientechnologies.orient.object.db

Examples of com.orientechnologies.orient.object.db.OObjectDatabaseTx


    }
  }

  @Test
  public void queryProjectionObjectLevel() {
    OObjectDatabaseTx db = new OObjectDatabaseTx(url);
    db.open("admin", "admin");

    List<ODocument> result = db.getUnderlying().query(
        new OSQLSynchQuery<ODocument>(" select nick, followings, followers from Profile "));

    Assert.assertTrue(result.size() != 0);

    for (ODocument d : result) {
      Assert.assertTrue(d.fieldNames().length <= 3);
      Assert.assertNull(d.getClassName());
      Assert.assertEquals(ORecordInternal.getRecordType(d), ODocument.RECORD_TYPE);
    }

    db.close();
  }
View Full Code Here


      ODatabaseHelper.dropDatabase(db, "server", getStorageType());
      ODatabaseHelper.createDatabase(db, url, getStorageType());
      ODatabaseHelper.dropDatabase(db, "server", getStorageType());

      database = new OObjectDatabaseTx(url);
      database.setProperty("security", Boolean.FALSE);

      ODatabaseHelper.dropDatabase(database, "server", getStorageType());
      ODatabaseHelper.createDatabase(database, url, getStorageType());
      ODatabaseHelper.dropDatabase(database, "server", getStorageType());
View Full Code Here

  }

  @Test(dependsOnMethods = { "testDbCreationNoSecurity" })
  public void testDbCreationDefault() throws IOException {
    if (ODatabaseHelper.existsDatabase(url))
      ODatabaseHelper.dropDatabase(new OObjectDatabaseTx(url), url, getStorageType());

    ODatabaseHelper.createDatabase(new OObjectDatabaseTx(url), url, getStorageType());
  }
View Full Code Here

    Assert.assertTrue(ODatabaseHelper.existsDatabase(new ODatabaseDocumentTx(url), getStorageType()));
  }

  @Test(dependsOnMethods = { "testDbExists" })
  public void testDbOpen() {
    database = new OObjectDatabaseTx(url);
    database.open("admin", "admin");
    Assert.assertNotNull(database.getName());
    database.close();
  }
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = { "testDbOpen" })
  public void testDbOpenWithLastAsSlash() {
    database = new OObjectDatabaseTx(url + "/");
    database.open("admin", "admin");
    database.close();
  }
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = { "testDbOpenWithLastAsSlash" })
  public void testDbOpenWithBackSlash() {
    database = new OObjectDatabaseTx(url.replace('/', '\\'));
    database.open("admin", "admin");
    database.close();
  }
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = { "testDbOpenWithBackSlash" })
  public void testChangeLocale() throws IOException {
    database = new OObjectDatabaseTx(url);
    database.open("admin", "admin");
    database.getStorage().getConfiguration().setLocaleLanguage(Locale.ENGLISH.getLanguage());
    database.getStorage().getConfiguration().setLocaleCountry(Locale.ENGLISH.getCountry());
    database.getStorage().getConfiguration().update();
    database.close();
View Full Code Here

    database.close();
  }

  @Test(dependsOnMethods = { "testChangeLocale" })
  public void testRoles() throws IOException {
    database = new OObjectDatabaseTx(url);
    database.open("admin", "admin");
    database.query(new OSQLSynchQuery<ORole>("select from ORole where name = 'admin'"));
    database.close();
  }
View Full Code Here

  public DbClosedTest(@Optional String url) {
    super(url);
  }

  public void testDoubleDb() {
    OObjectDatabaseTx db = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    // now I am getting another db instance
    OObjectDatabaseTx dbAnother = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    dbAnother.close();

    db.close();
  }
View Full Code Here

    db.close();
  }

  public void testDoubleDbWindowsPath() {
    OObjectDatabaseTx db = OObjectDatabasePool.global().acquire(url.replace('/', '\\'), "admin", "admin");

    // now I am getting another db instance
    OObjectDatabaseTx dbAnother = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    dbAnother.close();

    db.close();
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.object.db.OObjectDatabaseTx

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.