@BeforeMethod
public void before() {
ODatabaseDocumentTx.setDefaultSerializer(serializer);
databaseDocument = new ODatabaseDocumentTx("memory:" + ODocumentSchemafullSerializationTest.class.getSimpleName()).create();
// databaseDocument.getMetadata().
OSchema schema = databaseDocument.getMetadata().getSchema();
address = schema.createClass("Address");
address.createProperty(NAME, OType.STRING);
address.createProperty(NUMBER, OType.INTEGER);
address.createProperty(CITY, OType.STRING);
simple = schema.createClass("Simple");
simple.createProperty(STRING_FIELD, OType.STRING);
simple.createProperty(INT_FIELD, OType.INTEGER);
simple.createProperty(SHORT_FIELD, OType.SHORT);
simple.createProperty(LONG_FIELD, OType.LONG);
simple.createProperty(FLOAT_NUMBER, OType.FLOAT);
simple.createProperty(DOUBLE_NUMBER, OType.DOUBLE);
simple.createProperty(BYTE_FIELD, OType.BYTE);
simple.createProperty(BOOLEAN_FIELD, OType.BOOLEAN);
simple.createProperty(DATE_FIELD, OType.DATETIME);
simple.createProperty(RECORDID_FIELD, OType.LINK);
simple.createProperty(EMBEDDED_FIELD, OType.EMBEDDED, address);
embSimp = schema.createClass("EmbeddedCollectionSimple");
embSimp.createProperty(LIST_BOOLEANS, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_BYTES, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_DATES, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_DOUBLES, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_FLOATS, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_INTEGERS, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_LONGS, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_SHORTS, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_STRINGS, OType.EMBEDDEDLIST);
embSimp.createProperty(LIST_MIXED, OType.EMBEDDEDLIST);
embMapSimple = schema.createClass("EmbeddedMapSimple");
embMapSimple.createProperty(MAP_BYTES, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_DATE, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_DOUBLE, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_FLOAT, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_INT, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_LONG, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_SHORT, OType.EMBEDDEDMAP);
embMapSimple.createProperty(MAP_STRING, OType.EMBEDDEDMAP);
OClass clazzEmbComp = schema.createClass("EmbeddedComplex");
clazzEmbComp.createProperty("addresses", OType.EMBEDDEDLIST, address);
clazzEmbComp.createProperty("uniqueAddresses", OType.EMBEDDEDSET, address);
clazzEmbComp.createProperty("addressByStreet", OType.EMBEDDEDMAP, address);
}