JsonXsltPipe extends XsltPipe { @IbisDocRef({"1", JSONXSLTSENDER}) public void setJsonResult(boolean jsonResult) { ((JsonXsltSender)getSender()).setJsonResult(jsonResult); }  @IbisDocRef({"1", JSONXSLTSENDER}) void setJsonResult(boolean jsonResult); @Override @IbisDocRef({"2", JSONXSLTSENDER}) void setNamespaceDefs(String namespaceDefs);  }
@Test public void xmlOut() throws ConfigurationException, PipeStartException, IOException, PipeRunException { pipe.setStyleSheetName("/Xslt3/orgchart.xslt"); pipe.setJsonResult(false); pipe.configure(); pipe.start(); String input=TestFileUtils.getTestFile("/Xslt3/employees.json"); log.debug("inputfile ["+input+"]"); String expectedXml=TestFileUtils.getTestFile("/Xslt3/orgchart.xml"); PipeRunResult prr = doPipe(pipe, input,session); String xmlOut=prr.getResult().asString(); assertEquals(expectedXml,xmlOut); }
@Test public void testXPath() throws ConfigurationException, PipeStartException, IOException, PipeRunException { pipe.setXpathExpression("j:map/j:map/j:map[j:string[@key='department']='Security']/j:string[@key='firstname']"); pipe.setOutputType("text"); pipe.setJsonResult(false); pipe.configure(); pipe.start(); String input=TestFileUtils.getTestFile("/Xslt3/employees.json"); log.debug("inputfile ["+input+"]"); String expectedText="James"; PipeRunResult prr = doPipe(pipe, input,session); String textOut=prr.getResult().asString(); assertEquals(expectedText,textOut); }