From e45c71f358804793f93a85a053d9dd0b7e4d250f Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Fri, 13 Sep 2024 17:53:26 -0700 Subject: [PATCH] Ready to test --- Adaptation/FileHandlers/TIBCO/FileRead.cs | 8 ++- .../FileHandlers/TIBCO/Transport/Job.cs | 66 ++++++++++++++++++- .../FileHandlers/TIBCO/Transport/Main.cs | 7 +- .../FileHandlers/TIBCO/Transport/Reactor.cs | 18 +++++ .../TIBCO/Transport/ReactorRoot.cs | 14 ++++ .../TIBCO/Transport/RunDataSheet.cs | 18 +++++ .../TIBCO/Transport/RunDataSheetRoot.cs | 14 ++++ Adaptation/_Tests/Static/Job.cs | 48 +++++++++++--- MET08DDUPSP1TBI.csproj | 4 ++ 9 files changed, 184 insertions(+), 13 deletions(-) create mode 100644 Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs create mode 100644 Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs create mode 100644 Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs create mode 100644 Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs diff --git a/Adaptation/FileHandlers/TIBCO/FileRead.cs b/Adaptation/FileHandlers/TIBCO/FileRead.cs index 888154d..9787e98 100644 --- a/Adaptation/FileHandlers/TIBCO/FileRead.cs +++ b/Adaptation/FileHandlers/TIBCO/FileRead.cs @@ -6,6 +6,7 @@ using Adaptation.Shared.Methods; using System; using System.Collections.Generic; using System.IO; +using System.Net.Http; using System.Text.Json; namespace Adaptation.FileHandlers.TIBCO; @@ -17,6 +18,7 @@ public class FileRead : Shared.FileRead, IFileRead public const string BarcodeHostFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\BarcodeHost\API"; public const string MetrologyFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\WorkMaterialOut\API"; + public const string OpenInsightApplicationProgrammingInterface = @"http://oi-prod-ec-api.mes.infineon.com/api/oiWizard"; public const string LSL2SQLConnectionString = @"Data Source=messqlec1.infineon.com\PROD1,53959;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;"; private long? _TickOffset; @@ -42,6 +44,9 @@ public class FileRead : Shared.FileRead, IFileRead string metrologyFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Metrology.FileShare"); if (metrologyFileShare != MetrologyFileShare) throw new NotSupportedException($"Update configuration for [{nameof(MetrologyFileShare)}]"); + string openInsightApplicationProgrammingInterface = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.Application.Programming.Interface"); + if (openInsightApplicationProgrammingInterface != OpenInsightApplicationProgrammingInterface) + throw new NotSupportedException($"Update configuration for [{nameof(OpenInsightApplicationProgrammingInterface)}]"); ModelObjectParameterDefinition[] tibcoParameters = GetProperties(cellInstanceConnectionName, modelObjectParameters, "TIBCO."); string tibcoParameterChannel = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CHANNEL"); string tibcoParameterSubject = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_SUBJECT"); @@ -54,7 +59,8 @@ public class FileRead : Shared.FileRead, IFileRead throw new Exception($"Unable to access file-share <{BarcodeHostFileShare}>"); if (_IsEAFHosted) { - Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, LSL2SQLConnectionString, MetrologyFileShare, BarcodeHostFileShare); + HttpClient httpClient = new() { BaseAddress = new(OpenInsightApplicationProgrammingInterface) }; + Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, LSL2SQLConnectionString, MetrologyFileShare, BarcodeHostFileShare, httpClient); if (!string.IsNullOrEmpty(fileConnectorConfiguration.SourceFileLocation)) _ = Transport.Main.Setup(useSleep: true, setIfxTransport: true, tibcoParameterChannel, tibcoParameterSubjectPrefix, tibcoParameterConfigurationLocation, tibcoParameterConfigurationLocationCopy, tibcoParameterSubject); else diff --git a/Adaptation/FileHandlers/TIBCO/Transport/Job.cs b/Adaptation/FileHandlers/TIBCO/Transport/Job.cs index de48abb..005038d 100644 --- a/Adaptation/FileHandlers/TIBCO/Transport/Job.cs +++ b/Adaptation/FileHandlers/TIBCO/Transport/Job.cs @@ -5,9 +5,11 @@ using System.Data.SqlClient; using System.Globalization; using System.IO; using System.Linq; +using System.Net.Http; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; +using System.Threading.Tasks; namespace Adaptation.FileHandlers.TIBCO.Transport; @@ -37,7 +39,7 @@ public partial class Job public DateTime DateTime { get; } public List Items { get; } - public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, string mid) + public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient, string mid) { const int zero = 0; Items = new List(); @@ -59,7 +61,10 @@ public partial class Job DateTime = DateTime.Now; else DateTime = new DateTime(sequence); - if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && Regex.IsMatch(input.MID, reactorNumberPattern) && input.MesEntity is bioRad2 or bioRad3) + const string dep08CEPIEPSILON = "DEP08CEPIEPSILON"; + if (input.EquipmentType == dep08CEPIEPSILON) + (common, workOrder) = Get(input, httpClient); + else if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && Regex.IsMatch(input.MID, reactorNumberPattern) && input.MesEntity is bioRad2 or bioRad3) (common, workOrder) = Get(input, barcodeHostFileShare); else { @@ -348,6 +353,63 @@ public partial class Job return result; } + private static (Common common, WorkOrder workOrder) Get(Input input, HttpClient httpClient) + { + int? rds; + string psn; + Common common; + WorkOrder workOrder; + Task streamTask; + string zone = string.Empty; + string layer = string.Empty; + Task httpResponseMessageTask; + JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true }; + int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber; + httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/reactors/{reactor}"); + httpResponseMessageTask.Wait(); + if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK) + throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>"); + streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync(); + streamTask.Wait(); + if (!streamTask.Result.CanRead) + throw new NullReferenceException(nameof(streamTask)); + ReactorRoot? reactorRoot = JsonSerializer.Deserialize(streamTask.Result, jsonSerializerOptions); + streamTask.Result.Dispose(); + if (reactorRoot is null || reactor != reactorRoot.Reactor.ReactorNo || reactorRoot.Reactor.LoadedRDS is null || reactorRoot.Reactor.LoadedRDS.Length < 1) + { + rds = null; + psn = string.Empty; + workOrder = new(null, null, null, null, false); + common = new(layer, psn, rds, reactor, zone); + } + else + { + rds = reactorRoot.Reactor.LoadedRDS[0]; + workOrder = new(null, null, null, null, false); + httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/materials/rds/{rds}"); + httpResponseMessageTask.Wait(); + if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK) + throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>"); + streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync(); + streamTask.Wait(); + if (!streamTask.Result.CanRead) + throw new NullReferenceException(nameof(streamTask)); + RunDataSheetRoot? runDataSheetRoot = JsonSerializer.Deserialize(streamTask.Result, jsonSerializerOptions); + streamTask.Result.Dispose(); + if (runDataSheetRoot is null || reactor != runDataSheetRoot.RunDataSheet.Reactor) + { + psn = string.Empty; + common = new(layer, psn, rds, reactor, zone); + } + else + { + psn = runDataSheetRoot.RunDataSheet.PSN.ToString(); + common = new(layer, psn, rds, reactor, zone); + } + } + return new(common, workOrder); + } + private static (Common common, WorkOrder workOrder) Get(Input input, string barcodeHostFileShare) { if (string.IsNullOrEmpty(barcodeHostFileShare) || !Directory.Exists(barcodeHostFileShare)) diff --git a/Adaptation/FileHandlers/TIBCO/Transport/Main.cs b/Adaptation/FileHandlers/TIBCO/Transport/Main.cs index 6bd77d5..9eb9e7b 100644 --- a/Adaptation/FileHandlers/TIBCO/Transport/Main.cs +++ b/Adaptation/FileHandlers/TIBCO/Transport/Main.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Net.Http; using System.Threading; namespace Adaptation.FileHandlers.TIBCO.Transport; @@ -19,12 +20,14 @@ internal partial class Main private static string _BarcodeHostFileShare; private static string _LSL2SQLConnectionString; private static string _TibcoParameterSubjectPrefix; + private static HttpClient _HttpClient; private static FileConnectorConfiguration _FileConnectorConfiguration; - internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare) + internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient) { _SMTP = smtp; _IfxTransport = null; + _HttpClient = httpClient; _CellInstanceName = cellInstanceName; _MetrologyFileShare = metrologyFileShare; _TibcoParameterSubjectPrefix = string.Empty; @@ -186,7 +189,7 @@ internal partial class Main if (!subject.Contains(_TibcoParameterSubjectPrefix)) throw new Exception("Invalid Subject"); mid = GetJobsMID(envelopeDocument); - Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, mid); + Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, _HttpClient, mid); if (job.IsAreaSi) { IfxDoc sendReply = GetJobsReply(job); diff --git a/Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs b/Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs new file mode 100644 index 0000000..dd53328 --- /dev/null +++ b/Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.TIBCO.Transport; + +public class Reactor +{ + + [JsonConstructor] + public Reactor(int reactorNo, int[] loadedRDS) + { + ReactorNo = reactorNo; + LoadedRDS = loadedRDS; + } + + [JsonPropertyName("reactorNo")] public int ReactorNo { get; } // { init; get; } + [JsonPropertyName("loadedRDS")] public int[] LoadedRDS { get; } // { init; get; } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs b/Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs new file mode 100644 index 0000000..53c00d1 --- /dev/null +++ b/Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs @@ -0,0 +1,14 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.TIBCO.Transport; + +public class ReactorRoot +{ + + [JsonConstructor] + public ReactorRoot(Reactor reactor) => + Reactor = reactor; + + [JsonPropertyName("reactor")] public Reactor Reactor { get; } // { init; get; } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs b/Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs new file mode 100644 index 0000000..71df1b8 --- /dev/null +++ b/Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.TIBCO.Transport; + +public class RunDataSheet +{ + + [JsonConstructor] + public RunDataSheet(int psn, int reactor) + { + PSN = psn; + Reactor = reactor; + } + + [JsonPropertyName("PSN")] public int PSN { get; } // { init; get; } + [JsonPropertyName("reactor")] public int Reactor { get; } // { init; get; } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs b/Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs new file mode 100644 index 0000000..4b53cf5 --- /dev/null +++ b/Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs @@ -0,0 +1,14 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.TIBCO.Transport; + +public class RunDataSheetRoot +{ + + [JsonConstructor] + public RunDataSheetRoot(RunDataSheet runDataSheet) => + RunDataSheet = runDataSheet; + + [JsonPropertyName("rds")] public RunDataSheet RunDataSheet { get; } // { init; get; } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Static/Job.cs b/Adaptation/_Tests/Static/Job.cs index 15cef52..04bf05f 100644 --- a/Adaptation/_Tests/Static/Job.cs +++ b/Adaptation/_Tests/Static/Job.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics; +using System.Net.Http; using System.Reflection; namespace Adaptation._Tests.Static; @@ -47,34 +48,42 @@ public class Job : LoggingUnitTesting, IDisposable [TestMethod] public void TestJobA() { + string mid; FileHandlers.TIBCO.Transport.Job job; MethodBase methodBase = new StackFrame().GetMethod(); string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare; string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare; string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString; LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}"); + HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) }; + mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "21"); Assert.IsTrue(job.LotName == "123456"); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4609"); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}"); + mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51"); Assert.IsTrue(job.LotName == "544481"); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158"); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}"); + mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51"); Assert.IsTrue(job.LotName == "544481"); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158"); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08THFTIRQS408M\", \"MesEntity\": \"BIORAD2\", \"Sequence\": \"123456789\", \"MID\": \"37--\", \"Recipe\": \"Recipe\"}"); + mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08THFTIRQS408M\", \"MesEntity\": \"BIORAD2\", \"Sequence\": \"123456789\", \"MID\": \"37--\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(job.ProcessType == "37"); Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "549918"); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5101"); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}"); + mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54"); Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000"); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445"); LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE5\", \"Sequence\": \"638163023363575829\", \"MID\": \"B48\", \"Recipe\": \"lsl_6in \"}"); + mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE5\", \"Sequence\": \"638163023363575829\", \"MID\": \"B48\", \"Recipe\": \"lsl_6in \"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54"); Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000"); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445"); @@ -92,7 +101,9 @@ public class Job : LoggingUnitTesting, IDisposable string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare; string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString; LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"P1234\", \"Recipe\": \"Recipe\"}"); + HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) }; + string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"P1234\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); @@ -110,7 +121,28 @@ public class Job : LoggingUnitTesting, IDisposable string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare; string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString; LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"BIORAD3\", \"Sequence\": \"638234699589174855\", \"MID\": \"33--\", \"Recipe\": \"Recipe\"}"); + HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) }; + string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"BIORAD3\", \"Sequence\": \"638234699589174855\", \"MID\": \"33--\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); + Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); + Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); + Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + + [TestMethod] + public void TestJobD() + { + FileHandlers.TIBCO.Transport.Job job; + MethodBase methodBase = new StackFrame().GetMethod(); + string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare; + string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare; + string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString; + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) }; + string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"DEP08CEPIEPSILON\", \"MesEntity\": \"32\", \"Sequence\": \"638234699589174855\", \"MID\": \"32--\", \"Recipe\": \"Recipe\"}"; + job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid); Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); diff --git a/MET08DDUPSP1TBI.csproj b/MET08DDUPSP1TBI.csproj index a67efe2..eb9ae76 100644 --- a/MET08DDUPSP1TBI.csproj +++ b/MET08DDUPSP1TBI.csproj @@ -125,7 +125,11 @@ + + + +