- assertNotNull(dataSchemaNode);
- // SchemaContextUtil.
-
- ControllerContext controllerContext = ControllerContext.getInstance();
- controllerContext.setSchemas(loadSchemaContext(modules));
- StructuredData structuredData = new StructuredData(compositeNode, dataSchemaNode);
- try {
- structuredDataToJsonProvider.writeTo(structuredData, null, null, null, null, null, byteArrayOS);
- } catch (WebApplicationException | IOException e) {
- e.printStackTrace();
- }
- assertFalse("Returning JSON string can't be empty for node " + dataSchemaNode.getQName().getLocalName(),
- byteArrayOS.toString().isEmpty());
-
- jsonResult = byteArrayOS.toString();
- try {
- outputToFile(byteArrayOS, outputPath);
- } catch (IOException e) {
- System.out.println("Output file wasn't cloased sucessfuly.");
- }
-
- return jsonResult;