@AfterClass(alwaysRun = true) void stopMarshaller() { marshaller.stop(); }
@AfterClass public static void tearDownClass() { marshaller.stop(); }
@AfterMethod public void tearDown() throws PersistenceException { if (writer != null) writer.stop(); if (loader != null) loader.stop(); marshaller.stop(); }
@AfterMethod public void shutdown() { store.clear(); store.stop(); marshaller.stop(); executorService.shutdown(); }
@AfterMethod public void tearDown() throws PersistenceException { try { if (store != null) { store.clear(); store.stop(); } marshaller.stop(); } finally { store = null; } }
@AfterMethod(alwaysRun = true) public void tearDown() throws PersistenceException { try { if (cl != null) { cl.clear(); cl.destroy(); } if (marshaller != null) { marshaller.stop(); } } finally { cl = null; } }
TestingUtil.replaceComponent(cache, PersistenceManager.class, pm, true, true); sm.stop();
TestingUtil.replaceComponent(cache, PersistenceManager.class, pm, true, true); sm.stop();
TestingUtil.replaceComponent(cache, PersistenceManager.class, pm, true, true); sm.stop();
TestingUtil.replaceComponent(cache0, PersistenceManager.class, pm, true, true); sm.stop();
TestingUtil.replaceComponent(cache0, PersistenceManager.class, pm, true, true); sm.stop();
public void testStoreSizeExceeded() throws Exception { assertStoreSize(0, 0); TestObjectStreamMarshaller sm = new TestObjectStreamMarshaller(); try { store.write(new MarshalledEntryImpl(1, "v1", null, sm)); store.write(new MarshalledEntryImpl(2, "v2", null, sm)); assertStoreSize(1, 1); } finally { sm.stop(); } }
TestingUtil.replaceComponent(cache0, PersistenceManager.class, pm, true, true); sm.stop();
public void testConfigureMarshaller() { GlobalConfigurationBuilder gc = new GlobalConfigurationBuilder(); TestObjectStreamMarshaller marshaller = new TestObjectStreamMarshaller(); gc.serialization().marshaller(marshaller); withCacheManager(new CacheManagerCallable( createCacheManager(gc, new ConfigurationBuilder())) { @Override public void call() { cm.getCache(); } }); marshaller.stop(); }
public void testSkipCacheLoadFlagUsage() throws PersistenceException { CountingStore countingCS = getCountingCacheStore(); TestObjectStreamMarshaller sm = new TestObjectStreamMarshaller(); try { store.write(new MarshalledEntryImpl("home", "Vermezzo", null, sm)); store.write(new MarshalledEntryImpl("home-second", "Newcastle Upon Tyne", null, sm)); assert countingCS.numLoads == 0; //load using SKIP_CACHE_LOAD should not find the object in the store assert cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD).get("home") == null; assert countingCS.numLoads == 0; assert cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD).put("home", "Newcastle") == null; assert countingCS.numLoads == 0; final Object put = cache.getAdvancedCache().put("home-second", "Newcastle Upon Tyne, second"); assertEquals(put, "Newcastle Upon Tyne"); assert countingCS.numLoads == 1; } finally { sm.stop(); } }