001/* $Id: TestDelegate.java 1102402 2011-05-12 18:03:26Z simonetripodi $
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements.  See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License.  You may obtain a copy of the License at
009 *
010 *      http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019package org.apache.commons.digester3.plugins;
020
021import org.apache.commons.digester3.Digester;
022import org.apache.commons.digester3.plugins.PluginRules;
023import org.junit.Test;
024
025/**
026 * Test cases for Delegate behaviour.
027 */
028
029public class TestDelegate
030{
031    // --------------------------------------------------------------- Test cases
032    @Test
033    public void testDummy()
034    {
035        // it is an error if a TestSuite doesn't have at least one test,
036        // so here is one...
037    }
038
039    public void ignoretestDelegate()
040        throws Exception
041    {
042        // this method tests the Delegate functionality by capturing all
043        // data below the specified pattern, and printing it to stdout.
044        // I can't for the moment think how to turn this into a unit test,
045        // so this test is disabled.
046        Digester digester = new Digester();
047        PluginRules rc = new PluginRules();
048        digester.setRules( rc );
049
050        DumperRule dr = new DumperRule();
051        digester.addRule( "root", dr );
052
053        try
054        {
055            digester.parse( Utils.getInputStream( this, "test1.xml" ) );
056        }
057        catch ( Exception e )
058        {
059            throw e;
060        }
061    }
062}