Compare commits
9 Commits
refactored
...
dev-mkoebi
| Author | SHA1 | Date | |
|---|---|---|---|
| f720f37f09 | |||
| e4f2717423 | |||
| f758abbc21 | |||
| f98995332c | |||
| 2505c6ddcd | |||
| 818089917d | |||
| b6adf386f5 | |||
| f07d3e62a8 | |||
|
|
1beaca2622 |
@@ -12,7 +12,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
public class DatabaseOperationsTests
|
public class DatabaseOperationsTests
|
||||||
{
|
{
|
||||||
|
|
||||||
[Fact]//(Skip ="Keine Datenbank-Verbindung m<>glich")]
|
[Fact (Skip ="Keine Datenbank-Verbindung m<>glich")]
|
||||||
public void ConnectAndExecuteHochbauTest()
|
public void ConnectAndExecuteHochbauTest()
|
||||||
{
|
{
|
||||||
DatabaseOperations.conString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dborap04.stadtdo.de)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=bgvp.stadtdo.de)));user id=leser;password=leser;";
|
DatabaseOperations.conString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dborap04.stadtdo.de)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=bgvp.stadtdo.de)));user id=leser;password=leser;";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
{
|
{
|
||||||
public class EmailTests
|
public class EmailTests
|
||||||
{
|
{
|
||||||
[Theory(Skip = "Kein lotus installiert")]
|
[Theory(Skip = "Kein Lotus Notes installiert")]
|
||||||
[InlineData(@"C:\TEMP\test.txt")]
|
[InlineData(@"C:\TEMP\test.txt")]
|
||||||
public void SenMailTest(string attachment)
|
public void SenMailTest(string attachment)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ using Xunit;
|
|||||||
namespace Hochbaustatistik.Testing.Utilities
|
namespace Hochbaustatistik.Testing.Utilities
|
||||||
{
|
{
|
||||||
public class DataOpsTest
|
public class DataOpsTest
|
||||||
{
|
{
|
||||||
readonly string sourceFile = @"TestData\TestData.csv";
|
|
||||||
public readonly VorgangInpro vorgang = new VorgangInpro() { Schlussabnahme = "2022" };
|
public readonly VorgangInpro vorgang = new VorgangInpro() { Schlussabnahme = "2022" };
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
@@ -119,7 +118,7 @@ namespace Hochbaustatistik.Testing.Utilities
|
|||||||
Assert.Equal(expected2, actuals.ElementAt(1));
|
Assert.Equal(expected2, actuals.ElementAt(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "Keine Datenbank-Verbindung möglich")]
|
||||||
public void MergeInproWithITNRWTest()
|
public void MergeInproWithITNRWTest()
|
||||||
{
|
{
|
||||||
var resultFile = @"C:\TEMP\hochbaustatistik.csv";
|
var resultFile = @"C:\TEMP\hochbaustatistik.csv";
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
public class WebTesting
|
public class WebTesting
|
||||||
{
|
{
|
||||||
|
|
||||||
[Fact (Skip ="Keine Daten zum Download vorhanden")]
|
[Fact (Skip ="Derzeit keine Daten zum Download vorhanden")]
|
||||||
public void DownloadList()
|
public void DownloadList()
|
||||||
{
|
{
|
||||||
//DownloadFolder
|
//DownloadFolder
|
||||||
@@ -58,7 +58,7 @@ namespace Hochbaustatistik.Testing
|
|||||||
driver.Quit();
|
driver.Quit();
|
||||||
|
|
||||||
Assert.True(File.Exists(pathDownloadedList));
|
Assert.True(File.Exists(pathDownloadedList));
|
||||||
//File.Delete(pathDownloadedList);
|
File.Delete(pathDownloadedList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Hochbaustatistik.Business
|
|||||||
#region Methods
|
#region Methods
|
||||||
string ReplaceHiphenWithSlash(string aktenzeichen)
|
string ReplaceHiphenWithSlash(string aktenzeichen)
|
||||||
{
|
{
|
||||||
var regex = new Regex(Regex.Escape("-"));
|
var regex = new Regex(Regex.Escape("-"),RegexOptions.None,TimeSpan.FromMilliseconds(5));
|
||||||
string res = regex.Replace(aktenzeichen, "/", 1);
|
string res = regex.Replace(aktenzeichen, "/", 1);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ namespace Hochbaustatistik.Business
|
|||||||
public string Aktenstandort { get; set; }
|
public string Aktenstandort { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
[ExcludeFromCodeCoverage]
|
||||||
public override string GenerateVorgang(Vorgang v)
|
public override string GenerateVorgang(Vorgang v)
|
||||||
{
|
{
|
||||||
StringBuilder sbInpro = new StringBuilder();
|
StringBuilder sbInpro = new StringBuilder();
|
||||||
|
|||||||
@@ -92,81 +92,27 @@ namespace Hochbaustatistik.Database
|
|||||||
vorgangInproHochbau.ZdA = reader.GetValue(6).ToString();
|
vorgangInproHochbau.ZdA = reader.GetValue(6).ToString();
|
||||||
|
|
||||||
vorgangInproHochbau.Eingangsdatum = reader.GetValue(7).ToString().Split(' ').FirstOrDefault();
|
vorgangInproHochbau.Eingangsdatum = reader.GetValue(7).ToString().Split(' ').FirstOrDefault();
|
||||||
var tempDate = reader.GetValue(8).ToString();
|
|
||||||
|
vorgangInproHochbau.Genehmigung = reader.GetValue(8).ToString() == null ? "" : reader.GetValue(8).ToString().Split(' ').FirstOrDefault();
|
||||||
if (tempDate == null)
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Genehmigung = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Genehmigung = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
vorgangInproHochbau.Freigabe = reader.GetValue(9).ToString();
|
vorgangInproHochbau.Freigabe = reader.GetValue(9).ToString();
|
||||||
vorgangInproHochbau.Statistik_Relevant = reader.GetValue(10).ToString();
|
vorgangInproHochbau.Statistik_Relevant = reader.GetValue(10).ToString();
|
||||||
vorgangInproHochbau.Statistik1 = reader.GetValue(11).ToString();
|
vorgangInproHochbau.Statistik1 = reader.GetValue(11).ToString();
|
||||||
vorgangInproHochbau.Statistik2 = reader.GetValue(12).ToString();
|
vorgangInproHochbau.Statistik2 = reader.GetValue(12).ToString();
|
||||||
|
|
||||||
tempDate = reader.GetValue(13).ToString();
|
vorgangInproHochbau.Genehmigung_Gemeldet = reader.GetValue(13).ToString() == null ? "" : reader.GetValue(13).ToString().Split(' ').FirstOrDefault();
|
||||||
if (tempDate == null)
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Genehmigung_Gemeldet = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Genehmigung_Gemeldet = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
tempDate = reader.GetValue(14).ToString();
|
vorgangInproHochbau.Fertigstellung_Gemeldet = reader.GetValue(14).ToString() == null ? "" : reader.GetValue(14).ToString().Split(' ').FirstOrDefault();
|
||||||
if (tempDate == null)
|
vorgangInproHochbau.Baubeginn = reader.GetValue(15).ToString() == null ? "" : reader.GetValue(15).ToString().Split(' ').FirstOrDefault();
|
||||||
{
|
|
||||||
vorgangInproHochbau.Fertigstellung_Gemeldet = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Fertigstellung_Gemeldet = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
tempDate = reader.GetValue(15).ToString();
|
vorgangInproHochbau.Teilrohbauabnahme = reader.GetValue(16).ToString() == null ? "" : reader.GetValue(16).ToString().Split(' ').FirstOrDefault();
|
||||||
if (tempDate == null)
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Baubeginn = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Baubeginn = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
tempDate = reader.GetValue(16).ToString();
|
|
||||||
if (tempDate == null)
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Teilrohbauabnahme = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Teilrohbauabnahme = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
tempDate = reader.GetValue(17).ToString();
|
vorgangInproHochbau.Rohbauabnahme = reader.GetValue(17).ToString() == null ? "" : reader.GetValue(17).ToString().Split(' ').FirstOrDefault();
|
||||||
if (tempDate == null)
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Rohbauabnahme = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Rohbauabnahme = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
tempDate = reader.GetValue(18).ToString();
|
vorgangInproHochbau.Schlussabnahme = reader.GetValue(18).ToString() == null ? "" : reader.GetValue(18).ToString().Split(' ').FirstOrDefault();
|
||||||
if (tempDate == null)
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Schlussabnahme = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vorgangInproHochbau.Schlussabnahme = tempDate.Split(' ').FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
string tempDate = string.Empty;
|
||||||
if (tempDate == null)
|
if (tempDate == null)
|
||||||
{
|
{
|
||||||
vorgangInproHochbau.Vorjahr = "";
|
vorgangInproHochbau.Vorjahr = "";
|
||||||
|
|||||||
@@ -76,20 +76,7 @@ namespace Hochbaustatistik.Utilities
|
|||||||
|
|
||||||
return az;
|
return az;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ExcludeFromCodeCoverage]
|
|
||||||
public string ApplyLastAzToNewAz(string az, string currentName, string currentStrasse, LastData ld)
|
|
||||||
{
|
|
||||||
int linguName = String.Compare(currentName, ld.name, StringComparison.InvariantCultureIgnoreCase);
|
|
||||||
int linguStrasse = String.Compare(currentStrasse, ld.strasse, StringComparison.InvariantCultureIgnoreCase);
|
|
||||||
|
|
||||||
if (linguName > 0 || linguStrasse > 0)
|
|
||||||
{
|
|
||||||
az = ld.az;
|
|
||||||
}
|
|
||||||
return az;
|
|
||||||
}
|
|
||||||
|
|
||||||
[ExcludeFromCodeCoverage]
|
[ExcludeFromCodeCoverage]
|
||||||
private void CheckForDoubleSlashAndCorrect(ref string az)
|
private void CheckForDoubleSlashAndCorrect(ref string az)
|
||||||
{
|
{
|
||||||
@@ -186,7 +173,7 @@ namespace Hochbaustatistik.Utilities
|
|||||||
public bool IsValid(string az)
|
public bool IsValid(string az)
|
||||||
{
|
{
|
||||||
string pattern = @"\b(61[/][0-9]{1}[-][0-9]{1}[-][0-9]{6})";
|
string pattern = @"\b(61[/][0-9]{1}[-][0-9]{1}[-][0-9]{6})";
|
||||||
Regex r = new Regex(pattern);
|
Regex r = new Regex(pattern,RegexOptions.None, TimeSpan.FromMilliseconds(5));
|
||||||
bool matched = r.IsMatch(az);
|
bool matched = r.IsMatch(az);
|
||||||
bool len = az.Length == 13;
|
bool len = az.Length == 13;
|
||||||
if (matched && len)
|
if (matched && len)
|
||||||
@@ -299,8 +286,7 @@ namespace Hochbaustatistik.Utilities
|
|||||||
VorgangInpro vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang);
|
VorgangInpro vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang);
|
||||||
if (vorgangHochbauInpro.IdStrasse == null)
|
if (vorgangHochbauInpro.IdStrasse == null)
|
||||||
{
|
{
|
||||||
vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang, Convert.ToInt32(identifikator));// Convert.ToInt32(ReshapeIdentifikator(hochbauListe.ElementAt(record).Identifikator)));
|
vorgangHochbauInpro = DatabaseOperations.ConnectAndExecuteHochbau(vorgang, Convert.ToInt32(identifikator));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (vorgang.Aktenzeichen.Equals("NOT_CORRECTED"))
|
if (vorgang.Aktenzeichen.Equals("NOT_CORRECTED"))
|
||||||
{
|
{
|
||||||
@@ -316,7 +302,7 @@ namespace Hochbaustatistik.Utilities
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private class Nested
|
private static class Nested
|
||||||
{
|
{
|
||||||
// Tell C# compiler not to mark type as beforefieldinit (https://csharpindepth.com/articles/BeforeFieldInit)
|
// Tell C# compiler not to mark type as beforefieldinit (https://csharpindepth.com/articles/BeforeFieldInit)
|
||||||
static Nested()
|
static Nested()
|
||||||
@@ -331,13 +317,5 @@ namespace Hochbaustatistik.Utilities
|
|||||||
{
|
{
|
||||||
_logger.Info("Singleton erzeugt.");
|
_logger.Info("Singleton erzeugt.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct LastData
|
|
||||||
{
|
|
||||||
public string az;
|
|
||||||
public string ident;
|
|
||||||
public string name;
|
|
||||||
public string strasse;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
21
Hochbaustatistik/config/Jenkinsfile
vendored
21
Hochbaustatistik/config/Jenkinsfile
vendored
@@ -4,7 +4,7 @@ pipeline
|
|||||||
{
|
{
|
||||||
node
|
node
|
||||||
{
|
{
|
||||||
label 'Jenkins_Homer'
|
label 'jenkins_homer_agent'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stages
|
stages
|
||||||
@@ -13,17 +13,14 @@ pipeline
|
|||||||
{
|
{
|
||||||
environment
|
environment
|
||||||
{
|
{
|
||||||
dotnet ="C:\\Program Files\\dotnet\\"
|
dotnet ="C:\\Program Files\\dotnet\\"
|
||||||
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
|
||||||
token = 'sqa_71202f188aacbe40492ba767cf3e841179d3f41a'
|
|
||||||
project = 'hochbaustatistik'
|
|
||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
cleanWs()
|
cleanWs()
|
||||||
checkout scm
|
checkout scm
|
||||||
bat "dotnet restore Hochbaustatistik\\Hochbaustatistik.sln"
|
bat "dotnet restore Hochbaustatistik\\Hochbaustatistik.sln"
|
||||||
bat "${scannerHome}\\SonarScanner.MSBuild.exe begin /k:${project} /d:sonar.login=${token} /d:sonar.verbose=true /d:sonar.cs.opencover.reportsPaths=${WORKSPACE}\\coverage.xml"
|
|
||||||
bat "\"${tool 'MSBuild17'}\" ${WORKSPACE}\\Hochbaustatistik\\Hochbaustatistik.sln /t:Restore /t:Rebuild /p:Configuration=Debug"
|
bat "\"${tool 'MSBuild17'}\" ${WORKSPACE}\\Hochbaustatistik\\Hochbaustatistik.sln /t:Restore /t:Rebuild /p:Configuration=Debug"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,14 +41,16 @@ pipeline
|
|||||||
stage('SonarQube')
|
stage('SonarQube')
|
||||||
{
|
{
|
||||||
environment
|
environment
|
||||||
{
|
{
|
||||||
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
||||||
|
//token = '5f6fffb1bd335a10f8da70b77701bb73d6cd15cf'
|
||||||
token = 'sqa_71202f188aacbe40492ba767cf3e841179d3f41a'
|
token = 'sqa_71202f188aacbe40492ba767cf3e841179d3f41a'
|
||||||
project = 'hochbaustatistik'
|
project = 'hochbaustatistik'
|
||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
bat "${scannerHome}\\SonarScanner.MSBuild.exe end /d:sonar.login=${token}"
|
bat "${scannerHome}\\SonarScanner.MSBuild.exe begin /k:${project} /d:sonar.token=${token} /d:sonar.verbose=true /d:sonar.cs.opencover.reportsPaths=${WORKSPACE}\\coverage.xml
|
||||||
|
bat "${scannerHome}\\SonarScanner.MSBuild.exe end /d:sonar.token=${token}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Coverage')
|
stage('Coverage')
|
||||||
|
|||||||
Reference in New Issue
Block a user