示例#1
0
 public void ValidateEvents()
 {
     Thread.Sleep(5000);
     m_listener.ShowTallies();
     m_writer.ShowTallies();
     Assert.AreEqual(0, m_listener.Creates, "Should be 0 creates");
     Assert.AreEqual(0, m_listener.Updates, "Should be 0 updates");
     Assert.AreEqual(20, m_listener.Invalidates, "Should be 20 invalidates");
     Assert.AreEqual(5, m_listener.Destroys, "Should be 5 destroys");
     Assert.AreEqual(false, m_writer.IsWriterInvoked, "Writer Should not be invoked");
 }
示例#2
0
 public void ValidateLocalListenerWriterData()
 {
     Thread.Sleep(2000);
     Assert.AreEqual(true, m_writer.IsWriterInvoked, "Writer should be invoked");
     Assert.AreEqual(true, m_listener.IsListenerInvoked, "Listener should be invoked");
     Assert.AreEqual(true, m_writer.IsCallBackArgCalled, "Writer CallbackArg should be invoked");
     Assert.AreEqual(true, m_listener.IsCallBackArgCalled, "Listener CallbackArg should be invoked");
     m_listener.ShowTallies();
     m_writer.ShowTallies();
 }
示例#3
0
        public void VerifyTallies()
        {
            IRegion <object, object> region1 = CacheHelper.GetVerifyRegion <object, object>(m_regionNames[0]);
            IRegion <object, object> region2 = CacheHelper.GetVerifyRegion <object, object>(m_regionNames[1]);

            TallyLoader <object, object>   loader1   = (TallyLoader <object, object>)region1.Attributes.CacheLoader;
            TallyListener <object, object> listener1 = (TallyListener <object, object>)region1.Attributes.CacheListener;
            TallyWriter <object, object>   writer1   = (TallyWriter <object, object>)region1.Attributes.CacheWriter;
            TallyResolver <object, object> resolver1 = (TallyResolver <object, object>)region1.Attributes.PartitionResolver;

            TallyLoader <object, object>   loader2   = (TallyLoader <object, object>)region2.Attributes.CacheLoader;
            TallyListener <object, object> listener2 = (TallyListener <object, object>)region2.Attributes.CacheListener;
            TallyWriter <object, object>   writer2   = (TallyWriter <object, object>)region2.Attributes.CacheWriter;
            TallyResolver <object, object> resolver2 = (TallyResolver <object, object>)region2.Attributes.PartitionResolver;

            loader1.ShowTallies();
            writer1.ShowTallies();
            listener1.ShowTallies();
            resolver1.ShowTallies();

            loader2.ShowTallies();
            writer2.ShowTallies();
            listener2.ShowTallies();
            resolver2.ShowTallies();

            // We don't assert for partition resolver because client metadata service may
            // not have fetched PR single hop info to trigger the resolver.

            Assert.AreEqual(1, loader1.ExpectLoads(1));
            //Assert.AreEqual(1, resolver1.ExpectLoads(1));
            Assert.AreEqual(1, writer1.ExpectCreates(1));
            Assert.AreEqual(0, writer1.ExpectUpdates(0));
            Assert.AreEqual(2, listener1.ExpectCreates(2));
            Assert.AreEqual(1, listener1.ExpectUpdates(1));

            Assert.AreEqual(1, loader2.ExpectLoads(1));
            //Assert.AreEqual(1, resolver2.ExpectLoads(1));
            Assert.AreEqual(1, writer2.ExpectCreates(1));
            Assert.AreEqual(0, writer2.ExpectUpdates(0));
            Assert.AreEqual(2, listener2.ExpectCreates(2));
            Assert.AreEqual(1, listener2.ExpectUpdates(1));
        }
示例#4
0
 public void SendCreate()
 {
     Util.Log("put(1,1) from Client 1 noack");
     m_regionw.Put(1, 1);
     m_listener.ShowTallies();
 }