Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.JellyContext.runScript()


     * Simple connection
     */
    public void connect() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/ldap-connect.jelly"), xmlOutput);
  xmlOutput.flush();
    }

    /**
     * Simple query
View Full Code Here


     * Simple query
     */
    public void query() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/ldap-query.jelly"), xmlOutput);
  xmlOutput.flush();
    }

    /**
     * Simple insert
View Full Code Here

     * Simple insert
     */
    public void insert() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/ldap-insert.jelly"), xmlOutput);
  xmlOutput.flush();
    }

    /**
     * Simple update
View Full Code Here

     * Simple update
     */
    public void update() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/ldap-update.jelly"), xmlOutput);
  xmlOutput.flush();
    }

    /**
     * Simple delete
View Full Code Here

     * Simple delete
     */
    public void delete() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/ldap-delete.jelly"), xmlOutput);
  xmlOutput.flush();
    }

}

View Full Code Here

     * Simple parsing test
     */
    public void runScript() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/test.jelly"), xmlOutput);
  xmlOutput.flush();
    }

    private class ExtXMLParser extends XMLParser {
  public void configure () {
View Full Code Here

     * @return a newly created TestSuite
     */
    public static TestSuite createTestSuite(URL script) throws Exception {
        JellyContext context = new JellyContext(script);
        XMLOutput output = XMLOutput.createXMLOutput(System.out);
        context = context.runScript(script, output);
        TestSuite answer = (TestSuite) context.getVariable("org.apache.commons.jelly.junit.suite");
        if ( answer == null ) {
            log.warn( "Could not find a TestSuite created by Jelly for the script:" + script );
            // return an empty test suite
            return new TestSuite();
View Full Code Here

           
            InputSource is = XmlUtil.getInputSourceFromDom(pIn);
            // jelly will throw a malformed url exception if no system identifier is specified
            is.setSystemId("http://toxicity.sourceforge.net");
           
            context.runScript(is, xmlOutput);
            xmlOutput.flush();
           
            return XmlUtil.getDomFromInputStream(new ByteArrayInputStream(baos.toByteArray()));
           
        } catch (Exception e) {
View Full Code Here

     * @return a newly created TestSuite
     */
    public static TestSuite createTestSuite(URL script) throws Exception {
        JellyContext context = new JellyContext(script);
        XMLOutput output = XMLOutput.createXMLOutput(System.out);
        context = context.runScript(script, output);
        TestSuite answer = (TestSuite) context.getVariable("org.apache.commons.jelly.junit.suite");
        if ( answer == null ) {
            log.warn( "Could not find a TestSuite created by Jelly for the script:" + script );
            // return an empty test suite
            return new TestSuite();
View Full Code Here

                + " </j:jelly>";
       ByteArrayOutputStream output = new ByteArrayOutputStream();
       XMLOutput xmlOutput = XMLOutput.createXMLOutput(output);
       InputSource script = new InputSource( new StringReader(message.toString()) );
       JellyContext context = new JellyContext();
       context.runScript( script, xmlOutput);
       output.close();
       //check that the output confirms the expected
       assertEquals("jelly-test-case", new String(output.toByteArray()));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.