import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
/**
- *
- * Each test tests whether json input is correctly transformed to normalized node structure
+ * Each test tests whether json input is correctly transformed to normalized node structure.
*/
public class JsonStreamToNormalizedNodeTest {
}
/**
- * Test of translating internal augmentations to normalized nodes structure
+ * Test of translating internal augmentations to normalized nodes structure.
*
+ * <p>
* 2 nodes are added via internal augmentation A, 1 node via internal augmentation B and one node is originally
* member of case.
- *
*/
@Test
public void caseNodeAugmentationInChoiceInContainer() throws IOException, URISyntaxException {
}
/**
- * also test using of namesakes (equal local names with different
- *
- * @throws IOException
- * @throws URISyntaxException
+ * also test using of namesakes (equal local names with different.
*/
@Test
public void caseNodeExternalAugmentationInChoiceInContainer() throws IOException, URISyntaxException {
- final String inputJson = loadTextFile("/complexjson/case-node-external-augmentation-in-choice-in-container.json");
+ final String inputJson =
+ loadTextFile("/complexjson/case-node-external-augmentation-in-choice-in-container.json");
verifyTransformationToNormalizedNode(inputJson,
TestingNormalizedNodeStructuresCreator.caseNodeExternalAugmentationInChoiceInContainer());
}
/**
- * augmentation of choice - adding new case
+ * augmentation of choice - adding new case.
*/
@Test
public void choiceNodeAugmentationInContainer() throws IOException, URISyntaxException {
@Test
public void unkeyedNodeInContainer() throws IOException, URISyntaxException {
final String inputJson = loadTextFile("/complexjson/unkeyed-node-in-container.json");
- verifyTransformationToNormalizedNode(inputJson, TestingNormalizedNodeStructuresCreator.unkeyedNodeInContainer());
+ verifyTransformationToNormalizedNode(inputJson,
+ TestingNormalizedNodeStructuresCreator.unkeyedNodeInContainer());
}
/**
* Top level JSON element contains no information about module name.
*
+ * <p>
* It should be possible to find out potential module name from available schema context.
- *
*/
@Test
public void missingModuleInfoInTopLevelElement() throws IOException, URISyntaxException {
}
/**
- *
* Exception expected.
*
+ * <p>
* It tests case when several elements with the same name and various namespaces exists and are in JSON specified
* without module name prefix.
*/
}
/**
- *
* Exception expected.
*
+ * <p>
* Json input contains element which doesn't exist in YANG schema
*/
@Test
//second parameter isn't necessary because error will be raised before it is used.
verifyTransformationToNormalizedNode(inputJson, null);
} catch (final IllegalStateException e) {
- assertTrue(e.getMessage().contains("Schema node with name dummy-element wasn't found"));
+ assertTrue(e.getMessage().contains("Schema node with name dummy-element was not found"));
}
}
-
@Test
public void listItemWithoutArray() throws IOException, URISyntaxException {
final String inputJson = loadTextFile("/complexjson/keyed-list-restconf-behaviour.json");
assertNotNull(transformedInput);
}
- @Test
+ @Test
public void multipleChoiceAugmentation() throws IOException, URISyntaxException {
final String inputJson = loadTextFile("/complexjson/multiple-choice-augmentation-in-container.json");
assertEquals("Transformation of json input to normalized node wasn't successful.", awaitedStructure,
transformedInput);
}
-
}