Package com.orientechnologies.orient.core.db.document

Examples of com.orientechnologies.orient.core.db.document.ODatabaseDocument.drop()


      assertEquals(extr.fields(), document.fields());
      assertEquals(((Set<?>) extr.field("linkSet")).size(), ((Set<?>) document.field("linkSet")).size());
      assertTrue(((Set<?>) extr.field("linkSet")).containsAll((Set<?>) document.field("linkSet")));
      assertEquals(extr.field("linkList"), document.field("linkList"));
    } finally {
      db.drop();
    }

  }

  @Test
View Full Code Here


      byte[] res = serializer.toStream(document, false);
      ODocument extr = (ODocument) serializer.fromStream(res, new ODocument(), new String[] {});
      assertEquals(extr.fields(), document.fields());
      assertEquals(extr.field("map"), document.field("map"));
    } finally {
      db.drop();
    }
  }

  @Test
  public void testDocumentWithClassName() {
View Full Code Here

      ODocument extr = (ODocument) serializer.fromStream(res, new ODocument(), new String[] {});
      assertEquals(extr.getClassName(), document.getClassName());
      assertEquals(extr.fields(), document.fields());
      assertEquals(extr.field("test"), document.field("test"));
    } finally {
      db.drop();
    }
  }

  public static class Custom implements OSerializableStream {
    byte[] bytes = new byte[10];
View Full Code Here


  public void testDbDeleteNoCredential() throws IOException {
    ODatabaseDocument db = new ODatabaseDocumentTx(url);
    try {
      db.drop();
      Assert.fail("Should have thrown ODatabaseException because trying to delete a not opened");
    } catch (ODatabaseException e) {
      Assert.assertTrue(e.getMessage().equals("Database '" + url + "' is closed"));
    } catch (OStorageException e) {
      Assert.assertTrue(e.getMessage().startsWith("Cannot delete the remote storage:"));
View Full Code Here

    if (db.exists()) {
      if (db.isClosed())
        db.open("admin", "admin");

      db.drop();
      db.create();
    }

    final OClass indexedClass = db.getMetadata().getSchema().createClass("IndexedClass");
    indexedClass.createProperty("value", OType.STRING);
View Full Code Here

    final ODocument document = new ODocument("IndexedClass");
    document.field("value", "value");
    document.save();

    db.drop();
  }
}
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.