[RM] Feature Implement embedded message option in Xml and JsonYaml DictionaryStructureWriters
MODIFY
FrontEnd/SailfishFrontEnd/src/main/java/com/exactpro/sf/testwebgui/structures/JsonYamlDictionaryStructureWriter.java
FrontEnd/SailfishFrontEnd/src/main/java/com/exactpro/sf/testwebgui/structures/JsonYamlDictionaryStructureWriter.java
******************************************************************************/
package com.exactpro.sf.testwebgui.structures;
-import com.exactpro.sf.common.impl.messages.json.JsonYamlDictionaryWriter;
-import com.exactpro.sf.common.impl.messages.json.configuration.JsonAttribute;
-import com.exactpro.sf.common.impl.messages.json.configuration.JsonField;
-import com.exactpro.sf.common.impl.messages.json.configuration.JsonMessage;
-import com.exactpro.sf.common.impl.messages.json.configuration.JsonYamlDictionary;
-import com.exactpro.sf.common.messages.structures.IAttributeStructure;
-import com.exactpro.sf.common.util.EPSCommonException;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -34,6 +26,14 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import com.exactpro.sf.common.impl.messages.json.JsonYamlDictionaryWriter;
+import com.exactpro.sf.common.impl.messages.json.configuration.JsonAttribute;
+import com.exactpro.sf.common.impl.messages.json.configuration.JsonField;
+import com.exactpro.sf.common.impl.messages.json.configuration.JsonMessage;
+import com.exactpro.sf.common.impl.messages.json.configuration.JsonYamlDictionary;
+import com.exactpro.sf.common.messages.structures.IAttributeStructure;
+import com.exactpro.sf.common.util.EPSCommonException;
+
public class JsonYamlDictionaryStructureWriter {
public static void write(ModifiableDictionaryStructure dictionaryStructure, OutputStream output, boolean asYaml) {
@@ -97,12 +97,7 @@ public class JsonYamlDictionaryStructureWriter {
for (ModifiableMessageStructure messageStructure : dictionaryStructure.getImplMessageStructures()) {
- JsonMessage jsonMessage = new JsonMessage();
-
- jsonMessage.setName(messageStructure.getName());
- jsonMessage.setDescription(messageStructure.getDescription());
-
- addAttributes(messageStructure, jsonMessage);
+ JsonMessage jsonMessage = createMessageFromStructure(messageStructure, structureMessageMap, structureFieldMap, referenceMap);
if (messageStructure.getReference() != null) {
messageReferenceMap.put(jsonMessage, (ModifiableMessageStructure)messageStructure.getReference());
@@ -110,25 +105,6 @@ public class JsonYamlDictionaryStructureWriter {
structureMessageMap.put(messageStructure, jsonMessage);
- for (ModifiableFieldStructure fieldStructure : messageStructure.getImplFields().values()) {
-
- JsonField jsonField = createFieldFromStructure(fieldStructure);
-
- addAttributes(fieldStructure, jsonField);
-
- if (fieldStructure.getReference() != null) {
-
- if (fieldStructure.getImplReference().isImplSimple() || fieldStructure.getImplReference().isImplEnum()) {
- jsonField.setReference(structureFieldMap.get(fieldStructure.getImplReference()));
- jsonField.setReferenceName(jsonField.getReference().getName());
- } else {
- referenceMap.put(jsonField, fieldStructure.getImplReference());
- }
- }
-
- jsonMessage.getFields().add(jsonField);
- }
-
messages.add(jsonMessage);
}
@@ -204,4 +180,45 @@ public class JsonYamlDictionaryStructureWriter {
return attribute;
}
+
+ private static JsonMessage createMessageFromStructure(ModifiableMessageStructure messageStructure,
+ Map<ModifiableMessageStructure, JsonMessage> structureMessageMap, Map<ModifiableFieldStructure, JsonField> structureFieldMap,
+ Map<JsonField, ModifiableFieldStructure> referenceMap) {
+
+ JsonMessage jsonMessage = new JsonMessage();
+
+ jsonMessage.setName(messageStructure.getName());
+ jsonMessage.setDescription(messageStructure.getDescription());
+
+ addAttributes(messageStructure, jsonMessage);
+
+ structureMessageMap.put(messageStructure, jsonMessage);
+
+ for (ModifiableFieldStructure fieldStructure : messageStructure.getImplFields().values()) {
+
+ if (fieldStructure.isMessage()) {
+ JsonMessage embeddedMessage = createMessageFromStructure((ModifiableMessageStructure)fieldStructure,
+ structureMessageMap, structureFieldMap, referenceMap);
+ jsonMessage.getFields().add(embeddedMessage);
+ } else {
+
+ JsonField jsonField = createFieldFromStructure(fieldStructure);
+
+ addAttributes(fieldStructure, jsonField);
+
+ if (fieldStructure.getReference() != null) {
+
+ if (fieldStructure.getImplReference().isImplSimple() || fieldStructure.getImplReference().isImplEnum()) {
+ jsonField.setReference(structureFieldMap.get(fieldStructure.getImplReference()));
+ jsonField.setReferenceName(jsonField.getReference().getName());
+ } else {
+ referenceMap.put(jsonField, fieldStructure.getImplReference());
+ }
+ }
+
+ jsonMessage.getFields().add(jsonField);
+ }
+ }
+ return jsonMessage;
+ }
}

MODIFY
FrontEnd/SailfishFrontEnd/src/main/java/com/exactpro/sf/testwebgui/structures/XmlDictionaryStructureWriter.java
FrontEnd/SailfishFrontEnd/src/main/java/com/exactpro/sf/testwebgui/structures/XmlDictionaryStructureWriter.java
@@ -103,34 +103,14 @@ public class XmlDictionaryStructureWriter {
for (ModifiableMessageStructure messageStructure : dictionaryStructure.getImplMessageStructures()) {
- Message message = new Message();
- message.setId("M_" + messageStructure.getName());
- message.setName(messageStructure.getName());
- message.setDescription(messageStructure.getDescription());
- addAttributes(messageStructure, message);
+ Message message = createMessageFromStructure(messageStructure, structureMessageMap, structureFieldMap, referenceMap);
+
if (messageStructure.getReference() != null) {
messageReferenceMap.put(message, (ModifiableMessageStructure)messageStructure.getReference());
}
structureMessageMap.put(messageStructure, message);
- for(ModifiableFieldStructure fieldStructure : messageStructure.getImplFields().values()) {
-
- Field field = createFieldFromStructure(fieldStructure, false);
- addAttributes(fieldStructure, field);
-
- if (fieldStructure.getReference() != null) {
-
- if (fieldStructure.getImplReference().isImplSimple() || fieldStructure.getImplReference().isImplEnum()) {
- field.setReference(structureFieldMap.get(fieldStructure.getImplReference()));
- } else {
- referenceMap.put(field, fieldStructure.getImplReference());
- }
- }
-
- message.getFieldsAndMessages().add(field);
- }
-
messages.getMessages().add(message);
}
@@ -204,4 +184,41 @@ public class XmlDictionaryStructureWriter {
}
+ private static Message createMessageFromStructure(ModifiableMessageStructure messageStructure,
+ Map<ModifiableMessageStructure, Message> structureMessageMap, Map<ModifiableFieldStructure, Field> structureFieldMap,
+ Map<Field, ModifiableFieldStructure> referenceMap) {
+
+ Message message = new Message();
+ message.setId("M_" + messageStructure.getName());
+ message.setName(messageStructure.getName());
+ message.setDescription(messageStructure.getDescription());
+ addAttributes(messageStructure, message);
+
+ structureMessageMap.put(messageStructure, message);
+
+ for (ModifiableFieldStructure fieldStructure : messageStructure.getImplFields().values()) {
+
+ if (fieldStructure.isMessage()) {
+ message.getFieldsAndMessages().add(createMessageFromStructure((ModifiableMessageStructure)fieldStructure,
+ structureMessageMap, structureFieldMap, referenceMap));
+ } else {
+
+ Field field = createFieldFromStructure(fieldStructure, false);
+ addAttributes(fieldStructure, field);
+
+ if (fieldStructure.getReference() != null) {
+
+ if (fieldStructure.getImplReference().isImplSimple() || fieldStructure.getImplReference().isImplEnum()) {
+ field.setReference(structureFieldMap.get(fieldStructure.getImplReference()));
+ } else {
+ referenceMap.put(field, fieldStructure.getImplReference());
+ }
+ }
+
+ message.getFieldsAndMessages().add(field);
+ }
+ }
+ return message;
+ }
+
}
\ No newline at end of file

ADD
FrontEnd/SailfishFrontEnd/src/test/java/com/exactpro/sf/testwebgui/structures/DifferenceListener.java
+/*******************************************************************************
+ * Copyright 2009-2020 Exactpro (Exactpro Systems Limited)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.exactpro.sf.testwebgui.structures;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.exactpro.sf.common.messages.structures.DictionaryComparator.DictionaryPath;
+import com.exactpro.sf.common.messages.structures.DictionaryComparator.DistinctionType;
+import com.exactpro.sf.common.messages.structures.DictionaryComparator.IDiffListener;
+
+public class DifferenceListener implements IDiffListener {
+
+ List<String> differences = new ArrayList<>();
+
+ @Override
+ public void differnce(DistinctionType distinctionType, Object first, Object second,
+ DictionaryPath dictionaryPath) {
+
+ StringBuilder differenceStorage = new StringBuilder();
+
+ differenceStorage.append('[');
+ if (first != null) {
+ differenceStorage.append(first.getClass().getSimpleName()).append(" : ");
+ }
+ differenceStorage.append(first).append(']')
+ .append(' ')
+ .append('[');
+ if (second != null) {
+ differenceStorage.append(second.getClass().getSimpleName()).append(" : ");
+ }
+ differenceStorage.append(second).append(']');
+ if (distinctionType != null) {
+ differenceStorage.append(" - ").append(distinctionType);
+ }
+
+ differences.add(differenceStorage.toString());
+ }
+
+ List<String> getDifferences() {
+ return differences;
+ }
+}
+
+

MODIFY
FrontEnd/SailfishFrontEnd/src/test/java/com/exactpro/sf/testwebgui/structures/TestJsonYamlDictionaryStructureWriter.java
FrontEnd/SailfishFrontEnd/src/test/java/com/exactpro/sf/testwebgui/structures/TestJsonYamlDictionaryStructureWriter.java
@@ -21,8 +21,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
import org.junit.Assert;
import org.junit.Rule;
@@ -30,18 +28,15 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import com.exactpro.sf.common.messages.structures.DictionaryComparator;
-import com.exactpro.sf.common.messages.structures.DictionaryComparator.DictionaryPath;
-import com.exactpro.sf.common.messages.structures.DictionaryComparator.DistinctionType;
-import com.exactpro.sf.common.messages.structures.DictionaryComparator.IDiffListener;
-import com.exactpro.sf.common.messages.structures.IDictionaryStructure;
-import com.exactpro.sf.common.messages.structures.loaders.JsonYamlDictionaryStructureLoader;
public class TestJsonYamlDictionaryStructureWriter {
private static final Path BASE_DIR = Paths.get((System.getProperty("basedir") == null) ? "." : System.getProperty("basedir")).toAbsolutePath().normalize();
+ private static final String TEST_FILES_DIRECTORY_PATH = BASE_DIR + File.separator + "src" + File.separator + "test" + File.separator + "resources";
- private static final String MESSAGE_INHERITANCE_FILE_PATH = BASE_DIR + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "message-inheritance.json";
- private static final String WRITER_TEST_DICTIONARY_FILE_PATH = BASE_DIR + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "writer-test-dictionary.json";
+ private static final File MESSAGE_INHERITANCE_FILE = new File(TEST_FILES_DIRECTORY_PATH, "message-inheritance.json");
+ private static final File WRITER_TEST_DICTIONARY_FILE = new File(TEST_FILES_DIRECTORY_PATH, "writer-test-dictionary.json");
+ private static final File MESSAGE_EMBEDDED_FILE = new File(TEST_FILES_DIRECTORY_PATH, "message-embedded.json");
@Rule
public TemporaryFolder folder = new TemporaryFolder();
@@ -49,59 +44,38 @@ public class TestJsonYamlDictionaryStructureWriter {
@Test
public void testWriterWithoutDifference() throws IOException {
- ModifiableDictionaryStructure modifiableDictionaryStructure;
-
- try (FileInputStream inputStream = new FileInputStream(MESSAGE_INHERITANCE_FILE_PATH)) {
-
- modifiableDictionaryStructure = new ModifiableJsonYamlDictionaryStructureLoader()
- .load(inputStream);
- }
+ ModifiableDictionaryStructure modifiableDictionaryStructure = getDictionaryStructure(MESSAGE_INHERITANCE_FILE);
File tempFile = folder.newFile("jsonDictionary.json");
JsonYamlDictionaryStructureWriter.write(modifiableDictionaryStructure, tempFile, false);
- IDictionaryStructure dictionaryStructureFromJson;
- try (InputStream inputStream = new FileInputStream(tempFile)) {
-
- JsonYamlDictionaryStructureLoader loader = new JsonYamlDictionaryStructureLoader();
- dictionaryStructureFromJson = loader.load(inputStream);
- }
+ ModifiableDictionaryStructure dictionaryStructureFromJson = getDictionaryStructure(tempFile);
- Listener listener = new Listener();
+ DifferenceListener listener = new DifferenceListener();
DictionaryComparator comparator = new DictionaryComparator();
comparator.compare(listener,
modifiableDictionaryStructure, dictionaryStructureFromJson, true, false, true);
- Assert.assertEquals(listener.getDifferences().isEmpty(), true);
+ Assert.assertTrue(listener.getDifferences().isEmpty());
}
@Test
public void testWriterWithDifference() throws IOException {
- ModifiableDictionaryStructure modifiableDictionaryStructure;
-
- try (FileInputStream inputStream = new FileInputStream(WRITER_TEST_DICTIONARY_FILE_PATH)) {
- modifiableDictionaryStructure = new ModifiableJsonYamlDictionaryStructureLoader()
- .load(inputStream);
- }
+ ModifiableDictionaryStructure modifiableDictionaryStructure = getDictionaryStructure(WRITER_TEST_DICTIONARY_FILE);
File tempFile = folder.newFile("jsonDictionary.json");
JsonYamlDictionaryStructureWriter.write(modifiableDictionaryStructure, tempFile, false);
- IDictionaryStructure dictionaryStructureFromJson;
- try (InputStream inputStream = new FileInputStream(tempFile)) {
-
- JsonYamlDictionaryStructureLoader loader = new JsonYamlDictionaryStructureLoader();
- dictionaryStructureFromJson = loader.load(inputStream);
- }
+ ModifiableDictionaryStructure dictionaryStructureFromJson = getDictionaryStructure(tempFile);
modifiableDictionaryStructure.setNamespace("SetDifferentNamespace");
modifiableDictionaryStructure.setDescription("SetDifferentDescription");
- Listener listener = new Listener();
+ DifferenceListener listener = new DifferenceListener();
DictionaryComparator comparator = new DictionaryComparator();
comparator.compare(listener,
@@ -113,37 +87,30 @@ public class TestJsonYamlDictionaryStructureWriter {
}
- private class Listener implements IDiffListener {
+ @Test
+ public void testEmbeddedMessage() throws IOException {
- List<String> differences = new ArrayList<>();
+ ModifiableDictionaryStructure dictionaryStructureBeforeWriting = getDictionaryStructure(MESSAGE_EMBEDDED_FILE);
- @Override
- public void differnce(DistinctionType distinctionType, Object first, Object second,
- DictionaryPath dictionaryPath) {
+ File tempFile = folder.newFile("jsonDictionary.json");
- StringBuilder differenceStorage = new StringBuilder();
+ JsonYamlDictionaryStructureWriter.write(dictionaryStructureBeforeWriting, tempFile, false);
- differenceStorage.append('[');
- if (first != null) {
- differenceStorage.append(first.getClass().getSimpleName()).append(" : ");
- }
- differenceStorage.append(first).append(']')
- .append(' ')
- .append('[');
- if (second != null) {
- differenceStorage.append(second.getClass().getSimpleName()).append(" : ");
- }
- differenceStorage.append(second).append(']');
- if (distinctionType != null) {
- differenceStorage.append(" - ").append(distinctionType);
- }
+ ModifiableDictionaryStructure dictionaryStructureAfterWriting = getDictionaryStructure(tempFile);
- differences.add(differenceStorage.toString());
+ DifferenceListener listener = new DifferenceListener();
+ DictionaryComparator comparator = new DictionaryComparator();
+
+ comparator.compare(listener,
+ dictionaryStructureBeforeWriting, dictionaryStructureAfterWriting, true, false, true);
+
+ Assert.assertTrue(listener.getDifferences().isEmpty());
}
- List<String> getDifferences() {
- return differences;
+ private ModifiableDictionaryStructure getDictionaryStructure(File dictionary) throws IOException {
+ try (InputStream inputStream = new FileInputStream(dictionary)) {
+ ModifiableJsonYamlDictionaryStructureLoader loader = new ModifiableJsonYamlDictionaryStructureLoader();
+ return loader.load(inputStream);
}
}
-
}
\ No newline at end of file

MODIFY
FrontEnd/SailfishFrontEnd/src/test/java/com/exactpro/sf/testwebgui/structures/XmlDictionaryStructureWriterTest.java
FrontEnd/SailfishFrontEnd/src/test/java/com/exactpro/sf/testwebgui/structures/XmlDictionaryStructureWriterTest.java
******************************************************************************/
package com.exactpro.sf.testwebgui.structures;
-import com.exactpro.sf.common.impl.messages.xml.configuration.JavaType;
-import com.exactpro.sf.common.messages.structures.IAttributeStructure;
-import org.junit.Assert;
-import org.junit.Test;
+import static com.google.common.collect.Sets.newHashSet;
import java.io.File;
import java.io.FileInputStream;
@@ -28,39 +25,41 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
-import static com.google.common.collect.Sets.newHashSet;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import com.exactpro.sf.common.impl.messages.xml.configuration.JavaType;
+import com.exactpro.sf.common.messages.structures.DictionaryComparator;
+import com.exactpro.sf.common.messages.structures.IAttributeStructure;
public class XmlDictionaryStructureWriterTest {
private static final Path BASE_DIR = Paths.get((System.getProperty("basedir") == null) ? "." : System.getProperty("basedir")).toAbsolutePath().normalize();
- private static final String FILE_PATH = BASE_DIR + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "dictionary_attributes.xml";
+ private static final String TEST_FILES_DIRECTORY_PATH = BASE_DIR + File.separator + "src" + File.separator + "test" + File.separator + "resources";
+
+ private static final File DICTIONARY_ATTRIBUTE_FILE = new File(TEST_FILES_DIRECTORY_PATH, "dictionary_attributes.xml");
+ private static final File MESSAGE_EMBEDDED_FILE = new File(TEST_FILES_DIRECTORY_PATH, "message-embedded.xml");
private static final String FIRST_ATTRIBUTE_NAME = "String";
private static final String SECOND_ATTRIBUTE_NAME = "Integer";
private static final String THIRD_ATTRIBUTE_NAME = "Boolean";
+ @Rule
+ public TemporaryFolder folder = new TemporaryFolder();
+
@Test
public void testDictionaryAttributesWriting() throws IOException {
- File dictionary = new File(FILE_PATH);
-
- ModifiableDictionaryStructure dictionaryStructure = getDictionaryStructure(dictionary);
+ ModifiableDictionaryStructure dictionaryStructure = getDictionaryStructure(DICTIONARY_ATTRIBUTE_FILE);
- ModifiableDictionaryStructure dictionaryStructureAfterWriting;
- File tempFile = null;
- try {
-
- tempFile = File.createTempFile("dictionary", ".xml");
+ File tempFile = folder.newFile("xmlDictionary.xml");
XmlDictionaryStructureWriter.write(dictionaryStructure, tempFile);
- dictionaryStructureAfterWriting = getDictionaryStructure(tempFile);
- } finally {
+ ModifiableDictionaryStructure dictionaryStructureAfterWriting = getDictionaryStructure(tempFile);
- if (tempFile != null) {
- tempFile.delete();
- }
- }
Map<String, IAttributeStructure> attributes = dictionaryStructureAfterWriting.getAttributes();
Assert.assertEquals(newHashSet(FIRST_ATTRIBUTE_NAME, SECOND_ATTRIBUTE_NAME, THIRD_ATTRIBUTE_NAME), attributes.keySet());
@@ -72,14 +71,34 @@ public class XmlDictionaryStructureWriterTest {
Assert.assertEquals(Integer.valueOf(attributes.get(SECOND_ATTRIBUTE_NAME).getValue()), Integer.valueOf(5112020));
Assert.assertEquals(attributes.get(THIRD_ATTRIBUTE_NAME).getType(), JavaType.JAVA_LANG_BOOLEAN);
- Assert.assertEquals(Boolean.valueOf(attributes.get(THIRD_ATTRIBUTE_NAME).getValue()), true);
+ Assert.assertTrue(Boolean.parseBoolean(attributes.get(THIRD_ATTRIBUTE_NAME).getValue()));
+ }
+
+ @Test
+ public void testMessageEmbedded() throws IOException {
+
+ File tempFile = folder.newFile("dictionary.xml");
+
+ ModifiableDictionaryStructure dictionaryStructureBeforeWriting = getDictionaryStructure(MESSAGE_EMBEDDED_FILE);
+
+ XmlDictionaryStructureWriter.write(dictionaryStructureBeforeWriting, tempFile);
+
+ ModifiableDictionaryStructure dictionaryStructureAfterWriting = getDictionaryStructure(tempFile);
+
+ DifferenceListener listener = new DifferenceListener();
+ DictionaryComparator comparator = new DictionaryComparator();
+
+ comparator.compare(listener,
+ dictionaryStructureBeforeWriting, dictionaryStructureAfterWriting, true, false, true);
+
+ Assert.assertTrue(listener.getDifferences().isEmpty());
+
}
private ModifiableDictionaryStructure getDictionaryStructure(File dictionary) throws IOException {
- ModifiableXmlDictionaryStructureLoader loader = new ModifiableXmlDictionaryStructureLoader();
try (InputStream inputStream = new FileInputStream(dictionary)) {
+ ModifiableXmlDictionaryStructureLoader loader = new ModifiableXmlDictionaryStructureLoader();
return loader.load(inputStream);
}
}
-
}
\ No newline at end of file

ADD
FrontEnd/SailfishFrontEnd/src/test/resources/message-embedded.json
+{
+ "name" : "MessageEmbedded",
+ "fields" : {
+ "Integer" : {
+ "type" : "java.lang.Integer"
+ },
+ "String" : {
+ "type" : "java.lang.String"
+ }
+ },
+ "messages" : {
+ "Parent" : {
+ "attributes" : {
+ "AttributeA" : {
+ "type" : "java.lang.String",
+ "value" : "ValueA"
+ }
+ },
+ "fields" : {
+ "FieldA" : {
+ "reference" : "String"
+ },
+ "MessageEmbedded" : {
+ "attributes" : {
+ "AttributeE" : {
+ "type" : "java.lang.String",
+ "value" : "ValueE"
+ }
+ },
+ "fields" : {
+ "EmbeddedField" : {
+ "reference" : "String"
+ },
+ "SecondLevelEmbedded" : {
+ "fields" : {
+ "ThirdLevelEmbedded" : {
+ "fields" : {
+ "EmbeddedFieldFromThirdLevel" : {
+ "reference" : "Integer"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file

ADD
FrontEnd/SailfishFrontEnd/src/test/resources/message-embedded.xml
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Copyright 2009-2020 Exactpro (Exactpro Systems Limited)
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<dictionary name="MessageEmbedded" xmlns="http://exactprosystems.com/dictionary">
+ <fields>
+ <field name="String" id="String" type="java.lang.String"/>
+ <field name="Integer" id="Integer" type="java.lang.Integer"/>
+ </fields>
+ <messages>
+ <message name="Root" id="RootId">
+ <attribute name="AttributeA" type="java.lang.String">ValueA</attribute>
+ <message name="FirstLevelEmbedded1" id="FirstLevelEmbedded1Id">
+ <field name="FirstLevelEmbeddedField1" reference="String"/>
+ <message name="SecondLevelEmbedded1" id="SecondLevelEmbedded1Id">
+ <field name="SecondLevelEmbeddedField1" reference="String"/>
+ </message>
+ <field name="EmbeddedField" reference="String"/>
+ </message>
+ <field name="FieldA" reference="String"/>
+ <message name="FirstLevelEmbedded2" id="FirstLevelEmbedded2Id">
+ <field name="FirstdLevelEmbeddedField2" reference="String"/>
+ <message name="SecondLevelEmbedded2" id="SecondLevelEmbedded2Id">
+ <field name="SecondLevelEmbeddedField2" reference="String"/>
+ </message>
+ <field name="EmbeddedField" reference="String"/>
+ </message>
+ </message>
+ </messages>
+</dictionary>
\ No newline at end of file

[RM] Feature #72143. Implement embedded message option in Xml and JsonYaml DictionaryStructureWriters

Change-Id: I9ee32296aadfa3b3af9c0fb86a6c1779a3deefa7