Package org.infinispan.marshall

Examples of org.infinispan.marshall.TestObjectStreamMarshaller


   private Map<Object, InternalCacheEntry> expectedState = new ConcurrentHashMap<Object, InternalCacheEntry>();
   private TestObjectStreamMarshaller marshaller;

   @BeforeTest
   void startMarshaller() {
      marshaller = new TestObjectStreamMarshaller();
   }
View Full Code Here


      gtf.init(false, false, true, false);
   }

   @BeforeMethod
   public void setUp() throws Exception {
      marshaller = new TestObjectStreamMarshaller();
      try {
         cl = createStore();
      } catch (Exception e) {
         //in IDEs this won't be printed which makes debugging harder
         e.printStackTrace();
View Full Code Here

   private Map<Object, InternalCacheEntry> expectedState = new ConcurrentHashMap<Object, InternalCacheEntry>();
   private TestObjectStreamMarshaller marshaller;

   @BeforeTest
   void startMarshaller() {
      marshaller = new TestObjectStreamMarshaller();
   }
View Full Code Here

   }

   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();
      }
   }
View Full Code Here

      });
   }

   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();
   }
View Full Code Here

      underlying.start();
   }

   @BeforeMethod
   public void createMarshaller() {
      marshaller = new TestObjectStreamMarshaller();
   }
View Full Code Here

   private AsyncStore createAsyncStore() throws CacheLoaderException {
      DummyInMemoryCacheStore backendStore = createBackendStore("async2");
      AsyncStoreConfig asyncCfg = new AsyncStoreConfig();
      asyncCfg.modificationQueueSize(0);
      AsyncStore store = new AsyncStore(backendStore, asyncCfg);
      store.init(backendStore.getCacheStoreConfig(), null, new TestObjectStreamMarshaller());
      store.start();
      return store;
   }
View Full Code Here

      return store;
   }

   private DummyInMemoryCacheStore createBackendStore(String storeName) throws CacheLoaderException {
      DummyInMemoryCacheStore store = new DummyInMemoryCacheStore();
      store.init(new DummyInMemoryCacheStore.Cfg(storeName), null, new TestObjectStreamMarshaller());
      store.start();
      return store;
   }
View Full Code Here

   /**
    * @return a mock marshaller for use with the cache store impls
    */
   protected StreamingMarshaller getMarshaller() {
      return new TestObjectStreamMarshaller(false);
   }
View Full Code Here

      cs = null;
      gtf = null;
   }

   void start() throws DatabaseException, CacheLoaderException {
      cs.init(cfg, factory, cache, new TestObjectStreamMarshaller());
      when(cache.getName()).thenReturn("cache");
      when(cache.getConfiguration()).thenReturn(null);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.marshall.TestObjectStreamMarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.