final OProperty propOne = oClass.getProperty("prop1");
propOne.createIndex(OClass.INDEX_TYPE.UNIQUE);
final Collection<OIndex<?>> indexes = propOne.getIndexes();
OIndexDefinition indexDefinition = null;
for (final OIndex<?> index : indexes) {
if (index.getName().equals("PropertyIndexTestClass.prop1")) {
indexDefinition = index.getDefinition();
break;
}
}
Assert.assertNotNull(indexDefinition);
Assert.assertEquals(indexDefinition.getParamCount(), 1);
Assert.assertEquals(indexDefinition.getFields().size(), 1);
Assert.assertTrue(indexDefinition.getFields().contains("prop1"));
Assert.assertEquals(indexDefinition.getTypes().length, 1);
Assert.assertEquals(indexDefinition.getTypes()[0], OType.STRING);
schema.save();
}