public class RuleTestCase extends Object
Test Case for the Digester class. These tests perform parsing of XML documents to exercise the built-in rules.
Modifier and Type | Field and Description |
---|---|
protected Digester |
digester
The digester instance we will be processing.
|
Constructor and Description |
---|
RuleTestCase() |
Modifier and Type | Method and Description |
---|---|
protected InputStream |
getInputStream(String name)
Return an appropriate InputStream for the specified test file (which must be inside our current package.
|
void |
setUp()
Set up instance variables required by this test case.
|
void |
tearDown()
Tear down instance variables required by this test case.
|
void |
testAddRule()
Test rule addition - this boils down to making sure that digester is set properly on rule addition.
|
void |
testObjectCreate1()
Test object creation (and associated property setting) with nothing on the stack, which should cause an
appropriate Employee object to be returned.
|
void |
testObjectCreate2()
Test object creation (and associated property setting) with nothing on the stack, which should cause an
appropriate Employee object to be returned.
|
void |
testObjectCreate3()
Test object creation (and associated property setting) with nothing on the stack, which should cause an
appropriate Employee object to be returned.
|
void |
testObjectCreate4()
Same as testObjectCreate1(), except use individual call method rules to set the properties of the Employee.
|
void |
testObjectCreate5()
Same as testObjectCreate1(), except use individual call method rules to set the properties of the Employee.
|
void |
testRepeatedParse()
It should be possible to parse the same input twice, and get trees of objects that are isomorphic but not be
identical object instances.
|
void |
testRuleSet1()
Test object creation (and associated property setting) with nothing on the stack, which should cause an
appropriate Employee object to be returned.
|
void |
testRuleSet2()
Same as
testRuleSet1 except using a single namespace. |
void |
testRuleSet3()
Same as
testRuleSet2 except using a namespace for employee that we should recognize, and a namespace
for address that we should skip. |
void |
testSetCustomProperties() |
void |
testSetNext() |
void |
testSetTop() |
void |
testSetTopRule1()
Test the two argument version of the SetTopRule rule.
|
void |
testSetTopRule2()
Same as
testSetTopRule1 except using the three argument form of the SetTopRule rule. |
protected void |
validateObjectCreate3(Object root)
Validate the assertions for ObjectCreateRule3.
|
public RuleTestCase()
public void setUp()
public void tearDown()
public void testObjectCreate1() throws SAXException, IOException
SAXException
IOException
public void testObjectCreate2() throws SAXException, IOException
SAXException
IOException
public void testObjectCreate3() throws SAXException, IOException
SAXException
IOException
public void testObjectCreate4() throws SAXException, IOException
SAXException
IOException
public void testObjectCreate5() throws SAXException, IOException
SAXException
IOException
public void testRepeatedParse() throws SAXException, IOException
SAXException
IOException
public void testRuleSet1() throws SAXException, IOException
SAXException
IOException
public void testRuleSet2() throws SAXException, IOException
testRuleSet1
except using a single namespace.SAXException
IOException
public void testRuleSet3() throws SAXException, IOException
testRuleSet2
except using a namespace for employee that we should recognize, and a namespace
for address that we should skip.SAXException
IOException
public void testSetTopRule1() throws SAXException, IOException
testSetTopRule2
.SAXException
IOException
public void testSetTopRule2() throws SAXException, IOException
testSetTopRule1
except using the three argument form of the SetTopRule rule.SAXException
IOException
public void testAddRule()
public void testSetNext() throws SAXException, IOException
SAXException
IOException
public void testSetTop() throws SAXException, IOException
SAXException
IOException
public void testSetCustomProperties() throws SAXException, IOException
SAXException
IOException
protected InputStream getInputStream(String name) throws IOException
name
- Name of the test file we wantIOException
- if an input/output error occursprotected void validateObjectCreate3(Object root)
root
- Root object returned by digester.parse()
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.