Exemplo n.º 1
0
        private void OnTaskFailedMasterCommand(TaskFailedMasterCommand message)
        {
            Trace.WriteLine("ENTER: Task '{0}' in processor '{1}' failed ...".FormatInvariant(message.TaskId, message.TaskProcessorId));

            if (!message.IsTaskProcessorStopping)
            {
                this.AssignTasksToProcessor(message.TaskProcessorId);
            }

            Trace.WriteLine("EXIT: Task '{0}' failed in processor '{1}' failed.".FormatInvariant(message.TaskId, message.TaskProcessorId));
        }
Exemplo n.º 2
0
        public void AddTaskFailedMasterCommand()
        {
            Guid taskId = Guid.NewGuid();

            Guid taskProcessorId = Guid.NewGuid();

            DateTime timestamp = DateTime.UtcNow;

            this.Sender.NotifyTaskFailed(taskId, timestamp, taskProcessorId, false, "Hello Error");

            Thread.Sleep(this.Timeout);

            TaskFailedMasterCommand command = this.MasterCommands.OfType <TaskFailedMasterCommand>().First(c => c.TaskId == taskId);

            Assert.AreEqual(taskProcessorId, command.TaskProcessorId);
            Assert.IsFalse(command.IsTaskProcessorStopping);
            Assert.AreEqual("Hello Error", command.Error);

            this.AssertEquals(timestamp, command.TimestampUtc);
        }