- dataLoad("/xml-to-cnsn/data-of-several-modules/yang",2,"module1","cont_m1");
- }
-
- @Test
- public void dataFromSeveralModulesToJsonTest() throws WebApplicationException, IOException, URISyntaxException {
- SchemaContext schemaContext = TestUtils.loadSchemaContext(modules);
- String output = TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCnSn(), modules, schemaContext,
- StructuredDataToJsonProvider.INSTANCE);
-
-// String output =
-// String.format("\"data\" : {\n" +
-// "\t\"cont_m1\" : {\n" +
-// "\t\t\"lf1_m1\" : \"lf1 m1 value\"\n" +
-// "\t}\n" +
-// "\t\"cont_m2\" : {\n" +
-// "\t\t\"lf1_m2\" : \"lf1 m2 value\"\n" +
-// "\t}\n" +
-// "}");
-
- StringBuilder regex = new StringBuilder();
- regex.append("^");
-
- regex.append(".*\"data\"");
- regex.append(".*:");
- regex.append(".*\\{");
-
- regex.append(".*\"contB_m1\"");
- regex.append(".*:");
- regex.append(".*\\{");
- regex.append(".*\\}");
-
- regex.append(".*\"cont_m1\"");
- regex.append(".*:");
- regex.append(".*\\{");
- regex.append(".*\\}");
-
- regex.append(".*\"contB_m2\"");
- regex.append(".*:");
- regex.append(".*\\{");
- regex.append(".*\\}");
-
- regex.append(".*\"cont_m2\"");
- regex.append(".*:");
- regex.append(".*\\{");
- regex.append(".*\\}");
-
- regex.append(".*\\}");
-
- regex.append(".*");
- regex.append("$");
-
- Pattern ptrn = Pattern.compile(regex.toString(), Pattern.DOTALL);
- Matcher matcher = ptrn.matcher(output);
-
- assertTrue(matcher.find());
-