Skip to content

Commit

Permalink
Bumped version numbers to 6.2.2 (#150)
Browse files Browse the repository at this point in the history
* Bumped version numbers

* Attempt to push again through appveyor

* adjust configuration

* Make relative paths for requests consistent
  • Loading branch information
Alex Vorobiev authored Nov 5, 2020
1 parent 6dcbfe9 commit c1c3904
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 51 deletions.
24 changes: 12 additions & 12 deletions CDP4Dal.NetCore.Tests/DAL/DalTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,31 @@ public void Verify_That_UriBuilder_Constructs_Proper_Uris()
var pathWithSlash = $"/{this.somePath}";
var correctFullUri = "http://someuri:80/SiteDirectory";

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());
Assert.AreEqual(this.somePath, pathWithSlash);
this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/"));

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());

var pathWithoutSlash = $"{this.somePath}";
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());

this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/mdb/"));
correctFullUri = "http://someuri:80/mdb/SiteDirectory";

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());

this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/mdb/a/b/c"));
correctFullUri = "http://someuri:80/mdb/a/b/c/SiteDirectory";

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());

this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/mdb/a/b/c/"));

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());
}

[Test]
Expand Down Expand Up @@ -316,9 +316,9 @@ public string CleanPathSlashes(string path)
return base.CleanPathStartingSlash(path);
}

public UriBuilder GetBuilder(Uri uri, string path)
public UriBuilder GetBuilder(Uri uri, ref string path)
{
return base.GetUriBuilder(uri, path);
return base.GetUriBuilder(uri, ref path);
}

internal void TestOperationContainerFileVerification(OperationContainer operationContainer, IEnumerable<string> files)
Expand Down
24 changes: 12 additions & 12 deletions CDP4Dal.Tests/DAL/DalTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,31 @@ public void Verify_That_UriBuilder_Constructs_Proper_Uris()
var pathWithSlash = $"/{this.somePath}";
var correctFullUri = "http://someuri:80/SiteDirectory";

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());
Assert.AreEqual(this.somePath, pathWithSlash);
this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/"));

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());

var pathWithoutSlash = $"{this.somePath}";
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());

this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/mdb/"));
correctFullUri = "http://someuri:80/mdb/SiteDirectory";

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());

this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/mdb/a/b/c"));
correctFullUri = "http://someuri:80/mdb/a/b/c/SiteDirectory";

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());

this.credentials = new Credentials("John", "Doe", new Uri("http://someURI/mdb/a/b/c/"));

Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, pathWithSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithoutSlash).ToString());
Assert.AreEqual(correctFullUri, dal.GetBuilder(this.credentials.Uri, ref pathWithSlash).ToString());
}

[Test]
Expand Down Expand Up @@ -316,9 +316,9 @@ public string CleanPathSlashes(string path)
return base.CleanPathStartingSlash(path);
}

public UriBuilder GetBuilder(Uri uri, string path)
public UriBuilder GetBuilder(Uri uri, ref string path)
{
return base.GetUriBuilder(uri, path);
return base.GetUriBuilder(uri, ref path);
}

internal void TestOperationContainerFileVerification(OperationContainer operationContainer, IEnumerable<string> files)
Expand Down
4 changes: 2 additions & 2 deletions CDP4Dal/CDP4Dal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<Company>RHEA System S.A.</Company>
<Title>CDP4Dal Community Edition</Title>
<VersionPrefix>6.2.0</VersionPrefix>
<VersionPrefix>6.2.2</VersionPrefix>
<Description>CDP4 Data Access Layer library, a consumer of an ECSS-E-TM-10-25 Annex C API</Description>
<Copyright>Copyright © RHEA System S.A.</Copyright>
<Authors>Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathaniel, Kamil</Authors>
Expand All @@ -19,7 +19,7 @@
<PackageTags>CDP CDP4 ECSS-E-TM-10-25</PackageTags>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<PackageReleaseNotes>
[Update] to CDP4Common 6.2.0
[Update] Uri handling
</PackageReleaseNotes>
</PropertyGroup>

