Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/merge in system text json branch; fixes #262 #354

Open
wants to merge 35 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a626887
Fix #262: Moved from Newtonsoft.Json to System.Text.Json
Mar 21, 2024
b6ad0cb
Fix SQ issues
Mar 21, 2024
3493e78
Update README
Mar 21, 2024
843b096
Fix SQ issue
Mar 21, 2024
721771b
space indentation and encoding in all csproj file + versionbump script
Mar 21, 2024
f1aee5c
Missing method on ICDP4JsonSerializer interface
Mar 21, 2024
bb9e07a
Added Deserialize from string
Mar 22, 2024
585d6fb
added snupkg
Mar 22, 2024
160c208
PostOperation is concrete class now
Mar 22, 2024
09d9365
Improved deserialization of postoperation
Mar 22, 2024
f155be5
Remove useless constructor of PostOperation
Mar 22, 2024
ebafaa4
Requested changes, fix build and improved PropertySerialization
Mar 22, 2024
b1227a4
Fix deserialization of OrderedItem
Mar 22, 2024
3b03b1f
Remove default value for IgnoreCopyProperty for PostOperation serialize
Mar 22, 2024
0665703
Missing README in CDP4JsonSerializer
Mar 22, 2024
c11aa53
Initial commit containing only codegen Serializer and Resolver classes
Oct 24, 2024
69c87ef
Merge branch 'feat/gh262-system-text-json-serializer' into feat/merge…
Oct 24, 2024
64d2721
Bump version number and fix errors
Oct 24, 2024
f7ddc66
Story so far
Oct 25, 2024
10cfdfc
Finetuning
Nov 5, 2024
0fcfde7
Upgrades and fixes according to Annex.C3 Integration Tests
Nov 6, 2024
6f4f4f2
RHEA -> Starion
Nov 6, 2024
0505162
Finetuning and bugfixes
Nov 18, 2024
d0a68ee
update PackageReleaseNotes
Nov 18, 2024
1936e00
MessageBus performance
Nov 19, 2024
91e394a
Upgrade references
Nov 20, 2024
03573d7
Refactor Assembler for better performance
Nov 21, 2024
26c12bd
Revert "MessageBus performance"
Nov 22, 2024
d0e8bd9
Review comments
Nov 25, 2024
53eb823
Move specific CDP4DalJsonSerializer project classes to CDP4JsonSerial…
Nov 26, 2024
64abba5
- use PostOperation where possible
Nov 27, 2024
e4da0af
- use Microsoft.AspNet.WebApi.Client instead of System.Net.Http.Forma…
Nov 27, 2024
2022268
- Refactor creation of default JsonSerializerOptions
Nov 27, 2024
a1f429a
Review comment
Nov 29, 2024
73b763e
Always support MessagePack deserialization as a DefaultRequestHeader …
Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CDP4-SDK.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<copyright file="${File.FileName}" company="Starion Group S.A.">
Copyright (c) 2015-${CurrentDate.Year} Starion Group S.A.

Author: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, Antoine Théate, Omar Elebiary, Jaime Bernar
Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Nathanael Smiechowski, Antoine Théate, Omar Elebiary, Jaime Bernar

This file is part of CDP4-COMET SDK Community Edition

Expand Down
2 changes: 1 addition & 1 deletion CDP4Common.NetCore.Tests/CDP4Common.NetCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Console" Version="3.18.3" />
Expand Down
2 changes: 1 addition & 1 deletion CDP4Common.Tests/CDP4Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Console" Version="3.18.3" />
Expand Down
4 changes: 2 additions & 2 deletions CDP4Common/CDP4Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net48;netstandard2.0</TargetFrameworks>
<Company>Starion Group S.A.</Company>
<Title>CDP4Common Community Edition</Title>
<VersionPrefix>27.4.0</VersionPrefix>
<VersionPrefix>28.0.0</VersionPrefix>
<Description>CDP4 Common Class Library that contains DTOs, POCOs</Description>
<Copyright>Copyright © Starion Group S.A.</Copyright>
<Authors>Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed</Authors>
Expand All @@ -20,7 +20,7 @@
<PackageTags>CDP COMET ECSS-E-TM-10-25</PackageTags>
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
<PackageReleaseNotes>
[ADD] SharpZipLibExtension Methods
[Refactor] Newtonsoft to System.Text.Json
</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CDP4Dal.NetCore.Tests/CDP4Dal.NetCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.dotMemoryUnit" Version="3.2.20220510" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Console" Version="3.18.3" />
Expand Down
22 changes: 14 additions & 8 deletions CDP4Dal.NetCore.Tests/DAL/DalTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
//
// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------

