Skip to content

Commit

Permalink
Add GCD manual file changes, fix bugs and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed Jan 19, 2024
1 parent 94ee871 commit 4e7a7fe
Show file tree
Hide file tree
Showing 81 changed files with 2,504 additions and 2,307 deletions.
10 changes: 5 additions & 5 deletions CDP4Common.NetCore.Tests/Helpers/TypeResolverTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TypeResolverTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2020 RHEA System S.A.
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
//
// This file is part of CDP4-SDK Community Edition
// This file is part of CDP4-COMET SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// 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.
Expand Down Expand Up @@ -49,7 +49,7 @@ public void Verify_that_GetDerivedTypes_returns_expected_results()

var subtypes = TypeResolver.GetDerivedTypes(subjectType, assembly).ToList();

Assert.That(subtypes.Count, Is.EqualTo(67));
Assert.That(subtypes.Count, Is.EqualTo(68));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
//
// This file is part of CDP4-SDK Community Edition
// This file is part of CDP4-COMET SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// 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.
Expand Down Expand Up @@ -48,6 +48,7 @@ public void verify_that_correct_versions_are_returned()
new Version(1, 1, 0),
new Version(1, 2, 0),
new Version(1, 3, 0),
new Version(1, 4, 0),
};

var versions = new MetaDataProvider().QuerySupportedModelVersions();
Expand All @@ -58,7 +59,7 @@ public void verify_that_correct_versions_are_returned()
[Test]
public void verify_that_correct_max_version_is_returned()
{
var expected = new Version(1, 3, 0);
var expected = new Version(1, 4, 0);

var version = new MetaDataProvider().GetMaxSupportedModelVersion();

Expand Down
10 changes: 5 additions & 5 deletions CDP4Common.NetCore.Tests/Poco/ParticipantRoleTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ParticipantRoleTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2020 RHEA System S.A.
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
//
// This file is part of CDP4-SDK Community Edition
// This file is part of CDP4-COMET SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// 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.
Expand All @@ -38,7 +38,7 @@ internal class ParticipantRoleTestFixture
public void VerifyPopulateParticipantPermissions()
{
var participantRole = new ParticipantRole();
Assert.AreEqual(48, participantRole.ParticipantPermission.Count);
Assert.AreEqual(49, participantRole.ParticipantPermission.Count);
Assert.IsTrue(participantRole.ParticipantPermission.All(x => x.AccessRight == ParticipantAccessRightKind.NONE));
}
}
Expand Down
12 changes: 6 additions & 6 deletions CDP4Common.Tests/Helpers/TypeResolverTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TypeResolverTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2019 RHEA System S.A.
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// This file is part of CDP4-SDK Community Edition
// This file is part of CDP4-COMET SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// 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.
Expand Down Expand Up @@ -47,7 +47,7 @@ public void Verify_that_GetDerivedTypes_returns_expected_results()

var subtypes = TypeResolver.GetDerivedTypes(subjectType, assembly).ToList();

Assert.That(subtypes.Count, Is.EqualTo(67));
Assert.That(subtypes.Count, Is.EqualTo(68));
}

[Test]
Expand Down
11 changes: 6 additions & 5 deletions CDP4Common.Tests/MetaInfo/MetadataProviderTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// <copyright file="MetadataProviderTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// This file is part of CDP4-SDK Community Edition
// This file is part of CDP4-COMET SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// The CDP4-COMET SDKK 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.
Expand Down Expand Up @@ -48,6 +48,7 @@ public void verify_that_correct_versions_are_extracted_drom_dto_classes()
new Version(1, 1, 0),
new Version(1, 2, 0),
new Version(1, 3, 0),
new Version(1, 4, 0),
};

