Save This Page
Home » commons-digester-1.8-src » org.apache.commons » digester » [javadoc | source]
org.apache.commons.digester
public class: CallMethodRuleTestCase [javadoc | source]
java.lang.Object
   junit.framework.TestCase
      org.apache.commons.digester.CallMethodRuleTestCase

Tests for the CallMethodRule and associated CallParamRule.

Field Summary
protected  Digester digester    The digester instance we will be processing. 
Constructor:
 public CallMethodRuleTestCase(String name) 
    Construct a new instance of this test case.
    Parameters:
    name - Name of the test case
Method from org.apache.commons.digester.CallMethodRuleTestCase Summary:
getInputStream,   setUp,   suite,   tearDown,   testBasic,   testCallInvalidTarget,   testCallMethodOnly,   testCallNext,   testCallRoot,   testFromStack,   testNestedBody,   testOrderNestedPartA,   testOrderNestedPartB,   testParamsFromStack,   testPathCallParam,   testPrimitiveReading,   testProcessingHook,   testSettingProperties,   testTwoCalls
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.digester.CallMethodRuleTestCase Detail:
 protected InputStream getInputStream(String name) throws IOException 
    Return an appropriate InputStream for the specified test file (which must be inside our current package.
 public  void setUp() 
    Set up instance variables required by this test case.
 public static Test suite() 
    Return the tests included in this test suite.
 public  void tearDown() 
    Tear down instance variables required by this test case.
 public  void testBasic() throws IOException, SAXException 
    Test method calls with the CallMethodRule rule. It should be possible to call a method with no arguments using several rule syntaxes.
 public  void testCallInvalidTarget() throws Exception 
    Test invoking an object which does not exist on the stack.
 public  void testCallMethodOnly() throws Exception 
    Test method calls with the CallMethodRule reading from the element body, with no CallParamMethod rules added.
 public  void testCallNext() throws Exception 
    Test invoking an object which is at top-1 on the stack, like SetNextRule does...
 public  void testCallRoot() throws Exception 
    Test invoking an object which is at the root of the stack, like SetRoot does...
 public  void testFromStack() throws Exception 
 public  void testNestedBody() throws Exception 
 public  void testOrderNestedPartA() throws Exception 
    Test that the target object for a CallMethodRule is the object that was on top of the object stack when the CallMethodRule fired, even when other rules fire between the CallMethodRule and its associated CallParamRules.

    The current implementation of CallMethodRule ensures this works by firing only at the end of the tag that CallMethodRule triggered on.

 public  void testOrderNestedPartB() throws Exception 
    Test nested CallMethod rules.

    The current implementation of CallMethodRule, in which the method is invoked in its end() method, causes behaviour which some users find non-intuitive. In this test it can be seen to "reverse" the order of data processed. However this is the way CallMethodRule has always behaved, and it is expected that apps out there rely on this call order so this test is present to ensure that no-one changes this behaviour.

 public  void testParamsFromStack() throws IOException, SAXException 
    This tests the call methods params enhancement that provides for more complex stack-based calls.
 public  void testPathCallParam() throws Exception 
    Test for the PathCallParamRule
 public  void testPrimitiveReading() throws Exception 
 public  void testProcessingHook() throws Exception 
 public  void testSettingProperties() throws IOException, SAXException 
    Test CallMethodRule variants which specify the classes of the parameters to target methods. String, int, boolean, float should all be acceptable as parameter types.
 public  void testTwoCalls() throws Exception