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: implement asset information serialisation #163

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

emildinchev
Copy link
Contributor

No description provided.

@@ -1,5 +1,6 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have decided that it is better to decrease the class visibility to package-private. In such way the class is visible only from dataformat-json project. But it needs to be in the same package as ObjectMapperFactory.

@@ -0,0 +1,97 @@
package org.eclipse.digitaltwin.aas4j.v3.dataformat.json;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion the ObjectMapper created by this class can fully replace the JsonSerializer and JsonDeserializer.

@@ -0,0 +1,15 @@
package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bug in the aas4j library, so the order of tests execution is important.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be resolved now (see #157)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be resolved now (see #157)

@@ -123,7 +123,7 @@ public void deserializeAASFullConceptDescription() throws FileNotFoundException,
@Test
public void deserializeAASWithExtensionMinimal() throws SerializationException, SAXException, FileNotFoundException, DeserializationException {
Environment env = new XmlDeserializer().read(XmlSerializerTest.AAS_WITH_EXTENSION_MINIMAL);

//String xml = new XmlSerializer().write(env);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you uncomment this line, the test will fail. This is a illustration of the bug: the XML serializer modifies the serialized object.

@@ -72,4 +72,18 @@
<artifactId>jackson-core</artifactId>
</dependency>
</dependencies>
<build>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to ensure the execution of the tests in the given order (XMLSerializerTest should be at the end)

@sebbader-sap sebbader-sap marked this pull request as draft December 6, 2023 15:43
@twebermartins twebermartins added the enhancement New feature or request label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants