public void TestNearCacheTruncate() { LocalNamedCache localcache = new LocalNamedCache(); INamedCache safecache = CacheFactory.GetCache(CacheName); NearCache nearcache = new NearCache(localcache, safecache, CompositeCacheStrategyType.ListenNone); nearcache.Clear(); Hashtable ht = new Hashtable(); ht.Add("Aleks", 1); ht.Add("Ana", 2); ht.Add("Goran", 3); ht.Add("Ivan", 4); nearcache.InsertAll(ht); IFilter filter = new BetweenFilter(IdentityExtractor.Instance, 2, 10); object[] result = nearcache.GetKeys(filter); Assert.AreEqual(3, result.Length); nearcache.Truncate(); Assert.IsTrue(nearcache.IsActive); Thread.Sleep(2000); result = nearcache.GetKeys(filter); Assert.AreEqual(0, result.Length); nearcache.Release(); Assert.IsFalse(nearcache.IsActive); CacheFactory.Shutdown(); }