var versions = new MetaDataProvider().QuerySupportedModelVersions();
Expand All @@ -58,7 +59,7 @@ public void verify_that_correct_versions_are_extracted_drom_dto_classes()
[Test]
public void verify_that_correct_max_version_is_returned()
{
var expected = new Version(1, 3, 0);
var expected = new Version(1, 4, 0);

var version = new MetaDataProvider().GetMaxSupportedModelVersion();

Expand Down
12 changes: 6 additions & 6 deletions CDP4Common.Tests/Poco/ParticipantRoleTestFixture.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#region Copyright
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ParticipantRoleTestFixture.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2019 RHEA System S.A.
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// This file is part of CDP4-SDK Community Edition
// This file is part of CDP4-COMET SDK Community Edition
//
// The CDP4-SDK Community Edition is free software; you can redistribute it and/or
// 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.
Expand All @@ -38,7 +38,7 @@ internal class ParticipantRoleTestFixture
public void VerifyPopulateParticipantPermissions()
{
var participantRole = new ParticipantRole();
Assert.AreEqual(48, participantRole.ParticipantPermission.Count);
Assert.AreEqual(49, participantRole.ParticipantPermission.Count);
Assert.IsTrue(participantRole.ParticipantPermission.All(x => x.AccessRight == ParticipantAccessRightKind.NONE));
}
}
Expand Down
1 change: 1 addition & 0 deletions CDP4Common/AutoGenDto/DefinedThing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ protected DefinedThing(Guid iid, int rev) : base(iid: iid, rev: rev)
/// <summary>
/// Gets or sets the unique identifiers of the contained Attachment instances.
/// </summary>
[CDPVersion("1.4.0")]
[UmlInformation(aggregation: AggregationKind.Composite, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)]
[DataMember]
public virtual List<Guid> Attachment { get; set; }
Expand Down
1 change: 1 addition & 0 deletions CDP4Common/AutoGenPoco/DefinedThing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ protected DefinedThing(Guid iid, ConcurrentDictionary<CacheKey, Lazy<CommonData.
/// <remarks>
/// Reference to one or more Attachments that are linked to this DefinedThing
/// </remarks>
[CDPVersion("1.4.0")]
[UmlInformation(aggregation: AggregationKind.Composite, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)]
public virtual ContainerList<Attachment> Attachment { get; protected set; }

Expand Down
37 changes: 37 additions & 0 deletions CDP4Common/Dto/Attachment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Attachment.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// 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-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 CDP4Common.DTO
{
/// <summary>
/// The extended part of the auto-generated <see cref="Attachment" />
/// </summary>
public partial class Attachment : ILocalFile
{
/// <summary>
/// Contains the path of the file in the context of the User's PC
/// </summary>
public string LocalPath { get; set; }
}
}
37 changes: 37 additions & 0 deletions CDP4Common/Dto/FileRevision.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Attachment.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// 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-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 CDP4Common.DTO
{
/// <summary>
/// The extended part of the auto-generated <see cref="FileRevision"/>
/// </summary>
public partial class FileRevision : ILocalFile
{
/// <summary>
/// Contains the path of the file in the context of the User's PC
/// </summary>
public string LocalPath { get; set; }
}
}
42 changes: 42 additions & 0 deletions CDP4Common/Dto/ILocalFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ILocalFile.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2024 RHEA System S.A.
//
// Author: Sam Gerené, Merlin Bieze, Alex Vorobiev, Naron Phou, Alexander van Delft
//
// 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-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 CDP4Common.DTO
{
/// <summary>
/// An interface for DTO classes containing data that's needed in a file upload scenario.
/// Typically used for <see cref="FileRevision"/> objects.
/// </summary>
public interface ILocalFile
{
/// <summary>
/// Gets or sets the ContentHash.
/// </summary>
/// <remarks>
/// SHA-1 hash code of the content (byte stream) of this object
/// Note: The SHA-1 cryptographic hash is described in <a href="http://en.wikipedia.org/wiki/SHA-1">http://en.wikipedia.org/wiki/SHA-1</a>. It provides a unique hash to the file content of the file and was selected for future compatibility with a GIT (<a href="http://git-scm.com/">http://git-scm.com/</a>) version controlled file store. Implementations of E-TM-10-25 need to provide a way to associate a SHA-1 hash to the content of a file. Whether or not the content of two FileRevisions differs can then be determined by just comparing the SHA-1 hashes without the need for having access to the actual file content itself.
/// </remarks>
string ContentHash { get; }
}
}
Loading

0 comments on commit 4e7a7fe

Please sign in to comment.