Example #1
0
 public void TestEventCount(int clientNum)
 {
     Util.Log("check Client {0} event count.", clientNum);
     m_listener.ShowTallies();
     Assert.AreEqual(2, m_listener.ExpectCreates(2), "Should have been 2 creates.");
     Assert.AreEqual(1, m_listener.ExpectUpdates(1), "Should have been 1 update.");
 }
Example #2
0
 public void CheckEmpty()
 {
     Util.Log("check s2p2-subset is still empty.");
     Thread.Sleep(100); //let it do receiving...
     m_regionw.Test(1, -1);
     Assert.AreEqual(0, m_listener.Creates, "Should be no creates");
     Assert.AreEqual(0, m_listener.Updates, "Should be no updates");
     m_regionw.Put(2, 1);
     Assert.AreEqual(1, m_listener.ExpectCreates(1), "Should have been 1 create.");
     Assert.AreEqual(0, m_listener.ExpectUpdates(0), "Should be no updates");
 }
Example #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));
        }
Example #4
0
        public void StepThreeCallbacks()
        {
            Assert.AreEqual(2, m_reg1Listener1.ExpectCreates(2),
                            "Two creation events were expected for region1.");
            Assert.AreEqual(2, m_reg2Listener1.ExpectCreates(2),
                            "Two creation events were expected for region2.");

            Assert.AreEqual(0, m_reg1Listener1.ExpectUpdates(0),
                            "No update event was expected for region1.");
            Assert.AreEqual(0, m_reg2Listener1.ExpectUpdates(0),
                            "No update event was expected for region2.");

            Assert.AreEqual(1, m_reg1Loader1.ExpectLoads(1),
                            "One loader event was expected for region1.");
            Assert.AreEqual(1, m_reg2Loader1.ExpectLoads(1),
                            "One loader event was expected for region2.");

            Assert.AreEqual(1, m_reg1Writer1.ExpectCreates(1),
                            "One writer create event was expected for region1.");
            Assert.AreEqual(1, m_reg2Writer1.ExpectCreates(1),
                            "One writer create event was expected for region2.");
        }