namespace CDP4Dal.Tests.DAL
{
Expand All @@ -36,11 +36,12 @@ namespace CDP4Dal.Tests.DAL
using CDP4Common.Helpers;

using CDP4Dal.Composition;
using CDP4Dal.DAL;
using CDP4Dal.Exceptions;
using CDP4Dal.Operations;
using CDP4Dal.DAL;

using CDP4DalCommon.Tasks;
using CDP4DalCommon.Protocol.Operations;
using CDP4DalCommon.Protocol.Tasks;

using NUnit.Framework;

Expand Down Expand Up @@ -140,6 +141,7 @@ public void Verify_That_SetIterationId_Works_as_expected()
var iteration = new Iteration();
var elementDefinition = new ElementDefinition();
var parameter = new Parameter();

var list = new List<Thing>
{
model,
Expand Down Expand Up @@ -303,7 +305,10 @@ public void Verify_that_OperationContainerFileVerification_throws_no_exception_w
[CDPVersion("1.1.0")]
internal class TestDal : Dal
{
public override bool IsReadOnly { get { return false; } }
public override bool IsReadOnly
{
get { return false; }
}

public TestDal(Credentials credentials)
: base()
Expand Down Expand Up @@ -451,6 +456,7 @@ public override Task<IEnumerable<Thing>> CherryPick(Guid engineeringModelId, Gui
internal class DecoratedDal : Dal
{
public override bool IsReadOnly { get; }

public override Task<IEnumerable<Thing>> Write(IEnumerable<OperationContainer> operationContainer, IEnumerable<string> files = null)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -566,4 +572,4 @@ public override Task<IEnumerable<Thing>> CherryPick(Guid engineeringModelId, Gui
throw new NotSupportedException();
}
}
}
}
22 changes: 13 additions & 9 deletions CDP4Dal.NetCore.Tests/Operations/OperationContainerTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,32 @@
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
//
// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------

namespace CDP4Dal.Tests
{
using System;
using System.Linq;

using CDP4Common.CommonData;
using CDP4Common.DTO;
using CDP4Common.DTO;

using CDP4Dal.Operations;

using CDP4DalCommon.Protocol.Operations;

using NUnit.Framework;

[TestFixture]
public class OperationContainerTestFixture
{
Expand All @@ -42,7 +46,7 @@ public class OperationContainerTestFixture
[SetUp]
public void SetUp()
{
this.siteDirectoryContext = "/SiteDirectory/47363f0d-eb6d-4a58-95f5-fa7854995650";
this.siteDirectoryContext = "/SiteDirectory/47363f0d-eb6d-4a58-95f5-fa7854995650";
this.iterationContext = "/EngineeringModel/5e5dc7f8-833d-4331-b421-eb2c64fcf64b/iteration/b58ea73d-350d-4520-b9d9-a52c75ac2b5d";
}

Expand Down Expand Up @@ -98,9 +102,9 @@ public void VerifyExecutionOfOperationAddAndRemove()
var elementDefinition = new ElementDefinition(Guid.NewGuid(), 0);
elementDefinition.PartialRoutes.Add("iteration/b58ea73d-350d-4520-b9d9-a52c75ac2b5d");
elementDefinition.PartialRoutes.Add("EngineeringModel/5e5dc7f8-833d-4331-b421-eb2c64fcf64b");

var clone = elementDefinition.DeepClone<ElementDefinition>();
var operation = new Operation(elementDefinition, clone, OperationKind.Update);
var operation = new Operation(elementDefinition, clone, OperationKind.Update);

var operationContainer = new OperationContainer(this.iterationContext);

Expand Down
8 changes: 4 additions & 4 deletions CDP4Dal.NetCore.Tests/Operations/OperationTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
//
// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Expand All @@ -26,7 +26,7 @@ namespace CDP4Dal.Tests
{
using CDP4Common.DTO;

using CDP4Dal.Operations;
using CDP4DalCommon.Protocol.Operations;

using NUnit.Framework;

Expand Down
22 changes: 7 additions & 15 deletions CDP4Dal.NetCore.Tests/Operations/PostOperationTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
//
// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------

namespace CDP4Dal.Tests
{
Expand All @@ -29,9 +29,9 @@ namespace CDP4Dal.Tests
using CDP4Common;
using CDP4Common.Dto;
using CDP4Common.DTO;
using CDP4Dal.Operations;

using CDP4DalCommon.Protocol.Operations;

using NUnit.Framework;

[TestFixture]
Expand All @@ -50,13 +50,5 @@ public void VerifyThatConstructorSetsLists()

internal class TestPostOperation : PostOperation
lxatstariongroup marked this conversation as resolved.
Show resolved Hide resolved
{
public override List<ClasslessDTO> Delete { get; set; }
public override List<Thing> Create { get; set; }
public override List<ClasslessDTO> Update { get; set; }
public override List<CopyInfo> Copy { get; set; }
public override void ConstructFromOperation(Operation operation)
{
throw new System.NotImplementedException();
}
}
}
22 changes: 13 additions & 9 deletions CDP4Dal.NetCore.Tests/Operations/ThingTransactionTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-SDK Community Edition is distributed in the hope that it will be useful,
//
// The CDP4-COMET SDK Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------

namespace CDP4Dal.Tests
{
Expand All @@ -34,9 +34,11 @@ namespace CDP4Dal.Tests
using CDP4Common.EngineeringModelData;
using CDP4Common.SiteDirectoryData;
using CDP4Common.Types;

using CDP4Dal.Operations;


using CDP4DalCommon.Protocol.Operations;

using NUnit.Framework;

/// <summary>
Expand Down Expand Up @@ -131,6 +133,7 @@ public void VerifyThatCreateThingWorksWithAbstractContainer()
{
Container = this.siteDirectory
};

this.cache.TryAdd(new CacheKey(siteRdl.Iid, null), new Lazy<Thing>(() => siteRdl));

var cloneRdl = siteRdl.Clone(false);
Expand Down Expand Up @@ -183,7 +186,7 @@ public void VerifyThatCreateThingTwiceDoesntThrowException()
var transaction = new ThingTransaction(transactionContext, this.siteDirectory.Clone(false));
var phone = new TelephoneNumber(Guid.NewGuid(), this.cache, this.uri);

Assert.That(() =>
Assert.That(() =>
{
transaction.Create(phone);
transaction.Create(phone);
Expand Down Expand Up @@ -246,7 +249,6 @@ public void VerifyThatDeleteThingAlreadyDeletedWorks()
[Test]
public void VerifyThatUpdateContainerWorks()
{

var iterationClone = this.iteration.Clone(false);
var option1 = new Option(Guid.NewGuid(), this.cache, this.uri);

Expand Down Expand Up @@ -328,6 +330,7 @@ public void FunctionalTestCase1()
emailTrans.Create(email);

emailTrans.FinalizeSubTransaction(email, person1_1);

// end add email, verify that email is added to person1_1, (the clone of person1)

Assert.That(2, Is.EqualTo(person1_1Tr.AddedThing.Count()));
Expand All @@ -339,6 +342,7 @@ public void FunctionalTestCase1()
var phone_1Trans = new ThingTransaction(phone_1, person1_1Tr, person1_1);
phone_1Trans.CreateOrUpdate(phone_1);
phone_1Trans.FinalizeSubTransaction(phone_1, person1_1);

// end update phone

// verify that the new reference is used
Expand All @@ -354,7 +358,6 @@ public void FunctionalTestCase1()
Assert.That(rootTransaction.AddedThing.Contains(phone_1), Is.True);
Assert.That(1, Is.EqualTo(cloneSiteDir.Person.Count));


// Create new person
var person2 = new Person();
var person2Trans = new ThingTransaction(person2, rootTransaction, cloneSiteDir);
Expand Down Expand Up @@ -828,6 +831,7 @@ public void VerifyThatCascadeDeleteWorksOnAddedThing()
transaction.Delete(person.Clone(false));

var operationContainer = transaction.FinalizeTransaction();

// Update sitedir
Assert.That(1, Is.EqualTo(operationContainer.Operations.Count()));
}
Expand Down
Loading
Loading