Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.TakeOfflineConfiguration


*/
@Test (groups = "xsite, functional", testName = "xsite.offline.OfflineStatusTest")
public class OfflineStatusTest extends AbstractInfinispanTest {

   public void timeBasedTakeOffline() {
      final OfflineStatus offlineStatus = new OfflineStatus(new TakeOfflineConfiguration(10, 3000), TIME_SERVICE);

      assert !offlineStatus.isOffline();
      for (int i = 0; i < 9; i++) {
         offlineStatus.updateOnCommunicationFailure(now());
      }
View Full Code Here


      assert offlineStatus.isOffline();
      assert offlineStatus.minTimeHasElapsed();
   }

   public void testFailureBasedOnly() throws Throwable {
      final OfflineStatus offlineStatus = new OfflineStatus(new TakeOfflineConfiguration(10, 0), TIME_SERVICE);
      test(offlineStatus);
      offlineStatus.reset();
      test(offlineStatus);
   }
View Full Code Here

   public void testNoTakeOffline() {
      Configuration dcc = cacheManager.getCacheConfiguration("noTakeOffline");
      assertEquals(1, dcc.sites().allBackups().size());

      assertTrue(dcc.sites().allBackups().contains(new BackupConfiguration("NYC", BackupConfiguration.BackupStrategy.SYNC,
                                                                        12003, BackupFailurePolicy.WARN, null, false, new TakeOfflineConfiguration(0,0), true)));
      assertNull(dcc.sites().backupFor().remoteSite());
      assertNull(dcc.sites().backupFor().remoteCache());
   }
View Full Code Here

      assertNull(dcc.sites().backupFor().remoteCache());
   }
   public void testTakeOfflineDifferentConfig() {
      Configuration dcc = cacheManager.getCacheConfiguration("takeOfflineDifferentConfig");
      assertEquals(1, dcc.sites().allBackups().size());
      TakeOfflineConfiguration toc = new TakeOfflineConfiguration(321, 3765);
      assertTrue(dcc.sites().allBackups().contains(new BackupConfiguration("NYC", BackupConfiguration.BackupStrategy.SYNC,
                                                                        12003l, BackupFailurePolicy.IGNORE, null, false, toc, true)));

   }
View Full Code Here

                                                                        12003l, BackupFailurePolicy.IGNORE, null, false, toc, true)));

   }

   private void testDefault(Configuration dcc) {
      TakeOfflineConfiguration toc = new TakeOfflineConfiguration(123, 5673);
      assertTrue(dcc.sites().allBackups().contains(new BackupConfiguration("NYC", BackupConfiguration.BackupStrategy.SYNC,
                                                                        12003l, BackupFailurePolicy.IGNORE, null, false, toc, true)));
      assertEquals("someCache", dcc.sites().backupFor().remoteCache());
      assertEquals("SFO", dcc.sites().backupFor().remoteSite());
   }
View Full Code Here

      Configuration dcc = cacheManager.getCacheConfiguration("noTakeOffline");
      assertEquals(1, dcc.sites().allBackups().size());

      assertTrue(dcc.sites().allBackups().contains(new BackupConfiguration("NYC", BackupConfiguration.BackupStrategy.SYNC,
                                                                        12003, BackupFailurePolicy.WARN, null, false,
                                                                        new TakeOfflineConfiguration(0, 0),
                                                                        DEFAULT_STATE_TRANSFER, true)));
      assertNull(dcc.sites().backupFor().remoteSite());
      assertNull(dcc.sites().backupFor().remoteCache());
   }
View Full Code Here

      assertNull(dcc.sites().backupFor().remoteCache());
   }
   public void testTakeOfflineDifferentConfig() {
      Configuration dcc = cacheManager.getCacheConfiguration("takeOfflineDifferentConfig");
      assertEquals(1, dcc.sites().allBackups().size());
      TakeOfflineConfiguration toc = new TakeOfflineConfiguration(321, 3765);
      assertTrue(dcc.sites().allBackups().contains(new BackupConfiguration("NYC", BackupConfiguration.BackupStrategy.SYNC,
                                                                        12003l, BackupFailurePolicy.IGNORE, null, false, toc,
                                                                        DEFAULT_STATE_TRANSFER, true)));

   }
View Full Code Here

                                                                        DEFAULT_STATE_TRANSFER, true)));

   }

   private void testDefault(Configuration dcc) {
      TakeOfflineConfiguration toc = new TakeOfflineConfiguration(123, 5673);
      assertTrue(dcc.sites().allBackups().contains(new BackupConfiguration("NYC", BackupConfiguration.BackupStrategy.SYNC,
                                                                        12003l, BackupFailurePolicy.IGNORE, null, false, toc,
                                                                        DEFAULT_STATE_TRANSFER, true)));
      assertEquals("someCache", dcc.sites().backupFor().remoteCache());
      assertEquals("SFO", dcc.sites().backupFor().remoteSite());
View Full Code Here

*/
@Test (groups = "xsite, functional", testName = "xsite.offline.OfflineStatusTest")
public class OfflineStatusTest extends AbstractInfinispanTest {

   public void timeBasedTakeOffline() {
      final OfflineStatus offlineStatus = new OfflineStatus(new TakeOfflineConfiguration(10, 3000), TIME_SERVICE);

      assert !offlineStatus.isOffline();
      for (int i = 0; i < 9; i++) {
         offlineStatus.updateOnCommunicationFailure(now());
      }
View Full Code Here

      assert offlineStatus.isOffline();
      assert offlineStatus.minTimeHasElapsed();
   }

   public void testFailureBasedOnly() throws Throwable {
      final OfflineStatus offlineStatus = new OfflineStatus(new TakeOfflineConfiguration(10, 0), TIME_SERVICE);
      test(offlineStatus);
      offlineStatus.reset();
      test(offlineStatus);
   }
View Full Code Here

TOP

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

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.