Search in sources :

Example 1 with ODocumentComparator

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

the class CRUDDocumentValidationTest method testNullComparison.

@Test
public void testNullComparison() {
    // given
    ODocument doc1 = new ODocument().field("testField", (Object) null);
    ODocument doc2 = new ODocument().field("testField", (Object) null);
    ODocumentComparator comparator = new ODocumentComparator(Collections.singletonList(new OPair<String, String>("testField", "asc")), new OBasicCommandContext());
    Assert.assertEquals(comparator.compare(doc1, doc2), 0);
}
Also used : OBasicCommandContext(com.orientechnologies.orient.core.command.OBasicCommandContext) OPair(com.orientechnologies.common.util.OPair) ODocumentComparator(com.orientechnologies.orient.core.record.impl.ODocumentComparator) ODocument(com.orientechnologies.orient.core.record.impl.ODocument) Test(org.testng.annotations.Test)

Aggregations

OPair (com.orientechnologies.common.util.OPair)1 OBasicCommandContext (com.orientechnologies.orient.core.command.OBasicCommandContext)1 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)1 ODocumentComparator (com.orientechnologies.orient.core.record.impl.ODocumentComparator)1 Test (org.testng.annotations.Test)1