Search in sources :

Example 1 with ONeOperator

use of com.orientechnologies.orient.core.sql.parser.ONeOperator in project orientdb by orientechnologies.

the class ONeOperatorTest method test.

@Test
public void test() {
    ONeOperator op = new ONeOperator(-1);
    Assert.assertTrue(op.execute(null, 1));
    Assert.assertTrue(op.execute(1, null));
    Assert.assertTrue(op.execute(null, null));
    Assert.assertFalse(op.execute(1, 1));
    Assert.assertTrue(op.execute(1, 0));
    Assert.assertTrue(op.execute(0, 1));
    Assert.assertTrue(op.execute("aaa", "zzz"));
    Assert.assertTrue(op.execute("zzz", "aaa"));
    Assert.assertFalse(op.execute("aaa", "aaa"));
    Assert.assertTrue(op.execute(1, 1.1));
    Assert.assertTrue(op.execute(1.1, 1));
    Assert.assertFalse(op.execute(BigDecimal.ONE, 1));
    Assert.assertFalse(op.execute(1, BigDecimal.ONE));
    Assert.assertTrue(op.execute(1.1, BigDecimal.ONE));
    Assert.assertTrue(op.execute(2, BigDecimal.ONE));
    Assert.assertTrue(op.execute(BigDecimal.ONE, 0.999999));
    Assert.assertTrue(op.execute(BigDecimal.ONE, 0));
    Assert.assertTrue(op.execute(BigDecimal.ONE, 2));
    Assert.assertTrue(op.execute(BigDecimal.ONE, 1.0001));
    Assert.assertFalse(op.execute(new ORecordId(1, 10), new ORecordId((short) 1, 10)));
    Assert.assertTrue(op.execute(new ORecordId(1, 10), new ORecordId((short) 1, 20)));
    Assert.assertTrue(op.execute(new Object(), new Object()));
}
Also used : ONeOperator(com.orientechnologies.orient.core.sql.parser.ONeOperator) ORecordId(com.orientechnologies.orient.core.id.ORecordId) Test(org.testng.annotations.Test)

Aggregations

ORecordId (com.orientechnologies.orient.core.id.ORecordId)1 ONeOperator (com.orientechnologies.orient.core.sql.parser.ONeOperator)1 Test (org.testng.annotations.Test)1