Search in sources :

Example 1 with IntegerIndexKey

use of org.apache.ignite.internal.cache.query.index.sorted.keys.IntegerIndexKey in project ignite by apache.

the class InlineIndexKeyTypeRegistryTest method testObjectCheck.

/**
 */
@Test
public void testObjectCheck() {
    InlineIndexKeyType t = InlineIndexKeyTypeRegistry.get(new IntegerIndexKey(3), IndexKeyTypes.JAVA_OBJECT, pojoArrayKeyTypeSettings);
    assertEquals(IndexKeyTypes.INT, t.type());
    t = InlineIndexKeyTypeRegistry.get(new PlainJavaObjectIndexKey(new BinaryObjectImpl(), null), IndexKeyTypes.JAVA_OBJECT, pojoArrayKeyTypeSettings);
    assertEquals(IndexKeyTypes.JAVA_OBJECT, t.type());
    t = InlineIndexKeyTypeRegistry.get(new PlainJavaObjectIndexKey(new BinaryObjectImpl(), null), IndexKeyTypes.INT, pojoArrayKeyTypeSettings);
    assertEquals(IndexKeyTypes.JAVA_OBJECT, t.type());
    t = InlineIndexKeyTypeRegistry.get(new IntegerIndexKey(3), IndexKeyTypes.JAVA_OBJECT, pojoHashKeyTypeSettings);
    assertEquals(IndexKeyTypes.INT, t.type());
}
Also used : PlainJavaObjectIndexKey(org.apache.ignite.internal.cache.query.index.sorted.keys.PlainJavaObjectIndexKey) IntegerIndexKey(org.apache.ignite.internal.cache.query.index.sorted.keys.IntegerIndexKey) BinaryObjectImpl(org.apache.ignite.internal.binary.BinaryObjectImpl) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 2 with IntegerIndexKey

use of org.apache.ignite.internal.cache.query.index.sorted.keys.IntegerIndexKey in project ignite by apache.

the class InlineIndexKeyTypeRegistryTest method testMismatchType.

/**
 */
@Test
public void testMismatchType() {
    InlineIndexKeyType t = InlineIndexKeyTypeRegistry.get(new IntegerIndexKey(3), 11, pojoArrayKeyTypeSettings);
    assertEquals(IndexKeyTypes.INT, t.type());
}
Also used : IntegerIndexKey(org.apache.ignite.internal.cache.query.index.sorted.keys.IntegerIndexKey) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

IntegerIndexKey (org.apache.ignite.internal.cache.query.index.sorted.keys.IntegerIndexKey)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 Test (org.junit.Test)2 BinaryObjectImpl (org.apache.ignite.internal.binary.BinaryObjectImpl)1 PlainJavaObjectIndexKey (org.apache.ignite.internal.cache.query.index.sorted.keys.PlainJavaObjectIndexKey)1