Beispiel #1
0
        public static void AssertState(params ContextState[] descs)
        {
            Assert.AreEqual(descs.Length, state.Count);
            int count = -1;

            foreach (ContextState desc in descs)
            {
                count++;
                String text = "failed at descriptor " + count;
                ContextStatePathValue value = state.Get(new ContextStatePathKey(desc.Level, desc.ParentPath, desc.Subpath));
                Assert.AreEqual(desc.AgentInstanceId, (int)value.OptionalContextPartitionId, text);
                Assert.AreEqual(desc.IsStarted ? ContextPartitionState.STARTED : ContextPartitionState.STOPPED, value.State, text);

                Object payloadReceived = ContextStateCacheNoSave.DEFAULT_SPI_TEST_BINDING.ByteArrayToObject(value.Blob, null);
                if (desc.Payload == null)
                {
                    Assert.NotNull(payloadReceived);
                }
                else
                {
                    EPAssertionUtil.AssertEqualsAllowArray(text, desc.Payload, payloadReceived);
                }
            }
        }
Beispiel #2
0
 public void UpdateContextPath(String contextName, ContextStatePathKey key, ContextStatePathValue value)
 {
     state.Put(key, value);
 }