Author: simonetripodi
Date: Thu Feb 3 17:02:20 2011
New Revision: 1066868
URL: http://svn.apache.org/viewvc?rev=1066868&view=rev
Log:
added method to DRY, loading a new digester from a module and parse an XML
resource in the classpath happens at 90% of the cases
Modified:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AbstractTestCase.java
Modified:
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AbstractTestCase.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AbstractTestCase.java?rev=1066868&r1=1066867&r2=1066868&view=diff
==============================================================================
---
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AbstractTestCase.java
(original)
+++
commons/sandbox/digester3/trunk/src/test/java/org/apache/commons/digester3/AbstractTestCase.java
Thu Feb 3 17:02:20 2011
@@ -49,4 +49,16 @@ abstract class AbstractTestCase {
return
(this.getClass().getResourceAsStream("/org/apache/commons/digester3/" + name));
}
+ /**
+ * Creates a new Digester given the Modules and parse the XML resource in
the classpath.
+ *
+ * @param xmlResourceName
+ * @param rulesModules
+ * @return
+ * @throws Throwable
+ */
+ protected Object newBasicDigesterAndParse(String xmlResourceName,
RulesModule...rulesModules) throws Throwable {
+ return
this.newBasicDigester(rulesModules).parse(getInputStream(xmlResourceName));
+ }
+
}