diff --git a/Adaptation/.vscode/tasks.json b/Adaptation/.vscode/tasks.json index 7f4975d..68cdbae 100644 --- a/Adaptation/.vscode/tasks.json +++ b/Adaptation/.vscode/tasks.json @@ -68,7 +68,7 @@ "args": [ "/target:Build", "/restore:True", - "/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json", + "/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json", "/detailedsummary", "/consoleloggerparameters:PerformanceSummary;ErrorsOnly;", "/property:Configuration=Debug;TargetFrameworkVersion=v4.8", @@ -76,6 +76,18 @@ ], "problemMatcher": "$msCompile" }, + { + "label": "Project", + "type": "shell", + "command": "code ../MET08AWCT.csproj", + "problemMatcher": [] + }, + { + "label": "Git Config", + "type": "shell", + "command": "code ../.git/config", + "problemMatcher": [] + }, { "label": "Kanbn Console", "type": "npm", diff --git a/Adaptation/MET08AWCT.Tests.csproj b/Adaptation/MET08AWCT.Tests.csproj index 12d111c..d273faf 100644 --- a/Adaptation/MET08AWCT.Tests.csproj +++ b/Adaptation/MET08AWCT.Tests.csproj @@ -35,7 +35,7 @@ - + NU1701 NU1701 @@ -44,41 +44,39 @@ NU1701 NU1701 NU1701 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + NU1701 - - - + + + - - - - - - - + + NU1701 - NU1701 - NU1701 - NU1701 + + + + + diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs index 136ccae..b2ca7b6 100644 --- a/Adaptation/Shared/ProcessDataStandardFormat.cs +++ b/Adaptation/Shared/ProcessDataStandardFormat.cs @@ -152,9 +152,11 @@ public class ProcessDataStandardFormat { string value; string[] segments; + List lines = new(); StringBuilder stringBuilder = new(); foreach (string bodyLine in bodyLines) { + _ = stringBuilder.Clear(); _ = stringBuilder.Append('{'); segments = bodyLine.Trim().Split('\t'); if (!lookForNumbers) @@ -179,10 +181,11 @@ public class ProcessDataStandardFormat } } _ = stringBuilder.Remove(stringBuilder.Length - 1, 1); - _ = stringBuilder.AppendLine("},"); + _ = stringBuilder.AppendLine("}"); + lines.Add(stringBuilder.ToString()); } - _ = stringBuilder.Remove(stringBuilder.Length - 3, 3); - results = JsonSerializer.Deserialize(string.Concat("[", stringBuilder, "]")); + string json = $"[{string.Join(",", lines)}]"; + results = JsonSerializer.Deserialize(json); } return results; } diff --git a/Adaptation/_Tests/CreateSelfDescription/Production/v2.59.0/MET08AWCT.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.59.0/MET08AWCT.cs new file mode 100644 index 0000000..cfee7c7 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Production/v2.59.0/MET08AWCT.cs @@ -0,0 +1,63 @@ +#if true +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +namespace Adaptation._Tests.CreateSelfDescription.Production.v2_59_0; + +[TestClass] +public class MET08AWCT : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static MET08AWCT EAFLoggingUnitTesting { get; private set; } + + public MET08AWCT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public MET08AWCT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new MET08AWCT(testContext); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); + File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); + File.WriteAllText(fileNameAndText[2], fileNameAndText[3]); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + EAFLoggingUnitTesting.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Production__v2_59_0__MET08AWCT__ZipFilesByDate() + { + string check = "*.pdsf"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Production/v2.59.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Production/v2.59.0/WC6INCH1-EQPT.cs new file mode 100644 index 0000000..4d0e856 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Production/v2.59.0/WC6INCH1-EQPT.cs @@ -0,0 +1,65 @@ +#if true +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +namespace Adaptation._Tests.CreateSelfDescription.Production.v2_59_0; + +[TestClass] +public class WC6INCH1_EQPT : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static WC6INCH1_EQPT EAFLoggingUnitTesting { get; private set; } + + static WC6INCH1_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; + + public WC6INCH1_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public WC6INCH1_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new WC6INCH1_EQPT(testContext); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); + File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); + File.WriteAllText(fileNameAndText[2], fileNameAndText[3]); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + EAFLoggingUnitTesting.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Production__v2_59_0__WC6INCH1_EQPT__ConvertExcelToJson() + { + string check = "*.wc"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/MET08AWCT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/MET08AWCT.cs index 1ab72cc..a6726f6 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/MET08AWCT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/MET08AWCT.cs @@ -1,4 +1,4 @@ -#if true +#if v2_57_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/WC6INCH1-EQPT.cs index 0eaf223..aca4d42 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/WC6INCH1-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.57.0/WC6INCH1-EQPT.cs @@ -1,4 +1,4 @@ -#if true +#if v2_57_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Adaptation/_Tests/Extract/Production/v2.59.0/MET08AWCT.cs b/Adaptation/_Tests/Extract/Production/v2.59.0/MET08AWCT.cs new file mode 100644 index 0000000..8b67333 --- /dev/null +++ b/Adaptation/_Tests/Extract/Production/v2.59.0/MET08AWCT.cs @@ -0,0 +1,29 @@ +#if true +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adaptation._Tests.Extract.Production.v2_59_0; + +[TestClass] +public class MET08AWCT +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Production.v2_59_0.MET08AWCT _MET08AWCT; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Production.v2_59_0.MET08AWCT.ClassInitialize(testContext); + _MET08AWCT = CreateSelfDescription.Production.v2_59_0.MET08AWCT.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Production__v2_59_0__MET08AWCT__ZipFilesByDate() => _MET08AWCT.Production__v2_59_0__MET08AWCT__ZipFilesByDate(); + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Production/v2.59.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/Extract/Production/v2.59.0/WC6INCH1-EQPT.cs new file mode 100644 index 0000000..70a0311 --- /dev/null +++ b/Adaptation/_Tests/Extract/Production/v2.59.0/WC6INCH1-EQPT.cs @@ -0,0 +1,62 @@ +#if true +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text.Json; + +namespace Adaptation._Tests.Extract.Production.v2_59_0; + +[TestClass] +public class WC6INCH1_EQPT +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Production.v2_59_0.WC6INCH1_EQPT _WC6INCH1_EQPT; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Production.v2_59_0.WC6INCH1_EQPT.ClassInitialize(testContext); + _WC6INCH1_EQPT = CreateSelfDescription.Production.v2_59_0.WC6INCH1_EQPT.EAFLoggingUnitTesting; + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Production__v2_59_0__WC6INCH1_EQPT__ConvertExcelToJson() => _WC6INCH1_EQPT.Production__v2_59_0__WC6INCH1_EQPT__ConvertExcelToJson(); + + [Ignore] + [TestMethod] + public void Production__v2_59_0__WC6INCH1_EQPT__ConvertExcelToJson637961178824025822__Normal() + { + string check = "*.wc"; + bool validatePDSF = false; + MethodBase methodBase = new StackFrame().GetMethod(); + _WC6INCH1_EQPT.Production__v2_59_0__WC6INCH1_EQPT__ConvertExcelToJson(); + Assert.IsFalse(string.IsNullOrEmpty(_WC6INCH1_EQPT.AdaptationTesting.TestContext.FullyQualifiedTestClassName)); + string[] variables = _WC6INCH1_EQPT.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _WC6INCH1_EQPT.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Tuple> extractResult = fileRead.ReExtract(); + Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1)); + Assert.IsNotNull(extractResult.Item3); + Assert.IsNotNull(extractResult.Item4); + NonThrowTryCatch(); + } + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.57.0/MET08AWCT.cs b/Adaptation/_Tests/Extract/Staging/v2.57.0/MET08AWCT.cs index 2838d9d..3871682 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.57.0/MET08AWCT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.57.0/MET08AWCT.cs @@ -1,4 +1,4 @@ -#if true +#if v2_57_0 using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Adaptation._Tests.Extract.Staging.v2_57_0; diff --git a/Adaptation/_Tests/Extract/Staging/v2.57.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.57.0/WC6INCH1-EQPT.cs index 2273a50..bc5e1ed 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.57.0/WC6INCH1-EQPT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.57.0/WC6INCH1-EQPT.cs @@ -1,4 +1,4 @@ -#if true +#if v2_57_0 using Adaptation.Shared; using Adaptation.Shared.Methods; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Adaptation/_Tests/Static/MET08AWCT.cs b/Adaptation/_Tests/Static/MET08AWCT.cs index 9e2132c..d66a3af 100644 --- a/Adaptation/_Tests/Static/MET08AWCT.cs +++ b/Adaptation/_Tests/Static/MET08AWCT.cs @@ -58,20 +58,20 @@ public class MET08AWCT : LoggingUnitTesting, IDisposable [Ignore] #endif [TestMethod] - public void Staging() + public void Production() { MethodBase methodBase = new StackFrame().GetMethod(); StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("MET08AWCT", "v2.57.0"), + new("MET08AWCT", "v2.59.0"), }; - string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2"; + string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); foreach ((string cellInstanceName, string cellInstanceVersionName) in collection) { - cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration"); + cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{production}/{cellInstanceName}/{cellInstanceVersionName}/configuration"); _ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}"); } string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; diff --git a/Adaptation/_Tests/Static/WC.cs b/Adaptation/_Tests/Static/WC.cs index 6b73d18..1bbe73c 100644 --- a/Adaptation/_Tests/Static/WC.cs +++ b/Adaptation/_Tests/Static/WC.cs @@ -58,26 +58,26 @@ public class WC : LoggingUnitTesting, IDisposable [Ignore] #endif [TestMethod] - public void Staging() + public void Production() { MethodBase methodBase = new StackFrame().GetMethod(); StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("WC6INCH1-EQPT", "v2.57.0"), - new("WC6INCH2-EQPT", "v2.57.0"), - new("WC6INCH3-EQPT", "v2.57.0"), - new("WC6INCH4-EQPT", "v2.57.0"), - new("WC8INCH1-EQPT", "v2.57.0"), - new("WC8INCH2-EQPT", "v2.57.0"), - new("WC8INCH3-EQPT", "v2.57.0"), + new("WC6INCH1-EQPT", "v2.59.0"), + new("WC6INCH2-EQPT", "v2.59.0"), + new("WC6INCH3-EQPT", "v2.59.0"), + new("WC6INCH4-EQPT", "v2.59.0"), + new("WC8INCH1-EQPT", "v2.59.0"), + new("WC8INCH2-EQPT", "v2.59.0"), + new("WC8INCH3-EQPT", "v2.59.0"), }; - string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2"; + string production = "http://messa08ec.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); foreach ((string cellInstanceName, string cellInstanceVersionName) in collection) { - cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration"); + cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{production}/{cellInstanceName}/{cellInstanceVersionName}/configuration"); _ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}"); } string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; diff --git a/MET08AWCT.csproj b/MET08AWCT.csproj index 2d2e6f7..6e48f67 100644 --- a/MET08AWCT.csproj +++ b/MET08AWCT.csproj @@ -159,13 +159,13 @@ - 2.57.0 + 2.59.0 5.2.7 - 6.0.3 + 8.0.3 4.3.0