maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r735478 - in /maven/doxia/doxia/trunk/doxia-modules: doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/ doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/
Date Sun, 18 Jan 2009 16:00:44 GMT
Author: vsiveton
Date: Sun Jan 18 08:00:44 2009
New Revision: 735478

URL: http://svn.apache.org/viewvc?rev=735478&view=rev
Log:
DOXIA-177: Invalid XHTML because of wrong position of table caption

o be sure to close the sink

Modified:
    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
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java

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=735478&r1=735477&r2=735478&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
Sun Jan 18 08:00:44 2009
@@ -80,6 +80,7 @@
 
             Sink sink = new XdocSink( output );
             createParser().parse( reader, sink );
+            sink.close();
         }
         finally
         {
@@ -118,6 +119,7 @@
 
             Sink sink = new XdocSink( output );
             createParser().parse( reader, sink );
+            sink.close();
         }
         finally
         {
@@ -237,7 +239,7 @@
     {
         return text.replaceAll( EOL, "" );
     }
-    
+
     public void testSectionIdAnchor()
         throws Exception
     {
@@ -250,10 +252,10 @@
         Iterator it = sink.getEventList().iterator();
 
         SinkEventElement anchorEvt = (SinkEventElement) it.next();
-        
+
         assertEquals( "anchor", anchorEvt.getName() );
         assertEquals( "test-id", anchorEvt.getArgs()[0] );
-        
+
         assertEquals( "anchor_", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "section1", ( (SinkEventElement) it.next() ).getName() );
         assertEquals( "sectionTitle1", ( (SinkEventElement) it.next() ).getName() );

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=735478&r1=735477&r2=735478&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
Sun Jan 18 08:00:44 2009
@@ -129,6 +129,7 @@
         XhtmlParser parser = (XhtmlParser) createParser();
         parser.setValidate( false );
         parser.parse( text.toString(), sink );
+        sink.close();
         String result = w.toString();
 
         assertTrue( result.indexOf( "ř" ) != -1 );

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.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/XhtmlSinkTest.java?rev=735478&r1=735477&r2=735478&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Sun Jan 18 08:00:44 2009
@@ -60,10 +60,9 @@
         throws Exception
     {
         XhtmlSink sink = null;
-
+        Writer writer =  new StringWriter();
         try
         {
-            Writer writer =  new StringWriter();
             sink = (XhtmlSink) createSink( writer );
             sink.link( "http:/www.xdoc.com" );
             sink.link_();
@@ -73,14 +72,6 @@
             sink.link_();
             sink.link( "index.html" );
             sink.link_();
-
-            String actual = writer.toString();
-            assertTrue( actual.indexOf( "<a class=\"externalLink\" href=\"http:/www.xdoc.com\"></a>"
) != -1 );
-            assertTrue( actual.indexOf( "<a href=\"./index.html#anchor\"></a>"
) != -1 );
-            assertTrue( actual.indexOf( "<a href=\"../index.html#anchor\"></a>"
) != -1 );
-            assertTrue( actual.indexOf( "<a href=\"index.html\"></a>" ) != -1
);
-
-            sink.close();
         }
         finally
         {
@@ -89,6 +80,12 @@
                 sink.close();
             }
         }
+
+        String actual = writer.toString();
+        assertTrue( actual.indexOf( "<a class=\"externalLink\" href=\"http:/www.xdoc.com\"></a>"
) != -1 );
+        assertTrue( actual.indexOf( "<a href=\"./index.html#anchor\"></a>" )
!= -1 );
+        assertTrue( actual.indexOf( "<a href=\"../index.html#anchor\"></a>" )
!= -1 );
+        assertTrue( actual.indexOf( "<a href=\"index.html\"></a>" ) != -1 );
     }
 
     /** {@inheritDoc} */



Mime
View raw message