Package org.jboss.cache.config

Examples of org.jboss.cache.config.BuddyReplicationConfig


                  "         <properties>\n" +
                  "            numBuddies = 3\n" +
                  "         </properties>\n" +
                  "      </locator>\n" +
                  "   </buddy>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);

      assertTrue(mgr.isEnabled());
      assertEquals("groupOne", mgr.getBuddyPoolName());
      assertEquals(NextMemberBuddyLocator.class, mgr.buddyLocator.getClass());
View Full Code Here


    * @throws Exception
    */
   public void testConstruction3() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"false\"/>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);
      assertTrue(!mgr.isEnabled());
   }
View Full Code Here

    */
   public void testConstruction4() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"true\"/>";

      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      BuddyManager mgr = new BuddyManager(config);

      assertTrue(mgr.isEnabled());
      assertNull(mgr.getBuddyPoolName());
      assertEquals(NextMemberBuddyLocator.class, mgr.buddyLocator.getClass());
View Full Code Here

   {
      BuddyManager bm = null;
      try
      {
         String xmlConfig = "<buddy enabled=\"false\"/>";
         BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
         bm = new BuddyManager(config);
         bm.injectDependencies(null, null, null, null, null, null, null, null, new BuddyFqnTransformer());
         CommandsFactoryImpl commandsFactory = new CommandsFactoryImpl();
         commandsFactory.initialize(null, null, null, null, null, null, null, new Configuration(), null, new BuddyFqnTransformer());
         bm.initFqnTransformer(DUMMY_LOCAL_ADDRESS, commandsFactory);
View Full Code Here

            "bin=" + name, false, true, false, false, false);
      clc.setPassivation(true);
      c.setCacheLoaderConfig(clc);
      if (useBR)
      {
         BuddyReplicationConfig brc = new BuddyReplicationConfig();
         brc.setEnabled(true);
         brc.setAutoDataGravitation(false);
         brc.setDataGravitationSearchBackupTrees(brSearchSubtrees);
         brc.setDataGravitationRemoveOnFind(true);
         c.setBuddyReplicationConfig(brc);
      }
      return c;
   }
View Full Code Here

   }


   private BuddyReplicationConfig getBuddyConfig() throws Exception
   {
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      brc.setBuddyPoolName("TEST");
      return brc;
   }
View Full Code Here

   }

   public void testDisabledConfig() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"false\"/>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
      cache.getConfiguration().setBuddyReplicationConfig(config);
      assertNull(cache.getBuddyManager());
   }
View Full Code Here

   }

   public void testBasicConfig() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"true\"/>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      c.setBuddyReplicationConfig(config);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
      cache.create();
View Full Code Here

   private BuddyReplicationConfig getBuddyReplicationConfig(String xmlConfig)
         throws Exception
   {
      Element element = XmlConfigHelper.stringToElementInCoreNS(xmlConfig);
      BuddyElementParser elementParser = new BuddyElementParser();
      BuddyReplicationConfig config = elementParser.parseBuddyElement(element);
      return config;
   }
View Full Code Here

   }

   public void testLocalModeConfig() throws Exception
   {
      String xmlConfig = "<buddy enabled=\"true\"/>";
      BuddyReplicationConfig config = getBuddyReplicationConfig(xmlConfig);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
      cache.getConfiguration().setBuddyReplicationConfig(config);
      cache.create();
      cache.start();
      assert cache.getBuddyManager() == null;
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.BuddyReplicationConfig

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.