Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLProcess


     * @throws Exception if an error occures
     */
    public void testStartPrefixMappingInFlowControlMode() throws Exception {
        // create a FlowControlProcess that is in flow control mode and
        // has a next process set
        XMLProcess testable = createTestableProcess();
        prepareProcessForFlowControlTest(testable);
       
        // invoke the method being tested
        testable.startPrefixMapping(PREFIX, URI);
       
        // as in flow control mode ensure event was not forwarded to 
        // the next process
        XMLProcessTestable next =
                (XMLProcessTestable) testable.getNextProcess();
        next.assertStartPrefixMappingNotInvoked();
    }
View Full Code Here


     * @throws Exception if an error occures
     */
    public void testErrorInFlowControlMode() throws Exception {
        // create a FlowControlProcess that is in flow control mode and
        // has a next process set
        XMLProcess testable = createTestableProcess();
        prepareProcessForFlowControlTest(testable);
       
        // invoke the method being tested
        testable.error(EXCEPTION);
       
        // even in flow control mode errors should be forwarded
        XMLProcessTestable next =
                (XMLProcessTestable) testable.getNextProcess();
        next.assertErrorInvoked(EXCEPTION);
    }
View Full Code Here

     * @throws Exception if an error occures
     */
    public void testFatalErrorInFlowControlMode() throws Exception {
        // create a FlowControlProcess that is in flow control mode and
        // has a next process set
        XMLProcess testable = createTestableProcess();
        prepareProcessForFlowControlTest(testable);
       
        // invoke the method being tested
        try {
            testable.fatalError(EXCEPTION);
            fail("fatalError did not forward the error to the next process");
        } catch(SAXParseException e) {           
        }       
    }
View Full Code Here

     * @throws Exception if an error occures
     */
    public void testWarningInFlowControlMode() throws Exception {
        // create a FlowControlProcess that is in flow control mode and
        // has a next process set
        XMLProcess testable = createTestableProcess();
        prepareProcessForFlowControlTest(testable);
       
        // invoke the method being tested
        testable.warning(EXCEPTION);
       
        // even in flow control mode warnings should be forwarded
        XMLProcessTestable next =
                (XMLProcessTestable) testable.getNextProcess();
        next.assertWarningInvoked(EXCEPTION);
    }
View Full Code Here

        InputSource inputSource = new InputSource(getInputReader(input));
        Document expectedDoc = new SAXBuilder().
                build(getExpectedReader(expected));

        SAXHandler handler = new SAXHandler();
        XMLProcess consumer = XMLHelpers.createSAXHandlerProcess(handler);

        ContextAnnotatingProcess cap = new ContextAnnotatingProcess();
        initializeProcess(cap);
        cap.setNextProcess(consumer);
View Full Code Here

        // Prepare mocks
        contextMock.expects.findObject(CacheProperties.class).
                returns(properties).any();

        DynamicElementRule rule = new CacheControlRule();
        XMLProcess process = (XMLProcess) rule.
                startElement(dynamicProcessMock, elementName, attributes);

        assertNull(process);

        rule.endElement(dynamicProcessMock, elementName, process);
View Full Code Here

     * testEndElement() because they all need to use the same
     * MessageAdapterProcess instance.
     * @throws Exception
     */
    public void testStartCharactersEndElement() throws Exception {
        XMLProcess process = createTestableProcess();

        // Don't call super.test.... methods because they expect
        // MessageAdapterProcess to forward the next adapter process which
        // it correctly does not.
        process.startProcess();
        process.startElement(NAMESPACE_URI, LOCAL_NAME, Q_NAME, ATTS);
        process.characters(CH, START, LENGTH);
        process.endElement(NAMESPACE_URI, LOCAL_NAME, Q_NAME);
        process.stopProcess();
    }
View Full Code Here

     *
     * @param pipeline The pipeline whose target process is requested.
     * @return Target process.
     */
    protected XMLProcess getTargetProcess(XMLPipeline pipeline) {
        XMLProcess target = pipeline.getHeadProcess();
        if (target == null) {
            target = pipeline.getPipelineProcess().getNextProcess();
        }
        if (target == null) {
            throw new IllegalStateException("Cannot find target process");
View Full Code Here

     *
     * @param pipeline The pipeline whose target process is requested.
     * @return Target process.
     */
    protected XMLProcess getTargetProcess(XMLPipeline pipeline) {
        XMLProcess target = pipeline.getHeadProcess();
        if (target == null) {
            target = pipeline.getPipelineProcess().getNextProcess();
        }
        if (target == null) {
            throw new IllegalStateException("Cannot find target process");
View Full Code Here

                               ExpandedName element,
                               Attributes attributes)
            throws SAXException {

        // factor the XMLProcess that should be added to the pipeline
        XMLProcess process = createProcess(dynamicProcess,
                                           element,
                                           attributes);
        if (process != null) {
            // add the process to the pipeline
            dynamicProcess.addProcess(process);
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLProcess

Copyright © 2018 www.massapicom. 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.