Exemple #1
0
        private ExecutionEngineType GetExecutionEngineType(MemberInfo memberInfo)
        {
            var executionEngineType = ExecutionEngineType.TestStudio;

            ExecutionEngineType methodExecutionEngineType = this.GetExecutionEngineTypeByMethodInfo(memberInfo);
            ExecutionEngineType classExecutionEngineType  = this.GetExecutionEngineType(memberInfo.DeclaringType);

            if (methodExecutionEngineType != ExecutionEngineType.NotSpecified)
            {
                executionEngineType = methodExecutionEngineType;
            }
            else if (classExecutionEngineType != ExecutionEngineType.NotSpecified)
            {
                executionEngineType = classExecutionEngineType;
            }

            return(executionEngineType);
        }
        private void Refresh(ExecutionEngineType type)
        {
            string endpointAddress = null;

            if (type == ExecutionEngineType.Retrival)
            {
                endpointAddress = "net.pipe://localhost/ItSoftware.CompuFlow.Retrival";
            }
            else if (type == ExecutionEngineType.Generator)
            {
                endpointAddress = "net.pipe://localhost/ItSoftware.CompuFlow.Generator";
            }
            else if (type == ExecutionEngineType.Publisher)
            {
                endpointAddress = "net.pipe://localhost/ItSoftware.CompuFlow.Publisher";
            }
            else if (type == ExecutionEngineType.Events)
            {
                endpointAddress = "net.pipe://localhost/ItSoftware.CompuFlow.Events";
            }

            if (string.IsNullOrEmpty(endpointAddress) || string.IsNullOrWhiteSpace(endpointAddress))
            {
                return;
            }

            try
            {
                StatusInformationProxy proxy = new StatusInformationProxy(new NetNamedPipeBinding(NetNamedPipeSecurityMode.None), new EndpointAddress(endpointAddress));
                //string info = @"<?xml version=""1.0"" encoding=""utf-8""?><statusInformation><channels><channel name=""ChannelA"" queueCount=""5""><queue><item>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FlowManifest&gt;&lt;GUID&gt;789ceeed-b3c3-43ce-9311-d9a7c61bac35&lt;/GUID&gt;&lt;RequestInitiated&gt;2010-06-29T15:04:28&lt;/RequestInitiated&gt;&lt;RequestCompleted&gt;0001-01-01T00:00:00&lt;/RequestCompleted&gt;&lt;FlowID&gt;1&lt;/FlowID&gt;&lt;FlowStatus&gt;CompletedGateway&lt;/FlowStatus&gt;&lt;InputParameters&gt;&lt;InputParameter&gt;&lt;Key&gt;FlowID&lt;/Key&gt;&lt;Value&gt;1&lt;/Value&gt;&lt;/InputParameter&gt;&lt;InputParameter&gt;&lt;Key&gt;Site&lt;/Key&gt;&lt;Value&gt;kjetil.info&lt;/Value&gt;&lt;/InputParameter&gt;&lt;/InputParameters&gt;&lt;/FlowManifest&gt;</item><item>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FlowManifest&gt;&lt;GUID&gt;b70f784c-bb62-4269-bcd5-4ef667250b97&lt;/GUID&gt;&lt;RequestInitiated&gt;2010-06-29T15:04:29&lt;/RequestInitiated&gt;&lt;RequestCompleted&gt;0001-01-01T00:00:00&lt;/RequestCompleted&gt;&lt;FlowID&gt;1&lt;/FlowID&gt;&lt;FlowStatus&gt;CompletedGateway&lt;/FlowStatus&gt;&lt;InputParameters&gt;&lt;InputParameter&gt;&lt;Key&gt;FlowID&lt;/Key&gt;&lt;Value&gt;1&lt;/Value&gt;&lt;/InputParameter&gt;&lt;InputParameter&gt;&lt;Key&gt;Site&lt;/Key&gt;&lt;Value&gt;kjetil.info&lt;/Value&gt;&lt;/InputParameter&gt;&lt;/InputParameters&gt;&lt;/FlowManifest&gt;</item><item>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FlowManifest&gt;&lt;GUID&gt;2ec98202-d449-4a41-a623-8d536f35ebf7&lt;/GUID&gt;&lt;RequestInitiated&gt;2010-06-29T15:04:30&lt;/RequestInitiated&gt;&lt;RequestCompleted&gt;0001-01-01T00:00:00&lt;/RequestCompleted&gt;&lt;FlowID&gt;1&lt;/FlowID&gt;&lt;FlowStatus&gt;CompletedGateway&lt;/FlowStatus&gt;&lt;InputParameters&gt;&lt;InputParameter&gt;&lt;Key&gt;FlowID&lt;/Key&gt;&lt;Value&gt;1&lt;/Value&gt;&lt;/InputParameter&gt;&lt;InputParameter&gt;&lt;Key&gt;Site&lt;/Key&gt;&lt;Value&gt;kjetil.info&lt;/Value&gt;&lt;/InputParameter&gt;&lt;/InputParameters&gt;&lt;/FlowManifest&gt;</item><item>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FlowManifest&gt;&lt;GUID&gt;61ce2cdb-33a9-40ac-8c75-ebadea38417b&lt;/GUID&gt;&lt;RequestInitiated&gt;2010-06-29T15:04:31&lt;/RequestInitiated&gt;&lt;RequestCompleted&gt;0001-01-01T00:00:00&lt;/RequestCompleted&gt;&lt;FlowID&gt;1&lt;/FlowID&gt;&lt;FlowStatus&gt;CompletedGateway&lt;/FlowStatus&gt;&lt;InputParameters&gt;&lt;InputParameter&gt;&lt;Key&gt;FlowID&lt;/Key&gt;&lt;Value&gt;1&lt;/Value&gt;&lt;/InputParameter&gt;&lt;InputParameter&gt;&lt;Key&gt;Site&lt;/Key&gt;&lt;Value&gt;kjetil.info&lt;/Value&gt;&lt;/InputParameter&gt;&lt;/InputParameters&gt;&lt;/FlowManifest&gt;</item><item>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FlowManifest&gt;&lt;GUID&gt;4c0fe694-df5f-4dc0-bd02-b035a0f4053d&lt;/GUID&gt;&lt;RequestInitiated&gt;2010-06-29T15:04:32&lt;/RequestInitiated&gt;&lt;RequestCompleted&gt;0001-01-01T00:00:00&lt;/RequestCompleted&gt;&lt;FlowID&gt;1&lt;/FlowID&gt;&lt;FlowStatus&gt;CompletedGateway&lt;/FlowStatus&gt;&lt;InputParameters&gt;&lt;InputParameter&gt;&lt;Key&gt;FlowID&lt;/Key&gt;&lt;Value&gt;1&lt;/Value&gt;&lt;/InputParameter&gt;&lt;InputParameter&gt;&lt;Key&gt;Site&lt;/Key&gt;&lt;Value&gt;kjetil.info&lt;/Value&gt;&lt;/InputParameter&gt;&lt;/InputParameters&gt;&lt;/FlowManifest&gt;</item></queue><flows><flow filename=""C:\ItSoftware.CompuFlow\Retrival\Retrivals\ChannelA\1\1.zip"" flowID=""1""><lastExecTime>00:00:00</lastExecTime><minExecTime>00:00:00</minExecTime><maxExecTime>00:00:00</maxExecTime><avgExecTime>00:00:00</avgExecTime><progressItems /></flow></flows></channel></channels></statusInformation>";
                string info = proxy.GatherStatusInformation();
                RenderStatusInformation(info, type);
            }
            catch (Exception x) {
                ExceptionManager.PublishException(x, "Error");
                ErrorInfoWindow wei = new ErrorInfoWindow();
                wei.ErrorInformation = this.FormatException(x);
                wei.ShowDialog();
            }
        }
 public ExecutionEngineAttribute(ExecutionEngineType executionEngineType, Browsers browser)
 {
     Browser             = browser;
     ExecutionEngineType = executionEngineType;
 }
 private void RenderStatusInformation(string info, ExecutionEngineType type)
 {
     if (type == ExecutionEngineType.Retrival)
     {
         DataTable dt = null;
         if (this.Details == DetailsType.Status)
         {
             dt = CreateDataTableStatus(info);
         }
         else if (this.Details == DetailsType.Progress)
         {
             dt = CreateDataTableProgress(info);
         }
         else if (this.Details == DetailsType.Manifest)
         {
             dt = CreateDataTableManifest(info);
         }
         else if (this.Details == DetailsType.Queue)
         {
             dt = CreateDataTableQueue(info);
         }
         if (dt != null)
         {
             this.RetrivalDataGrid.ItemsSource = null;
             this.RetrivalDataGrid.ItemsSource = dt.DefaultView;
         }
     }
     else if (type == ExecutionEngineType.Generator)
     {
         DataTable dt = null;
         if (this.Details == DetailsType.Status)
         {
             dt = CreateDataTableStatus(info);
         }
         else if (this.Details == DetailsType.Progress)
         {
             dt = CreateDataTableProgress(info);
         }
         else if (this.Details == DetailsType.Manifest)
         {
             dt = CreateDataTableManifest(info);
         }
         else if (this.Details == DetailsType.Queue)
         {
             dt = CreateDataTableQueue(info);
         }
         if (dt != null)
         {
             this.GeneratorDataGrid.ItemsSource = null;
             this.GeneratorDataGrid.ItemsSource = dt.DefaultView;
         }
     }
     else if (type == ExecutionEngineType.Publisher)
     {
         DataTable dt = null;
         if (this.Details == DetailsType.Status)
         {
             dt = CreateDataTableStatus(info);
         }
         else if (this.Details == DetailsType.Progress)
         {
             dt = CreateDataTableProgress(info);
         }
         else if (this.Details == DetailsType.Manifest)
         {
             dt = CreateDataTableManifest(info);
         }
         else if (this.Details == DetailsType.Queue)
         {
             dt = CreateDataTableQueue(info);
         }
         if (dt != null)
         {
             this.PublisherDataGrid.ItemsSource = null;
             this.PublisherDataGrid.ItemsSource = dt.DefaultView;
         }
     }
     else if (type == ExecutionEngineType.Events)
     {
         DataTable dt = null;
         if (this.Details == DetailsType.Status)
         {
             dt = CreateDataTableStatus(info);
         }
         else if (this.Details == DetailsType.Progress)
         {
             dt = CreateDataTableProgress(info);
         }
         else if (this.Details == DetailsType.Manifest)
         {
             dt = CreateDataTableManifest(info);
         }
         else if (this.Details == DetailsType.Queue)
         {
             dt = CreateDataTableQueue(info);
         }
         if (dt != null)
         {
             this.EventsDataGrid.ItemsSource = null;
             this.EventsDataGrid.ItemsSource = dt.DefaultView;
         }
     }
 }
 protected override void PreTestInit(object sender, TestExecutionEventArgs e)
 {
     _executionBrowserType = ConfigureTestExecutionBrowser(e.MemberInfo);
     _executionEngineType  = GetExecutionEngineType(e.MemberInfo);
     ResolveAllDriverDependencies();
 }