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

Fix #262: Moved from Newtonsoft.Json to System.Text.Json #324

Open
wants to merge 15 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions CDP4-SDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CDP4ServicesMessaging.Tests
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CDP4DalCommon", "CDP4DalCommon\CDP4DalCommon.csproj", "{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDP4DalJsonSerializer", "CDP4DalJsonSerializer\CDP4DalJsonSerializer.csproj", "{36C38A02-C1CF-4F4F-AB40-F0A231256B30}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -209,6 +211,10 @@ Global
{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7CDB217-8442-4FD4-8E87-F4A8BFE9622A}.Release|Any CPU.Build.0 = Release|Any CPU
{36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36C38A02-C1CF-4F4F-AB40-F0A231256B30}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
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="RHEA System S.A.">
Copyright (c) 2015-${CurrentDate.Year} RHEA System 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
38 changes: 22 additions & 16 deletions CDP4Dal.NetCore.Tests/DAL/DalTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------
// <copyright file="DalTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2020 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// This file is part of CDP4-SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// Copyright (c) 2015-2024 RHEA System S.A.
//
// 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
//
// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or
// 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();
}
}
}
}
38 changes: 21 additions & 17 deletions CDP4Dal.NetCore.Tests/Operations/OperationContainerTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------
// <copyright file="OperationContainerTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2019 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
//
// This file is part of CDP4-SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// Copyright (c) 2015-2024 RHEA System S.A.
//
// 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
//
// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or
// 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
30 changes: 15 additions & 15 deletions CDP4Dal.NetCore.Tests/Operations/OperationTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#region Copyright
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------
// <copyright file="OperationTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2019 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
//
// This file is part of CDP4-SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// Copyright (c) 2015-2024 RHEA System S.A.
//
// 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
//
// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or
// 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>
// --------------------------------------------------------------------------------------------------------------------
#endregion
// -------------------------------------------------------------------------------------------------------------------------------

namespace CDP4Dal.Tests
{
using CDP4Common.DTO;
using CDP4Dal.Operations;

using CDP4DalCommon.Protocol.Operations;

using NUnit.Framework;

[TestFixture]
Expand Down
44 changes: 18 additions & 26 deletions CDP4Dal.NetCore.Tests/Operations/PostOperationTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
#region Copyright
// --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------------------
// <copyright file="PostOperationTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2019 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
//
// This file is part of CDP4-SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// Copyright (c) 2015-2024 RHEA System S.A.
//
// 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
//
// The CDP4-COMET SDK Community Edition is free software; you can redistribute it and/or
// 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>
// --------------------------------------------------------------------------------------------------------------------
#endregion

using CDP4Common;
// -------------------------------------------------------------------------------------------------------------------------------

namespace CDP4Dal.Tests
{
using System.Collections.Generic;

using CDP4Common;
using CDP4Common.Dto;
using CDP4Common.DTO;
using CDP4Dal.Operations;

using CDP4DalCommon.Protocol.Operations;

using NUnit.Framework;

[TestFixture]
Expand All @@ -44,19 +44,11 @@ public void VerifyThatConstructorSetsLists()
Assert.IsNotNull(testPostOperation.Delete);
Assert.IsNotNull(testPostOperation.Create);
Assert.IsNotNull(testPostOperation.Update);
Assert.IsNotNull(testPostOperation.Copy);
Assert.IsNotNull(testPostOperation.Copy);
}
}

internal class TestPostOperation : PostOperation
{
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();
}
}
}
Loading
Loading