You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/06/11 18:53:07 UTC

[GitHub] [maven-doxia] michael-o commented on a diff in pull request #104: [DOXIA-590] implement hidden rows

michael-o commented on code in PR #104:
URL: https://github.com/apache/maven-doxia/pull/104#discussion_r895056477


##########
doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java:
##########
@@ -1086,15 +1086,86 @@ public void testTableRow()
         {
             sink = new Xhtml5BaseSink( writer );
 
+            sink.tableRows( null, false );
+            sink.tableRow( attributes );
+            sink.tableRow_();
+            sink.tableRow();
+            sink.tableRow_();
+            sink.tableRows_();
+            sink.table_();
+        }
+        finally
+        {
+            sink.close();
+        }
+
+        String nl = System.lineSeparator();
+        String xmlExpected = "<table border=\"0\" class=\"bodyTable\">" + nl + "<tr style=\"bold\" class=\"a\"></tr>"
+            + nl + "<tr class=\"b\"></tr></table>";
+
+        assertEquals( xmlExpected, writer.toString() );
+    }
+
+    /**
+     * Test striping for hidden rows in tableRow method.
+     */
+    @Test
+    public void testHiddenTableRowStriping()
+    {
+        try
+        {
+            SinkEventAttributeSet attributes2 = new SinkEventAttributeSet();
+            SinkEventAttributeSet attributes3 = new SinkEventAttributeSet();
+            attributes3.addAttributes( attributes );
+            sink = new Xhtml5BaseSink( writer );
+
+            sink.tableRow();
+            sink.tableRow_();
             sink.tableRow( attributes );
             sink.tableRow_();
+            attributes2.addAttribute( SinkEventAttributes.CLASS, "hidden xyz abc" );
+            sink.tableRow( attributes2 );
+            sink.tableRow_();
+            attributes2.addAttribute( SinkEventAttributes.CLASS, "abc hidden xyz" );
+            sink.tableRow( attributes2 );
+            sink.tableRow_();
+            sink.tableRow();
+            sink.tableRow_();
+            attributes2.addAttribute( SinkEventAttributes.CLASS, "not-hidden xyz" );
+            sink.tableRow( attributes2 );
+            sink.tableRow_();
+            attributes2.addAttribute( SinkEventAttributes.CLASS, "xyz not-hidden" );
+            sink.tableRow( attributes2 );
+            sink.tableRow_();
+            attributes3.addAttribute( SinkEventAttributes.CLASS, "xyz abc hidden" );
+            sink.tableRow( attributes3 );
+            sink.tableRow_();
+            attributes2.addAttribute( SinkEventAttributes.CLASS, "xyz hidden-not" );
+            sink.tableRow( attributes2 );
+            sink.tableRow_();
+            sink.tableRow();
+            sink.tableRow_();
         }
         finally
         {
             sink.close();
         }
 
-        assertEquals( "<tr style=\"bold\" class=\"a\"></tr>", writer.toString() );
+        String nl = System.lineSeparator();

Review Comment:
   Use provided `LS`



##########
doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java:
##########
@@ -1086,15 +1086,86 @@ public void testTableRow()
         {
             sink = new Xhtml5BaseSink( writer );
 
+            sink.tableRows( null, false );
+            sink.tableRow( attributes );
+            sink.tableRow_();
+            sink.tableRow();
+            sink.tableRow_();
+            sink.tableRows_();
+            sink.table_();
+        }
+        finally
+        {
+            sink.close();
+        }
+
+        String nl = System.lineSeparator();

Review Comment:
   Use provided `LS`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org