kwin commented on code in PR #202:
URL: https://github.com/apache/maven-doxia/pull/202#discussion_r1521273625


##########
doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java:
##########
@@ -146,6 +156,91 @@ public final void testSinkWrapper() throws ParseException, 
IOException {
         }
     }
 
+    /**
+     * Override this method if the parser always emits some static prefix for 
incomplete documents
+     * and consume the prefix related events from the given {@link Iterator}.
+     * @param eventIterator the iterator
+     */
+    protected void assertEventPrefix(Iterator<SinkEventElement> eventIterator) 
{
+        // do nothing by default, i.e. assume no prefix
+    }
+
+    /**
+     * Override this method if the parser always emits some static suffix for 
incomplete documents
+     * and consume the suffix related events from the given {@link Iterator}.
+     * @param eventIterator the iterator
+     */
+    protected void assertEventSuffix(Iterator<SinkEventElement> eventIterator) 
{
+        assertFalse(eventIterator.hasNext(), "didn't expect any further events 
but got at least one");
+    }
+
+    /**
+     * @return markup representing the verbatim text {@value 
#TEXT_WITH_SPECIAL_CHARS} (needs to be properly escaped).
+     * {@code null} can be returned to skip the test for a particular parser.
+     */
+    protected abstract String getVerbatimSource();
+
+    /**
+     * Test a verbatim block (no code) given through {@link 
#getVerbatimSource()}
+     * @throws ParseException
+     */
+    @Test
+    public void testVerbatim() throws ParseException {
+        String source = getVerbatimSource();
+        assumeTrue(source != null, "parser does not support simple verbatim 
text");

Review Comment:
   No longer part of JUnit5: 
https://junit.org/junit5/docs/5.10.2/api/org.junit.jupiter.api/org/junit/jupiter/api/Assumptions.html



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to