Package de.danet.an.workflow.tools.test

Source Code of de.danet.an.workflow.tools.test.JellyTest

/*
* This file is part of the WfMOpen project.
* Copyright (C) 2001-2007 Danet GmbH (www.danet.de), BU BTS.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* $Id: JellyTest.java 2321 2007-03-22 15:49:45Z schnelle $
*
* $Log$
* Revision 1.1  2007/03/22 13:49:11  schnelle
* Initial release.
*
*/

package de.danet.an.workflow.tools.test;

import java.io.IOException;

import org.xml.sax.SAXException;

import de.danet.an.workflow.spis.aii.ToolAgent;
import de.danet.an.workflow.tools.JellyTool;
import de.danet.an.workflow.util.SAXEventBufferImpl;

/**
* Base class for tests with the {@link JellyTool} tool.
*
* @author Dirk Schnelle
*/
public class JellyTest extends ToolAgentTestBase {
    /**
     * Constructs a test case without a name.
     */
    public JellyTest() {
        this(null);
    }

    /**
     * Constructs a test case with the specified name.
     * @param name name of the test.
     */
    public JellyTest(String name) {
        super(name);
    }

    /* (non-Javadoc)
     * Comment copied from interface or super class.
     */
    public ToolAgent createToolAgent() {
        return new JellyTool();
    }
   
    /**
     * Retrieves the Jelly tool.
     *
     * @return The Jelly tool.
     */
    public JellyTool getJellyTool() {
        return (JellyTool) getTool();
    }
   
    /**
     * Loads the Jelly script and sets it in the tool.
     * @param script Filename of the XSL transformation to load.
     * @throws IOException Error reading the XSLT.
     * @throws SAXException
     *         Script error.
     */
    protected void loadScript(String script) throws IOException, SAXException {
        SAXEventBufferImpl buf = loadDocument(script);
       
        getJellyTool().setScript(buf);
    }
}
TOP

Related Classes of de.danet.an.workflow.tools.test.JellyTest

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.