You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2013/03/18 08:38:36 UTC

svn commit: r1457663 - in /commons/proper/digester/trunk: core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java src/changes/changes.xml

Author: simonetripodi
Date: Mon Mar 18 07:38:36 2013
New Revision: 1457663

URL: http://svn.apache.org/r1457663
Log:
[DIGESTER-173] added a testcase that demonstrates DTD validation suppression - props to Ivan Diana that submitted the patch

Modified:
    commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java
    commons/proper/digester/trunk/src/changes/changes.xml

Modified: commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java?rev=1457663&r1=1457662&r2=1457663&view=diff
==============================================================================
--- commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java (original)
+++ commons/proper/digester/trunk/core/src/test/java/org/apache/commons/digester3/DTDValidationTestCase.java Mon Mar 18 07:38:36 2013
@@ -1,4 +1,4 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -110,4 +110,26 @@ public class DTDValidationTestCase
         .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml" ) );
     }
 
+    @Test
+    public void testDigesterLoaderFeatureDisabled()
+        throws Exception
+    {
+       newLoader( new AbstractRulesModule()
+        {
+
+           @Override
+            protected void configure()
+            {
+                // do nothing
+            }
+
+        } )
+        .setFeature("http://xml.org/sax/features/validation", false)
+        .setFeature("http://xml.org/sax/features/external-parameter-entities", false)
+        .setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false)
+        .setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
+        .newDigester()
+        .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd-error.xml" ) );
+    }
+
 }

Modified: commons/proper/digester/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/changes/changes.xml?rev=1457663&r1=1457662&r2=1457663&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/changes/changes.xml (original)
+++ commons/proper/digester/trunk/src/changes/changes.xml Mon Mar 18 07:38:36 2013
@@ -29,8 +29,8 @@
     <action dev="simonetripodi" type="fix" issue="DIGESTER-174" due-to="Andreas Sahlbach">
       Inner List Annotation has wrong @Target for most of the predefined annotation rules
     </action>
-    <action dev="simonetripodi" type="fix" issue="DIGESTER-173" due-to="Ivan Diana">
-      No way to enable schema validation from DigesterLoader
+    <action dev="simonetripodi" type="fix" issue="DIGESTER-173" due-to="Nick Williams">
+      No way to enable schema validation from DigesterLoader - patch provided by Ivan Diana
     </action>
     <action dev="simonetripodi" type="fix" issue="DIGESTER-172" due-to="Ivan Diana">
       Even with custom ErrorHandler, SAX errors are still written to stderr