diff --git a/.gitignore b/.gitignore index eab1f67..56d8c06 100644 --- a/.gitignore +++ b/.gitignore @@ -331,10 +331,15 @@ ASALocalRun/ ## ## Visual Studio Code ## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +**/.vscode/* +!**/.vscode/extensions.json +!**/.vscode/format-report.json +!**/.vscode/launch.json +!**/.vscode/settings.json +!**/.vscode/tasks.json +!**/.vscode/mklink.md *.lnk + +.kanbn +Adaptation/.kanbn diff --git a/.groovy b/.groovy deleted file mode 100644 index dd33f0d..0000000 --- a/.groovy +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env groovy -/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */ -import groovy.transform.Field - -@Field String _DDrive = 'D:/' -@Field String _AssemblyName = '...' -@Field String _TargetLocation = '...' -@Field String _GitCommitSeven = '...' -@Field String _GitName = 'DEP08SIASM' -@Field String _TestProjectDirectory = 'Adaptation' -@Field String _AgentStaging = 'mestsa07ec-ecmeseaf' -@Field String _DDriveNet = "${_DDrive}Framework4.8" -@Field String _AgentProduction = 'messa08ec-ecmeseaf' -@Field String _AgentDevelopment = 'mestsa003-mesedasvc' -@Field String _ProgramFilesDotnet = 'C:/Program Files/dotnet/dotnet.exe' -@Field String _ProgramFilesMSBuild = 'C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe' - -pipeline { - agent { - label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else' - } - parameters { - string(name: 'GIT_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'mestsa003.infineon.com' : 'mestsa07ec.ec.local', description: 'git server') - string(name: 'DEFAULT_FILE_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'messv02ecc1_ec_local' : 'messv02ecc1.ec.local', description: 'Default file server...') - } - stages { - stage('Git') { - steps { - bat(returnStatus: true, script: 'git init') - bat(returnStatus: true, script: 'git remote add origin \\\\' + params.GIT_SERVER + '\\Git\\' + _GitName + '.git') - bat(returnStatus: true, script: 'git pull origin master') - } - } - stage('Setup') { - steps { - script { - _AssemblyName = "${env.JOB_NAME}" - _GitCommitSeven = '1234567' - // _GitCommitSeven = env.GIT_COMMIT.substring(0, 7) - def files = findFiles(glob: '*.csproj') - if (files.length != 1) { - error("Build failed because couldn't find a *.csproj file") - } - echo """ - ${files[0].name} - ${files[0].path} - ${files[0].directory} - ${files[0].length} - ${files[0].lastModified} - """ - _AssemblyName = files[0].name.split('[.]csproj')[0] - _TargetLocation = "\\\\${params.DEFAULT_FILE_SERVER}\\EC_EAFRepository\\${env.JENKINS_ENVIRONMENT}\\DeploymentStorage\\Adaptation_${_AssemblyName}" - } - } - } - stage('Info') { - steps { - echo "_AssemblyName ${_AssemblyName}" // ... - echo "BUILD_NUMBER ${env.BUILD_NUMBER}" // 11 - echo "DEFAULT_FILE_SERVER ${params.DEFAULT_FILE_SERVER}" // 11 - echo "GIT_BRANCH ${env.GIT_BRANCH}" // origin/master - echo "GIT_COMMIT ${env.GIT_COMMIT}" // 73b814069f2cf0173a62a8228815a9bc9ba93c41 - echo "GIT_SERVER ${params.GIT_SERVER}" // ... - echo "GIT_URL ${env.GIT_URL}" // D:\ProgramData\Git\....git - echo "JENKINS_ENVIRONMENT ${env.JENKINS_ENVIRONMENT}" // 11 - echo "JENKINS_URL ${env.JENKINS_URL}" // http://localhost:8080/ - echo "JOB_NAME ${env.JOB_NAME}" // ... - echo "WORKSPACE ${env.WORKSPACE}" // D:\.jenkins\_\... - } - } - // stage('Restore') { - // steps { - // bat(returnStatus: true, script: 'dotnet --info') - // } - // } - stage('Safe storage of app secrets') { - steps { - dir(_TestProjectDirectory) { - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets init') - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets set "BuildNumber" "' + env.BUILD_NUMBER + '"') - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets set "GitCommitSeven" "' + _GitCommitSeven + '"') - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets set "Server" "' + params.DEFAULT_FILE_SERVER + '"') - } - } - } - stage('Core Build') { - steps { - echo "Build number is ${currentBuild.number}" - dir(_TestProjectDirectory) { - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'build --runtime win-x64 --self-contained --verbosity quiet') - } - } - } - // stage('Test') { - // options { - // timeout(time: 10, unit: 'MINUTES') - // } - // steps { - // dir(_TestProjectDirectory) { - // bat('dotnet --info') - // } - // } - // } - stage('Framework Build') { - steps { - echo "Build number is ${currentBuild.number}" - bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' + - '/target:Restore ' + - '/detailedsummary ' + - '/consoleloggerparameters:PerformanceSummary;ErrorsOnly; ' + - '/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' + - _AssemblyName + '.csproj') - bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' + - '/target:Build ' + - '/detailedsummary ' + - '/consoleloggerparameters:PerformanceSummary;ErrorsOnly; ' + - '/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' + - _AssemblyName + '.csproj') - } - } - stage('Commit Id') { - steps { - dir('bin/Debug') { - writeFile file: "${_AssemblyName}.txt", text: "${env.GIT_COMMIT}-${env.BUILD_NUMBER}-${env.GIT_URL}" - } - } - } - stage('Package') { - steps { - fileOperations([fileZipOperation(folderPath: 'bin/Debug', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug")]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug", targetNameExpression: '')]) - } - } - // stage('Force Fail') { - // steps { - // error("Build failed because of this and that..") - // } - // } - stage('Copy Files to: file-share') { - steps { - dir('bin/Debug') { - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.txt", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.dll", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.exe", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.pdb", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - } - } - } - } - post { - always { - dir('bin') { - deleteDir() - } - dir('obj') { - deleteDir() - } - dir(_TestProjectDirectory + '/bin') { - deleteDir() - } - dir(_TestProjectDirectory + '/obj') { - deleteDir() - } - // cleanWs() - } - } -} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..71cf24f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,55 @@ +{ + "files.eol": "\n", + "[markdown]": { + "editor.wordWrap": "off" + }, + "cSpell.words": [ + "PDSF", + "Syncthing" + ], + "files.exclude": { + "**/node_modules": true + }, + "files.watcherExclude": { + "**/node_modules": true + }, + "foam.files.ignore": [ + ".foam/**/*", + ".stfolder/**/*", + "**/_layouts/**/*", + "**/_site/**/*", + "**/.vscode/**/*", + "**/node_modules/**/*" + ], + "kanbn.showBurndownButton": false, + "kanbn.showSprintButton": false, + "foam.links.hover.enable": false, + "foam.placeholders.exclude": [ + ".kanbn/Archive/**/*" + ], + "foam.orphans.exclude": [ + ".journal/**/*" + ], + "foam.graph.style": { + "background": "#202020", + "node": { + "wired": "green", + "wireless": "orange", + "person": "white", + "topic": "#bc2a3c", + "kanbn": "#ff7b00", + "basic-note": "#773b93", + "daily-note": "#ff9d00", + "note": "#f2cb1d", + "placeholder": "#ff9d00", + "tag": "#0494c1", + "bug": "#bc2a3c", + "epic": "#ff7b00", + "feature": "#773b93", + "issue": "#ff9d00", + "task": "#f2cb1d", + "test-case": "#ff9d00", + "user-story": "#0494c1" + } + } +} \ No newline at end of file diff --git a/Adaptation/.config/dotnet-tools.json b/Adaptation/.config/dotnet-tools.json new file mode 100644 index 0000000..cd368e1 --- /dev/null +++ b/Adaptation/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-reportgenerator-globaltool": { + "version": "5.1.15", + "commands": [ + "reportgenerator" + ] + } + } +} \ No newline at end of file diff --git a/Adaptation/.editorconfig b/Adaptation/.editorconfig index 2220133..69ecc38 100644 --- a/Adaptation/.editorconfig +++ b/Adaptation/.editorconfig @@ -1,3 +1,19 @@ +[*.md] +end_of_line = crlf +file_header_template = unset +indent_size = 2 +indent_style = space +insert_final_newline = false +root = true +tab_width = 2 +[*.csproj] +end_of_line = crlf +file_header_template = unset +indent_size = 2 +indent_style = space +insert_final_newline = false +root = true +tab_width = 2 [*.cs] csharp_indent_block_contents = true csharp_indent_braces = false @@ -76,14 +92,36 @@ csharp_using_directive_placement = outside_namespace dotnet_code_quality_unused_parameters = all dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter dotnet_code_quality.CAXXXX.api_surface = private, internal +dotnet_diagnostic.CA1816.severity = none # CA1816: Call GC.SuppressFinalize correctly dotnet_diagnostic.CA1825.severity = warning # CA1823: Avoid zero-length array allocations dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable +dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer AsSpan over Substring +dotnet_diagnostic.CA1847.severity = none # CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters +dotnet_diagnostic.CA1854.severity = warning # CA1854: Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check to avoid double lookup +dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance +dotnet_diagnostic.CA1861.severity = none # CA1861: Prefer 'static readonly' fields over constant array arguments +dotnet_diagnostic.CA1862.severity = none # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase' +dotnet_diagnostic.CA1864.severity = none # CA1864: To avoid double lookup, call 'TryAdd' instead of calling 'Add' with a 'ContainsKey' guard +dotnet_diagnostic.CA1866.severity = none # CA1866: Use 'string.EndsWith(char)' instead of 'string.EndsWith(string)' when you have a string with a single char +dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead. +dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])' dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2"); +dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant. dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary +dotnet_diagnostic.IDE0028.severity = none # IDE0028: Collection initialization can be simplified +dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031) dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed +dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049) dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter +dotnet_diagnostic.IDE0200.severity = warning # IDE0200: Lambda expression can be removed +dotnet_diagnostic.IDE0270.severity = none # IDE0270: Null check can be simplified +dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290) +dotnet_diagnostic.IDE0300.severity = none # IDE0300: Collection initialization can be simplified +dotnet_diagnostic.IDE0301.severity = none #IDE0301: Collection initialization can be simplified +dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified +dotnet_diagnostic.SYSLIB1045.severity = none # SYSLIB1045: diagnostics for regex source generation dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method @@ -215,7 +253,7 @@ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity dotnet_style_parentheses_in_other_operators = never_if_unnecessary dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity dotnet_style_predefined_type_for_locals_parameters_members = true -dotnet_style_predefined_type_for_member_access = true +dotnet_style_predefined_type_for_member_access = true:warning dotnet_style_prefer_auto_properties = true:warning dotnet_style_prefer_compound_assignment = true:warning dotnet_style_prefer_conditional_expression_over_assignment = false diff --git a/Adaptation/.vscode/launch.json b/Adaptation/.vscode/launch.json index 8962180..ff26980 100644 --- a/Adaptation/.vscode/launch.json +++ b/Adaptation/.vscode/launch.json @@ -4,7 +4,7 @@ "name": ".NET Core Attach", "type": "coreclr", "request": "attach", - "processId": 20908 + "processId": 8084 } ] } diff --git a/Adaptation/.vscode/mklink.md b/Adaptation/.vscode/mklink.md new file mode 100644 index 0000000..5803c6e --- /dev/null +++ b/Adaptation/.vscode/mklink.md @@ -0,0 +1,5 @@ +# mklink + +```bash +mklink /J "T:\DEP08SIHTRPLC\06_SourceCode\DEP08SIHTRPLC\Adaptation\.kanbn" "D:\5-Other-Small\Kanban\DEP08SIHTRPLC" +``` diff --git a/Adaptation/.vscode/settings.json b/Adaptation/.vscode/settings.json index 4d1a803..ea870fc 100644 --- a/Adaptation/.vscode/settings.json +++ b/Adaptation/.vscode/settings.json @@ -1,4 +1,7 @@ { + "[markdown]": { + "editor.wordWrap": "off" + }, "cSpell.words": [ "Analyte", "CICN", @@ -52,6 +55,7 @@ "XRDXRR", "XRDXY" ], + "coverage-gutters.coverageBaseDir": "../../../../DEP08SIASM/05_TestResults/TestResults/**", "workbench.colorCustomizations": { "activityBar.activeBackground": "#7ea1d9", "activityBar.activeBorder": "#f8e6ed", diff --git a/Adaptation/.vscode/tasks.json b/Adaptation/.vscode/tasks.json new file mode 100644 index 0000000..2323d41 --- /dev/null +++ b/Adaptation/.vscode/tasks.json @@ -0,0 +1,104 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Test-Debug", + "command": "dotnet", + "type": "process", + "args": [ + "test", + "-c", + "Debug" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Test-Release", + "command": "dotnet", + "type": "process", + "args": [ + "test", + "-c", + "Release" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Format", + "command": "dotnet", + "type": "process", + "args": [ + "format", + "--report", + ".vscode", + "--verbosity", + "detailed", + "--severity", + "warn" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Nuget Clear", + "command": "dotnet", + "type": "process", + "args": [ + "nuget", + "locals", + "all", + "--clear" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "MSBuild for EAF Deployment Packages", + "command": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe", + "type": "process", + "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", + "/detailedsummary", + "/consoleloggerparameters:PerformanceSummary;ErrorsOnly;", + "/property:Configuration=Debug;TargetFrameworkVersion=v4.8", + "../DEP08SIASM.csproj" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "File-Folder-Helper AOT s M .Kanbn Tasks", + "type": "shell", + "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe s M T:/DEP08SIASM/06_SourceCode/DEP08SIASM/Adaptation -s T:/DEP08SIASM/06_SourceCode/DEP08SIASM/Adaptation/.kanbn/tasks", + "problemMatcher": [] + }, + { + "label": "Kanbn Console", + "type": "npm", + "script": "kanbn.board", + "problemMatcher": [] + }, + { + "label": "Kanbn Write Boad", + "type": "shell", + "command": "& kanbn board -j | L:/Git/kanbn2md/kanbn2md.exe >.kanbn/board.md", + "problemMatcher": [] + }, + { + "label": "Kanbn Write json", + "type": "npm", + "script": "kanbn.board.json", + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/Adaptation/DEP08SIASM-Development.yml b/Adaptation/DEP08SIASM-Development.yml new file mode 100644 index 0000000..4d6a3b4 --- /dev/null +++ b/Adaptation/DEP08SIASM-Development.yml @@ -0,0 +1 @@ +ECHO is on. diff --git a/Adaptation/DEP08SIASM.Tests.csproj b/Adaptation/DEP08SIASM.Tests.csproj index 73eacbf..4f84b25 100644 --- a/Adaptation/DEP08SIASM.Tests.csproj +++ b/Adaptation/DEP08SIASM.Tests.csproj @@ -8,10 +8,9 @@ disable false - 10.0 disable win-x64 - net6.0 + net8.0 trx @@ -33,49 +32,11 @@ Linux - - - - - - - - - - - - + - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - NU1701 - NU1701 - NU1701 - - - NU1701 + + NU1701 NU1701 NU1701 @@ -83,6 +44,41 @@ NU1701 NU1701 NU1701 + + + + + + + + + + + + + + + + NU1701 + + + + + + + + + + + + + + NU1701 + + + NU1701 + NU1701 + NU1701 diff --git a/Adaptation/DEP08SIASM.yml b/Adaptation/DEP08SIASM.yml new file mode 100644 index 0000000..4d6a3b4 --- /dev/null +++ b/Adaptation/DEP08SIASM.yml @@ -0,0 +1 @@ +ECHO is on. diff --git a/Adaptation/FileHandlers/CellInstanceConnectionName.cs b/Adaptation/FileHandlers/CellInstanceConnectionName.cs index f4dbcb5..f020ba1 100644 --- a/Adaptation/FileHandlers/CellInstanceConnectionName.cs +++ b/Adaptation/FileHandlers/CellInstanceConnectionName.cs @@ -9,14 +9,14 @@ namespace Adaptation.FileHandlers; public class CellInstanceConnectionName { - internal static IFileRead Get(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) + internal static IFileRead Get(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, int? connectionCount) { IFileRead result = cellInstanceConnectionName switch { - nameof(DownloadJpegFile) => new DownloadJpegFile.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted), - nameof(jpeg) => new jpeg.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted), - nameof(MonitorApplication) => new MonitorApplication.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted), - nameof(OpenInsight) => new OpenInsight.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted), + nameof(DownloadJpegFile) => new DownloadJpegFile.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), + nameof(jpeg) => new jpeg.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), + nameof(MonitorApplication) => new MonitorApplication.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), + nameof(OpenInsight) => new OpenInsight.FileRead(smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null), _ => throw new Exception($"\"{cellInstanceConnectionName}\" not mapped") }; return result; diff --git a/Adaptation/FileHandlers/DownloadJpegFile/FileRead.cs b/Adaptation/FileHandlers/DownloadJpegFile/FileRead.cs index d60dca1..b8608c1 100644 --- a/Adaptation/FileHandlers/DownloadJpegFile/FileRead.cs +++ b/Adaptation/FileHandlers/DownloadJpegFile/FileRead.cs @@ -20,8 +20,8 @@ public class FileRead : Shared.FileRead, IFileRead private readonly string _FFmpegFileName; private readonly string _StaticFileServer; - public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : - base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted) + public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : + base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null) { _MinFileLength = 10; _NullData = string.Empty; @@ -111,14 +111,7 @@ public class FileRead : Shared.FileRead, IFileRead return results; } - private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) - { - if (reportFullPath is null) - { } - if (dateTime == DateTime.MinValue) - { } - throw new Exception(string.Concat("See ", nameof(Callback))); - } + private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) => throw new Exception(string.Concat("See ", nameof(Callback))); private void DownloadJpegFileSynchronously() { diff --git a/Adaptation/FileHandlers/MonitorApplication/FileRead.cs b/Adaptation/FileHandlers/MonitorApplication/FileRead.cs index 0ba797a..2965f4d 100644 --- a/Adaptation/FileHandlers/MonitorApplication/FileRead.cs +++ b/Adaptation/FileHandlers/MonitorApplication/FileRead.cs @@ -18,8 +18,8 @@ public class FileRead : Shared.FileRead, IFileRead private readonly string _MonitorApplicationSite; private readonly string _MonitorApplicationResource; - public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : - base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted) + public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : + base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null) { _MinFileLength = 10; _NullData = string.Empty; @@ -110,9 +110,10 @@ public class FileRead : Shared.FileRead, IFileRead } private void SendData(DateTime dateTime, List descriptions) +#pragma warning restore IDE0060 { if (dateTime == DateTime.MinValue) - { } + throw new Exception(); MonIn monIn = MonIn.GetInstance(); int value = int.TryParse(descriptions[0].Lot, out int check) ? check : 0; string performanceName = string.Concat(_MonitorApplicationResource, "_", _Logistics.MesEntity); diff --git a/Adaptation/FileHandlers/OpenInsight/FileRead.cs b/Adaptation/FileHandlers/OpenInsight/FileRead.cs index 6ffe427..deacbf8 100644 --- a/Adaptation/FileHandlers/OpenInsight/FileRead.cs +++ b/Adaptation/FileHandlers/OpenInsight/FileRead.cs @@ -19,8 +19,8 @@ public class FileRead : Shared.FileRead, IFileRead private readonly string _MemoryPath; private readonly HttpClient _HttpClient; - public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : - base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted) + public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : + base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null) { _MinFileLength = 10; _NullData = string.Empty; @@ -113,9 +113,10 @@ public class FileRead : Shared.FileRead, IFileRead } private void SendData(DateTime dateTime, List descriptions) +#pragma warning restore IDE0060 { if (dateTime == DateTime.MinValue) - { } + throw new Exception(); string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}"; string logisticsSequenceMemoryDirectory = Path.Combine(_MemoryPath, _EquipmentType, "Source", weekDirectory, _Logistics.Sequence.ToString()); diff --git a/Adaptation/FileHandlers/jpeg/Description.cs b/Adaptation/FileHandlers/jpeg/Description.cs index 9b1046b..ec1ef04 100644 --- a/Adaptation/FileHandlers/jpeg/Description.cs +++ b/Adaptation/FileHandlers/jpeg/Description.cs @@ -35,6 +35,8 @@ public class Description : IDescription, Shared.Properties.IDescription public int TotalDelta { get; set; } public string ClosestMatchFileName { get; set; } + public string RDS { get; set; } + string IDescription.GetEventDescription() => "File Has been read and parsed"; List IDescription.GetNames(IFileRead fileRead, Logistics logistics) @@ -136,7 +138,7 @@ public class Description : IDescription, Shared.Properties.IDescription { List results = new(); - if (iProcessData is null || !iProcessData.Details.Any() || iProcessData is not ProcessData processData) + if (iProcessData is null || iProcessData.Details.Count == 0 || iProcessData is not ProcessData processData) results.Add(GetDefault(fileRead, logistics)); else { @@ -222,4 +224,6 @@ public class Description : IDescription, Shared.Properties.IDescription return result; } + internal static string GetDateFormat() => "MM/dd/yyyy hh:mm:ss tt"; + } \ No newline at end of file diff --git a/Adaptation/FileHandlers/jpeg/FileRead.cs b/Adaptation/FileHandlers/jpeg/FileRead.cs index 1d6b35a..937801d 100644 --- a/Adaptation/FileHandlers/jpeg/FileRead.cs +++ b/Adaptation/FileHandlers/jpeg/FileRead.cs @@ -15,6 +15,7 @@ namespace Adaptation.FileHandlers.jpeg; public class FileRead : Shared.FileRead, IFileRead { + private long? _TickOffset; protected long _LastChange; protected string _LastText; protected readonly int _EndX; @@ -29,8 +30,8 @@ public class FileRead : Shared.FileRead, IFileRead protected readonly Dictionary _Reactors; protected readonly List> _ColorCollections; - public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : - base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted) + public FileRead(ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) : + base(new Description(), true, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null) { _MinFileLength = 36790; _NullData = string.Empty; @@ -157,7 +158,8 @@ public class FileRead : Shared.FileRead, IFileRead private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) { Tuple> results = new(string.Empty, null, null, new List()); - _Logistics = new Logistics(this, reportFullPath, useSplitForMID: true); + _TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks; + _Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true); SetFileParameterLotIDToLogisticsMID(); if (_Logistics.FileInfo.Length < _MinFileLength) results.Item4.Add(_Logistics.FileInfo); @@ -174,7 +176,7 @@ public class FileRead : Shared.FileRead, IFileRead SetFileParameterLotID(mid); string processJobID = iProcessData.GetCurrentReactor(this, _Logistics, _Reactors); _Logistics.Update(mid, processJobID); - if (!iProcessData.Details.Any()) + if (iProcessData.Details.Count == 0) throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks)); if (processData.Text == _LastText && _LastChange > DateTime.Now.AddMinutes(-30).Ticks) File.Delete(reportFullPath); diff --git a/Adaptation/FileHandlers/jpeg/ProcessData.cs b/Adaptation/FileHandlers/jpeg/ProcessData.cs index 700293e..b6f7b8e 100644 --- a/Adaptation/FileHandlers/jpeg/ProcessData.cs +++ b/Adaptation/FileHandlers/jpeg/ProcessData.cs @@ -7,8 +7,10 @@ using System.Data; using System.Drawing; using System.IO; using System.Linq; +using System.Text; using System.Text.Json; using System.Text.Json.Serialization; +using Tesseract; namespace Adaptation.FileHandlers.jpeg; @@ -32,8 +34,6 @@ public class ProcessData : IProcessData public ProcessData(IFileRead fileRead, Logistics logistics, List fileInfoCollection, int startX, int startY, int endX, int endY, int offSetX, int offSetY, Size size, List> colorCollections) { - if (logistics is null) - { } JobID = logistics.JobID; fileInfoCollection.Clear(); _Details = new List(); @@ -330,4 +330,157 @@ public class ProcessData : IProcessData return results; } +#pragma warning disable CA1416 + + private static MemoryStream GetMemoryStream(System.Drawing.Imaging.ImageFormat imageFormat, Bitmap bitmap, int startX, int startY, int endX, int endY, int offSetX, int offSetY) + { + Color color; + int negitiveGrayScale; + MemoryStream result = new(); + int startXValue = startX + offSetX; + int startYValue = startY + offSetY; + int endXValue = endX + offSetX; + int endYValue = endY + offSetY; + using Bitmap selectedBitmap = new(endXValue - startXValue, endYValue - startYValue); + for (int x = startXValue; x < endXValue; x++) + { + for (int y = startYValue; y < endYValue; y++) + { + color = bitmap.GetPixel(x, y); + negitiveGrayScale = 255 - (int)((color.R * 0.3) + (color.G * 0.59) + (color.B * 0.11)); + if (negitiveGrayScale < 162) + selectedBitmap.SetPixel(x - startXValue, y - startYValue, Color.FromArgb(color.A, 0, 0, 0)); + else + selectedBitmap.SetPixel(x - startXValue, y - startYValue, Color.FromArgb(color.A, 255, 255, 255)); + } + } + selectedBitmap.Save(result, imageFormat); + return result; + } + + private static List GetMemoryStreams(string reportFullPath, string extension) + { + List results = new(); + System.Drawing.Imaging.ImageFormat imageFormat = Get(extension); + using Bitmap? bitmap = Image.FromFile(reportFullPath) as Bitmap; + if (bitmap is null) + throw new Exception($"Couldn't load image from <{reportFullPath}>"); + results.Add(GetMemoryStream(imageFormat, bitmap, 6, 130, 791, 953, 0, 0)); + results.Add(GetMemoryStream(imageFormat, bitmap, 48, 795, 359, 869, 0, 0)); + results.Add(GetMemoryStream(imageFormat, bitmap, 376, 814, 430, 832, 0, 0)); + results.Add(GetMemoryStream(imageFormat, bitmap, 373, 793, 433, 874, 0, 0)); + return results; + } + + public static List<(float, string, List)> Parse(string reportFullPath) + { + List<(float, string, List)> results = new(); + string text; + float pageMeanConfidence; + MemoryStream memoryStream; + List blocks = new(); + const string extension = ".tiff"; + StringBuilder stringBuilder = new(); + using TesseractEngine engine = new(string.Empty, "eng", EngineMode.Default); + List memoryStreams = GetMemoryStreams(reportFullPath, extension); + for (int i = 0; i < memoryStreams.Count; i++) + { + _ = stringBuilder.Clear(); + memoryStream = memoryStreams[i]; + using Pix img = Pix.LoadFromMemory(memoryStream.GetBuffer()); + using Page page = engine.Process(img); + text = page.GetText(); + pageMeanConfidence = page.GetMeanConfidence(); + using ResultIterator iter = page.GetIterator(); + iter.Begin(); + do + { + do + { + do + { + do + { + _ = stringBuilder.Append(iter.GetText(PageIteratorLevel.Word)).Append(' '); + if (iter.IsAtFinalOf(PageIteratorLevel.TextLine, PageIteratorLevel.Word) && stringBuilder.Length > 0) + { + blocks.Add(stringBuilder.ToString()); + _ = stringBuilder.Clear(); + } + } while (iter.Next(PageIteratorLevel.TextLine, PageIteratorLevel.Word)); + if (iter.IsAtFinalOf(PageIteratorLevel.Para, PageIteratorLevel.TextLine)) + _ = stringBuilder.AppendLine(); + } while (iter.Next(PageIteratorLevel.Para, PageIteratorLevel.TextLine)); + } while (iter.Next(PageIteratorLevel.Block, PageIteratorLevel.Para)); + } while (iter.Next(PageIteratorLevel.Block)); + if (stringBuilder.Length > 0) + blocks.Add(stringBuilder.ToString()); + results.Add(new(pageMeanConfidence, text, blocks)); + // if (!fileRead.IsEAFHosted) + // { + // fileInfoCollection.Add(new FileInfo(saveFileName)); + SaveToFile(extension, $"{reportFullPath}{i}{extension}", memoryStream); + // } + } + return results; + } + +#pragma warning restore CA1416 + + public static (float, string, List) Parse(string reportFullPath, List fileInfoCollection, int startX, int startY, int endX, int endY, int offSetX, int offSetY) + { + (float, string, List) result; + List blocks = new(); + StringBuilder stringBuilder = new(); + using TesseractEngine engine = new(string.Empty, "eng", EngineMode.Default); + using Pix img = Pix.LoadFromFile(reportFullPath); + using Page page = engine.Process(img); + string text = page.GetText(); + float pageMeanConfidence = page.GetMeanConfidence(); + using ResultIterator iter = page.GetIterator(); + iter.Begin(); + do + { + do + { + do + { + do + { + _ = stringBuilder.Append(iter.GetText(PageIteratorLevel.Word)).Append(' '); + if (iter.IsAtFinalOf(PageIteratorLevel.TextLine, PageIteratorLevel.Word) && stringBuilder.Length > 0) + { + blocks.Add(stringBuilder.ToString()); + _ = stringBuilder.Clear(); + } + } while (iter.Next(PageIteratorLevel.TextLine, PageIteratorLevel.Word)); + if (iter.IsAtFinalOf(PageIteratorLevel.Para, PageIteratorLevel.TextLine)) + _ = stringBuilder.AppendLine(); + } while (iter.Next(PageIteratorLevel.Para, PageIteratorLevel.TextLine)); + } while (iter.Next(PageIteratorLevel.Block, PageIteratorLevel.Para)); + } while (iter.Next(PageIteratorLevel.Block)); + if (stringBuilder.Length > 0) + blocks.Add(stringBuilder.ToString()); + result = new(pageMeanConfidence, text, blocks); + return result; + } + + private void Parse(IFileRead fileRead, List fileInfoCollection, int startX, int startY, int endX, int endY, int offSetX, int offSetY) + { + (float pageMeanConfidence, string text, List blocks) = Parse(fileRead.ReportFullPath, fileInfoCollection, startX, startY, endX, endY, offSetX, offSetY); + _Log.Debug(string.Format("Mean confidence: {0}", pageMeanConfidence)); + _Log.Debug(string.Format("Text (GetText): \r\n{0}", text)); + _Log.Debug("Text (iterator):"); + if (blocks.Count == 0) + _Details.Add(text); + else + { + blocks = (from l in blocks where l.Split(':').Length == 3 select l).ToList(); + if (blocks.Count == 0) + _Details.Add(text); + else + _Details.Add(blocks[0]); + } + } + } \ No newline at end of file diff --git a/Adaptation/Infineon/Monitoring/MonA/MonIn.cs b/Adaptation/Infineon/Monitoring/MonA/MonIn.cs index e9ffce8..7a8a711 100644 --- a/Adaptation/Infineon/Monitoring/MonA/MonIn.cs +++ b/Adaptation/Infineon/Monitoring/MonA/MonIn.cs @@ -18,21 +18,12 @@ public class MonIn : IMonIn, IDisposable public static MonIn GetInstance(string url = "http://moninhttp.{0}.infineon.com/input/text") { MonIn instance; - if (_Instances.ContainsKey(url)) + lock (_Instances) { - instance = _Instances[url]; - } - else - { - lock (_Instances) + if (_Instances.TryGetValue(url, out instance)) { - if (!_Instances.ContainsKey(url)) - { - instance = new MonIn(url); - _Instances.Add(url, instance); - } - else - instance = _Instances[url]; + instance = new MonIn(url); + _Instances.Add(url, instance); } } return instance; diff --git a/Adaptation/Shared/Duplicator/Description.cs b/Adaptation/Shared/Duplicator/Description.cs index abbb7a4..964612e 100644 --- a/Adaptation/Shared/Duplicator/Description.cs +++ b/Adaptation/Shared/Duplicator/Description.cs @@ -12,6 +12,7 @@ public class Description : IDescription, Properties.IDescription public int Test { get; set; } public int Count { get; set; } public int Index { get; set; } + public string RDS { get; set; } // public string EventName { get; set; } public string NullData { get; set; } @@ -109,6 +110,42 @@ public class Description : IDescription, Properties.IDescription List IDescription.GetDescriptions(IFileRead fileRead, Logistics logistics, List tests, IProcessData iProcessData) { List results = new(); + if (iProcessData is null || iProcessData.Details.Count == 0) + results.Add(GetDefault(fileRead, logistics)); + else + { + string nullData; + Description description; + object configDataNullData = fileRead.NullData; + if (configDataNullData is null) + nullData = string.Empty; + else + nullData = configDataNullData.ToString(); + for (int i = 0; i < iProcessData.Details.Count; i++) + { + if (iProcessData.Details[i] is null) + continue; + description = new Description + { + Test = (int)tests[i], + Count = tests.Count, + Index = i, + // + EventName = fileRead.EventName, + NullData = nullData, + JobID = fileRead.CellInstanceName, + Sequence = logistics.Sequence.ToString(), + MesEntity = logistics.MesEntity, + ReportFullPath = logistics.ReportFullPath, + ProcessJobID = logistics.ProcessJobID, + MID = logistics.MID, + // + Date = DateTime.Now.ToString(GetDateFormat()), + RDS = string.Empty, + }; + results.Add(description); + } + } return results; } @@ -139,4 +176,6 @@ public class Description : IDescription, Properties.IDescription return result; } + internal static string GetDateFormat() => "MM/dd/yyyy hh:mm:ss tt"; + } \ No newline at end of file diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index 9e02131..6bdd9cb 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -63,7 +63,7 @@ public class FileRead : Properties.IFileRead string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName; string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType; - public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) + public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, Dictionary> dummyRuns, Dictionary> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) { _SMTP = smtp; _IsEvent = isEvent; @@ -106,7 +106,7 @@ public class FileRead : Properties.IFileRead throw new Exception(cellInstanceConnectionName); if (string.IsNullOrEmpty(equipmentDictionaryName) && isEvent) throw new Exception(cellInstanceConnectionName); - if (!string.IsNullOrEmpty(equipmentDictionaryName) && !isEvent) + if (!string.IsNullOrEmpty(equipmentDictionaryName) && !isEvent && connectionCount > 1) throw new Exception(cellInstanceConnectionName); // if (string.IsNullOrEmpty(equipmentDictionaryName) && !isEvent) // throw new Exception(cellInstanceConnectionName); @@ -163,7 +163,7 @@ public class FileRead : Properties.IFileRead protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList modelObjectParameters, string propertyNamePrefix) { ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray(); - if (!results.Any()) + if (results.Length == 0) throw new Exception(cellInstanceConnectionName); return results; } @@ -171,7 +171,7 @@ public class FileRead : Properties.IFileRead protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix) { ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray(); - if (!results.Any()) + if (results.Length == 0) throw new Exception(cellInstanceConnectionName); return results; } @@ -203,7 +203,7 @@ public class FileRead : Properties.IFileRead } lock (threadExceptions) { - if (threadExceptions.Any()) + if (threadExceptions.Count != 0) { foreach (Exception item in threadExceptions) _Log.Error(string.Concat(item.Message, Environment.NewLine, Environment.NewLine, item.StackTrace)); @@ -241,7 +241,7 @@ public class FileRead : Properties.IFileRead if (!_IsDuplicator) WriteAllLines(to, results); } - if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Any()) + if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Count != 0) { string itemFile; List directories = new(); @@ -260,24 +260,25 @@ public class FileRead : Properties.IFileRead return results; } - protected static string GetTupleFile(Logistics logistics, Properties.IScopeInfo scopeInfo, string duplicateDirectory) + protected static string GetTupleFile(Logistics logistics, List descriptions, Properties.IScopeInfo scopeInfo, string duplicateDirectory, string duplicateFile) where T : Properties.IDescription { string result; string rds; + string fileName; string dateValue; - string datePlaceholder; - string[] segments = logistics.MID.Split('-'); - if (segments.Length < 2) - rds = "%RDS%"; + string rdsPlaceholder = "%RDS%"; + string mesEntityPlaceholder = "%MesEntity%"; + if (descriptions.Count == 0 || string.IsNullOrEmpty(descriptions[0].RDS)) + rds = logistics.MID; else - rds = segments[1]; - segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries); + rds = descriptions[0].RDS; + string[] segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries); if (segments.Length == 0) - result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace("%RDS%", rds)); + result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity)); else { - datePlaceholder = "%DateTime%"; segments = segments[1].Split('%'); + string datePlaceholder = "%DateTime%"; dateValue = logistics.DateTimeFromSequence.ToString(segments[0]); foreach (string segment in scopeInfo.FileName.Split('%')) { @@ -285,18 +286,23 @@ public class FileRead : Properties.IFileRead continue; datePlaceholder = string.Concat('%', segment, '%'); } - result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileName.Replace("%RDS%", rds).Replace(datePlaceholder, dateValue)); + fileName = scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity).Replace(datePlaceholder, dateValue); + if (!duplicateFile.Contains("Viewer")) + result = Path.Combine(duplicateDirectory, fileName); + else + result = Path.Combine(duplicateDirectory, $"Viewer_{fileName}"); } if (result.Contains('%')) throw new Exception("Placeholder exists!"); return result; } - protected void WaitForFileConsumption(string sourceDirectoryCloaking, Logistics logistics, DateTime dateTime, string successDirectory, string duplicateDirectory, string duplicateFile, List<(Properties.IScopeInfo, string)> tuples) + protected void WaitForFileConsumption(string sourceDirectoryCloaking, Logistics logistics, DateTime dateTime, List descriptions, string successDirectory, string duplicateDirectory, string duplicateFile, List<(Properties.IScopeInfo, string)> collection) where T : Properties.IDescription { bool check; long preWait; string tupleFile; + string tupleFileName = string.Empty; List duplicateFiles = new(); StringBuilder stringBuilder = new(); List consumedFileIndices = new(); @@ -306,26 +312,28 @@ public class FileRead : Properties.IFileRead preWait = dateTime.AddMilliseconds(1234).Ticks; else preWait = dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks; - if (!tuples.Any()) + if (collection.Count == 0) duplicateFiles.Add(duplicateFile); string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath); string successFile = string.Concat(successDirectory, @"\", Path.GetFileName(logistics.ReportFullPath)); - foreach ((Properties.IScopeInfo scopeInfo, string text) in tuples) + foreach ((Properties.IScopeInfo scopeInfo, string text) in collection) { if (scopeInfo.FileName.StartsWith(@"\")) tupleFile = scopeInfo.FileName; else if (!scopeInfo.FileName.Contains('%')) tupleFile = string.Concat(duplicateDirectory, @"\", fileName, "_", scopeInfo.FileNameWithoutExtension, ".pdsfc"); else - tupleFile = GetTupleFile(logistics, scopeInfo, duplicateDirectory); + tupleFile = GetTupleFile(logistics, descriptions, scopeInfo, duplicateDirectory, duplicateFile); + tupleFileName = Path.GetFileNameWithoutExtension(tupleFile).Split('.')[0]; duplicateFiles.Add(tupleFile); - File.WriteAllText(tupleFile, text); + if (_IsEAFHosted) + File.WriteAllText(tupleFile, text); } for (short i = 0; i < short.MaxValue; i++) { if (DateTime.Now.Ticks > preWait) break; - Thread.Sleep(500); + Thread.Sleep(100); } if (!moreThanAnHour) { @@ -340,7 +348,17 @@ public class FileRead : Properties.IFileRead for (int i = 0; i < duplicateFiles.Count; i++) { if (!File.Exists(duplicateFiles[i])) - consumedFileIndices.Add(i); + { + if (string.IsNullOrEmpty(tupleFileName)) + consumedFileIndices.Add(i); + else if (duplicateFiles.All(l => Path.GetFileNameWithoutExtension(l).Split('.')[0] == tupleFileName)) + { + for (int j = 0; j < duplicateFiles.Count; j++) + consumedFileIndices.Add(j); + } + else + consumedFileIndices.Add(i); + } } if (consumedFileIndices.Count == duplicateFiles.Count) break; @@ -361,7 +379,7 @@ public class FileRead : Properties.IFileRead } throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder)); } - Thread.Sleep(500); + Thread.Sleep(250); } } } @@ -404,10 +422,12 @@ public class FileRead : Properties.IFileRead protected void WritePDSF(IFileRead fileRead, JsonElement[] jsonElements) { string directory; + string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); + string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}"; if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType) - directory = Path.Combine(_TracePath, _EquipmentType, "Target", _CellInstanceName, _CellInstanceConnectionName); + directory = Path.Combine(_TracePath, _EquipmentType, "Target", weekDirectory, _CellInstanceName, _CellInstanceConnectionName); else - directory = Path.Combine(_TracePath, _EquipmentType, "Source", _CellInstanceName, _CellInstanceConnectionName); + directory = Path.Combine(_TracePath, _EquipmentType, "Source", weekDirectory, _CellInstanceName, _CellInstanceConnectionName); if (!Directory.Exists(directory)) _ = Directory.CreateDirectory(directory); string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf")); @@ -442,6 +462,7 @@ public class FileRead : Properties.IFileRead protected void TriggerEvents(Tuple> extractResults, List headerNames, Dictionary keyValuePairs) { object value; + string segments; string description; List list; for (int i = 0; i < extractResults.Item3.Length; i++) @@ -449,10 +470,10 @@ public class FileRead : Properties.IFileRead _Log.Debug(string.Concat("TriggerEvent - {", _Logistics.ReportFullPath, "} ", i, " of ", extractResults.Item3.Length)); foreach (JsonProperty jsonProperty in extractResults.Item3[i].EnumerateObject()) { - if (jsonProperty.Value.ValueKind != JsonValueKind.String || !keyValuePairs.ContainsKey(jsonProperty.Name)) + if (jsonProperty.Value.ValueKind != JsonValueKind.String || !keyValuePairs.TryGetValue(jsonProperty.Name, out segments)) description = string.Empty; else - description = keyValuePairs[jsonProperty.Name].Split('|')[0]; + description = segments.Split('|')[0]; if (!_UseCyclicalForDescription || headerNames.Contains(jsonProperty.Name)) value = jsonProperty.Value.ToString(); else @@ -484,10 +505,10 @@ public class FileRead : Properties.IFileRead matches = Directory.GetFiles(_FileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.AllDirectories); else matches = Directory.GetFiles(_FileConnectorConfiguration.SourceFileLocation, segments.Last(), SearchOption.TopDirectoryOnly); - if (matches.Any()) + if (matches.Length != 0) break; } - if (matches is null || !matches.Any()) + if (matches is null || matches.Length == 0) results = null; else { @@ -550,16 +571,99 @@ public class FileRead : Properties.IFileRead } } + internal static List GetDirectoryNames(string directory) + { +#nullable enable + List results = new(); + string? fileName; + string? checkDirectory = directory; + string? pathRoot = Path.GetPathRoot(directory); + string extension = Path.GetExtension(directory); + if (string.IsNullOrEmpty(pathRoot)) + throw new NullReferenceException(nameof(pathRoot)); + if (Directory.Exists(directory)) + { + fileName = Path.GetFileName(directory); + if (!string.IsNullOrEmpty(fileName)) + results.Add(fileName); + } + else if ((string.IsNullOrEmpty(extension) || extension.Length > 3) && !File.Exists(directory)) + { + fileName = Path.GetFileName(directory); + if (!string.IsNullOrEmpty(fileName)) + results.Add(fileName); + } + for (int i = 0; i < int.MaxValue; i++) + { + checkDirectory = Path.GetDirectoryName(checkDirectory); + if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot) + break; + fileName = Path.GetFileName(checkDirectory); + if (string.IsNullOrEmpty(fileName)) + continue; + results.Add(fileName); + } + results.Add(pathRoot); + results.Reverse(); + return results; +#nullable disable + } + + private string GetJobIdDirectory(string path) + { + string result; + List directoryNames = GetDirectoryNames(path); + if (!directoryNames.Contains(_Logistics.JobID)) + result = Path.GetDirectoryName(path); + else + { + result = string.Empty; + foreach (string directoryName in directoryNames) + { + result = Path.Combine(result, directoryName); + if (directoryName == _Logistics.JobID) + break; + } + } + return result; + } + + private static void DeleteEmptyTopDirectories(string rootDirectory) + { + if (Directory.Exists(rootDirectory)) + { + string[] files; + string[] directories; + string[] subDirectories = Directory.GetDirectories(rootDirectory, "*", SearchOption.TopDirectoryOnly); + foreach (string subDirectory in subDirectories) + { + files = Directory.GetFiles(subDirectory, "*", SearchOption.AllDirectories); + if (files.Length > 0) + continue; + directories = Directory.GetDirectories(subDirectory, "*", SearchOption.TopDirectoryOnly); + if (directories.Length > 0) + continue; + try + { Directory.Delete(subDirectory); } + catch (UnauthorizedAccessException) + { + new DirectoryInfo(subDirectory).Attributes = FileAttributes.Normal; + Directory.Delete(subDirectory); + } + } + } + } + private void Shared1811(string to, FileInfo sourceFile) { if (!_IsDuplicator && _FileConnectorConfiguration.SourceFileFilter != "*" && sourceFile.Exists && sourceFile.Length < _MinFileLength) { string directoryName = Path.GetFileName(to); - string jobIdDirectory = Path.GetDirectoryName(to); + string jobIdDirectory = GetJobIdDirectory(to); DateTime dateTime = DateTime.Now.AddMinutes(-15); string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}"; - string destinationDirectory = string.Concat(jobIdDirectory, @"\_ Ignore 100 bytes\", weekDirectory, @"\", directoryName); + string destinationDirectory = Path.Combine(jobIdDirectory, "_ Ignore 100 bytes", weekDirectory, directoryName); if (!Directory.Exists(destinationDirectory)) _ = Directory.CreateDirectory(destinationDirectory); File.Move(sourceFile.FullName, string.Concat(destinationDirectory, @"\", sourceFile.Name)); @@ -570,13 +674,13 @@ public class FileRead : Properties.IFileRead { if (!checkDirectory.Contains('_')) continue; - if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any()) + if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Length != 0) continue; - if (Directory.GetFiles(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any()) + if (Directory.GetFiles(checkDirectory, "*", SearchOption.TopDirectoryOnly).Length != 0) continue; - if (Directory.GetDirectories(checkDirectory, "*", SearchOption.AllDirectories).Any()) + if (Directory.GetDirectories(checkDirectory, "*", SearchOption.AllDirectories).Length != 0) continue; - if (Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories).Any()) + if (Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories).Length != 0) continue; if (new DirectoryInfo(checkDirectory).CreationTime > dateTime) continue; @@ -584,6 +688,7 @@ public class FileRead : Properties.IFileRead } } catch (Exception) { throw; } + DeleteEmptyTopDirectories(jobIdDirectory); } } @@ -593,16 +698,16 @@ public class FileRead : Properties.IFileRead { foreach (string directory in (from l in directories orderby l.Split('\\').Length descending select l).Distinct()) { - if (Directory.Exists(directory) && !Directory.GetFiles(directory).Any()) + if (Directory.Exists(directory) && Directory.GetFiles(directory).Length == 0) Directory.Delete(directory); } } } - protected void WaitForFileConsumption(DateTime dateTime, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> tuples, string duplicateFile) + protected void WaitForFileConsumption(DateTime dateTime, List descriptions, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> collection, string duplicateFile) where T : Properties.IDescription { if (!isDummyRun && _IsEAFHosted) - WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, successDirectory, duplicateDirectory, duplicateFile, tuples); + WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, descriptions, successDirectory, duplicateDirectory, duplicateFile, collection); else { long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.ConnectionRetryInterval.Value).Ticks; diff --git a/Adaptation/Shared/Logistics.cs b/Adaptation/Shared/Logistics.cs index 38ed83c..cb1f805 100644 --- a/Adaptation/Shared/Logistics.cs +++ b/Adaptation/Shared/Logistics.cs @@ -51,7 +51,7 @@ public class Logistics : ILogistics _Logistics2 = new List(); } - public Logistics(IFileRead fileRead, string reportFullPath, bool useSplitForMID, int? fileInfoLength = null) + public Logistics(IFileRead fileRead, long tickOffset, string reportFullPath, bool useSplitForMID, int? fileInfoLength = null) { if (string.IsNullOrEmpty(fileRead.CellInstanceName)) throw new Exception(); @@ -59,7 +59,7 @@ public class Logistics : ILogistics throw new Exception(); _NullData = fileRead.NullData; _FileInfo = new(reportFullPath); - DateTime dateTime = _FileInfo.LastWriteTime; + DateTime dateTime = new(_FileInfo.LastWriteTime.Ticks + tickOffset); if (fileInfoLength.HasValue && _FileInfo.Length < fileInfoLength.Value) dateTime = dateTime.AddTicks(-1); _JobID = fileRead.CellInstanceName; @@ -91,7 +91,7 @@ public class Logistics : ILogistics string[] segments; _FileInfo = new(reportFullPath); _Logistics1 = logistics.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList(); - if (!Logistics1.Any() || !Logistics1[0].StartsWith("LOGISTICS_1")) + if (Logistics1.Count == 0 || !Logistics1[0].StartsWith("LOGISTICS_1")) { _NullData = null; _JobID = "null"; diff --git a/Adaptation/Shared/Metrology/ScopeInfo.cs b/Adaptation/Shared/Metrology/ScopeInfo.cs index 2de909e..539bd09 100644 --- a/Adaptation/Shared/Metrology/ScopeInfo.cs +++ b/Adaptation/Shared/Metrology/ScopeInfo.cs @@ -16,7 +16,7 @@ public class ScopeInfo : Properties.IScopeInfo public string QueryFilter { get; private set; } public string FileNameWithoutExtension { get; private set; } - public ScopeInfo(Test test, string fileName, string queryFilter = "", string title = "", string html = "") + public ScopeInfo(Test test, string fileName, string queryFilter = "", string title = "", string html = "", string extraExtension = "") { Enum = test; Test = test; diff --git a/Adaptation/Shared/Metrology/WS.Attachment.cs b/Adaptation/Shared/Metrology/WS.Attachment.cs index ea105ed..8edb116 100644 --- a/Adaptation/Shared/Metrology/WS.Attachment.cs +++ b/Adaptation/Shared/Metrology/WS.Attachment.cs @@ -2,18 +2,27 @@ public partial class WS { + public class Attachment { + public string SubGroupId { get; set; } + public long HeaderId { get; set; } + public string HeaderIdDirectory { get; set; } public string UniqueId { get; set; } public string DestinationFileName { get; set; } public string SourceFileName { get; set; } + public string AttachmentId { get; set; } - public Attachment(string uniqueId, string destinationFileName, string sourceFileName) + public Attachment(string subGroupId, long headerId, string headerIdDirectory, string uniqueId, string destinationFileName, string sourceFileName) { + SubGroupId = subGroupId; + HeaderId = headerId; + HeaderIdDirectory = headerIdDirectory; UniqueId = uniqueId; DestinationFileName = destinationFileName; SourceFileName = sourceFileName; + AttachmentId = System.Guid.NewGuid().ToString(); } } diff --git a/Adaptation/Shared/Metrology/WS.cs b/Adaptation/Shared/Metrology/WS.cs index b892219..4e43fa3 100644 --- a/Adaptation/Shared/Metrology/WS.cs +++ b/Adaptation/Shared/Metrology/WS.cs @@ -10,7 +10,7 @@ namespace Adaptation.Shared.Metrology; public partial class WS { - public static (string, Results) SendData(string url, object payload, int timeoutSeconds = 120) + public static (string, Results) SendData(string url, long sequence, string directory, object payload, int timeoutSeconds = 120) { Results results = new(); string resultsJson = string.Empty; @@ -30,7 +30,11 @@ public partial class WS }; HttpResponseMessage httpResponseMessage = httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseContentRead).Result; resultsJson = httpResponseMessage.Content.ReadAsStringAsync().Result; - results = JsonSerializer.Deserialize(resultsJson); + results = JsonSerializer.Deserialize(resultsJson, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); + string checkDirectory = Path.Combine(directory, $"-{results.HeaderID}"); + if (!Directory.Exists(checkDirectory)) + _ = Directory.CreateDirectory(checkDirectory); + File.WriteAllText(Path.Combine(checkDirectory, $"{sequence}.json"), json); } if (!results.Success) results.Errors.Add(results.ToString()); @@ -44,65 +48,49 @@ public partial class WS _ = stringBuilder.AppendLine(exception.Message); exception = exception.InnerException; } - if (results.Errors is null) - results.Errors = new List(); + results.Errors ??= new List(); + results.Errors.Add(resultsJson); results.Errors.Add(stringBuilder.ToString()); } return new(resultsJson, results); } - // this method is a wrapper for attaching a file to either a header or data record - // URL is the same URL used for SendData, ex: http://localhost/api/inbound/CDE - // attachToHeaderId is the ID returned by SendData - // attachToDataUniqueId is the string unique ID for the data record, aka the Title of the Sharepoint list entry - // fileContents is a byte array with the contents of the file - // fileName is which attachment this is, image.pdf, data.pdf, data.txt, header.pdf, etc - // timeoutSeconds is configured as the request timeout - // this method will either succeed or throw an exception - // also, this has been made synchronous - public static void AttachFile(string url, long attachToHeaderId, string attachToDataUniqueId, byte[] fileContents, string fileName, int timeoutSeconds = 60) + public static void AttachFile(string url, Attachment attachment, int timeoutSeconds = 60) { using HttpClient httpClient = new(); - string requestUrl = url + "/attachment?headerid=" + attachToHeaderId.ToString(); - if (!string.IsNullOrWhiteSpace(attachToDataUniqueId)) - { - requestUrl += "&datauniqueid="; - requestUrl += System.Net.WebUtility.UrlEncode(attachToDataUniqueId); - } - requestUrl += "&filename="; // this is just so the web server log shows the filename - requestUrl += System.Net.WebUtility.UrlEncode(fileName); - + string json = JsonSerializer.Serialize(attachment); httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0); - - MultipartFormDataContent multipartFormDataContent = new(); - ByteArrayContent byteArrayContent = new(fileContents); - byteArrayContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - - multipartFormDataContent.Add(byteArrayContent, "attachment", fileName); - - HttpResponseMessage httpResponseMessage = httpClient.PostAsync(requestUrl, multipartFormDataContent).Result; - - if (httpResponseMessage.IsSuccessStatusCode) - return; - - string resultBody = httpResponseMessage.Content.ReadAsStringAsync().Result; - - throw new Exception("Attachment failed: " + resultBody); + StringContent httpContent = new(json, Encoding.UTF8, "application/json"); + HttpResponseMessage httpResponseMessage = httpClient.PostAsync($"{url}/attachment", httpContent).Result; + if (!httpResponseMessage.IsSuccessStatusCode) + { + string resultBody = httpResponseMessage.Content.ReadAsStringAsync().Result; + throw new Exception($"Attachment failed: {resultBody}"); + } } - public static void AttachFiles(string url, long headerID, List headerAttachments = null, List dataAttachments = null) + public static void AttachFiles(string url, List headerAttachments = null, List dataAttachments = null) { + string directory; try { if (headerAttachments is not null) { foreach (Attachment attachment in headerAttachments) - AttachFile(url, headerID, "", File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName); + { + directory = Path.GetDirectoryName(attachment.HeaderIdDirectory) ?? throw new Exception(); + File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.AttachmentId, attachment.DestinationFileName), overwrite: true); + AttachFile(url, attachment); + } } if (dataAttachments is not null) { foreach (Attachment attachment in dataAttachments) - AttachFile(url, headerID, attachment.UniqueId, File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName); + { + directory = Path.GetDirectoryName(attachment.HeaderIdDirectory) ?? throw new Exception(); + File.Copy(attachment.SourceFileName, Path.Combine(directory, attachment.AttachmentId, attachment.DestinationFileName), overwrite: true); + AttachFile(url, attachment); + } } //MessageBox.Show(r.ToString()); } diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs index 9dcdb0a..136ccae 100644 --- a/Adaptation/Shared/ProcessDataStandardFormat.cs +++ b/Adaptation/Shared/ProcessDataStandardFormat.cs @@ -23,7 +23,7 @@ public class ProcessDataStandardFormat public static string GetPDSFText(IFileRead fileRead, Logistics logistics, JsonElement[] jsonElements, string logisticsText) { string result; - if (!jsonElements.Any()) + if (jsonElements.Length == 0) result = string.Empty; else { @@ -91,8 +91,7 @@ public class ProcessDataStandardFormat string segment; List body = new(); StringBuilder logistics = new(); - if (lines is null) - lines = File.ReadAllLines(reportFullPath); + lines ??= File.ReadAllLines(reportFullPath); string[] segments; if (lines.Length < 7) segments = Array.Empty(); @@ -147,7 +146,7 @@ public class ProcessDataStandardFormat string logistics = pdsf.Item1; string[] columns = pdsf.Item2; string[] bodyLines = pdsf.Item3; - if (!bodyLines.Any() || !bodyLines[0].Contains('\t')) + if (bodyLines.Length == 0 || !bodyLines[0].Contains('\t')) results = JsonSerializer.Deserialize("[]"); else { @@ -212,9 +211,10 @@ public class ProcessDataStandardFormat public static Tuple>>> GetTestDictionary(Tuple pdsf) { Dictionary>> results = new(); + List collection; string testColumn = nameof(Test); Dictionary> keyValuePairs = GetDictionary(pdsf); - if (!keyValuePairs.ContainsKey(testColumn)) + if (!keyValuePairs.TryGetValue(testColumn, out collection)) throw new Exception(); int min; int max; @@ -222,9 +222,9 @@ public class ProcessDataStandardFormat List vs; string columnKey; Dictionary> tests = new(); - for (int i = 0; i < keyValuePairs[testColumn].Count; i++) + for (int i = 0; i < collection.Count; i++) { - if (Enum.TryParse(keyValuePairs[testColumn][i], out Test test)) + if (Enum.TryParse(collection[i], out Test test)) { if (!results.ContainsKey(test)) { @@ -276,8 +276,7 @@ public class ProcessDataStandardFormat public static string GetLines(Logistics logistics, Properties.IScopeInfo scopeInfo, List names, Dictionary> keyValuePairs, string dateFormat, string timeFormat, List pairedParameterNames, bool useDateTimeFromSequence = true, string format = "", List ignoreParameterNames = null) { StringBuilder result = new(); - if (ignoreParameterNames is null) - ignoreParameterNames = new List(); + ignoreParameterNames ??= new List(); if (useDateTimeFromSequence && !string.IsNullOrEmpty(format)) throw new Exception(); else if (!useDateTimeFromSequence && string.IsNullOrEmpty(format)) @@ -327,7 +326,7 @@ public class ProcessDataStandardFormat _ = line.Append(';'); } } - if (!pairedParameterNames.Any()) + if (pairedParameterNames.Count == 0) { _ = line.Remove(line.Length - 1, 1); _ = result.AppendLine(line.ToString()); @@ -357,8 +356,7 @@ public class ProcessDataStandardFormat if (string.IsNullOrEmpty(lines[i])) continue; segments = lines[i].Split(inputSeparator); - if (currentGroup is null) - currentGroup = segments.Length; + currentGroup ??= segments.Length; if (segments.Length != currentGroup) { currentGroup = segments.Length; diff --git a/Adaptation/Shared/Properties/IDescription.cs b/Adaptation/Shared/Properties/IDescription.cs index 93e6de5..1166e17 100644 --- a/Adaptation/Shared/Properties/IDescription.cs +++ b/Adaptation/Shared/Properties/IDescription.cs @@ -6,5 +6,6 @@ public interface IDescription int Test { get; } int Count { get; } int Index { get; } + string RDS { get; } } \ No newline at end of file diff --git a/Adaptation/Shared/Test.cs b/Adaptation/Shared/Test.cs index aeb4bea..169f05b 100644 --- a/Adaptation/Shared/Test.cs +++ b/Adaptation/Shared/Test.cs @@ -14,6 +14,7 @@ public enum Test CandelaPSL = 38, CandelaVerify = 37, CDE = 24, + Climatec = 54, //Largest CV = 3, DailyRPMAverage = 19, DailyRPMPLRatio = 20, @@ -21,7 +22,7 @@ public enum Test Denton = 9, DiffusionLength = 45, GRATXTCenter = 51, - GRATXTEdge = 52, //Largest + GRATXTEdge = 52, GrowthRateXML = 50, Hall = 10, HgCV = 23, @@ -38,6 +39,7 @@ public enum Test RPMPLRatio = 17, RPMXY = 15, SP1 = 8, + SRP2100 = 53, Tencor = 7, UV = 35, VerificationLehighton = 14, diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/DEP08SIASM.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/DEP08SIASM.cs index 4ea91b1..26914c7 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/DEP08SIASM.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/DEP08SIASM.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,8 +32,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new DEP08SIASM(testContext); + EAFLoggingUnitTesting ??= new DEP08SIASM(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,13 +42,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -61,7 +59,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -74,7 +72,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -87,7 +85,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -100,7 +98,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -113,7 +111,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -126,7 +124,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -139,7 +137,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -152,7 +150,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -165,4 +163,5 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34-EQPT.cs index 978ccc9..3e65964 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,8 +32,7 @@ public class R34_EQPT : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R34_EQPT(testContext); + EAFLoggingUnitTesting ??= new R34_EQPT(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,13 +42,11 @@ public class R34_EQPT : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -61,4 +59,5 @@ public class R34_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34.cs index 42c1e14..5741c26 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R34.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,8 +32,7 @@ public class R34 : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R34(testContext); + EAFLoggingUnitTesting ??= new R34(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,13 +42,11 @@ public class R34 : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -61,4 +59,5 @@ public class R34 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36-EQPT.cs index ccbd113..2b222c6 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,8 +32,7 @@ public class R36_EQPT : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R36_EQPT(testContext); + EAFLoggingUnitTesting ??= new R36_EQPT(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,13 +42,11 @@ public class R36_EQPT : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -61,4 +59,5 @@ public class R36_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36.cs index ad3d4fd..6322fc1 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.39.2/R36.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -31,8 +32,7 @@ public class R36 : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R36(testContext); + EAFLoggingUnitTesting ??= new R36(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,13 +42,11 @@ public class R36 : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -61,4 +59,5 @@ public class R36 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/DEP08SIASM.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/DEP08SIASM.cs index 573d3b9..9d2253c 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/DEP08SIASM.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/DEP08SIASM.cs @@ -1,3 +1,4 @@ +#if v2_43_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -6,7 +7,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class DEP08SIASM : EAFLoggingUnitTesting @@ -31,8 +32,7 @@ public class DEP08SIASM : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new DEP08SIASM(testContext); + EAFLoggingUnitTesting ??= new DEP08SIASM(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,17 +42,15 @@ public class DEP08SIASM : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__MoveMatchingFiles() + public void Staging__v2_43_4__DEP08SIASM__MoveMatchingFiles() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -61,11 +59,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__OpenInsightMetrologyViewer() + public void Staging__v2_43_4__DEP08SIASM__OpenInsightMetrologyViewer() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -74,11 +72,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__IQSSi() + public void Staging__v2_43_4__DEP08SIASM__IQSSi() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -87,11 +85,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__OpenInsight() + public void Staging__v2_43_4__DEP08SIASM__OpenInsight() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -100,11 +98,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__OpenInsightMetrologyViewerAttachments() + public void Staging__v2_43_4__DEP08SIASM__OpenInsightMetrologyViewerAttachments() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -113,11 +111,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__APC() + public void Staging__v2_43_4__DEP08SIASM__APC() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -126,11 +124,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__SPaCe() + public void Staging__v2_43_4__DEP08SIASM__SPaCe() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -139,11 +137,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__Processed() + public void Staging__v2_43_4__DEP08SIASM__Processed() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -152,11 +150,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__Archive() + public void Staging__v2_43_4__DEP08SIASM__Archive() { string check = "*.pdsf"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -165,11 +163,11 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__Dummy() + public void Staging__v2_43_4__DEP08SIASM__Dummy() { string check = "637400762024374000.zip"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -178,4 +176,5 @@ public class DEP08SIASM : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34-EQPT.cs index e35c95b..0b1fddf 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_43_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -6,7 +7,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class R34_EQPT : EAFLoggingUnitTesting @@ -31,8 +32,7 @@ public class R34_EQPT : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R34_EQPT(testContext); + EAFLoggingUnitTesting ??= new R34_EQPT(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,17 +42,15 @@ public class R34_EQPT : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R34_EQPT__DownloadJpegFile() + public void Staging__v2_43_4__R34_EQPT__DownloadJpegFile() { string check = ".jpeg"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -61,4 +59,5 @@ public class R34_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34.cs index 93f87c1..a6dfc07 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R34.cs @@ -1,3 +1,4 @@ +#if v2_43_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -6,7 +7,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class R34 : EAFLoggingUnitTesting @@ -31,8 +32,7 @@ public class R34 : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R34(testContext); + EAFLoggingUnitTesting ??= new R34(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,17 +42,15 @@ public class R34 : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R34__jpeg() + public void Staging__v2_43_4__R34__jpeg() { string check = "*.jpeg"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -61,4 +59,5 @@ public class R34 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36-EQPT.cs index 64389b1..3f2d18e 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_43_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -6,7 +7,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class R36_EQPT : EAFLoggingUnitTesting @@ -31,8 +32,7 @@ public class R36_EQPT : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R36_EQPT(testContext); + EAFLoggingUnitTesting ??= new R36_EQPT(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,17 +42,15 @@ public class R36_EQPT : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R36_EQPT__DownloadJpegFile() + public void Staging__v2_43_4__R36_EQPT__DownloadJpegFile() { string check = ".jpeg"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -61,4 +59,5 @@ public class R36_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36.cs index fe15b10..dc2929e 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.43.0/R36.cs @@ -1,3 +1,4 @@ +#if v2_43_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -6,7 +7,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0; +namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4; [TestClass] public class R36 : EAFLoggingUnitTesting @@ -31,8 +32,7 @@ public class R36 : EAFLoggingUnitTesting [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (EAFLoggingUnitTesting is null) - EAFLoggingUnitTesting = new R36(testContext); + EAFLoggingUnitTesting ??= new R36(testContext); EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); @@ -42,17 +42,15 @@ public class R36 : EAFLoggingUnitTesting [ClassCleanup()] public static void ClassCleanup() { - if (EAFLoggingUnitTesting.Logger is not null) - EAFLoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (EAFLoggingUnitTesting is not null) - EAFLoggingUnitTesting.Dispose(); + EAFLoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R36__jpeg() + public void Staging__v2_43_4__R36__jpeg() { string check = "*.jpeg"; MethodBase methodBase = new StackFrame().GetMethod(); @@ -61,4 +59,5 @@ public class R36 : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/DEP08SIASM.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/DEP08SIASM.cs new file mode 100644 index 0000000..ef2d7e5 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/DEP08SIASM.cs @@ -0,0 +1,180 @@ +#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.Staging.v2_56_0; + +[TestClass] +public class DEP08SIASM : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static DEP08SIASM EAFLoggingUnitTesting { get; private set; } + + public DEP08SIASM() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public DEP08SIASM(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new DEP08SIASM(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 Staging__v2_56_0__DEP08SIASM__MoveMatchingFiles() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__OpenInsightMetrologyViewer() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__IQSSi() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__OpenInsight() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__OpenInsightMetrologyViewerAttachments() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__APC() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__SPaCe() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__Processed() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__Archive() + { + 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")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__Dummy() + { + string check = "637400762024374000.zip"; + 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.56.0/R34-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R34-EQPT.cs new file mode 100644 index 0000000..cc50fdf --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R34-EQPT.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.Staging.v2_56_0; + +[TestClass] +public class R34_EQPT : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static R34_EQPT EAFLoggingUnitTesting { get; private set; } + + public R34_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public R34_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new R34_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 Staging__v2_56_0__R34_EQPT__DownloadJpegFile() + { + string check = ".jpeg"; + 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.56.0/R34.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R34.cs new file mode 100644 index 0000000..d65b713 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R34.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.Staging.v2_56_0; + +[TestClass] +public class R34 : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static R34 EAFLoggingUnitTesting { get; private set; } + + public R34() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public R34(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new R34(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 Staging__v2_56_0__R34__jpeg() + { + string check = "*.jpeg"; + 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.56.0/R36-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R36-EQPT.cs new file mode 100644 index 0000000..a49d262 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R36-EQPT.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.Staging.v2_56_0; + +[TestClass] +public class R36_EQPT : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static R36_EQPT EAFLoggingUnitTesting { get; private set; } + + public R36_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public R36_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new R36_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 Staging__v2_56_0__R36_EQPT__DownloadJpegFile() + { + string check = ".jpeg"; + 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.56.0/R36.cs b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R36.cs new file mode 100644 index 0000000..ca9d02d --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Staging/v2.56.0/R36.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.Staging.v2_56_0; + +[TestClass] +public class R36 : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static R36 EAFLoggingUnitTesting { get; private set; } + + public R36() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public R36(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new R36(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 Staging__v2_56_0__R36__jpeg() + { + string check = "*.jpeg"; + 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/Extract/Staging/v2.39.2/DEP08SIASM.cs b/Adaptation/_Tests/Extract/Staging/v2.39.2/DEP08SIASM.cs index fb1ef82..3749e14 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.2/DEP08SIASM.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.2/DEP08SIASM.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation.Shared; using Adaptation.Shared.Methods; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -22,25 +23,25 @@ public class DEP08SIASM _DEP08SIASM = CreateSelfDescription.Staging.v2_39_2.DEP08SIASM.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM_() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM_(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM__() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM__(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -55,34 +56,35 @@ public class DEP08SIASM _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); } -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM___() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM___(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM____() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM____(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM_____() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM_____(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM______() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM______(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__DEP08SIASM__DEP08SIASM_______() => _DEP08SIASM.Staging__v2_39_2__DEP08SIASM__DEP08SIASM_______(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.2/R34-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.39.2/R34-EQPT.cs index a3d1e77..1ea31ae 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.2/R34-EQPT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.2/R34-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Adaptation._Tests.Extract.Staging.v2_39_2; @@ -18,16 +19,17 @@ public class R34_EQPT _R34_EQPT = CreateSelfDescription.Staging.v2_39_2.R34_EQPT.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__R34_EQPT__DownloadJpegFile() => _R34_EQPT.Staging__v2_39_2__R34_EQPT__DownloadJpegFile(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__R34_EQPT__DownloadJpegFile637812143477007703__Normal() => _R34_EQPT.Staging__v2_39_2__R34_EQPT__DownloadJpegFile(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.2/R34.cs b/Adaptation/_Tests/Extract/Staging/v2.39.2/R34.cs index b9bdee5..d0e6461 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.2/R34.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.2/R34.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Adaptation.Shared; using Adaptation.Shared.Methods; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -22,13 +23,13 @@ public class R34 _R34 = CreateSelfDescription.Staging.v2_39_2.R34.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__R34__jpeg() => _R34.Staging__v2_39_2__R34__jpeg(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] @@ -43,4 +44,5 @@ public class R34 _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.2/R36-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.39.2/R36-EQPT.cs index 78be740..e0969b7 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.2/R36-EQPT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.2/R36-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Adaptation._Tests.Extract.Staging.v2_39_2; @@ -18,10 +19,11 @@ public class R36_EQPT _R36_EQPT = CreateSelfDescription.Staging.v2_39_2.R36_EQPT.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__R36_EQPT__DownloadJpegFile() => _R36_EQPT.Staging__v2_39_2__R36_EQPT__DownloadJpegFile(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.39.2/R36.cs b/Adaptation/_Tests/Extract/Staging/v2.39.2/R36.cs index d5848e2..42ad25c 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.39.2/R36.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.39.2/R36.cs @@ -1,3 +1,4 @@ +#if v2_39_2 using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Adaptation._Tests.Extract.Staging.v2_39_2; @@ -18,10 +19,11 @@ public class R36 _R36 = CreateSelfDescription.Staging.v2_39_2.R36.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] public void Staging__v2_39_2__R36__jpeg() => _R36.Staging__v2_39_2__R36__jpeg(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/DEP08SIASM.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/DEP08SIASM.cs index 3287db9..7856c6d 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/DEP08SIASM.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.43.0/DEP08SIASM.cs @@ -1,6 +1,7 @@ +#if v2_43_0 using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Adaptation._Tests.Extract.Staging.v2_43_0; +namespace Adaptation._Tests.Extract.Staging.v2_43_4; [TestClass] public class DEP08SIASM @@ -9,73 +10,74 @@ public class DEP08SIASM #pragma warning disable CA2254 #pragma warning disable IDE0060 - private static CreateSelfDescription.Staging.v2_43_0.DEP08SIASM _DEP08SIASM; + private static CreateSelfDescription.Staging.v2_43_4.DEP08SIASM _DEP08SIASM; [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - CreateSelfDescription.Staging.v2_43_0.DEP08SIASM.ClassInitialize(testContext); - _DEP08SIASM = CreateSelfDescription.Staging.v2_43_0.DEP08SIASM.EAFLoggingUnitTesting; + CreateSelfDescription.Staging.v2_43_4.DEP08SIASM.ClassInitialize(testContext); + _DEP08SIASM = CreateSelfDescription.Staging.v2_43_4.DEP08SIASM.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__MoveMatchingFiles() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__MoveMatchingFiles(); + public void Staging__v2_43_4__DEP08SIASM__MoveMatchingFiles() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__MoveMatchingFiles(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__OpenInsightMetrologyViewer() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__OpenInsightMetrologyViewer(); + public void Staging__v2_43_4__DEP08SIASM__OpenInsightMetrologyViewer() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__OpenInsightMetrologyViewer(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__IQSSi() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__IQSSi(); + public void Staging__v2_43_4__DEP08SIASM__IQSSi() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__IQSSi(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__OpenInsight() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__OpenInsight(); + public void Staging__v2_43_4__DEP08SIASM__OpenInsight() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__OpenInsight(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__OpenInsightMetrologyViewerAttachments() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__OpenInsightMetrologyViewerAttachments(); + public void Staging__v2_43_4__DEP08SIASM__OpenInsightMetrologyViewerAttachments() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__OpenInsightMetrologyViewerAttachments(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__APC() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__APC(); + public void Staging__v2_43_4__DEP08SIASM__APC() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__APC(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__SPaCe() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__SPaCe(); + public void Staging__v2_43_4__DEP08SIASM__SPaCe() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__SPaCe(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__Processed() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__Processed(); + public void Staging__v2_43_4__DEP08SIASM__Processed() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__Processed(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__Archive() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__Archive(); + public void Staging__v2_43_4__DEP08SIASM__Archive() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__Archive(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__DEP08SIASM__Dummy() => _DEP08SIASM.Staging__v2_43_0__DEP08SIASM__Dummy(); + public void Staging__v2_43_4__DEP08SIASM__Dummy() => _DEP08SIASM.Staging__v2_43_4__DEP08SIASM__Dummy(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/R34-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/R34-EQPT.cs index 7ccd0ce..2333749 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/R34-EQPT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.43.0/R34-EQPT.cs @@ -1,6 +1,7 @@ +#if v2_43_0 using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Adaptation._Tests.Extract.Staging.v2_43_0; +namespace Adaptation._Tests.Extract.Staging.v2_43_4; [TestClass] public class R34_EQPT @@ -9,25 +10,26 @@ public class R34_EQPT #pragma warning disable CA2254 #pragma warning disable IDE0060 - private static CreateSelfDescription.Staging.v2_43_0.R34_EQPT _R34_EQPT; + private static CreateSelfDescription.Staging.v2_43_4.R34_EQPT _R34_EQPT; [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - CreateSelfDescription.Staging.v2_43_0.R34_EQPT.ClassInitialize(testContext); - _R34_EQPT = CreateSelfDescription.Staging.v2_43_0.R34_EQPT.EAFLoggingUnitTesting; + CreateSelfDescription.Staging.v2_43_4.R34_EQPT.ClassInitialize(testContext); + _R34_EQPT = CreateSelfDescription.Staging.v2_43_4.R34_EQPT.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R34_EQPT__DownloadJpegFile() => _R34_EQPT.Staging__v2_43_0__R34_EQPT__DownloadJpegFile(); + public void Staging__v2_43_4__R34_EQPT__DownloadJpegFile() => _R34_EQPT.Staging__v2_43_4__R34_EQPT__DownloadJpegFile(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R34_EQPT__DownloadJpegFile637812143477007703__Normal() => _R34_EQPT.Staging__v2_43_0__R34_EQPT__DownloadJpegFile(); + public void Staging__v2_43_4__R34_EQPT__DownloadJpegFile637812143477007703__Normal() => _R34_EQPT.Staging__v2_43_4__R34_EQPT__DownloadJpegFile(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/R34.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/R34.cs index 7bd867d..d104832 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/R34.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.43.0/R34.cs @@ -1,10 +1,11 @@ +#if v2_43_0 using Adaptation.Shared; using Adaptation.Shared.Methods; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Diagnostics; using System.Reflection; -namespace Adaptation._Tests.Extract.Staging.v2_43_0; +namespace Adaptation._Tests.Extract.Staging.v2_43_4; [TestClass] public class R34 @@ -13,29 +14,29 @@ public class R34 #pragma warning disable CA2254 #pragma warning disable IDE0060 - private static CreateSelfDescription.Staging.v2_43_0.R34 _R34; + private static CreateSelfDescription.Staging.v2_43_4.R34 _R34; [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - CreateSelfDescription.Staging.v2_43_0.R34.ClassInitialize(testContext); - _R34 = CreateSelfDescription.Staging.v2_43_0.R34.EAFLoggingUnitTesting; + CreateSelfDescription.Staging.v2_43_4.R34.ClassInitialize(testContext); + _R34 = CreateSelfDescription.Staging.v2_43_4.R34.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R34__jpeg() => _R34.Staging__v2_43_0__R34__jpeg(); + public void Staging__v2_43_4__R34__jpeg() => _R34.Staging__v2_43_4__R34__jpeg(); -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R34__jpeg637812143477007703__Normal() + public void Staging__v2_43_4__R34__jpeg638000598531758005__Normal() { string check = "*.jpeg"; - _R34.Staging__v2_43_0__R34__jpeg(); + _R34.Staging__v2_43_4__R34__jpeg(); MethodBase methodBase = new StackFrame().GetMethod(); string[] variables = _R34.AdaptationTesting.GetVariables(methodBase, check); IFileRead fileRead = _R34.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); @@ -66,4 +67,5 @@ public class R34 // http://10.95.154.28/get_status?_=1655307702476 } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/R36-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/R36-EQPT.cs index 219e741..31f6410 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/R36-EQPT.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.43.0/R36-EQPT.cs @@ -1,6 +1,7 @@ +#if v2_43_0 using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Adaptation._Tests.Extract.Staging.v2_43_0; +namespace Adaptation._Tests.Extract.Staging.v2_43_4; [TestClass] public class R36_EQPT @@ -9,19 +10,20 @@ public class R36_EQPT #pragma warning disable CA2254 #pragma warning disable IDE0060 - private static CreateSelfDescription.Staging.v2_43_0.R36_EQPT _R36_EQPT; + private static CreateSelfDescription.Staging.v2_43_4.R36_EQPT _R36_EQPT; [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - CreateSelfDescription.Staging.v2_43_0.R36_EQPT.ClassInitialize(testContext); - _R36_EQPT = CreateSelfDescription.Staging.v2_43_0.R36_EQPT.EAFLoggingUnitTesting; + CreateSelfDescription.Staging.v2_43_4.R36_EQPT.ClassInitialize(testContext); + _R36_EQPT = CreateSelfDescription.Staging.v2_43_4.R36_EQPT.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R36_EQPT__DownloadJpegFile() => _R36_EQPT.Staging__v2_43_0__R36_EQPT__DownloadJpegFile(); + public void Staging__v2_43_4__R36_EQPT__DownloadJpegFile() => _R36_EQPT.Staging__v2_43_4__R36_EQPT__DownloadJpegFile(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.43.0/R36.cs b/Adaptation/_Tests/Extract/Staging/v2.43.0/R36.cs index 3f66baf..4c66736 100644 --- a/Adaptation/_Tests/Extract/Staging/v2.43.0/R36.cs +++ b/Adaptation/_Tests/Extract/Staging/v2.43.0/R36.cs @@ -1,6 +1,7 @@ +#if v2_43_0 using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Adaptation._Tests.Extract.Staging.v2_43_0; +namespace Adaptation._Tests.Extract.Staging.v2_43_4; [TestClass] public class R36 @@ -9,19 +10,20 @@ public class R36 #pragma warning disable CA2254 #pragma warning disable IDE0060 - private static CreateSelfDescription.Staging.v2_43_0.R36 _R36; + private static CreateSelfDescription.Staging.v2_43_4.R36 _R36; [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - CreateSelfDescription.Staging.v2_43_0.R36.ClassInitialize(testContext); - _R36 = CreateSelfDescription.Staging.v2_43_0.R36.EAFLoggingUnitTesting; + CreateSelfDescription.Staging.v2_43_4.R36.ClassInitialize(testContext); + _R36 = CreateSelfDescription.Staging.v2_43_4.R36.EAFLoggingUnitTesting; } -#if true +#if DEBUG [Ignore] #endif [TestMethod] - public void Staging__v2_43_0__R36__jpeg() => _R36.Staging__v2_43_0__R36__jpeg(); + public void Staging__v2_43_4__R36__jpeg() => _R36.Staging__v2_43_4__R36__jpeg(); -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.56.0/DEP08SIASM.cs b/Adaptation/_Tests/Extract/Staging/v2.56.0/DEP08SIASM.cs new file mode 100644 index 0000000..1869165 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.56.0/DEP08SIASM.cs @@ -0,0 +1,83 @@ +#if true +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adaptation._Tests.Extract.Staging.v2_56_0; + +[TestClass] +public class DEP08SIASM +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_56_0.DEP08SIASM _DEP08SIASM; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_56_0.DEP08SIASM.ClassInitialize(testContext); + _DEP08SIASM = CreateSelfDescription.Staging.v2_56_0.DEP08SIASM.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__MoveMatchingFiles() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__MoveMatchingFiles(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__OpenInsightMetrologyViewer() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__OpenInsightMetrologyViewer(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__IQSSi() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__IQSSi(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__OpenInsight() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__OpenInsight(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__OpenInsightMetrologyViewerAttachments() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__OpenInsightMetrologyViewerAttachments(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__APC() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__APC(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__SPaCe() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__SPaCe(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__Processed() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__Processed(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__Archive() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__Archive(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__DEP08SIASM__Dummy() => _DEP08SIASM.Staging__v2_56_0__DEP08SIASM__Dummy(); + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.56.0/R34-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.56.0/R34-EQPT.cs new file mode 100644 index 0000000..bd8d3cf --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.56.0/R34-EQPT.cs @@ -0,0 +1,35 @@ +#if true +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adaptation._Tests.Extract.Staging.v2_56_0; + +[TestClass] +public class R34_EQPT +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_56_0.R34_EQPT _R34_EQPT; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_56_0.R34_EQPT.ClassInitialize(testContext); + _R34_EQPT = CreateSelfDescription.Staging.v2_56_0.R34_EQPT.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__R34_EQPT__DownloadJpegFile() => _R34_EQPT.Staging__v2_56_0__R34_EQPT__DownloadJpegFile(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__R34_EQPT__DownloadJpegFile637812143477007703__Normal() => _R34_EQPT.Staging__v2_56_0__R34_EQPT__DownloadJpegFile(); + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.56.0/R34.cs b/Adaptation/_Tests/Extract/Staging/v2.56.0/R34.cs new file mode 100644 index 0000000..99db3f2 --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.56.0/R34.cs @@ -0,0 +1,71 @@ +#if true +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics; +using System.Reflection; + +namespace Adaptation._Tests.Extract.Staging.v2_56_0; + +[TestClass] +public class R34 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_56_0.R34 _R34; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_56_0.R34.ClassInitialize(testContext); + _R34 = CreateSelfDescription.Staging.v2_56_0.R34.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__R34__jpeg() => _R34.Staging__v2_56_0__R34__jpeg(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__R34__jpeg638000598531758005__Normal() + { + string check = "*.jpeg"; + _R34.Staging__v2_56_0__R34__jpeg(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _R34.AdaptationTesting.GetVariables(methodBase, check); + IFileRead fileRead = _R34.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Logistics logistics = new(fileRead); + _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF: false); + // var uri = $"http://{hostip}/set_output?input=0&output=0&venc_framerate={venc_framerate}&venc_gop={venc_gop}&venc_width={venc_width}&venc_height={venc_height}&venc_bitrate={venc_bitrate}&http_ts_uri={http_ts_uri}&http_flv_uri={http_flv_uri}&rtsp_uri={rtsp_uri}&rtmp_enable={rtmp_enable}&rtmp_uri={rtmp_uri}&rtmp_publish_uri={rtmp_publish_uri}&rtmp_publish_enable={rtmp_publish_enable}&http_ts_enable={http_ts_enable}&http_flv_enable={http_flv_enable}&rtsp_enable={rtsp_enable}&venc_profile={venc_profile}&http_hls_uri={http_hls_uri}&http_hls_enable={http_hls_enable}&venc_width_height_same_as_input={venc_width_height_same_as_input}&multicast_ip={multicast_ip}&multicast_port={multicast_port}&multicast_enable={multicast_enable}&venc_codec={venc_codec}&srt_enable={srt_enable}&srt_port={srt_port}&srt_publish_enable={srt_publish_enable}&srt_publish_uri={srt_publish_uri}&srt_key={srt_key}&srt_key_enable={srt_key_enable}&max_qp={venc_max_qp}"; + // if (venc_rc_mode == "5") + // { + // uri += $"&ts_muxrate={venc_bitrate}; + // } + // else + // { + // uri += $"&venc_rc_mode={venc_rc_mode}&ts_muxrate=0"; + // } + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=30&venc_gop=30&venc_width=1920&venc_height=1080&venc_bitrate=2800&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=1&http_flv_enable=1&rtsp_enable=1&venc_profile=0&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655307410424 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=60&venc_gop=300&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=1&http_flv_enable=1&rtsp_enable=1&venc_profile=0&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=265&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655307485097 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=60&venc_gop=300&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=0&http_flv_enable=0&rtsp_enable=1&venc_profile=0&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655326370050 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=60&venc_gop=300&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=0&http_flv_enable=0&rtsp_enable=1&venc_profile=1&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655326507855 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=5&venc_gop=300&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=0&http_flv_enable=0&rtsp_enable=1&venc_profile=1&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655326566457 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=5&venc_gop=5&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=0&http_flv_enable=0&rtsp_enable=1&venc_profile=2&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655326739485 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=5&venc_gop=5&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=0&http_flv_enable=1&rtsp_enable=1&venc_profile=2&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655326928562 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=5&venc_gop=5&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=1&http_flv_enable=1&rtsp_enable=1&venc_profile=2&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655327093005 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=5&venc_gop=5&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=1&http_flv_enable=1&rtsp_enable=1&venc_profile=2&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655327167711 + // http://10.95.154.28/set_output?input=0&output=0&venc_framerate=5&venc_gop=5&venc_width=640&venc_height=480&venc_bitrate=32000&http_ts_uri=/0.ts&http_flv_uri=/0.flv&rtsp_uri=/0&rtmp_enable=0&rtmp_uri=/0&rtmp_publish_uri=rtmp%3A%2F%2F192.168.1.169%2Flive%2F0&rtmp_publish_enable=0&http_ts_enable=0&http_flv_enable=1&rtsp_enable=1&venc_profile=2&http_hls_uri=/0.m3u8&http_hls_enable=0&venc_width_height_same_as_input=0&multicast_ip=238.0.0.1&multicast_port=1234&multicast_enable=0&venc_codec=96&srt_enable=0&srt_port=9000&srt_publish_enable=0&srt_publish_uri=srt%3A%2F%2F192.168.1.169%3A9000&srt_key=0123456789&srt_key_enable=0&max_qp=42&venc_rc_mode=0&ts_muxrate=0&_=1655327315199 + // http://10.95.154.28/set_adv?vga_auto_adjust=1 + // http://10.95.154.28/set_time?sync_time= + // http://10.95.154.28/set_time?sync_time=1655307949&_=1655307949299 + // http://10.95.154.28/get_status?_=1655307702476 + } + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.56.0/R36-EQPT.cs b/Adaptation/_Tests/Extract/Staging/v2.56.0/R36-EQPT.cs new file mode 100644 index 0000000..196072d --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.56.0/R36-EQPT.cs @@ -0,0 +1,29 @@ +#if true +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adaptation._Tests.Extract.Staging.v2_56_0; + +[TestClass] +public class R36_EQPT +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_56_0.R36_EQPT _R36_EQPT; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_56_0.R36_EQPT.ClassInitialize(testContext); + _R36_EQPT = CreateSelfDescription.Staging.v2_56_0.R36_EQPT.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__R36_EQPT__DownloadJpegFile() => _R36_EQPT.Staging__v2_56_0__R36_EQPT__DownloadJpegFile(); + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Staging/v2.56.0/R36.cs b/Adaptation/_Tests/Extract/Staging/v2.56.0/R36.cs new file mode 100644 index 0000000..633615a --- /dev/null +++ b/Adaptation/_Tests/Extract/Staging/v2.56.0/R36.cs @@ -0,0 +1,29 @@ +#if true +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adaptation._Tests.Extract.Staging.v2_56_0; + +[TestClass] +public class R36 +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Staging.v2_56_0.R36 _R36; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Staging.v2_56_0.R36.ClassInitialize(testContext); + _R36 = CreateSelfDescription.Staging.v2_56_0.R36.EAFLoggingUnitTesting; + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__R36__jpeg() => _R36.Staging__v2_56_0__R36__jpeg(); + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Shared/AdaptationTesting.cs b/Adaptation/_Tests/Shared/AdaptationTesting.cs index 691f3fa..5b5db8a 100644 --- a/Adaptation/_Tests/Shared/AdaptationTesting.cs +++ b/Adaptation/_Tests/Shared/AdaptationTesting.cs @@ -305,7 +305,7 @@ public class AdaptationTesting : ISMTP else { results = Directory.GetFiles(mbn.TextFileDirectory, "*.txt", SearchOption.TopDirectoryOnly); - if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && !results.Any()) + if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && results.Length == 0) { _ = Process.Start("explorer.exe", mbn.TextFileDirectory); File.WriteAllText(Path.Combine(mbn.TextFileDirectory, "_ Why.why"), string.Empty); @@ -343,7 +343,7 @@ public class AdaptationTesting : ISMTP return result as T; } - protected static CellInstanceVersion GetCellInstanceVersion(string url) + public static CellInstanceVersion GetCellInstanceVersion(string url) { CellInstanceVersion result; byte[] byteArray; @@ -373,9 +373,7 @@ public class AdaptationTesting : ISMTP Tuple result; CellInstanceVersion cellInstanceVersion; string cellInstanceServiceV2 = string.Concat("http://", _HostNameAndPort, "/CellInstanceServiceV2/", cellInstanceName, "/", cellInstanceVersionName, "/configuration"); - if (_CellInstanceVersions.ContainsKey(cellInstanceServiceV2)) - cellInstanceVersion = _CellInstanceVersions[cellInstanceServiceV2]; - else + if (!_CellInstanceVersions.TryGetValue(cellInstanceServiceV2, out cellInstanceVersion)) { cellInstanceVersion = GetCellInstanceVersion(cellInstanceServiceV2); _CellInstanceVersions.Add(cellInstanceServiceV2, cellInstanceVersion); @@ -401,7 +399,7 @@ public class AdaptationTesting : ISMTP } } } - if (!results.Any() || (!string.IsNullOrEmpty(cellInstanceConnectionName) && !results.ContainsKey(cellInstanceConnectionName))) + if (results.Count == 0 || (!string.IsNullOrEmpty(cellInstanceConnectionName) && !results.ContainsKey(cellInstanceConnectionName))) throw new Exception("Match not found (check test method name matches Mango)!"); return results; } @@ -413,9 +411,8 @@ public class AdaptationTesting : ISMTP result = componentModelComponentsIndexes.ElementAt(0).Value; else { - if (componentModelComponentsIndexes is null || !componentModelComponentsIndexes.ContainsKey(cellInstanceConnectionName)) + if (componentModelComponentsIndexes is null || !componentModelComponentsIndexes.TryGetValue(cellInstanceConnectionName, out result)) throw new Exception(); - result = componentModelComponentsIndexes[cellInstanceConnectionName]; } return result; } @@ -487,7 +484,7 @@ public class AdaptationTesting : ISMTP else if (i == 1) _ = stringBuilder. AppendLine(). - Append("static ").Append(cellInstanceNameWithoutHyphen).AppendLine("() => DummyRoot = @\"\\\\messv02ecc1.ec.local\\EC_Characterization_Si\\Dummy\";"). + Append("static ").Append(cellInstanceNameWithoutHyphen).AppendLine("() => DummyRoot = @\"\\\\mesfs.infineon.com\\EC_Characterization_Si\\Dummy\";"). AppendLine(). Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)"). AppendLine("{"). @@ -565,7 +562,7 @@ public class AdaptationTesting : ISMTP else if (i == 1) { if (componentsCellComponentCellComponent.Equipment.EquipmentType.Version != cellInstanceVersionName) - throw new Exception("Versions should match!"); + throw new Exception($"Versions should match! {componentsCellComponentCellComponent.Equipment.EquipmentType.Version} != {cellInstanceVersionName}"); equipmentTypeName = componentsCellComponentCellComponent.Equipment.EquipmentType.Name; _ = stringBuilder. AppendLine("#if true"). @@ -596,7 +593,7 @@ public class AdaptationTesting : ISMTP throw new Exception(); _ = stringBuilder.Clear(); } - if (componentsCellComponentCellComponentEquipmentDictionaryNames.Any() && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy)) + if (componentsCellComponentCellComponentEquipmentDictionaryNames.Count != 0 && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy)) { if (!cellInstanceVersion.CellCommunicatingRule.EndsWith(".Communicating") || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellCommunicatingRule.Split('.')[0] select true).Any()) throw new Exception($"{methodName} - CellCommunicatingRule not correct in Mango!"); @@ -621,14 +618,10 @@ public class AdaptationTesting : ISMTP result = JsonSerializer.Deserialize(json, jsonSerializerOptions); if (string.IsNullOrEmpty(result.SourceFileFilter)) result.SourceFileFilter = string.Empty; - if (result.ErrorTargetFileLocation is null) - result.ErrorTargetFileLocation = string.Empty; - if (result.SourceFileLocation is null) - result.SourceFileLocation = string.Empty; - if (result.TargetFileLocation is null) - result.TargetFileLocation = string.Empty; - if (result.FolderAgeCheckIndividualSubFolders is null) - result.FolderAgeCheckIndividualSubFolders = false; + result.ErrorTargetFileLocation ??= string.Empty; + result.SourceFileLocation ??= string.Empty; + result.TargetFileLocation ??= string.Empty; + result.FolderAgeCheckIndividualSubFolders ??= false; result.ConnectionSettings = new List(); result.SourceFileFilters = result.SourceFileFilter.Split('|').ToList(); if (componentsCellComponentCellComponent.Equipment?.ConnectionSettings is not null) @@ -652,9 +645,7 @@ public class AdaptationTesting : ISMTP Tuple result; FileConnectorConfiguration fileConnectorConfiguration; string cellInstanceServiceV2With = string.Concat(cellInstanceVersionTuple.Item1, '/', cellInstanceConnectionName); - if (_FileConnectorConfigurations.ContainsKey(cellInstanceServiceV2With)) - fileConnectorConfiguration = _FileConnectorConfigurations[cellInstanceServiceV2With]; - else + if (!_FileConnectorConfigurations.TryGetValue(cellInstanceServiceV2With, out fileConnectorConfiguration)) { Dictionary componentModelComponentsIndexes = GetComponentModelComponentsIndexes(cellInstanceVersionTuple.Item2, cellInstanceConnectionName); int[] cellInstanceConnectionNameIndexes = GetCellInstanceConnectionNameIndexes(cellInstanceConnectionName, componentModelComponentsIndexes); @@ -700,9 +691,7 @@ public class AdaptationTesting : ISMTP int[] cellInstanceConnectionNameIndexes = GetCellInstanceConnectionNameIndexes(cellInstanceConnectionName, componentModelComponentsIndexes); ComponentsCellComponentCellComponent componentsCellComponentCellComponent = cellInstanceVersion.ComponentModel.Components[cellInstanceConnectionNameIndexes[0]].Children[cellInstanceConnectionNameIndexes[1]]; string equipmentTypeServiceV2 = string.Concat("http://", _HostNameAndPort, "/EquipmentTypeServiceV2/", componentsCellComponentCellComponent.Equipment.EquipmentType.Name, "/", componentsCellComponentCellComponent.Equipment.EquipmentType.Version, "/configuration"); - if (_EquipmentTypeVersions.ContainsKey(equipmentTypeServiceV2)) - equipmentTypeVersion = _EquipmentTypeVersions[equipmentTypeServiceV2]; - else + if (!_EquipmentTypeVersions.TryGetValue(equipmentTypeServiceV2, out equipmentTypeVersion)) { equipmentTypeVersion = GetEquipmentTypeVersion(equipmentTypeServiceV2); _EquipmentTypeVersions.Add(equipmentTypeServiceV2, equipmentTypeVersion); @@ -767,7 +756,7 @@ public class AdaptationTesting : ISMTP string[] results; string equipmentDictionaryName; string equipmentDictionaryVersionName; - if (_SkipEquipmentDictionary || equipmentTypeVersion?.EventActionSequences is null || !equipmentTypeVersion.EventActionSequences.Any() || !(from l in equipmentTypeVersion.EventActionSequences where l.HandledEvent.StartsWith("Equipment.FileRead") select 1).Any()) + if (_SkipEquipmentDictionary || equipmentTypeVersion?.EventActionSequences is null || equipmentTypeVersion.EventActionSequences.Length == 0 || !(from l in equipmentTypeVersion.EventActionSequences where l.HandledEvent.StartsWith("Equipment.FileRead") select 1).Any()) { equipmentDictionaryName = string.Empty; equipmentDictionaryVersionName = string.Empty; @@ -838,9 +827,7 @@ public class AdaptationTesting : ISMTP equipmentDictionaryVersion = null; else { - if (_EquipmentDictionaryVersions.ContainsKey(equipmentDictionaryServiceV2)) - equipmentDictionaryVersion = _EquipmentDictionaryVersions[equipmentDictionaryServiceV2]; - else + if (!_EquipmentDictionaryVersions.TryGetValue(equipmentDictionaryServiceV2, out equipmentDictionaryVersion)) { equipmentDictionaryVersion = GetEquipmentDictionaryVersion(equipmentDictionaryServiceV2); _EquipmentDictionaryVersions.Add(equipmentDictionaryServiceV2, equipmentDictionaryVersion); @@ -854,14 +841,15 @@ public class AdaptationTesting : ISMTP { Tuple>> result; List> results; + List> collection; if (_SkipEquipmentDictionary) results = new List>(); else if (string.IsNullOrEmpty(equipmentDictionaryVersionTuple.Item1)) throw new Exception(); else if (equipmentDictionaryVersionTuple?.Item4?.Events?.Event is null) results = new List>(); - else if (_EquipmentDictionaryEventDescriptions.ContainsKey(equipmentDictionaryVersionTuple.Item1)) - results = _EquipmentDictionaryEventDescriptions[equipmentDictionaryVersionTuple.Item1]; + else if (_EquipmentDictionaryEventDescriptions.TryGetValue(equipmentDictionaryVersionTuple.Item1, out collection)) + results = collection; else { results = new List>(); @@ -878,7 +866,7 @@ public class AdaptationTesting : ISMTP return result; } - protected Dictionary GetKeyValuePairs(string cellInstanceName, string cellInstanceVersionName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, List> equipmentDictionaryIsAlwaysEnabledEvents) + protected Dictionary GetKeyValuePairs(string cellInstanceName, string cellInstanceVersionName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList modelObjectParameters, string equipmentDictionaryName, List> equipmentDictionaryIsAlwaysEnabledEvents, int edaConnectionPortNumber) { Dictionary results = new() { @@ -887,6 +875,7 @@ public class AdaptationTesting : ISMTP { nameof(cellInstanceName), cellInstanceName }, { nameof(equipmentTypeName), equipmentTypeName }, { nameof(cellInstanceVersionName), cellInstanceVersionName }, + { nameof(edaConnectionPortNumber), edaConnectionPortNumber }, { nameof(equipmentDictionaryName), equipmentDictionaryName }, { nameof(cellInstanceConnectionName), cellInstanceConnectionName }, { nameof(FileConnectorConfiguration), fileConnectorConfiguration }, @@ -943,7 +932,7 @@ public class AdaptationTesting : ISMTP Tuple> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple); Tuple equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, mbn.CellInstanceConnectionName, equipmentTypeVersionTuple.Item4); Tuple>> equipmentDictionaryIsAlwaysEnabledEventsTuple = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple); - Dictionary objects = GetKeyValuePairs(mbn.CellInstanceName, mbn.CellInstanceVersionName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2); + Dictionary objects = GetKeyValuePairs(mbn.CellInstanceName, mbn.CellInstanceVersionName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2, cellInstanceVersionTuple.Item2.EdaConnection.PortNumber); string json = JsonSerializer.Serialize(objects, new JsonSerializerOptions { WriteIndented = true }); results = new string[] { fileInfo.FullName, json }; return results; @@ -975,28 +964,36 @@ public class AdaptationTesting : ISMTP } if (_TestContext.FullyQualifiedTestClassName.Contains(nameof(Extract))) { - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + try { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation); + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation); + } + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation); + } + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation); + } + if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) + { + if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) + _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder); + } } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) + catch (IOException ex) { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation); - } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) - { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation); - } - if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) - { - if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder)) - _ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder); + if (!ex.Message.Contains("SMB1")) + throw; } } - result = FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, mbn.CellInstanceName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: false); + result = FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, mbn.CellInstanceName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, staticRuns, useCyclicalForDescription, connectionCount: cellInstanceVersionTuple.Item2.EquipmentConnections.Length); return result; } @@ -1013,7 +1010,7 @@ public class AdaptationTesting : ISMTP string sourceFileLocation = string.Empty; MethodBaseName mbn = GetMethodBaseName(methodBase); string[] textFiles = GetTextFiles(mbn); - if (!textFiles.Any()) + if (textFiles.Length == 0) { if (_HasWaitForProperty) throw new Exception("Set text file!"); @@ -1077,7 +1074,7 @@ public class AdaptationTesting : ISMTP else { string[] files = Directory.GetFiles(ipdsfDirectory, searchPattern, SearchOption.TopDirectoryOnly); - if (files.Any()) + if (files.Length != 0) ipdsfFile = files[0]; else ipdsfFile = searchPattern; @@ -1121,9 +1118,9 @@ public class AdaptationTesting : ISMTP { string[] pdsfFiles; pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly); - if (!pdsfFiles.Any()) + if (pdsfFiles.Length == 0) _ = Process.Start("explorer.exe", searchDirectory); - Assert.IsTrue(pdsfFiles.Any(), "GetFiles check"); + Assert.IsTrue(pdsfFiles.Length != 0, "GetFiles check"); results = GetLogisticsColumnsAndBody(pdsfFiles[0]); } Assert.IsFalse(string.IsNullOrEmpty(results.Item1)); @@ -1256,6 +1253,8 @@ public class AdaptationTesting : ISMTP { string result; Tuple> extractResult = fileRead.ReExtract(); + if (extractResult is null) + throw new Exception($"Using pattern {variables[4]} no file was found <{variables[2]}>"); if (!fileRead.IsDuplicator) { Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1)); diff --git a/Adaptation/_Tests/Shared/LoggingUnitTesting.cs b/Adaptation/_Tests/Shared/LoggingUnitTesting.cs index f5c6a40..9628850 100644 --- a/Adaptation/_Tests/Shared/LoggingUnitTesting.cs +++ b/Adaptation/_Tests/Shared/LoggingUnitTesting.cs @@ -26,7 +26,7 @@ public class LoggingUnitTesting : UnitTesting, IDisposable base(testContext, declaringType) { _LoggerFactory = new LoggerFactory(); - if (testContext is null || declaringType is null) + if (testContext is null || declaringType is null || _IsEnvironment is null) { _ConfigurationRoot = null; _DefaultLogLevel = null; diff --git a/Adaptation/_Tests/Shared/UnitTesting.cs b/Adaptation/_Tests/Shared/UnitTesting.cs index 28df790..e4ef794 100644 --- a/Adaptation/_Tests/Shared/UnitTesting.cs +++ b/Adaptation/_Tests/Shared/UnitTesting.cs @@ -2,7 +2,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics; using System.IO; -using System.Linq; using System.Reflection; using System.Text; using System.Text.Json; @@ -29,53 +28,55 @@ public class UnitTesting { string waitFor = "\"WaitFor\":"; string projectDirectory = GetProjectDirectory(testContext); - _TestContextPropertiesAsJson = JsonSerializer.Serialize(testContext.Properties, new JsonSerializerOptions { WriteIndented = true }); - _HasWaitForProperty = _TestContextPropertiesAsJson.Contains(waitFor); - string vsCodeDirectory = Path.Combine(projectDirectory, ".vscode"); - if (!Directory.Exists(vsCodeDirectory)) - _ = Directory.CreateDirectory(vsCodeDirectory); - string launchText = GetLaunchText(); - File.WriteAllText(Path.Combine(vsCodeDirectory, "launch.json"), launchText); - if (_HasWaitForProperty) + if (string.IsNullOrEmpty(projectDirectory)) + _IsEnvironment = null; + else { - for (int i = 0; i < int.MaxValue; i++) + _TestContextPropertiesAsJson = JsonSerializer.Serialize(testContext.Properties, new JsonSerializerOptions { WriteIndented = true }); + _HasWaitForProperty = _TestContextPropertiesAsJson.Contains(waitFor); + string vsCodeDirectory = Path.Combine(projectDirectory, ".vscode"); + if (!Directory.Exists(vsCodeDirectory)) + _ = Directory.CreateDirectory(vsCodeDirectory); + string launchText = GetLaunchText(); + File.WriteAllText(Path.Combine(vsCodeDirectory, "launch.json"), launchText); + if (_HasWaitForProperty) { - if (!_TestContextPropertiesAsJson.Contains($"{waitFor} \"Debugger.IsAttached\"") || Debugger.IsAttached) - break; - Thread.Sleep(500); + for (int i = 0; i < int.MaxValue; i++) + { + if (!_TestContextPropertiesAsJson.Contains($"{waitFor} \"Debugger.IsAttached\"") || Debugger.IsAttached) + break; + Thread.Sleep(500); + } } - } - MethodBase methodBase = declaringType.GetMethod(testContext.TestName); - if (methodBase is not null) - { - TestCategoryAttribute testCategoryAttribute = methodBase.GetCustomAttribute(); - if (testCategoryAttribute is not null) + MethodBase methodBase = declaringType.GetMethod(testContext.TestName); + if (methodBase is not null) { - foreach (string testCategory in testCategoryAttribute.TestCategories) - _IsEnvironment = new IsEnvironment(testCategory); + TestCategoryAttribute testCategoryAttribute = methodBase.GetCustomAttribute(); + if (testCategoryAttribute is not null) + { + foreach (string testCategory in testCategoryAttribute.TestCategories) + _IsEnvironment = new IsEnvironment(testCategory); + } } + _IsEnvironment ??= new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached); } - if (_IsEnvironment is null) - _IsEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached); } } internal static string GetProjectDirectory(TestContext testContext) { string result; - string[] checkFiles = null; + string[] checkFiles; result = Path.GetDirectoryName(testContext.DeploymentDirectory); for (int i = 0; i < int.MaxValue; i++) { if (string.IsNullOrEmpty(result)) break; checkFiles = Directory.GetFiles(result, "*.Tests.*proj", SearchOption.TopDirectoryOnly); - if (checkFiles.Any()) + if (checkFiles.Length != 0) break; result = Path.GetDirectoryName(result); } - if (string.IsNullOrEmpty(result) || checkFiles is null || !checkFiles.Any()) - throw new Exception(result); return result; } diff --git a/Adaptation/_Tests/Static/DEP08SIASM.cs b/Adaptation/_Tests/Static/DEP08SIASM.cs new file mode 100644 index 0000000..0221e4c --- /dev/null +++ b/Adaptation/_Tests/Static/DEP08SIASM.cs @@ -0,0 +1,104 @@ +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace Adaptation._Tests.Static; + +[TestClass] +public class DEP08SIASM : LoggingUnitTesting, IDisposable +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static DEP08SIASM LoggingUnitTesting { get; private set; } + + public DEP08SIASM() : base(testContext: null, declaringType: null) + { + if (LoggingUnitTesting is null) + throw new Exception(); + } + + public DEP08SIASM(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new DEP08SIASM(testContext); + + [ClassCleanup()] + public static void ClassCleanup() + { + LoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + LoggingUnitTesting?.Dispose(); + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + + [TestMethod] + public void TestDateTime() + { + DateTime dateTime = DateTime.Now; + Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString()); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging() + { + MethodBase methodBase = new StackFrame().GetMethod(); + StringBuilder results = new(); + (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] + { + new("DEP08SIASM", "v2.56.0"), + }; + string staging = "http://mestsa07ec.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"); + _ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}"); + } + string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; + if (!Directory.Exists(sourceDirectory)) + _ = Directory.CreateDirectory(sourceDirectory); + File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString()); + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + + [TestMethod] + public void CellInstanceVersionEdaConnectionPortNumber() + { + MethodBase methodBase = new StackFrame().GetMethod(); + string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; + if (Directory.Exists(sourceDirectory)) + { + string destinationDirectory = Path.Combine(sourceDirectory, "All"); + if (!Directory.Exists(destinationDirectory)) + _ = Directory.CreateDirectory(destinationDirectory); + List lines = new(); + string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly); + foreach (string file in files) + lines.AddRange(File.ReadAllLines(file)); + File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l)); + } + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Static/EAF.cs b/Adaptation/_Tests/Static/EAF.cs index 76ae743..06b9540 100644 --- a/Adaptation/_Tests/Static/EAF.cs +++ b/Adaptation/_Tests/Static/EAF.cs @@ -33,8 +33,7 @@ public class EAF : LoggingUnitTesting, IDisposable [ClassInitialize] public static void ClassInitialize(TestContext testContext) { - if (LoggingUnitTesting is null) - LoggingUnitTesting = new EAF(testContext); + LoggingUnitTesting ??= new EAF(testContext); string dummyRoot = string.Empty; bool skipEquipmentDictionary = true; AdaptationTesting = new(dummyRoot, testContext, skipEquipmentDictionary, LoggingUnitTesting.TestContextPropertiesAsJson, LoggingUnitTesting.HasWaitForProperty); @@ -43,10 +42,8 @@ public class EAF : LoggingUnitTesting, IDisposable [ClassCleanup()] public static void ClassCleanup() { - if (LoggingUnitTesting.Logger is not null) - LoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (LoggingUnitTesting is not null) - LoggingUnitTesting.Dispose(); + LoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + LoggingUnitTesting?.Dispose(); } [TestMethod] @@ -58,9 +55,91 @@ public class EAF : LoggingUnitTesting, IDisposable HttpClient httpClient = new(); MethodBase methodBase = new StackFrame().GetMethod(); string currentActiveVersionTag = "CurrentActiveVersion>"; - string managementSite = "http://mestsa07ec.ec.local:9003/CellInstances/entity/"; + string managementSite = "http://mestsa07ec.infineon.com:9003/CellInstances/entity/"; LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - string[] cellInstances = new string[] { "R74-PLC", "MET08THFTIRQS408M", "HGCV1", "TENCOR1", "R53-EQPT", "EC", "TENCOR1-EDA", "R47-PLC-EDA", "SPV01", "CDE4-EDA", "MET08DDUPSP1TBI", "BACKLOG", "R34", "BIORAD5", "CDE3-EQPT", "BIORAD4-EDA", "CDE2-EDA", "CDE5-EDA", "DEP08SIHTRPLC", "R70-PLC-EDA", "MET08THFTIRSTRATUS", "R34-EQPT", "MET08ANLYSDIFAAST230", "BIORAD4", "CDE3-EDA", "CDE5-EQPT", "R72-PLC-EDA", "R74-PLC-EDA", "BACKLOG-EQPT", "CDE3", "TENCOR3-EDA", "R73-PLC-EDA", "R47-PLC", "SP101", "SPV01-EDA", "BIORAD3-EDA", "R70-PLC", "MET08RESIHGCV", "CDE4", "MET08RESIMAPCDE", "TENCOR2", "TENCOR3", "DEP08SIASM", "SP101-EQPT", "BIORAD2", "CDE2", "HGCV3-EDA", "HGCV2-EDA", "HGCV1-EDA", "BIORAD2-EDA", "TENCOR2-EDA", "CDE4-EQPT", "R72-PLC", "HGCV3", "HGCV2", "BIORAD3", "BIORAD5-EDA", "R34-EDA", "SP101-EDA", "R73-PLC", "CDE5", "MET08DDUPSFS6420" }; + string[] cellInstances = new string[] + { + "BACKLOG-EQPT", + "BACKLOG", + "BIORAD2-EDA", + "BIORAD2", + "BIORAD3-EDA", + "BIORAD3", + "BIORAD4-EDA", + "BIORAD4", + "BIORAD5-EDA", + "BIORAD5", + "CDE2-EDA", + "CDE2", + "CDE3-EDA", + "CDE3-EQPT", + "CDE3", + "CDE4-EDA", + "CDE4-EQPT", + "CDE4", + "CDE5-EDA", + "CDE5-EQPT", + "CDE5", + "CDE6-EDA", + "CDE6-EQPT", + "CDE6", + "DEP08SIASM", + "DEP08SIHTRPLC", + "EC", + "HGCV1-EDA", + "HGCV1-EQPT", + "HGCV1", + "HGCV2-EDA", + "HGCV2-EQPT", + "HGCV2", + "HGCV3-EDA", + "HGCV3-EQPT", + "HGCV3", + "MET08ANLYSDIFAAST230", + "MET08DDUPSFS6420", + "MET08DDUPSP1TBI", + "MET08RESIHGCV", + "MET08RESIMAPCDE", + "MET08RESISRP2100", + "MET08THFTIRQS408M", + "MET08THFTIRSTRATUS", + "R34-EDA", + "R34-EQPT", + "R34", + "R47-PLC-EDA", + "R47-PLC", + "R53-EDA", + "R53-EQPT", + "R53", + "R55-EDA", + "R55-EQPT", + "R55", + "R70-PLC-EDA", + "R70-PLC", + "R72-PLC-EDA", + "R72-PLC", + "R73-PLC-EDA", + "R73-PLC", + "R74-PLC-EDA", + "R74-PLC", + "SP101-EDA", + "SP101-EQPT", + "SP101", + "SPV01-EDA", + "SPV01", + "SRP-EDA", + "SRP-EQPT", + "SRP", + "T21", + "T27-EDA", + "T27", + "TENCOR1-EDA", + "TENCOR1", + "TENCOR2-EDA", + "TENCOR2", + "TENCOR3-EDA", + "TENCOR3", + }; foreach (string cellInstance in cellInstances.OrderBy(l => l)) { if (!cellInstance.Contains('-')) @@ -82,109 +161,50 @@ public class EAF : LoggingUnitTesting, IDisposable } -// 553,v2.19.0,R47-PLC-EDA,,,messtec102.EC.local -// 553,v2.19.0,R47-PLC,,,messtec102.EC.local -// 7589,v2.43.3,CDE5-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,messtec102.EC.local -// 8034,v2.43.4,R34-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating, -// 8034,v2.43.4,R53-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating, -// 8134,v2.43.4,R34,jpeg.Communicating,jpeg.NotCommunicating, -// 8134,v4.15.0,R34-EDA,,,messtec102.EC.local -// 8409,v2.43.0,MET08ANLYSDIFAAST230,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating,messtec102.EC.local -// 8439,v2.43.1,EC,,,messtec102.EC.local -// 8500,v2.43.0,BIORAD2,QS408M.Communicating,QS408M.NotCommunicating,messtec102.EC.local -// 8500,v4.15.0,BIORAD2-EDA,,,messtec102.EC.local -// 8501,v2.43.0,BIORAD3,QS408M.Communicating,QS408M.NotCommunicating,messtec102.EC.local -// 8501,v4.15.0,BIORAD3-EDA,,,messtec102.EC.local -// 8509,v2.43.2,MET08THFTIRQS408M,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating,messtec102.EC.local -// 8510,v2.43.0,BIORAD4,QS408M.Communicating,QS408M.NotCommunicating,messtec102.EC.local -// 8510,v4.15.0,BIORAD4-EDA,,,messtec102.EC.local -// 8511,v2.43.0,BIORAD5,QS408M.Communicating,QS408M.NotCommunicating,messtec102.EC.local -// 8511,v4.15.0,BIORAD5-EDA,,,messtec102.EC.local -// 8519,v2.43.2,MET08THFTIRSTRATUS,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating,messtec102.EC.local -// 8520,v2.43.4,CDE2,txt.Communicating,txt.NotCommunicating,MESSA010EC.EC.local -// 8520,v4.15.0,CDE2-EDA,,,messtec102.EC.local -// 8521,v2.43.4,CDE5,RsM.Communicating,RsM.NotCommunicating,MESSA010EC.EC.local -// 8521,v4.15.0,CDE5-EDA,,,messtec102.EC.local -// 8524,v2.43.0,BACKLOG,json.Communicating,json.NotCommunicating, -// 8524,v2.43.4,CDE3,RsM.Communicating,RsM.NotCommunicating,MESSA010EC.EC.local -// 8524,v2.43.4,CDE4,RsM.Communicating,RsM.NotCommunicating,MESSA010EC.EC.local -// 8524,v4.15.0,CDE3-EDA,,,messtec102.EC.local -// 8524,v4.15.0,CDE4-EDA,,,messtec102.EC.local -// 8526,v2.43.0,CDE3-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,messtec102.EC.local -// 8526,v2.43.3,CDE4-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating, -// 8528,v2.43.0,BACKLOG-EQPT,ConvertExcelToJson.Communicating,ConvertExcelToJson.NotCommunicating, -// 8529,v2.43.4,MET08RESIMAPCDE,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating, -// 8530,v2.43.4,HGCV1,pcl.Communicating,pcl.NotCommunicating,MESSA010EC.EC.local -// 8530,v4.15.0,HGCV1-EDA,,,messtec102.EC.local -// 8531,v2.43.4,HGCV2,pcl.Communicating,pcl.NotCommunicating,MESSA010EC.EC.local -// 8531,v4.15.0,HGCV2-EDA,,,messtec102.EC.local -// 8532,v2.43.4,HGCV3,pcl.Communicating,pcl.NotCommunicating,MESSA010EC.EC.local -// 8532,v4.15.0,HGCV3-EDA,,,messtec102.EC.local -// 8537,v2.43.4,DEP08SIASM,MonitorApplication.Communicating,MonitorApplication.NotCommunicating, -// 8538,v2.43.0,DEP08SIHTRPLC,ZipFilesByDate.Communicating,ZipFilesByDate.NotCommunicating, -// 8539,v2.43.4,MET08RESIHGCV,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating,MESSA010EC.EC.local -// 8540,v2.43.4,TENCOR1,pcl.Communicating,pcl.NotCommunicating,MESSA010EC.EC.local -// 8540,v4.15.0,TENCOR1-EDA,,,messtec102.EC.local -// 8541,v2.43.4,TENCOR2,pcl.Communicating,pcl.NotCommunicating,MESSA010EC.EC.local -// 8541,v4.15.0,TENCOR2-EDA,,,messtec102.EC.local -// 8542,v2.43.4,TENCOR3,pcl.Communicating,pcl.NotCommunicating -// 8542,v4.15.0,TENCOR3-EDA,,,messtec102.EC.local -// 8549,v2.43.4,MET08DDUPSFS6420,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating, -// 8550,v4.15.0,SP101-EDA,,,messtec102.EC.local -// 8551,v2.43.4,SP101,txt.Communicating,txt.NotCommunicating,MESSA010EC.EC.local -// 8555,v2.43.0,SP101-EQPT,MoveAllFiles.Communicating,MoveAllFiles.NotCommunicating,messtec102.EC.local -// 8559,v2.43.4,MET08DDUPSP1TBI,MoveMatchingFiles.Communicating,MoveMatchingFiles.NotCommunicating,MESSA010EC.EC.local -// 8569,v2.43.0,SPV01,,,messtec102.EC.local -// 8569,v4.15.0,SPV01-EDA,,,messtec102.EC.local -// 8770,v1.0.1,R70-PLC-EDA,,,messtec102.EC.local -// 8770,v2.19.0,R70-PLC,,,messtec102.EC.local -// 8772,v1.0.1,R72-PLC-EDA,,,messtec102.EC.local -// 8772,v2.19.0,R72-PLC,,,messtec102.EC.local -// 8773,v1.0.1,R73-PLC-EDA,,,messtec102.EC.local -// 8773,v2.19.0,R73-PLC,,,messtec102.EC.local -// 8774,v1.0.1,R74-PLC-EDA,,,messtec102.EC.local -// 8774,v2.19.0,R74-PLC,,,messtec102.EC.local - -// p p v i -// 553 553 v2.19.0 R47-PLC -// 7589 7589 v2.43.3 CDE5-EQPT -// 8034 8034 v2.43.4 R34-EQPT -// 8034 -// 8134 8134 v2.43.4 R34 -// 8409 8409 v2.43.0 MET08ANLYSDIFAAST230 -// 8439 8439 v2.43.1 EC -// 8500 8500 v2.43.0 BIORAD2 -// 8501 8501 v2.43.0 BIORAD3 -// 8509 8509 v2.43.2 MET08THFTIRQS408M -// 8510 8510 v2.43.0 BIORAD4 -// 8511 8511 v2.43.0 BIORAD5 -// 8519 8519 v2.43.2 MET08THFTIRSTRATUS -// 8520 8520 v2.43.4 CDE2 -// 8521 8521 v2.43.4 CDE5 -// 8524 -// 8524 8524 v2.43.4 CDE3 -// 8524 v2.43.4 CDE4 -// 8526 8526 v2.43.0 CDE3-EQPT -// 8526 v2.43.3 CDE4-EQPT -// 8528 8528 v2.43.0 BACKLOG-EQPT -// 8529 8529 v2.43.4 MET08RESIMAPCDE -// 8530 8530 v2.43.4 HGCV1 -// 8531 8531 v2.43.4 HGCV2 -// 8532 8532 v2.43.4 HGCV3 -// 8537 8537 v2.43.4 DEP08SIASM -// 8538 8538 v2.43.0 DEP08SIHTRPLC -// 8539 8539 v2.43.4 MET08RESIHGCV -// 8540 8540 v2.43.4 TENCOR1 -// 8541 8541 v2.43.4 TENCOR2 -// 8542 8542 v2.43.4 TENCOR3 -// 8549 8549 v2.43.4 MET08DDUPSFS6420 -// 8551 8551 v2.43.4 SP101 -// 8555 8555 v2.43.0 SP101-EQPT -// 8559 8559 v2.43.4 MET08DDUPSP1TBI -// 8569 8569 v2.43.0 SPV01 -// 8770 8770 v2.19.0 R70-PLC -// 8772 8772 v2.19.0 R72-PLC -// 8773 8773 v2.19.0 R73-PLC -// 8774 8774 v2.19.0 R74-PLC -// 8775 v2.43.0 BACKLOG -// 8653 v2.43.4 R53-EQPT +// Staging - Getting configuration +// 8500,v4.16.0,BIORAD2-EDA,,,messa010ec +// 8501,v4.16.0,BIORAD3-EDA,,,messa010ec +// 8510,v4.16.0,BIORAD4-EDA,,,messa010ec +// 8511,v4.16.0,BIORAD5-EDA,,,messa010ec +// 8520,v4.16.0,CDE2-EDA,,,messa010ec +// 8524,v4.16.0,CDE3-EDA,,,messa010ec +// 8526,v2.49.2,CDE3-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec +// 8524,v4.16.0,CDE4-EDA,,,messa010ec +// 8526,v2.49.2,CDE4-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec +// 8521,v4.16.0,CDE5-EDA,,,messa010ec +// 7589,v2.49.2,CDE5-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec +// 8522,v4.16.0,CDE6-EDA,,,messa010ec +// 7590,v2.49.2,CDE6-EQPT,DownloadRsMFile.Communicating,DownloadRsMFile.NotCommunicating,mestsa06ec +// 8530,v4.16.0,HGCV1-EDA,,,messa010ec +// 8536,v2.12.3,HGCV1-EQPT,,,messa010ec +// 8531,v4.16.0,HGCV2-EDA,,,messa010ec +// 8537,v2.12.3,HGCV2-EQPT,,,messa010ec +// 8532,v4.16.0,HGCV3-EDA,,,messa010ec +// 8538,v2.12.3,HGCV3-EQPT,,,messa010ec +// 8134,v4.16.0,R34-EDA,,,messa010ec +// 8034,v2.43.4,R34-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating,messa010ec +// 553,v2.19.0,R47-PLC,,,messtec102 +// 553,v2.19.0,R47-PLC-EDA,,,messtec102 +// 8153,v4.16.0,R53-EDA,,,messa010ec +// 8653,v2.43.4,R53-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating,messa010ec +// 8155,v4.16.0,R55-EDA,,,messa010ec +// 8655,v2.43.4,R55-EQPT,DownloadJpegFile.Communicating,DownloadJpegFile.NotCommunicating,messa010ec +// 8770,v2.19.0,R70-PLC,,,messtec102 +// 8770,v1.0.1,R70-PLC-EDA,,,messtec102 +// 8772,v2.19.0,R72-PLC,,,messtec102 +// 8772,v1.0.1,R72-PLC-EDA,,,messtec102 +// 8773,v2.19.0,R73-PLC,,,messtec102 +// 8773,v1.0.1,R73-PLC-EDA,,,messtec102 +// 8774,v2.19.0,R74-PLC,,,messtec102 +// 8774,v1.0.1,R74-PLC-EDA,,,messtec102 +// 8550,v4.16.0,SP101-EDA,,,messa010ec +// 8555,v2.49.3,SP101-EQPT,MoveAllFiles.Communicating,MoveAllFiles.NotCommunicating, +// 8569,v4.16.0,SPV01-EDA,,,messa010ec +// 8574,v4.16.0,SRP-EDA,,,messa010ec +// 8572,v2.49.2,SRP-EQPT,csv.Communicating,csv.NotCommunicating,mestsa06ec +// 7627,v4.16.0,T27-EDA,,,messa010ec +// 8540,v4.16.0,TENCOR1-EDA,,,messa010ec +// 8541,v4.16.0,TENCOR2-EDA,,,messa010ec +// 8542,v4.16.0,TENCOR3-EDA,,,messa010ec +// Staging - Exit +// Cleanup \ No newline at end of file diff --git a/Adaptation/_Tests/Static/jpeg.cs b/Adaptation/_Tests/Static/jpeg.cs new file mode 100644 index 0000000..e6b1527 --- /dev/null +++ b/Adaptation/_Tests/Static/jpeg.cs @@ -0,0 +1,131 @@ +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace Adaptation._Tests.Static; + +[TestClass] +public class JPEG : LoggingUnitTesting, IDisposable +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static JPEG LoggingUnitTesting { get; private set; } + + public JPEG() : base(testContext: null, declaringType: null) + { + if (LoggingUnitTesting is null) + throw new Exception(); + } + + public JPEG(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new JPEG(testContext); + + [ClassCleanup()] + public static void ClassCleanup() + { + LoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + LoggingUnitTesting?.Dispose(); + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void TestDescriptor() + { + MethodBase methodBase = new StackFrame().GetMethod(); + string fileName = "D:/Tmp/phares/R53-EQPT_638005905604624544 - Run Wafer.jpeg"; + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + // (float pageMeanConfidence, string text, List blocks) = FileHandlers.jpeg.ProcessData.Parse(fileName, new(), 0, 0, 0, 0, 0, 0); + List<(float pageMeanConfidence, string text, List blocks)> collection = FileHandlers.jpeg.ProcessData.Parse(fileName); + Assert.IsTrue(collection.Count != 0); + foreach ((float pageMeanConfidence, string text, List blocks) in collection) + { + Assert.IsTrue(pageMeanConfidence > 0); + Assert.IsTrue(!string.IsNullOrEmpty(text)); + Assert.IsTrue(blocks.Count != 0); + // Normal images + // "RECIPE:\nte end\nte a ee)\nAcne\n" + // Grayscale + // "RECIPE:\nEee en\nRECIPE e943\n\ncera ke\n" + // Grayscale Inverted + // "RECIPE:\nOT6_10PH. 60.3.0\nRECIPE e943\nASgMe\n" + // BW + // "RECIPE\nCTG.}0PH. 60.3.0\nRECIPE #943\nAGM e\n" + } + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging() + { + MethodBase methodBase = new StackFrame().GetMethod(); + StringBuilder results = new(); + (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] + { + new("R34", "v2.56.0"), + new("R53", "v2.56.0"), + new("R55", "v2.56.0"), + new("R34-EQPT", "v2.56.0"), + new("R53-EQPT", "v2.56.0"), + new("R55-EQPT", "v2.56.0"), + }; + string staging = "http://mestsa07ec.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"); + _ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}"); + } + string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; + if (!Directory.Exists(sourceDirectory)) + _ = Directory.CreateDirectory(sourceDirectory); + File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString()); + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + + [TestMethod] + public void CellInstanceVersionEdaConnectionPortNumber() + { + MethodBase methodBase = new StackFrame().GetMethod(); + string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; + if (Directory.Exists(sourceDirectory)) + { + string destinationDirectory = Path.Combine(sourceDirectory, "All"); + if (!Directory.Exists(destinationDirectory)) + _ = Directory.CreateDirectory(destinationDirectory); + List lines = new(); + string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly); + foreach (string file in files) + lines.AddRange(File.ReadAllLines(file)); + File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l)); + } + LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + NonThrowTryCatch(); + } + +} \ No newline at end of file diff --git a/Adaptation/_Tests/Static/xml.cs b/Adaptation/_Tests/Static/xml.cs index 05bfa9f..750fc29 100644 --- a/Adaptation/_Tests/Static/xml.cs +++ b/Adaptation/_Tests/Static/xml.cs @@ -27,19 +27,13 @@ public class XML : LoggingUnitTesting, IDisposable { } [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - if (LoggingUnitTesting is null) - LoggingUnitTesting = new XML(testContext); - } + public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new XML(testContext); [ClassCleanup()] public static void ClassCleanup() { - if (LoggingUnitTesting.Logger is not null) - LoggingUnitTesting.Logger.LogInformation("Cleanup"); - if (LoggingUnitTesting is not null) - LoggingUnitTesting.Dispose(); + LoggingUnitTesting?.Logger?.LogInformation("Cleanup"); + LoggingUnitTesting?.Dispose(); } [TestMethod] diff --git a/Adaptation/appsettings.Development.json b/Adaptation/appsettings.Development.json index 923c216..8630239 100644 --- a/Adaptation/appsettings.Development.json +++ b/Adaptation/appsettings.Development.json @@ -45,7 +45,7 @@ "Password": "tVyC7uPHtScZR8NLInSaxQ==" }, { - "Use": true, + "Use": false, "Letter": "i", "Share": "\\\\messdv002.na.infineon.com\\Candela", "User": "INFINEON\\MESGaNEAF", @@ -59,7 +59,7 @@ "Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k=" }, { - "Use": true, + "Use": false, "Letter": "k", "Share": "\\\\messdv002.na.infineon.com\\GaN_NEC\\Characterization", "User": "INFINEON\\MESGaNEAF", @@ -80,49 +80,49 @@ "Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00=" }, { - "Use": true, + "Use": false, "Letter": "n", "Share": "\\\\10.95.154.22\\C", "User": "10.95.154.22\\Aixtron", "Password": "DYVBOr2HJdB7KOhd/IFhLA==" }, { - "Use": true, + "Use": false, "Letter": "o", "Share": "\\\\10.95.154.16\\Aixtron", "User": "10.95.154.16\\Aixtron", "Password": "DYVBOr2HJdB7KOhd/IFhLA==" }, { - "Use": true, + "Use": false, "Letter": "p", "Share": "\\\\10.95.154.15\\Aixtron", "User": "10.95.154.15\\Aixtron", "Password": "DYVBOr2HJdB7KOhd/IFhLA==" }, { - "Use": true, + "Use": false, "Letter": "q", "Share": "\\\\10.95.154.21\\Data", "User": "10.95.154.21\\XRD04Admin", "Password": "v1NOsEOCvbnhzKabspPcCQ==" }, { - "Use": true, + "Use": false, "Letter": "r", "Share": "\\\\10.95.154.23\\Data", "User": "\"10.95.154.23\\infineon us\"", "Password": "rzXkXdHKetDfsukhZKW0yA==" }, { - "Use": true, + "Use": false, "Letter": "s", "Share": "\\\\messv02ecc1.ec.local\\EC_EAFRepository", "User": "EC\\ECMESEAF", "Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00=" }, { - "Use": true, + "Use": false, "Letter": "t", "Share": "\\\\messv02ecc1.ec.local\\EC_EDA", "User": "EC\\ECEDASvc", diff --git a/Adaptation/appsettings.json b/Adaptation/appsettings.json index bfeb1ac..842b156 100644 --- a/Adaptation/appsettings.json +++ b/Adaptation/appsettings.json @@ -45,7 +45,7 @@ "Password": "tVyC7uPHtScZR8NLInSaxQ==" }, { - "Use": true, + "Use": false, "Letter": "i", "Share": "\\\\messdv002.na.infineon.com\\Candela", "User": "INFINEON\\MESGaNEAF", @@ -59,7 +59,7 @@ "Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k=" }, { - "Use": true, + "Use": false, "Letter": "k", "Share": "\\\\messdv002.na.infineon.com\\GaN_NEC\\Characterization", "User": "INFINEON\\MESGaNEAF", @@ -80,49 +80,49 @@ "Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00=" }, { - "Use": true, + "Use": false, "Letter": "n", "Share": "\\\\10.95.154.22\\C", "User": "10.95.154.22\\Aixtron", "Password": "DYVBOr2HJdB7KOhd/IFhLA==" }, { - "Use": true, + "Use": false, "Letter": "o", "Share": "\\\\10.95.154.16\\Aixtron", "User": "10.95.154.16\\Aixtron", "Password": "DYVBOr2HJdB7KOhd/IFhLA==" }, { - "Use": true, + "Use": false, "Letter": "p", "Share": "\\\\10.95.154.15\\Aixtron", "User": "10.95.154.15\\Aixtron", "Password": "DYVBOr2HJdB7KOhd/IFhLA==" }, { - "Use": true, + "Use": false, "Letter": "q", "Share": "\\\\10.95.154.21\\Data", "User": "10.95.154.21\\XRD04Admin", "Password": "v1NOsEOCvbnhzKabspPcCQ==" }, { - "Use": true, + "Use": false, "Letter": "r", "Share": "\\\\10.95.154.23\\Data", "User": "\"10.95.154.23\\infineon us\"", "Password": "rzXkXdHKetDfsukhZKW0yA==" }, { - "Use": true, + "Use": false, "Letter": "s", "Share": "\\\\messv02ecc1.ec.local\\EC_EAFRepository", "User": "EC\\ECMESEAF", "Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00=" }, { - "Use": true, + "Use": false, "Letter": "t", "Share": "\\\\messv02ecc1.ec.local\\EC_EDA", "User": "EC\\ECEDASvc", diff --git a/Adaptation/package.json b/Adaptation/package.json index 3ba701a..925f772 100644 --- a/Adaptation/package.json +++ b/Adaptation/package.json @@ -7,17 +7,11 @@ "CA-CreateSelfDescription.Staging.v2_43_4-DEP08SIASM": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4 & ClassName~DEP08SIASM\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", "DA-CreateSelfDescription.Staging.v2_43_4": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.CreateSelfDescription.Staging.v2_43_4\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", "EA-Extract.Staging.v2_43_4-R34_EQPT-Staging__v2_43_4__R34_EQPT__DownloadJpegFile637812143477007703__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~R34_EQPT & Name~Staging__v2_43_4__R34_EQPT__DownloadJpegFile637812143477007703__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", - "FA-Extract.Staging.v2_43_4-R34-Staging__v2_43_4__R34__jpeg637812143477007703__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~R34 & Name~Staging__v2_43_4__R34__jpeg637812143477007703__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", + "FA-Extract.Staging.v2_43_4-R34-Staging__v2_43_4__R34__jpeg638000598531758005__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~R34 & Name~Staging__v2_43_4__R34__jpeg638000598531758005__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", "GA-Extract.Staging.v2_43_4-R34-Staging__v2_43_4__DEP08SIASM__DEP08SIASM__637825304581476827__Normal": "dotnet test --runtime win-x64 --no-build --filter \"FullyQualifiedName~Adaptation._Tests.Extract.Staging.v2_43_4 & ClassName~DEP08SIASM & Name~Staging__v2_43_4__DEP08SIASM__DEP08SIASM__637825304581476827__Normal\" -- TestRunParameters.Parameter(name=\\\"WaitFor\\\", value=\\\"Debugger.IsAttached\\\")", "Alpha": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "nuget-clear": "dotnet nuget locals all --clear", - "build": "dotnet build --runtime win-x64 --self-contained", - "build-Package-Management": "dotnet build --runtime win-x64 --self-contained --source https://packagemanagement.eu.infineon.com:4430/api/v2/", - "build-nuget-And-Package-Management": "dotnet build --runtime win-x64 --self-contained --source https://api.nuget.org/v3/index.json --source https://packagemanagement.eu.infineon.com:4430/api/v2/", - "build-All-Sources": "dotnet build --runtime win-x64 --self-contained --source https://api.nuget.org/v3/index.json --source https://packagemanagement.eu.infineon.com:4430/api/v2/ --source https://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json --source http://192.168.0.73:5002/v3/index.json", - "dotnet-format": "dotnet format --report .vscode --verbosity detailed --severity warn", - "MSBuild": "\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe\" /target:Build /restore:True /p:RestoreSources=https://api.nuget.org/v3/index.json%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=Debug;TargetFrameworkVersion=v4.8 ../DEP08SIASM.csproj", - "pull": "git pull", + "kanbn.board": "kanbn board", + "kanbn.board.json": "kanbn board -j > .kanbn/board.json", "garbage-collect": "git gc" } } \ No newline at end of file diff --git a/DEP08SIASM.csproj b/DEP08SIASM.csproj index 6e8b720..5903b1e 100644 --- a/DEP08SIASM.csproj +++ b/DEP08SIASM.csproj @@ -11,7 +11,8 @@ DEP08SIASM DEP08SIASM v4.8 - win-x86 + win-x86 + win 512 @@ -38,6 +39,12 @@ prompt 4 + + NETFRAMEWORK;NET20;NET35;NET40;NET45;NET451;NET452;NET46;NET461;NET462;NET47;NET471;NET472;NET48;$(DefineConstants) + + + + @@ -149,7 +156,7 @@ 4.7.0 - 2.43.0 + 2.56.0 1.6.1 diff --git a/FileHandlers/FileRead.cs b/FileHandlers/FileRead.cs index 24a7abe..0fad30a 100644 --- a/FileHandlers/FileRead.cs +++ b/FileHandlers/FileRead.cs @@ -165,7 +165,7 @@ public partial class FileRead : FileReaderHandler, ISMTP Equipment.SelfDescriptionBuilder.AddParameterTypeDefinition(structuredType); } if (!parameterTypeDefinitions.ContainsKey(jsonProperty.Value.ValueKind)) - throw new Exception(string.Concat('{', jsonProperty.Value.ValueKind, "} is not mapped!")); + throw new Exception(string.Concat('<', jsonProperty.Name, "> {", jsonProperty.Value.ValueKind, "} is not mapped!")); } foreach (JsonProperty jsonProperty in jsonProperties) { @@ -197,7 +197,7 @@ public partial class FileRead : FileReaderHandler, ISMTP FileConnectorConfiguration fileConnectorConfiguration = Mapper.Map(Configuration); string parameterizedModelObjectDefinitionType = methodBase.DeclaringType.FullName; IList modelObjectParameters = Mapper.Map(ConfiguredParameters); - _FileRead = CellInstanceConnectionName.Get(this, FileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, _DummyRuns, _StaticRuns, _UseCyclicalForDescription, isEAFHosted: true); + _FileRead = CellInstanceConnectionName.Get(this, FileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, _DummyRuns, _StaticRuns, _UseCyclicalForDescription, connectionCount: null); if (_FileRead.IsEvent) AddParameterRangeAndEvent(); } @@ -338,7 +338,7 @@ public partial class FileRead : FileReaderHandler, ISMTP if (modelObjectParameterDefinitionJsonElement.ValueKind != JsonValueKind.Array) throw new Exception(); IList modelObjectParameters = JsonSerializer.Deserialize>(modelObjectParameterDefinitionJsonElement.ToString(), jsonSerializerOptions); - _FileRead = CellInstanceConnectionName.Get(this, FileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, _DummyRuns, _StaticRuns, _UseCyclicalForDescription, isEAFHosted: false); + _FileRead = CellInstanceConnectionName.Get(this, FileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, _DummyRuns, _StaticRuns, _UseCyclicalForDescription, connectionCount: null); results = _FileRead.ReExtract(); if (results?.Item2 is null) throw new Exception(); diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 2cf0884..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env groovy -/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */ -import groovy.transform.Field - -@Field String _DDrive = 'D:/' -@Field String _AssemblyName = '...' -@Field String _TargetLocation = '...' -@Field String _GitCommitSeven = '...' -@Field String _GitName = 'DEP08SIASM' -@Field String _TestProjectDirectory = 'Adaptation' -@Field String _AgentStaging = 'mestsa07ec-ecmeseaf' -@Field String _DDriveNet = "${_DDrive}Framework4.8" -@Field String _AgentProduction = 'messa08ec-ecmeseaf' -@Field String _AgentDevelopment = 'mestsa003-mesedasvc' -@Field String _ProgramFilesDotnet = 'C:/Program Files/dotnet/dotnet.exe' -@Field String _ProgramFilesMSBuild = 'C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe' - -pipeline { - agent { - label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else' - } - parameters { - string(name: 'GIT_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'mestsa003.infineon.com' : 'mestsa07ec.ec.local', description: 'git server') - string(name: 'DEFAULT_FILE_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'messv02ecc1_ec_local' : 'messv02ecc1.ec.local', description: 'Default file server...') - } - stages { - // stage('Git') { - // steps { - // bat(returnStatus: true, script: 'git init') - // bat(returnStatus: true, script: 'git remote add origin \\\\' + params.GIT_SERVER + '\\Git\\' + _GitName + '.git') - // bat(returnStatus: true, script: 'git pull origin master') - // } - // } - stage('Setup') { - steps { - script { - _AssemblyName = "${env.JOB_NAME}" - // _GitCommitSeven = '1234567' - _GitCommitSeven = env.GIT_COMMIT.substring(0, 7) - def files = findFiles(glob: '*.csproj') - if (files.length != 1) { - error("Build failed because couldn't find a *.csproj file") - } - echo """ - ${files[0].name} - ${files[0].path} - ${files[0].directory} - ${files[0].length} - ${files[0].lastModified} - """ - _AssemblyName = files[0].name.split('[.]csproj')[0] - _TargetLocation = "\\\\${params.DEFAULT_FILE_SERVER}\\EC_EAFRepository\\${env.JENKINS_ENVIRONMENT}\\DeploymentStorage\\Adaptation_${_AssemblyName}" - } - } - } - stage('Info') { - steps { - echo "_AssemblyName ${_AssemblyName}" // ... - echo "BUILD_NUMBER ${env.BUILD_NUMBER}" // 11 - echo "DEFAULT_FILE_SERVER ${params.DEFAULT_FILE_SERVER}" // 11 - echo "GIT_BRANCH ${env.GIT_BRANCH}" // origin/master - echo "GIT_COMMIT ${env.GIT_COMMIT}" // 73b814069f2cf0173a62a8228815a9bc9ba93c41 - echo "GIT_SERVER ${params.GIT_SERVER}" // ... - echo "GIT_URL ${env.GIT_URL}" // D:\ProgramData\Git\....git - echo "JENKINS_ENVIRONMENT ${env.JENKINS_ENVIRONMENT}" // 11 - echo "JENKINS_URL ${env.JENKINS_URL}" // http://localhost:8080/ - echo "JOB_NAME ${env.JOB_NAME}" // ... - echo "WORKSPACE ${env.WORKSPACE}" // D:\.jenkins\_\... - } - } - // stage('Restore') { - // steps { - // bat(returnStatus: true, script: 'dotnet --info') - // } - // } - stage('Safe storage of app secrets') { - steps { - dir(_TestProjectDirectory) { - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets init') - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets set "BuildNumber" "' + env.BUILD_NUMBER + '"') - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets set "GitCommitSeven" "' + _GitCommitSeven + '"') - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'user-secrets set "Server" "' + params.DEFAULT_FILE_SERVER + '"') - } - } - } - stage('Core Build') { - steps { - echo "Build number is ${currentBuild.number}" - dir(_TestProjectDirectory) { - bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' + - 'build --runtime win-x64 --self-contained --verbosity quiet') - } - } - } - // stage('Test') { - // options { - // timeout(time: 10, unit: 'MINUTES') - // } - // steps { - // dir(_TestProjectDirectory) { - // bat('dotnet --info') - // } - // } - // } - stage('Framework Build') { - steps { - echo "Build number is ${currentBuild.number}" - bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' + - '/target:Restore ' + - '/detailedsummary ' + - '/consoleloggerparameters:PerformanceSummary;ErrorsOnly; ' + - '/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' + - _AssemblyName + '.csproj') - bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' + - '/target:Build ' + - '/detailedsummary ' + - '/consoleloggerparameters:PerformanceSummary;ErrorsOnly; ' + - '/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' + - _AssemblyName + '.csproj') - } - } - stage('Commit Id') { - steps { - dir('bin/Debug') { - writeFile file: "${_AssemblyName}.txt", text: "${env.GIT_COMMIT}-${env.BUILD_NUMBER}-${env.GIT_URL}" - } - } - } - stage('Package') { - steps { - fileOperations([fileZipOperation(folderPath: 'bin/Debug', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug")]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug", targetNameExpression: '')]) - } - } - // stage('Force Fail') { - // steps { - // error("Build failed because of this and that..") - // } - // } - stage('Copy Files to: file-share') { - steps { - dir('bin/Debug') { - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.txt", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.dll", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.exe", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.pdb", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')]) - } - } - } - } - post { - always { - dir('bin') { - deleteDir() - } - dir('obj') { - deleteDir() - } - dir(_TestProjectDirectory + '/bin') { - deleteDir() - } - dir(_TestProjectDirectory + '/obj') { - deleteDir() - } - cleanWs() - } - } -} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index e96c8e8..37b2fdc 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.43.4.0")] -[assembly: AssemblyFileVersion("2.43.4.0")] +[assembly: AssemblyVersion("2.52.0.0")] +[assembly: AssemblyFileVersion("2.52.0.0")]