Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.SingleFileStoreConfiguration


      c = cm.getCacheConfiguration("withFileStore");
      assertTrue(c.persistence().preload());
      assertTrue(!c.persistence().passivation());
      assertEquals(1, c.persistence().stores().size());

      SingleFileStoreConfiguration loaderCfg = (SingleFileStoreConfiguration) c.persistence().stores().get(0);

      assertTrue(loaderCfg.fetchPersistentState());
      assertTrue(loaderCfg.ignoreModifications());
      assertTrue(loaderCfg.purgeOnStartup());
      assertEquals("/tmp/FileCacheStore-Location", loaderCfg.location());
      assertEquals(5, loaderCfg.async().threadPoolSize());
      assertEquals(15000, loaderCfg.async().flushLockTimeout());
      assertTrue(loaderCfg.async().enabled());
      assertEquals(700, loaderCfg.async().modificationQueueSize());

      c = cm.getCacheConfiguration("withClusterLoader");
      assertEquals(1, c.persistence().stores().size());
      ClusterLoaderConfiguration clusterLoaderCfg = (ClusterLoaderConfiguration) c.persistence().stores().get(0);
      assertEquals(15000, clusterLoaderCfg.remoteCallTimeout());

      c = cm.getCacheConfiguration("withLoaderDefaults");
      loaderCfg = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
      assertEquals("/tmp/Another-FileCacheStore-Location", loaderCfg.location());

      c = cm.getCacheConfiguration("withouthJmxEnabled");
      assertTrue(!c.jmxStatistics().enabled());
      assertTrue(gc.globalJmxStatistics().enabled());
      assertTrue(gc.globalJmxStatistics().allowDuplicateDomains());
View Full Code Here


      c = cm.getCacheConfiguration("withFileStore");
      assertTrue(c.persistence().preload());
      assertTrue(!c.persistence().passivation());
      assertEquals(1, c.persistence().stores().size());

      SingleFileStoreConfiguration loaderCfg = (SingleFileStoreConfiguration) c.persistence().stores().get(0);

      assertTrue(loaderCfg.fetchPersistentState());
      assertTrue(loaderCfg.ignoreModifications());
      assertTrue(loaderCfg.purgeOnStartup());
      assertEquals("/tmp/FileCacheStore-Location", loaderCfg.location());
      assertEquals(20000, loaderCfg.singletonStore().pushStateTimeout());
      assertTrue(loaderCfg.singletonStore().pushStateWhenCoordinator());
      assertEquals(5, loaderCfg.async().threadPoolSize());
      assertEquals(15000, loaderCfg.async().flushLockTimeout());
      assertTrue(loaderCfg.async().enabled());
      assertEquals(700, loaderCfg.async().modificationQueueSize());

      c = cm.getCacheConfiguration("withClusterLoader");
      assertEquals(1, c.persistence().stores().size());
      ClusterLoaderConfiguration clusterLoaderCfg = (ClusterLoaderConfiguration) c.persistence().stores().get(0);
      assertEquals(15000, clusterLoaderCfg.remoteCallTimeout());

      c = cm.getCacheConfiguration("withLoaderDefaults");
      loaderCfg = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
      assertEquals("/tmp/Another-FileCacheStore-Location", loaderCfg.location());

      c = cm.getCacheConfiguration("withouthJmxEnabled");
      assertTrue(!c.jmxStatistics().enabled());
      assertTrue(gc.globalJmxStatistics().enabled());
      assertTrue(gc.globalJmxStatistics().allowDuplicateDomains());
