Search in sources :

Example 1 with GridCacheUtilityKey

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

the class ClusterReadOnlyModeSelfTest method testIgniteUtilityCacheAvailableForUpdatesOnReadOnlyCluster.

/**
 */
@Test
public void testIgniteUtilityCacheAvailableForUpdatesOnReadOnlyCluster() throws Exception {
    IgniteEx grid = startGrid(0);
    grid.cluster().state(ACTIVE_READ_ONLY);
    checkClusterInReadOnlyMode(true, grid);
    GridCacheUtilityKey<?> key = new GridCacheUtilityKey() {

        @Override
        protected boolean equalsx(GridCacheUtilityKey key) {
            return false;
        }

        @Override
        public int hashCode() {
            return 0;
        }
    };
    HashSet<String> sysTypes = GridTestUtils.getFieldValue(grid.context().marshallerContext(), "sysTypesSet");
    sysTypes.add(key.getClass().getName());
    grid.utilityCache().put(key, "test");
    assertEquals("test", grid.utilityCache().get(key));
}
Also used : GridCacheUtilityKey(org.apache.ignite.internal.processors.cache.GridCacheUtilityKey) IgniteEx(org.apache.ignite.internal.IgniteEx) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)1 GridCacheUtilityKey (org.apache.ignite.internal.processors.cache.GridCacheUtilityKey)1 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)1 Test (org.junit.Test)1