Search in sources :

Example 1 with TestEnum

use of org.apache.ignite.internal.processors.cache.CacheEnumOperationsAbstractTest.TestEnum in project ignite by apache.

the class BinaryArraySelfTest method doTestBoxedPrimitivesArrays.

/**
 */
private void doTestBoxedPrimitivesArrays(CacheAdapter<Object, Object> c) {
    Object[] data = new Object[] { new Byte[] { 1, 2, 3 }, new Short[] { 1, 2, 3 }, new Integer[] { 1, 2, 3 }, new Long[] { 1L, 2L, 3L }, new Float[] { 1f, 2f, 3f }, new Double[] { 1d, 2d, 3d }, new Character[] { 'a', 'b', 'c' }, new Boolean[] { true, false }, new TestEnum[] { VAL1, VAL2, VAL3 } };
    for (Object item : data) {
        c.put(1, item);
        Object item0 = c.get(1);
        assertTrue(c.replace(1, item, item));
        assertTrue(c.remove(1));
        if (useBinaryArrays)
            assertEquals(item.getClass(), item0.getClass());
        assertTrue(Arrays.equals((Object[]) item, (Object[]) item0));
        c.put(item, 1);
        assertTrue(c.containsKey(item));
        assertEquals(1, c.get(item));
        assertTrue(c.replace(item, 1, 2));
        assertTrue(c.remove(item));
    }
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BinaryObject(org.apache.ignite.binary.BinaryObject) TestEnum(org.apache.ignite.internal.processors.cache.CacheEnumOperationsAbstractTest.TestEnum)

Aggregations

AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 BinaryObject (org.apache.ignite.binary.BinaryObject)1 TestEnum (org.apache.ignite.internal.processors.cache.CacheEnumOperationsAbstractTest.TestEnum)1