use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testGetClassIndex.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testGetClassIndex() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final OIndex<?> result = indexManager.getClassIndex(CLASS_NAME, "propertyone");
assertNotNull(result);
assertEquals(result.getName(), "propertyone");
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testGetClassInvolvedIndexesTwoPropertiesArrayParams.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testGetClassInvolvedIndexesTwoPropertiesArrayParams() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final Set<OIndex<?>> result = indexManager.getClassInvolvedIndexes(CLASS_NAME, "fTwo", "fOne");
assertEquals(result.size(), 2);
assertTrue(containsIndex(result, "compositeone"));
assertTrue(containsIndex(result, "compositetwo"));
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testDropAllClassIndexes.
@Test
public void testDropAllClassIndexes() {
final OClass oClass = database.getMetadata().getSchema().createClass("indexManagerTestClassTwo");
oClass.createProperty("fOne", OType.INTEGER);
final OIndexManager indexManager = database.getMetadata().getIndexManager();
indexManager.createIndex("twoclassproperty", OClass.INDEX_TYPE.UNIQUE.toString(), new OPropertyIndexDefinition("indexManagerTestClassTwo", "fOne", OType.INTEGER), new int[] { database.getClusterIdByName("indexManagerTestClassTwo") }, null, null);
assertFalse(indexManager.getClassIndexes("indexManagerTestClassTwo").isEmpty());
indexManager.dropIndex("twoclassproperty");
assertTrue(indexManager.getClassIndexes("indexManagerTestClassTwo").isEmpty());
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testGetClassInvolvedIndexesOnePropertyArrayParams.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testGetClassInvolvedIndexesOnePropertyArrayParams() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final Set<OIndex<?>> result = indexManager.getClassInvolvedIndexes(CLASS_NAME, "fOne");
assertEquals(result.size(), 3);
assertTrue(containsIndex(result, "propertyone"));
assertTrue(containsIndex(result, "compositeone"));
assertTrue(containsIndex(result, "compositetwo"));
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testAreIndexedDoesNotContainPropertyArrayParams.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testAreIndexedDoesNotContainPropertyArrayParams() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final boolean result = indexManager.areIndexed(CLASS_NAME, "fSix");
assertFalse(result);
}
Aggregations