Search in sources :

Example 31 with OBlob

use of com.orientechnologies.orient.core.record.impl.OBlob in project orientdb by orientechnologies.

the class CRUDObjectPhysicalTest method testOrphanDelete.

@Test(dependsOnMethods = "testObjectDelete")
public void testOrphanDelete() {
    Media media = new Media();
    OBlob testRecord = new ORecordBytes("This is a test".getBytes());
    media.setContent(testRecord);
    media = database.save(media);
    Assert.assertEquals(new String(media.getContent().toStream()), "This is a test");
    // try to delete
    database.delete(media);
}
Also used : OBlob(com.orientechnologies.orient.core.record.impl.OBlob) ORecordBytes(com.orientechnologies.orient.core.record.impl.ORecordBytes) Test(org.testng.annotations.Test)

Example 32 with OBlob

use of com.orientechnologies.orient.core.record.impl.OBlob in project orientdb by orientechnologies.

the class CRUDObjectPhysicalTestSchemaFull method testObjectDelete.

@Test(dependsOnMethods = "testAddingORecordBytesAfterParentCreation")
public void testObjectDelete() {
    Media media = new Media();
    OBlob testRecord = new ORecordBytes("This is a test".getBytes());
    media.setContent(testRecord);
    media = database.save(media);
    Assert.assertEquals(new String(media.getContent().toStream()), "This is a test");
    // try to delete
    database.delete(media);
}
Also used : OBlob(com.orientechnologies.orient.core.record.impl.OBlob) ORecordBytes(com.orientechnologies.orient.core.record.impl.ORecordBytes) Test(org.testng.annotations.Test)

Aggregations

OBlob (com.orientechnologies.orient.core.record.impl.OBlob)32 ORecordBytes (com.orientechnologies.orient.core.record.impl.ORecordBytes)20 Test (org.testng.annotations.Test)19 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)12 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)8 ORID (com.orientechnologies.orient.core.id.ORID)4 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)4 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)3 IOException (java.io.IOException)3 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)2 ORecordId (com.orientechnologies.orient.core.id.ORecordId)2 OClass (com.orientechnologies.orient.core.metadata.schema.OClass)2 BufferedInputStream (java.io.BufferedInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 File (java.io.File)2 FileInputStream (java.io.FileInputStream)2 OAfterDeserialization (com.orientechnologies.orient.core.annotation.OAfterDeserialization)1 OBeforeSerialization (com.orientechnologies.orient.core.annotation.OBeforeSerialization)1 ODatabaseDocument (com.orientechnologies.orient.core.db.document.ODatabaseDocument)1 ORecordLazyList (com.orientechnologies.orient.core.db.record.ORecordLazyList)1