public class OverlappingCallMethodRuleTestCase extends Object
Tests for situations where CallMethodRule instances and their parameters overlap each other.
Constructor and Description |
---|
OverlappingCallMethodRuleTestCase() |
Modifier and Type | Method and Description |
---|---|
void |
setItemId(String id) |
void |
setItemName(String name) |
void |
testItem1() |
void |
testItem2() |
void |
testItem3() |
void |
testItem4()
This is an "anti-test" that demonstrates how digester can fails to produce the correct results, due to a
design flaw (or at least limitation) in the way that CallMethodRule and CallParamRule work.
|
void |
testWildcard1()
This test checks that CallParamRule instances which fetch data from xml attributes work ok when invoked
"recursively", ie a rule instances' methods gets called in the order
begin[1]/begin[2]/body[2]/end[2]/body[1]/end[1]
|
void |
testWildcard2()
This test checks that CallParamRule instances which fetch data from the xml element body work ok when invoked
"recursively", ie a rule instances' methods gets called in the order
begin[1]/begin[2]/body[2]/end[2]/body[1]/end[1]
|
public OverlappingCallMethodRuleTestCase()
public void setItemName(String name)
public void testItem1() throws SAXException, IOException
SAXException
IOException
public void testItem2() throws SAXException, IOException
SAXException
IOException
public void testItem3() throws SAXException, IOException
SAXException
IOException
public void testItem4() throws SAXException, IOException
The following sequence always fails:
One solution is for CallParamRule objects to know which CallMethodRule they are associated with. Even this might fail in corner cases where the same rule is associated with multiple patterns, or with wildcard patterns which cause a rule to fire in a "recursive" manner. However implementing this is not possible with the current digester design.
SAXException
IOException
public void testWildcard1() throws SAXException, IOException
SAXException
IOException
public void testWildcard2() throws SAXException, IOException
SAXException
IOException
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.