Search in sources :

Example 96 with ODatabaseDocumentTx

use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.

the class ODocumentTrackingNestedCollectionsTest method before.

@Before
public void before() {
    db = new ODatabaseDocumentTx("memory:" + ODocumentTrackingNestedCollectionsTest.class.getSimpleName());
    db.create();
}
Also used : ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) Before(org.junit.Before)

Example 97 with ODatabaseDocumentTx

use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.

the class DocumentTest method before.

@BeforeClass
public void before() {
    db = new ODatabaseDocumentTx("memory:" + DocumentTest.class.getSimpleName());
    db.create();
}
Also used : ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) BeforeClass(org.testng.annotations.BeforeClass)

Example 98 with ODatabaseDocumentTx

use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.

the class OSimpleKeyIndexDefinitionTest method testReload.

@Test
public void testReload() {
    final ODatabaseDocumentTx databaseDocumentTx = new ODatabaseDocumentTx("memory:osimplekeyindexdefinitiontest");
    databaseDocumentTx.create();
    final ODocument storeDocument = simpleKeyIndexDefinition.toStream();
    storeDocument.save();
    final ODocument loadDocument = databaseDocumentTx.load(storeDocument.getIdentity());
    final OSimpleKeyIndexDefinition loadedKeyIndexDefinition = new OSimpleKeyIndexDefinition();
    loadedKeyIndexDefinition.fromStream(loadDocument);
    databaseDocumentTx.drop();
    Assert.assertEquals(loadedKeyIndexDefinition, simpleKeyIndexDefinition);
}
Also used : ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) ODocument(com.orientechnologies.orient.core.record.impl.ODocument) Test(org.testng.annotations.Test)

Example 99 with ODatabaseDocumentTx

use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.

the class TxNonUniqueIndexWithCollationTest method before.

@Before
public void before() {
    db = new ODatabaseDocumentTx("memory:TxNonUniqueIndexWithCollationTest");
    db.create();
    db.getMetadata().getSchema().createClass("user").createProperty("name", OType.STRING).setCollate("ci").createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
    db.newInstance("user").field("name", "abc").save();
    db.newInstance("user").field("name", "aby").save();
    db.newInstance("user").field("name", "aby").save();
    db.newInstance("user").field("name", "abz").save();
}
Also used : ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) Before(org.junit.Before)

Example 100 with ODatabaseDocumentTx

use of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx in project orientdb by orientechnologies.

the class TxUniqueIndexWithCollationTest method before.

@Before
public void before() {
    db = new ODatabaseDocumentTx("memory:TxUniqueIndexWithCollationTest");
    db.create();
    db.getMetadata().getSchema().createClass("user").createProperty("name", OType.STRING).setCollate("ci").createIndex(OClass.INDEX_TYPE.UNIQUE);
    db.newInstance("user").field("name", "abc").save();
    db.newInstance("user").field("name", "aby").save();
    db.newInstance("user").field("name", "abz").save();
}
Also used : ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) Before(org.junit.Before)

Aggregations

ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)590 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)257 Test (org.testng.annotations.Test)182 OClass (com.orientechnologies.orient.core.metadata.schema.OClass)120 ODatabaseDocument (com.orientechnologies.orient.core.db.document.ODatabaseDocument)81 Test (org.junit.Test)79 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)61 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)47 OSchema (com.orientechnologies.orient.core.metadata.schema.OSchema)46 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)41 ORID (com.orientechnologies.orient.core.id.ORID)39 ORecordId (com.orientechnologies.orient.core.id.ORecordId)34 Before (org.junit.Before)34 File (java.io.File)33 OProperty (com.orientechnologies.orient.core.metadata.schema.OProperty)25 ArrayList (java.util.ArrayList)25 BeforeClass (org.testng.annotations.BeforeClass)23 BeforeMethod (org.testng.annotations.BeforeMethod)23 OStorage (com.orientechnologies.orient.core.storage.OStorage)21 List (java.util.List)20