/** @throws Exception If failed. */ @Test public void testGetErrorLocal() throws Exception { checkGetError(false, LOCAL); }
/** * @param nearEnabled Near cache flag. * @param cacheMode Cache mode. * @throws Exception If failed. */ private void checkGetError(boolean nearEnabled, CacheMode cacheMode) throws Exception { this.nearEnabled = nearEnabled; this.cacheMode = cacheMode; startGridsMultiThreaded(3); try { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { grid(0).cache(DEFAULT_CACHE_NAME).get(nearKey()); return null; } }, CacheLoaderException.class, null); } finally { stopAllGrids(); } }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE); IgniteConfiguration c = super.getConfiguration(igniteInstanceName); CacheConfiguration cc = defaultCacheConfiguration(); cc.setCacheMode(cacheMode); if (nearEnabled) cc.setNearConfiguration(new NearCacheConfiguration()); cc.setAtomicityMode(TRANSACTIONAL); cc.setCacheStoreFactory(new IgniteReflectionFactory<CacheStore>(TestStore.class)); cc.setReadThrough(true); cc.setWriteThrough(true); cc.setLoadPreviousValue(true); c.setCacheConfiguration(cc); c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); return c; }
/** @throws Exception If failed. */ @Test public void testGetErrorNear() throws Exception { checkGetError(true, PARTITIONED); }
/** @throws Exception If failed. */ @Test public void testGetErrorColocated() throws Exception { checkGetError(false, PARTITIONED); }
/** @throws Exception If failed. */ @Test public void testGetErrorReplicated() throws Exception { checkGetError(false, REPLICATED); }