View Full Code Here

   @Override
   protected AdvancedLoadWriteStore createStore() throws Exception {
      clearTempDir();
      store = new SingleFileStore();
      SingleFileStoreConfiguration fileStoreConfiguration = TestCacheManagerFactory
            .getDefaultCacheConfiguration(false)
            .persistence()
               .addStore(SingleFileStoreConfigurationBuilder.class)
                  .location(this.tmpDirectory)
                  .create();
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception {
      clearTempDir();
      store = new SingleFileStore();
      SingleFileStoreConfiguration fileStoreConfiguration = TestCacheManagerFactory
            .getDefaultCacheConfiguration(false)
            .persistence()
               .addStore(SingleFileStoreConfigurationBuilder.class)
                  .location(this.tmpDirectory)
                  .maxEntries(1)
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception {
      clearTempDir();
      store = new SingleFileStore();
      SingleFileStoreConfiguration fileStoreConfiguration = TestCacheManagerFactory
            .getDefaultCacheConfiguration(false)
            .persistence()
               .addStore(SingleFileStoreConfigurationBuilder.class)
                  .location(this.tmpDirectory)
                  .maxEntries(1)
View Full Code Here

            assertEquals(EvictionStrategy.LIRS, c.eviction().strategy());
            assertEquals(10000, c.expiration().wakeUpInterval());
            assertEquals(10, c.expiration().lifespan());
            assertEquals(10, c.expiration().maxIdle());
            assertFalse(c.persistence().passivation());
            SingleFileStoreConfiguration fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
            assertFalse(fileStore.fetchPersistentState());
            assertEquals("path", fileStore.location());
            assertFalse(fileStore.singletonStore().enabled());
            assertFalse(fileStore.purgeOnStartup());
            assertTrue(fileStore.preload());
            assertTrue(fileStore.shared());
            assertEquals(2, fileStore.async().flushLockTimeout());
            assertEquals(2048, fileStore.async().modificationQueueSize());
            assertEquals(20000, fileStore.async().shutdownTimeout());
            assertEquals(1, fileStore.async().threadPoolSize());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("invalid").getCacheConfiguration();
            assertEquals(CacheMode.INVALIDATION_ASYNC, c.clustering().cacheMode());
            assertTrue(c.invocationBatching().enabled());
            assertEquals(10, c.clustering().async().replQueueInterval());
            assertEquals(1000, c.clustering().async().replQueueMaxElements());
            assertTrue(c.clustering().async().asyncMarshalling());
            assertTrue(c.jmxStatistics().enabled());
            assertEquals(30500, c.locking().lockAcquisitionTimeout());
            assertEquals(2500, c.locking().concurrencyLevel());
            assertEquals(IsolationLevel.READ_COMMITTED, c.locking().isolationLevel()); // Converted to READ_COMMITTED by builder
            assertTrue(c.locking().useLockStriping());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(LockingMode.OPTIMISTIC, c.transaction().lockingMode());
            assertEquals(60500, c.transaction().cacheStopTimeout());
            assertEquals(20500, c.eviction().maxEntries());
            assertEquals(EvictionStrategy.LRU, c.eviction().strategy());
            assertEquals(10500, c.expiration().wakeUpInterval());
            assertEquals(11, c.expiration().lifespan());
            assertEquals(11, c.expiration().maxIdle());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("repl").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertTrue(c.invocationBatching().enabled());
            assertEquals(11, c.clustering().async().replQueueInterval());
            assertEquals(1500, c.clustering().async().replQueueMaxElements());
            assertFalse(c.clustering().async().asyncMarshalling());
            assertTrue(c.jmxStatistics().enabled());
            assertEquals(31000, c.locking().lockAcquisitionTimeout());
            assertEquals(3000, c.locking().concurrencyLevel());
            assertEquals(IsolationLevel.REPEATABLE_READ, c.locking().isolationLevel()); // Converted to REPEATABLE_READ by builder
            assertTrue(c.locking().useLockStriping());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non durable XA
            assertFalse(c.transaction().useSynchronization()); // Non durable XA
            assertFalse(c.transaction().recovery().enabled()); // Non durable XA
            assertTrue(c.transaction().syncCommitPhase()); // Non durable XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non durable XA - side effect of cache manager creation
            assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode());
            assertEquals(61000, c.transaction().cacheStopTimeout());
            assertEquals(21000, c.eviction().maxEntries());
            assertEquals(EvictionStrategy.FIFO, c.eviction().strategy());
            assertEquals(11000, c.expiration().wakeUpInterval());
            assertEquals(12, c.expiration().lifespan());
            assertEquals(12, c.expiration().maxIdle());
            assertFalse(c.clustering().stateTransfer().fetchInMemoryState());
            assertEquals(60000, c.clustering().stateTransfer().timeout());
            assertEquals(10000, c.clustering().stateTransfer().chunkSize());
            ClusterLoaderConfiguration clusterLoader = (ClusterLoaderConfiguration) c.persistence().stores().get(1);
            assertEquals(35000, clusterLoader.remoteCallTimeout());
            assertTrue(clusterLoader.preload());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("dist").getCacheConfiguration();
            assertEquals(CacheMode.DIST_SYNC, c.clustering().cacheMode());
            assertFalse(c.invocationBatching().enabled());
            assertEquals(1200000, c.clustering().l1().lifespan());
            assertEquals(4, c.clustering().hash().numOwners());
            assertEquals(35000, c.clustering().sync().replTimeout());
            assertEquals(2, c.clustering().hash().numSegments());
            assertTrue(c.clustering().hash().consistentHashFactory() instanceof SyncConsistentHashFactory);
            assertFalse(c.clustering().async().asyncMarshalling());
            assertTrue(c.jmxStatistics().enabled());
            assertEquals(31500, c.locking().lockAcquisitionTimeout());
            assertEquals(3500, c.locking().concurrencyLevel());
            assertEquals(IsolationLevel.READ_COMMITTED, c.locking().isolationLevel());
            assertTrue(c.locking().useLockStriping());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Full XA
            assertFalse(c.transaction().useSynchronization()); // Full XA
            assertTrue(c.transaction().recovery().enabled()); // Full XA
            assertTrue(c.transaction().syncCommitPhase()); // Full XA
            assertTrue(c.transaction().syncRollbackPhase()); // Full XA
            assertEquals(LockingMode.OPTIMISTIC, c.transaction().lockingMode());
            assertEquals(61500, c.transaction().cacheStopTimeout());
            assertEquals(21500, c.eviction().maxEntries());
            assertEquals(EvictionStrategy.UNORDERED, c.eviction().strategy());
            assertEquals(11500, c.expiration().wakeUpInterval());
            assertEquals(13, c.expiration().lifespan());
            assertEquals(13, c.expiration().maxIdle());
            assertTrue(c.clustering().stateTransfer().fetchInMemoryState());
            assertEquals(60500, c.clustering().stateTransfer().timeout());
            assertEquals(10500, c.clustering().stateTransfer().chunkSize());
            // Back up cross-site configuration
            BackupConfiguration backup = c.sites().allBackups().get(0);
            assertEquals("NYC", backup.site());
            assertEquals(BackupFailurePolicy.WARN, backup.backupFailurePolicy());
            assertEquals(BackupConfiguration.BackupStrategy.SYNC, backup.strategy());
            assertEquals(12500, backup.replicationTimeout());
            assertFalse(backup.enabled());
            backup = c.sites().allBackups().get(1);
            assertEquals("SFO", backup.site());
            assertEquals(BackupFailurePolicy.IGNORE, backup.backupFailurePolicy());
            assertEquals(BackupConfiguration.BackupStrategy.ASYNC, backup.strategy());
            assertEquals(13000, backup.replicationTimeout());
            assertTrue(backup.enabled());
            backup = c.sites().allBackups().get(2);
            assertEquals("LON", backup.site());
            assertEquals(BackupFailurePolicy.FAIL, backup.backupFailurePolicy());
            assertEquals(BackupConfiguration.BackupStrategy.SYNC, backup.strategy());
            assertEquals(13500, backup.replicationTimeout());
            assertTrue(backup.enabled());
            assertEquals(3, backup.takeOffline().afterFailures());
            assertEquals(10000, backup.takeOffline().minTimeToWait());
            assertEquals("users", c.sites().backupFor().remoteCache());
            assertEquals("LON", c.sites().backupFor().remoteSite());

            c = cm.getCache("capedwarf-data").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("capedwarf-metadata").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            DummyInMemoryStoreConfiguration dummyStore = (DummyInMemoryStoreConfiguration) c.persistence().stores().get(1);
            assertFalse(dummyStore.preload());
            assertFalse(dummyStore.purgeOnStartup());

            c = cm.getCache("capedwarf-memcache").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode());

            c = cm.getCache("capedwarf-default").getCacheConfiguration();
            assertEquals(CacheMode.DIST_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("capedwarf-dist").getCacheConfiguration();
            assertEquals(CacheMode.DIST_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("capedwarf-tasks").getCacheConfiguration();
            assertEquals(CacheMode.DIST_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.LIRS, c.eviction().strategy());
            assertEquals(10000, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("HibernateSearch-LuceneIndexesMetadata").getCacheConfiguration();
            assertEquals(CacheMode.REPL_SYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.invocationBatching().enabled());
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("HibernateSearch-LuceneIndexesData").getCacheConfiguration();
            assertEquals(CacheMode.REPL_SYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.invocationBatching().enabled());
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("HibernateSearch-LuceneIndexesLocking").getCacheConfiguration();
            assertEquals(CacheMode.REPL_SYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.invocationBatching().enabled());
View Full Code Here

   public FileStoreTest() {
      configurationFile = "52x-file-store.xml";
   }

   public void testLocationIsCorrect() {
      SingleFileStoreConfiguration c = ((SingleFileStore) cl).getConfiguration();
      assertEquals(c.location(), DIR);
   }
View Full Code Here

      c = cm.getCacheConfiguration("withFileStore");
      assertTrue(c.persistence().preload());
      assertTrue(!c.persistence().passivation());
      assertEquals(1, c.persistence().stores().size());

      SingleFileStoreConfiguration loaderCfg = (SingleFileStoreConfiguration) c.persistence().stores().get(0);

      assertTrue(loaderCfg.fetchPersistentState());
      assertTrue(loaderCfg.ignoreModifications());
      assertTrue(loaderCfg.purgeOnStartup());
      assertEquals("/tmp/FileCacheStore-Location", loaderCfg.location());
      assertEquals(5, loaderCfg.async().threadPoolSize());
      assertEquals(15000, loaderCfg.async().flushLockTimeout());
      assertTrue(loaderCfg.async().enabled());
      assertEquals(700, loaderCfg.async().modificationQueueSize());

      c = cm.getCacheConfiguration("withClusterLoader");
      assertEquals(1, c.persistence().stores().size());
      ClusterLoaderConfiguration clusterLoaderCfg = (ClusterLoaderConfiguration) c.persistence().stores().get(0);
      assertEquals(15000, clusterLoaderCfg.remoteCallTimeout());

      c = cm.getCacheConfiguration("withLoaderDefaults");
      loaderCfg = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
      assertEquals("/tmp/Another-FileCacheStore-Location", loaderCfg.location());

      c = cm.getCacheConfiguration("withouthJmxEnabled");
      assertTrue(!c.jmxStatistics().enabled());
      assertTrue(gc.globalJmxStatistics().enabled());
      assertTrue(gc.globalJmxStatistics().allowDuplicateDomains());
View Full Code Here

            assertEquals(EvictionStrategy.LIRS, c.eviction().strategy());
            assertEquals(10000, c.expiration().wakeUpInterval());
            assertEquals(10, c.expiration().lifespan());
            assertEquals(10, c.expiration().maxIdle());
            assertFalse(c.persistence().passivation());
            SingleFileStoreConfiguration fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
            assertFalse(fileStore.fetchPersistentState());
            assertEquals("path", fileStore.location());
            assertFalse(fileStore.singletonStore().enabled());
            assertFalse(fileStore.purgeOnStartup());
            assertTrue(fileStore.preload());
            assertTrue(fileStore.shared());
            assertEquals(2, fileStore.async().flushLockTimeout());
            assertEquals(2048, fileStore.async().modificationQueueSize());
            assertEquals(20000, fileStore.async().shutdownTimeout());
            assertEquals(1, fileStore.async().threadPoolSize());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("invalid").getCacheConfiguration();
            assertEquals(CacheMode.INVALIDATION_ASYNC, c.clustering().cacheMode());
            assertTrue(c.invocationBatching().enabled());
            assertEquals(10, c.clustering().async().replQueueInterval());
            assertEquals(1000, c.clustering().async().replQueueMaxElements());
            assertTrue(c.clustering().async().asyncMarshalling());
            assertTrue(c.jmxStatistics().enabled());
            assertEquals(30500, c.locking().lockAcquisitionTimeout());
            assertEquals(2500, c.locking().concurrencyLevel());
            assertEquals(IsolationLevel.READ_COMMITTED, c.locking().isolationLevel()); // Converted to READ_COMMITTED by builder
            assertTrue(c.locking().useLockStriping());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(LockingMode.OPTIMISTIC, c.transaction().lockingMode());
            assertEquals(60500, c.transaction().cacheStopTimeout());
            assertEquals(20500, c.eviction().maxEntries());
            assertEquals(EvictionStrategy.LRU, c.eviction().strategy());
            assertEquals(10500, c.expiration().wakeUpInterval());
            assertEquals(11, c.expiration().lifespan());
            assertEquals(11, c.expiration().maxIdle());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("repl").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertTrue(c.invocationBatching().enabled());
            assertEquals(11, c.clustering().async().replQueueInterval());
            assertEquals(1500, c.clustering().async().replQueueMaxElements());
            assertFalse(c.clustering().async().asyncMarshalling());
            assertTrue(c.jmxStatistics().enabled());
            assertEquals(31000, c.locking().lockAcquisitionTimeout());
            assertEquals(3000, c.locking().concurrencyLevel());
            assertEquals(IsolationLevel.REPEATABLE_READ, c.locking().isolationLevel()); // Converted to REPEATABLE_READ by builder
            assertTrue(c.locking().useLockStriping());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Batching, non XA
            assertTrue(c.transaction().useSynchronization()); // Batching, non XA
            assertFalse(c.transaction().recovery().enabled()); // Batching, non XA
            assertTrue(c.transaction().syncCommitPhase()); // Batching, non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Batching, non XA - side effect of cache manager creation
            assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode());
            assertEquals(61000, c.transaction().cacheStopTimeout());
            assertEquals(21000, c.eviction().maxEntries());
            assertEquals(EvictionStrategy.FIFO, c.eviction().strategy());
            assertEquals(11000, c.expiration().wakeUpInterval());
            assertEquals(12, c.expiration().lifespan());
            assertEquals(12, c.expiration().maxIdle());
            assertFalse(c.clustering().stateTransfer().fetchInMemoryState());
            assertEquals(60000, c.clustering().stateTransfer().timeout());
            assertEquals(10000, c.clustering().stateTransfer().chunkSize());
            ClusterLoaderConfiguration clusterLoader = (ClusterLoaderConfiguration) c.persistence().stores().get(1);
            assertEquals(35000, clusterLoader.remoteCallTimeout());
            assertTrue(clusterLoader.preload());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("dist").getCacheConfiguration();
            assertEquals(CacheMode.DIST_SYNC, c.clustering().cacheMode());
            assertFalse(c.invocationBatching().enabled());
            assertEquals(1200000, c.clustering().l1().lifespan());
            assertEquals(4, c.clustering().hash().numOwners());
            assertEquals(35000, c.clustering().sync().replTimeout());
            assertEquals(2, c.clustering().hash().numSegments());
            assertTrue(c.clustering().hash().consistentHashFactory() instanceof SyncConsistentHashFactory);
            assertFalse(c.clustering().async().asyncMarshalling());
            assertTrue(c.clustering().partitionHandling().enabled());
            assertTrue(c.jmxStatistics().enabled());
            assertEquals(31500, c.locking().lockAcquisitionTimeout());
            assertEquals(3500, c.locking().concurrencyLevel());
            assertEquals(IsolationLevel.READ_COMMITTED, c.locking().isolationLevel());
            assertTrue(c.locking().useLockStriping());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Full XA
            assertFalse(c.transaction().useSynchronization()); // Full XA
            assertTrue(c.transaction().recovery().enabled()); // Full XA
            assertTrue(c.transaction().syncCommitPhase()); // Full XA
            assertTrue(c.transaction().syncRollbackPhase()); // Full XA
            assertEquals(LockingMode.OPTIMISTIC, c.transaction().lockingMode());
            assertEquals(61500, c.transaction().cacheStopTimeout());
            assertEquals(21500, c.eviction().maxEntries());
            assertEquals(EvictionStrategy.UNORDERED, c.eviction().strategy());
            assertEquals(11500, c.expiration().wakeUpInterval());
            assertEquals(13, c.expiration().lifespan());
            assertEquals(13, c.expiration().maxIdle());
            assertTrue(c.clustering().stateTransfer().fetchInMemoryState());
            assertEquals(60500, c.clustering().stateTransfer().timeout());
            assertEquals(10500, c.clustering().stateTransfer().chunkSize());
            // Back up cross-site configuration
            BackupConfiguration backup = c.sites().allBackups().get(0);
            assertEquals("NYC", backup.site());
            assertEquals(BackupFailurePolicy.WARN, backup.backupFailurePolicy());
            assertEquals(BackupConfiguration.BackupStrategy.SYNC, backup.strategy());
            assertEquals(12500, backup.replicationTimeout());
            assertFalse(backup.enabled());
            backup = c.sites().allBackups().get(1);
            assertEquals("SFO", backup.site());
            assertEquals(BackupFailurePolicy.IGNORE, backup.backupFailurePolicy());
            assertEquals(BackupConfiguration.BackupStrategy.ASYNC, backup.strategy());
            assertEquals(13000, backup.replicationTimeout());
            assertTrue(backup.enabled());
            backup = c.sites().allBackups().get(2);
            assertEquals("LON", backup.site());
            assertEquals(BackupFailurePolicy.FAIL, backup.backupFailurePolicy());
            assertEquals(BackupConfiguration.BackupStrategy.SYNC, backup.strategy());
            assertEquals(13500, backup.replicationTimeout());
            assertTrue(backup.enabled());
            assertEquals(3, backup.takeOffline().afterFailures());
            assertEquals(10000, backup.takeOffline().minTimeToWait());
            assertEquals("users", c.sites().backupFor().remoteCache());
            assertEquals("LON", c.sites().backupFor().remoteSite());

            c = cm.getCache("capedwarf-data").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("capedwarf-metadata").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            DummyInMemoryStoreConfiguration dummyStore = (DummyInMemoryStoreConfiguration) c.persistence().stores().get(1);
            assertFalse(dummyStore.preload());
            assertFalse(dummyStore.purgeOnStartup());

            c = cm.getCache("capedwarf-memcache").getCacheConfiguration();
            assertEquals(CacheMode.REPL_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode());

            c = cm.getCache("capedwarf-default").getCacheConfiguration();
            assertEquals(CacheMode.DIST_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("capedwarf-dist").getCacheConfiguration();
            assertEquals(CacheMode.DIST_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            assertEquals(LockingMode.PESSIMISTIC, c.transaction().lockingMode());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(0);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("capedwarf-tasks").getCacheConfiguration();
            assertEquals(CacheMode.DIST_ASYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.LIRS, c.eviction().strategy());
            assertEquals(10000, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());
            assertEquals(Index.NONE, c.indexing().index());

            c = cm.getCache("HibernateSearch-LuceneIndexesMetadata").getCacheConfiguration();
            assertEquals(CacheMode.REPL_SYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.invocationBatching().enabled());
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("HibernateSearch-LuceneIndexesData").getCacheConfiguration();
            assertEquals(CacheMode.REPL_SYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.invocationBatching().enabled());
            assertTrue(c.transaction().useSynchronization()); // Non XA
            assertFalse(c.transaction().recovery().enabled()); // Non XA
            assertTrue(c.transaction().syncCommitPhase()); // Non XA - default configuration value
            assertTrue(c.transaction().syncRollbackPhase()); // Non XA - side effect of cache manager creation
            assertEquals(EvictionStrategy.NONE, c.eviction().strategy());
            assertEquals(-1, c.eviction().maxEntries());
            fileStore = (SingleFileStoreConfiguration) c.persistence().stores().get(1);
            assertTrue(fileStore.preload());
            assertFalse(fileStore.purgeOnStartup());

            c = cm.getCache("HibernateSearch-LuceneIndexesLocking").getCacheConfiguration();
            assertEquals(CacheMode.REPL_SYNC, c.clustering().cacheMode());
            assertEquals(TransactionMode.TRANSACTIONAL, c.transaction().transactionMode()); // Non XA
            assertTrue(c.invocationBatching().enabled());
View Full Code Here

   public FileStoreTest() {
      configurationFile = "52x-file-store.xml";
   }

   public void testLocationIsCorrect() {
      SingleFileStoreConfiguration c = ((SingleFileStore) cl).getConfiguration();
      assertEquals(c.location(), DIR);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.configuration.cache.SingleFileStoreConfiguration

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.