Author: carlos
Date: Fri Apr 28 16:24:40 2006
New Revision: 398035

URL: http://svn.apache.org/viewcvs?rev=398035&view=rev
Log:
Added docs and method getSink()

Modified:
    
maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java

Modified: 
maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
URL: 
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java?rev=398035&r1=398034&r2=398035&view=diff
==============================================================================
--- 
maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
 (original)
+++ 
maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
 Fri Apr 28 16:24:40 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.doxia.parser;
 
 /*
- * Copyright 2004-2005 The Apache Software Foundation.
+ * Copyright 2004-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,23 +24,50 @@
 import java.io.Reader;
 
 /**
+ * Test the parsing of sample input files
+ * 
+ * @author <a href="mailto:[EMAIL PROTECTED]">Carlos Sanchez</a>
  * @author <a href="mailto:[EMAIL PROTECTED]">Emmanuel Venisse</a>
  * @version $Id:AbstractParserTestCase.java 348605 2005-11-24 12:02:44 +1100 
(Thu, 24 Nov 2005) brett $
  */
 public abstract class AbstractParserTestCase
     extends PlexusTestCase
 {
+    /**
+     * Parser to use to convert input to sink events
+     * 
+     * @return the parser to use
+     */
     protected abstract Parser getParser();
 
+    /**
+     * Path of the document to test, relative to basedir
+     * 
+     * @return the relative path
+     */
     protected abstract String getDocument();
+    
+    /**
+     * Sink to write the output of the parsing
+     * 
+     * @return a SinkAdapter if not overridden
+     */
+    protected Sink getSink()
+    {
+        return new SinkAdapter();
+    }
 
+    /**
+     * Parse the document in the path specified by [EMAIL PROTECTED] 
#getDocument()},
+     * with parser from [EMAIL PROTECTED] #getParser()}, and output to sink 
from [EMAIL PROTECTED] #getSink()}
+     * 
+     * @throws Exception
+     */
     public void testParser()
         throws Exception
     {
-        Sink sink = new SinkAdapter();
-
         Reader reader = new FileReader( getTestFile( getBasedir(), 
getDocument() ) );
 
-        getParser().parse( reader, sink );
+        getParser().parse( reader, getSink() );
     }
 }


Reply via email to