Author: vsiveton
Date: Sat Jun 13 12:53:45 2009
New Revision: 784385

URL: http://svn.apache.org/viewvc?rev=784385&view=rev
Log:
o delete tmp dtd/xsd in tests

Modified:
    
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
    
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
    
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java?rev=784385&r1=784384&r2=784385&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
 Sat Jun 13 12:53:45 2009
@@ -19,14 +19,17 @@
  * under the License.
  */
 
+import java.io.File;
 import java.io.Reader;
 
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.SinkEventElement;
 import org.apache.maven.doxia.sink.SinkEventTestingSink;
+import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 
 /**
@@ -37,6 +40,24 @@
     extends AbstractParserTest
 {
     /** {...@inheritdoc} */
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files 
in ${java.io.tmpdir}
+        // Be sure to delete them
+        String tmpDir = System.getProperty( "java.io.tmpdir" );
+        String excludes = "fml-*.xsd, xml.xsd";
+        List tmpFiles = FileUtils.getFileNames( new File( tmpDir ), excludes, 
null, true );
+        for ( Iterator it = tmpFiles.iterator(); it.hasNext(); )
+        {
+            File tmpFile = new File( it.next().toString() );
+            tmpFile.delete();
+        }
+    }
+
+    /** {...@inheritdoc} */
     protected Parser createParser()
     {
         return new FmlParser();

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java?rev=784385&r1=784384&r2=784385&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
 Sat Jun 13 12:53:45 2009
@@ -25,6 +25,7 @@
 import java.io.Writer;
 
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.ParseException;
@@ -33,6 +34,7 @@
 import org.apache.maven.doxia.sink.SinkEventElement;
 import org.apache.maven.doxia.sink.SinkEventTestingSink;
 
+import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 
 /**
@@ -53,6 +55,17 @@
         super.setUp();
 
         parser = (XdocParser) lookup( Parser.ROLE, "xdoc" );
+
+        // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files 
in ${java.io.tmpdir}
+        // Be sure to delete them
+        String tmpDir = System.getProperty( "java.io.tmpdir" );
+        String excludes = "xdoc-*.xsd, xml.xsd";
+        List tmpFiles = FileUtils.getFileNames( new File( tmpDir ), excludes, 
null, true );
+        for ( Iterator it = tmpFiles.iterator(); it.hasNext(); )
+        {
+            File tmpFile = new File( it.next().toString() );
+            tmpFile.delete();
+        }
     }
 
     /** {...@inheritdoc} */

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java?rev=784385&r1=784384&r2=784385&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
 Sat Jun 13 12:53:45 2009
@@ -19,12 +19,15 @@
  * under the License.
  */
 
+import java.io.File;
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.SinkEventElement;
 import org.apache.maven.doxia.sink.SinkEventTestingSink;
+import org.codehaus.plexus.util.FileUtils;
 
 
 /**
@@ -35,6 +38,24 @@
     extends AbstractParserTest
 {
     /** {...@inheritdoc} */
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files 
in ${java.io.tmpdir}
+        // Be sure to delete them
+        String tmpDir = System.getProperty( "java.io.tmpdir" );
+        String excludes = "xhtml-lat1.ent, xhtml1-transitional.dtd, 
xhtml-special.ent, xhtml-symbol.ent";
+        List tmpFiles = FileUtils.getFileNames( new File( tmpDir ), excludes, 
null, true );
+        for ( Iterator it = tmpFiles.iterator(); it.hasNext(); )
+        {
+            File tmpFile = new File( it.next().toString() );
+            tmpFile.delete();
+        }
+    }
+
+    /** {...@inheritdoc} */
     protected Parser createParser()
     {
         return new XhtmlParser();


Reply via email to