Exemplo n.º 1
0
 void TrackingManager_TrackingCompleted(object sender, TrackingCompletedEventArgs e)
 {
     if (currentBehavior != null)
     {
         currentBehavior.OnTrackingCompleted(e);
     }
 }
        private void CreateAndModifyInOutermostListener(object sender, TrackingCompletedEventArgs e)
        {
            foreach (var change in e.Changes)
            {
                Console.WriteLine(change.Key);
                Console.WriteLine(change.State);
                foreach (var value in change.ChangedValues)
                {
                    Console.WriteLine(value.Field.Name);
                    Console.WriteLine(value.OriginalValue);
                    Console.WriteLine(value.NewValue);
                }
            }


            ListenerIsCalled();
            Assert.IsNotNull(e.Changes);
            Assert.AreEqual(1, e.Changes.Count());
            var ti = e.Changes.First();

            Assert.AreEqual(TrackingItemState.Created, ti.State);
            Assert.IsNotNull(ti.Key);
            Assert.IsNotNull(ti.RawData);
            Assert.AreEqual("some text", ti.RawData.GetValue(2));
        }
 public override void OnTrackingCompleted(TrackingCompletedEventArgs e)
 {
     // we're done and stuff
     if (e.Command.Label == command_label)
     {
         passCompleted = true;
     }
 }
        private void CreateInOutermostListener(object sender, TrackingCompletedEventArgs e)
        {
            ListenerIsCalled();
            Assert.IsNotNull(e.Changes);
            Assert.AreEqual(1, e.Changes.Count());
            var ti = e.Changes.First();

            Assert.AreEqual(TrackingItemState.Created, ti.State);
            Assert.IsNotNull(ti.Key);
            Assert.IsNotNull(ti.RawData);
        }
Exemplo n.º 5
0
        public override void OnTrackingCompleted(TrackingCompletedEventArgs e)
        {
            BehaviorManager.TraceSource.TraceEvent(TraceEventType.Verbose, 0, "in change lanes -- tracking completed, result {0}", e.Result);
            if (e.Command.Label == commandLabel)
            {
                // we've finished coming to a stop, cancel the behavior and execute a hold brake
                Services.BehaviorManager.Execute(new HoldBrakeBehavior(), null, true);

                // send a completion report
                ForwardCompletionReport(new SuccessCompletionReport(typeof(ChangeLaneBehavior)));
            }
        }
        private void RemoveInOutermostAndCreateInNestedListener(object sender, TrackingCompletedEventArgs e)
        {
            ListenerIsCalled();
            Assert.IsNotNull(e.Changes);
            Assert.AreEqual(1, e.Changes.Count());
            var ti = e.Changes.First();

            Assert.AreEqual(TrackingItemState.Changed, ti.State);
            Assert.IsNotNull(ti.Key);
            Assert.IsNotNull(ti.RawData);
            Assert.AreEqual(null, ti.RawData.GetValue(2));
            Assert.AreEqual("another text", ti.RawData.GetValue(3));
        }
Exemplo n.º 7
0
        public override void OnTrackingCompleted(TrackingCompletedEventArgs e)
        {
            BehaviorManager.TraceSource.TraceEvent(TraceEventType.Information, 0, "in turn behavior, received tracking complete: {0}, result {1}", e.Command, e.Result);
            if (e.Command.Label == commandLabel)
            {
                // we've come to a stop
                // transition to hold brake
                Services.BehaviorManager.Execute(new HoldBrakeBehavior(), null, true);

                // send a completion report
                ForwardCompletionReport(new SuccessCompletionReport(typeof(TurnBehavior)));
            }
        }
Exemplo n.º 8
0
        public override void OnTrackingCompleted(TrackingCompletedEventArgs e)
        {
            BehaviorManager.TraceSource.TraceEvent(TraceEventType.Information, 0, "in stay in lane behavior, received tracking complete: {0}, result {1}", e.Command, e.Result);
            if (e.Command.Label == commandLabel)
            {
                // we've finished coming to a stop, cancel the behavior and execute a hold brake
                Services.BehaviorManager.Execute(new HoldBrakeBehavior(), null, true);

                // send a completion report
                Stopwatch timer = Stopwatch.StartNew();
                ForwardCompletionReport(new SuccessCompletionReport(typeof(StayInLaneBehavior)));
                timer.Stop();
                BehaviorManager.TraceSource.TraceEvent(TraceEventType.Verbose, 0, "SendCompletionReport took {0} ms", timer.ElapsedMilliseconds);
            }
        }
        private void CreateAndModifyInNextListener(object sender, TrackingCompletedEventArgs e)
        {
            ListenerIsCalled();
            Assert.IsNotNull(e.Changes);
            Assert.AreEqual(1, e.Changes.Count());
            var ti = e.Changes.First();

            Assert.AreEqual(TrackingItemState.Changed, ti.State);
            Assert.IsNotNull(ti.Key);
            Assert.IsNotNull(ti.RawData);
            Assert.AreEqual(1, ti.ChangedValues.Count());
            var changedValue = ti.ChangedValues.First();

            Assert.AreEqual("some text", changedValue.OriginalValue);
            Assert.AreEqual("another text", changedValue.NewValue);
        }
Exemplo n.º 10
0
        public override void OnTrackingCompleted(TrackingCompletedEventArgs e)
        {
            // we're done and stuff
            if (e.Command.Label == command_label)
            {
                // we've finished coming to a stop, cancel the behavior and execute a hold brake
                Services.BehaviorManager.Execute(new HoldBrakeBehavior(), null, true);

                // send a completion report
                Services.BehaviorManager.ForwardCompletionReport(new SuccessCompletionReport(typeof(ZoneTravelingBehavior)));
            }
            else if (e.Command.Label == reverse_label)
            {
                reverseGear = false;
            }
        }
        private void CreateInOutermostAndNestedListener(object sender, TrackingCompletedEventArgs e)
        {
            ListenerIsCalled();
            Assert.IsNotNull(e.Changes);
            Assert.AreEqual(2, e.Changes.Count());
            var ti = e.Changes.First();

            Assert.AreEqual(TrackingItemState.Created, ti.State);
            Assert.IsNotNull(ti.Key);
            Assert.IsNotNull(ti.RawData);
            Assert.AreEqual("some text", ti.RawData.GetValue(2));
            ti = e.Changes.Skip(1).First();
            Assert.AreEqual(TrackingItemState.Created, ti.State);
            Assert.IsNotNull(ti.Key);
            Assert.IsNotNull(ti.RawData);
            Assert.AreEqual("some text", ti.RawData.GetValue(2));
        }
 private void CreateAndRollbackInOutermostListener(object sender, TrackingCompletedEventArgs e)
 {
     throw new AssertionException("This must not be called when outermost transaction is rolled back");
 }
 public void OnTrackingCompleted(TrackingCompletedEventArgs e)
 {
     // we shouldn't be stopping or anything
 }
Exemplo n.º 14
0
 public void OnTrackingCompleted(TrackingCompletedEventArgs e)
 {
     passCompleted = true;
 }
Exemplo n.º 15
0
 public void OnTrackingCompleted(TrackingCompletedEventArgs e)
 {
     // nothing to do
 }