コード例 #1
0
        public static RemoteCacheManager getRemoteCacheManager()
        {
            ConfigurationBuilder conf = new ConfigurationBuilder();

            conf.AddServer().Host("127.0.0.1").Port(11222);
            conf.AddServer().Host("127.0.0.1").Port(11322)
            .ConnectionTimeout(90000).SocketTimeout(6000)
            .NearCache().Mode(NearCacheMode.INVALIDATED).MaxEntries(10);
            conf.BalancingStrategyProducer(d);
            marshaller = new JBasicMarshaller();
            conf.Marshaller(marshaller);
            return(ClusterTestSuite.getRemoteCacheManager(conf.Build()));
        }
コード例 #2
0
        public void permanentCacheTest()
        {
            String cacheName = "cache4PermanentTest";
            var    flags     = new HashSet <AdminFlag>();

            flags.Add(AdminFlag.PERMANENT);
            remoteManager.Administration().WithFlags(flags).CreateCache <string, string>(cacheName, "template");
            remoteManager.Stop();
            ClusterTestSuite.server1.ShutDownHotrodServer();
            ClusterTestSuite.server2.ShutDownHotrodServer();
            ClusterTestSuite.server1.StartHotRodServer();
            ClusterTestSuite.server2.StartHotRodServer();
            remoteManager = ClusterTestSuite.getRemoteCacheManager();
            var ex = Assert.Throws <Infinispan.HotRod.Exceptions.HotRodClientException>(() =>
                                                                                        { remoteManager.Administration().CreateCache <string, string>(cacheName, "template"); });

            StringAssert.Contains("ISPN000507:", ex.Message);
        }
コード例 #3
0
 public void BeforeAnyTest()
 {
     ClusterTestSuite.EnsureServersUp();
     remoteManager = getRemoteCacheManager();
 }