Expand Down
7 changes: 5 additions & 2 deletions CDP4Dal/DAL/Dal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,15 @@ protected string CleanPathStartingSlash(string path)
/// subpaths in it already
/// </summary>
/// <param name="uri">The base uri (including subpaths)</param>
/// <param name="path">The path to be appended.</param>
/// <param name="path">The ref to a path to be appended.</param>
/// <returns>A complete <see cref="UriBuilder"/> object.</returns>
protected UriBuilder GetUriBuilder(Uri uri, string path)
protected UriBuilder GetUriBuilder(Uri uri, ref string path)
{
var cleanPath = this.CleanPathStartingSlash(path);

// make sure the original request path is consistently WITHOUT leading slash
path = cleanPath;

var result = new UriBuilder(uri);

result.Path = $"{result.Path}{(result.Path.EndsWith("/") ? string.Empty : "/")}{cleanPath}";
Expand Down
7 changes: 2 additions & 5 deletions CDP4JsonFileDal/CDP4JsonFileDal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<Company>RHEA System S.A.</Company>
<Title>CDP4JsonFileDal Community Edition</Title>
<VersionPrefix>6.2.0</VersionPrefix>
<VersionPrefix>6.2.2</VersionPrefix>
<Description>CDP4 Json File Dal Plugin</Description>
<Copyright>Copyright © RHEA System S.A.</Copyright>
<Authors>Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathaniel, Kamil</Authors>
Expand All @@ -19,10 +19,7 @@
<PackageTags>CDP CDP4 ECSS-E-TM-10-25</PackageTags>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<PackageReleaseNotes>
[Update] to CDP4Common 6.2.0
[Update] to CDP4Dal 6.2.0
[Update] DotNetZip 1.13.8
[Fix] serialization of Person related objects; fixes #131
[Update] to CDP4Dal 6.2.2
</PackageReleaseNotes>
</PropertyGroup>

Expand Down
7 changes: 3 additions & 4 deletions CDP4ServicesDal/CDP4ServicesDal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<Company>RHEA System S.A.</Company>
<Title>CDP4ServicesDal Community Edition</Title>
<VersionPrefix>6.2.0</VersionPrefix>
<VersionPrefix>6.2.2</VersionPrefix>
<Description>CDP4ServicesDal Dal Plugin</Description>
<Copyright>Copyright © RHEA System S.A.</Copyright>
<Authors>Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathaniel, Kamil</Authors>
Expand All @@ -19,9 +19,8 @@
<PackageTags>CDP CDP4 ECSS-E-TM-10-25</PackageTags>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<PackageReleaseNotes>
[Update] to CDP4Common 6.2.0;
[Update] to CDP4Dal 6.2.0
[Update] to CDP4JsonSerializer 6.2.0
[Update] to CDP4Dal 6.2.2
[Fix] Uri handling
</PackageReleaseNotes>
</PropertyGroup>

Expand Down
16 changes: 12 additions & 4 deletions CDP4ServicesDal/CdpServicesDal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ public override async Task<IEnumerable<Thing>> Write(OperationContainer operatio
var postToken = operationContainer.Token;
var resourcePath = $"{operationContainer.Context}{attribute}";

var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", postToken, resourcePath);
Logger.Debug("CDP4 Services POST: {0} - {1}", postToken, uriBuilder);

var requestContent = this.CreateHttpContent(postToken, operationContainer, files);
Expand Down Expand Up @@ -279,7 +281,9 @@ public override async Task<byte[]> ReadFile(Thing thing, CancellationToken cance
var resourcePath = $"{thingRoute}?includeFileData=true";

var readToken = CDP4Common.Helpers.TokenGenerator.GenerateRandomToken();
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", readToken, resourcePath);
Logger.Debug("CDP4Services GET {0}: {1}", readToken, uriBuilder);

var requestsw = Stopwatch.StartNew();
Expand Down Expand Up @@ -362,7 +366,9 @@ public override async Task<IEnumerable<Thing>> Read<T>(T thing, CancellationToke
var resourcePath = $"{thingRoute}{attributes?.ToString()}";

var readToken = CDP4Common.Helpers.TokenGenerator.GenerateRandomToken();
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", readToken, resourcePath);
Logger.Debug("CDP4Services GET {0}: {1}", readToken, uriBuilder);

var requestsw = Stopwatch.StartNew();
Expand Down Expand Up @@ -492,7 +498,9 @@ public override async Task<IEnumerable<Thing>> Open(Credentials credentials, Can

var watch = Stopwatch.StartNew();

var uriBuilder = this.GetUriBuilder(credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", openToken, resourcePath);
Logger.Debug("CDP4Services Open {0}: {1}", openToken, uriBuilder);

var requestsw = Stopwatch.StartNew();
Expand Down
9 changes: 4 additions & 5 deletions CDP4WspDal/CDP4WspDal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<Company>RHEA System S.A.</Company>
<Title>CDP4WspDal Community Edition</Title>
<VersionPrefix>6.2.0</VersionPrefix>
<VersionPrefix>6.2.2</VersionPrefix>
<Description>CDP4 WSP Dal Plugin</Description>
<Copyright>Copyright © RHEA System S.A.</Copyright>
<Authors>Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathaniel, Kamil</Authors>
Expand All @@ -19,10 +19,9 @@
<PackageTags>CDP CDP4 ECSS-E-TM-10-25</PackageTags>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<PackageReleaseNotes>
[Update] to CDP4Common 6.2.0;
[Update] to CDP4Dal 6.2.0
[Update] to CDP4JsonSerializer 6.2.0
</PackageReleaseNotes>
[Update] to CDP4Dal 6.2.2
[Fix] Uri handling
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 9 additions & 3 deletions CDP4WspDal/WSPDal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public override async Task<IEnumerable<Thing>> Write(OperationContainer operatio

var postToken = operationContainer.Token;
var resourcePath = $"{operationContainer.Context}{attribute}";
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", postToken, resourcePath);
Logger.Debug("WSP Dal POST: {0} - {1}", postToken, uriBuilder);

var requestContent = this.CreateHttpContent(postToken, operationContainer, files);
Expand Down Expand Up @@ -338,7 +340,9 @@ public override async Task<IEnumerable<Thing>> Read<T>(T thing, CancellationToke
var resourcePath = $"{thingRoute}{attributes.ToString()}";

var readToken = CDP4Common.Helpers.TokenGenerator.GenerateRandomToken();
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(this.Credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", readToken, resourcePath);
Logger.Debug("WSP GET {0}: {1}", readToken, uriBuilder);

var requestsw = Stopwatch.StartNew();
Expand Down Expand Up @@ -464,7 +468,9 @@ public override async Task<IEnumerable<Thing>> Open(Credentials credentials, Can

var watch = Stopwatch.StartNew();

var uriBuilder = this.GetUriBuilder(credentials.Uri, resourcePath);
var uriBuilder = this.GetUriBuilder(credentials.Uri, ref resourcePath);

Logger.Debug("Resource Path {0}: {1}", openToken, resourcePath);
Logger.Debug("WSP Open {0}: {1}", openToken, uriBuilder);

var requestsw = Stopwatch.StartNew();
Expand Down
15 changes: 13 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ environment:
SONARCLOUD_TOKEN:
secure: t9Adl8VvYx+PRNMC3aXmpSErjxmh/LaCV52WW1X/IxGgjkGYRTf7ZYcNs4s3Fqrt

GITHUB_TOKEN:
secure: uS7/WlBplrAs/j9ab9P3SUN7GZyf4QAHZX//YpDOzXG/DZ6o1MGHdIWLHHdDYM5P

skip_branch_with_pr: true

for:
Expand Down Expand Up @@ -59,8 +62,16 @@ build_script:
- cmd: dotnet build CDP4-SDK-NETF.sln --configuration %CONFIGURATION% -v q --framework net45
- cmd: dotnet build CDP4-SDK-NETC.sln --configuration %CONFIGURATION% -v q --framework netcoreapp3.1
- ps: >-
Write-Host Building Nugets
dotnet pack CDP4-SDK-NETF.sln --configuration $env:CONFIGURATION -p:TargetFrameworks=net45 --no-build --include-symbols --version-suffix "$env:APPVEYOR_BUILD_NUMBER"
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
Write-Host Building Nugets PR# $env:APPVEYOR_PULL_REQUEST_NUMBER
dotnet pack CDP4-SDK-NETF.sln --configuration $env:CONFIGURATION -p:TargetFrameworks=net45 --no-build --version-suffix "$env:APPVEYOR_BUILD_NUMBER-PR$env:APPVEYOR_PULL_REQUEST_NUMBER"
nuget sources add -name github -username RHEAGROUP -password $env:GITHUB_TOKEN -source https://nuget.pkg.github.com/RHEAGROUP/index.json
nuget setApiKey $env:GITHUB_TOKEN -Source "github" -Verbosity quiet
Get-ChildItem -Path C:\projects\cdp4-sdk-community-edition\ -Filter *.nupkg -Recurse -File -Name| ForEach-Object {
nuget push $_ -Source "github"
}
}
test_script:
- >
Expand Down

0 comments on commit c1c3904

Please sign in to comment.