1 /* $Id: TestDelegate.java 1102402 2011-05-12 18:03:26Z simonetripodi $ 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one or more 4 * contributor license agreements. See the NOTICE file distributed with 5 * this work for additional information regarding copyright ownership. 6 * The ASF licenses this file to You under the Apache License, Version 2.0 7 * (the "License"); you may not use this file except in compliance with 8 * the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.apache.commons.digester3.plugins; 20 21 import org.apache.commons.digester3.Digester; 22 import org.apache.commons.digester3.plugins.PluginRules; 23 import org.junit.Test; 24 25 /** 26 * Test cases for Delegate behaviour. 27 */ 28 29 public class TestDelegate 30 { 31 // --------------------------------------------------------------- Test cases 32 @Test 33 public void testDummy() 34 { 35 // it is an error if a TestSuite doesn't have at least one test, 36 // so here is one... 37 } 38 39 public void ignoretestDelegate() 40 throws Exception 41 { 42 // this method tests the Delegate functionality by capturing all 43 // data below the specified pattern, and printing it to stdout. 44 // I can't for the moment think how to turn this into a unit test, 45 // so this test is disabled. 46 Digester digester = new Digester(); 47 PluginRules rc = new PluginRules(); 48 digester.setRules( rc ); 49 50 DumperRule dr = new DumperRule(); 51 digester.addRule( "root", dr ); 52 53 try 54 { 55 digester.parse( Utils.getInputStream( this, "test1.xml" ) ); 56 } 57 catch ( Exception e ) 58 { 59 throw e; 60 } 61 } 62 }