Examples of TestObjectStreamMarshaller


Examples of org.infinispan.marshall.TestObjectStreamMarshaller

      int value = UnitTestDatabaseManager.rowCount(connectionFactory, tableName);
      assert value == rowCount : "Expected " + rowCount + " rows, actual value is " + value;
   }

   protected Marshaller getMarshaller() {
      return new TestObjectStreamMarshaller(false);
   }
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

   public void testNotCreateConnectionFactory() throws Exception {
      JdbcBinaryCacheStore jdbcBucketCacheStore = new JdbcBinaryCacheStore();
      JdbcBinaryCacheStoreConfig config = new JdbcBinaryCacheStoreConfig(false);
      config.setCreateTableOnStart(false);
      jdbcBucketCacheStore.init(config, null, new TestObjectStreamMarshaller());
      jdbcBucketCacheStore.start();
      assert jdbcBucketCacheStore.getConnectionFactory() == null;

      /* this will make sure that if a method like stop is called on the connection then it will barf an exception */
      ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

   protected CacheStore createCacheStore() throws CacheLoaderException {
      ChainingCacheStore store = new ChainingCacheStore();
      CacheStoreConfig cfg;
      store1 = new DummyInMemoryCacheStore();
      store1.init((cfg = new DummyInMemoryCacheStore.Cfg("instance1")), null, new TestObjectStreamMarshaller());

      store.addCacheLoader(store1, cfg);

      store2 = new DummyInMemoryCacheStore();
      store2.init((cfg = new DummyInMemoryCacheStore.Cfg("instance2")), null, new TestObjectStreamMarshaller());
      // set store2 up for streaming
      cfg.setFetchPersistentState(true);
      store.addCacheLoader(store2, cfg);

      stores = new DummyInMemoryCacheStore[]{store1, store2};
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

            .persistence()
               .addStore(SingleFileStoreConfigurationBuilder.class)
                  .location(this.tmpDirectory)
                  .maxEntries(1);

      marshaller = new TestObjectStreamMarshaller();
      store.init(PersistenceMockUtil.createContext(getClass().getSimpleName(), builder.build(), marshaller));
      store.start();
   }
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

      }
   }

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

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

      cache0.putAll(originalValues);

      PersistenceManager persistenceManager = TestingUtil.extractComponent(cache0, PersistenceManager.class);
      DummyInMemoryStore store = persistenceManager.getStores(DummyInMemoryStore.class).iterator().next();

      TestObjectStreamMarshaller sm = new TestObjectStreamMarshaller();
      PersistenceManager pm = null;
      try {
         MagicKey loaderKey = new MagicKey(cache2);
         String loaderValue = "loader-value";
         store.write(new MarshalledEntryImpl(loaderKey, loaderValue, null, sm));
         if (includeLoaderEntry) {
            originalValues.put(loaderKey, loaderValue);
         }
      } finally {
         sm.stop();
      }
      return originalValues;
   }
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

   public void init(CacheLoaderConfig config, Cache cache, Marshaller m) {
      super.init(config, cache, m);
      this.config = (Cfg) config;
      this.cache = cache;
      this.marshaller = m;
      if (marshaller == null) marshaller = new TestObjectStreamMarshaller();
   }
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

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

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

                  .key2StringMapper(PersonKey2StringMapper.class);

      UnitTestDatabaseManager.buildTableManipulation(storeBuilder.table(), false);
      UnitTestDatabaseManager.configureUniqueConnectionFactory(storeBuilder);
      cacheStore = new JdbcStringBasedStore();
      marshaller = new TestObjectStreamMarshaller();
      cacheStore.init(PersistenceMockUtil.createContext(getClass().getSimpleName(), builder.build(), marshaller));
      cacheStore.start();
      tableManipulation = (TableManipulation) ReflectionUtil.getValue(cacheStore, "tableManipulation");
   }
View Full Code Here

Examples of org.infinispan.marshall.TestObjectStreamMarshaller

   /**
    * @return a mock marshaller for use with the cache store impls
    */
   protected StreamingMarshaller getMarshaller() {
      return new TestObjectStreamMarshaller(false);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.