You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2009/02/25 11:43:11 UTC
svn commit: r747735 - in /maven/doxia/doxia/trunk:
doxia-core/src/main/java/org/apache/maven/doxia/macro/
doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/
doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/
doxia-core/src/main/java...
Author: ltheussl
Date: Wed Feb 25 10:43:09 2009
New Revision: 747735
URL: http://svn.apache.org/viewvc?rev=747735&view=rev
Log:
Javadocs, formatting, checkstyle fixes
Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/index/IndexEntryTest.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/MacroManagerTest.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTestCase.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/render/RenderingContextTest.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java
maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java
maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/PlexusLoggerWrapper.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.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-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.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-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java Wed Feb 25 10:43:09 2009
@@ -34,12 +34,12 @@
implements Macro
{
/** Log instance. */
- private Log log;
+ private Log logger;
/** {@inheritDoc} */
public void enableLogging( Log log )
{
- this.log = log;
+ this.logger = log;
}
/**
@@ -51,12 +51,12 @@
*/
protected Log getLog()
{
- if ( log == null )
+ if ( logger == null )
{
- log = new SystemStreamLog();
+ logger = new SystemStreamLog();
}
- return log;
+ return logger;
}
/**
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java Wed Feb 25 10:43:09 2009
@@ -45,8 +45,10 @@
/** Holds the cache. */
private static Map cache = new HashMap();
+ private static final int HOUR = 60;
+
/** One hour default cache. */
- private long timeout = 60 * 60 * 1000;
+ private long timeout = HOUR * HOUR * 1000;
/** Holds the time cache. */
private static Map timeCached = new HashMap();
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java Wed Feb 25 10:43:09 2009
@@ -20,6 +20,7 @@
*/
import java.io.StringReader;
+
import java.util.Iterator;
import org.apache.maven.doxia.index.IndexEntry;
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Wed Feb 25 10:43:09 2009
@@ -71,20 +71,28 @@
extends AbstractParser
implements XmlMarkup
{
- /** Entity pattern for HTML entity, i.e. &nbsp; "<!ENTITY(\\s)+([^>|^\\s]+)(\\s)+\"(\\s)*(&[a-zA-Z]{2,6};)(\\s)*\"(\\s)*>
+ /**
+ * Entity pattern for HTML entity, i.e. &nbsp;
+ * "<!ENTITY(\\s)+([^>|^\\s]+)(\\s)+\"(\\s)*(&[a-zA-Z]{2,6};)(\\s)*\"(\\s)*>
* <br/>
- * see <a href="http://www.w3.org/TR/REC-xml/#NT-EntityDecl">http://www.w3.org/TR/REC-xml/#NT-EntityDecl</a> */
+ * see <a href="http://www.w3.org/TR/REC-xml/#NT-EntityDecl">http://www.w3.org/TR/REC-xml/#NT-EntityDecl</a>.
+ */
private static final Pattern PATTERN_ENTITY_1 =
Pattern.compile( ENTITY_START + "(\\s)+([^>|^\\s]+)(\\s)+\"(\\s)*(&[a-zA-Z]{2,6};)(\\s)*\"(\\s)*>" );
- /** Entity pattern for Unicode entity, i.e. &#38; "<!ENTITY(\\s)+([^>|^\\s]+)(\\s)+\"(\\s)*(&(#x?[0-9a-fA-F]{1,4};)*)(\\s)*\"(\\s)*>"
+ /**
+ * Entity pattern for Unicode entity, i.e. &#38;
+ * "<!ENTITY(\\s)+([^>|^\\s]+)(\\s)+\"(\\s)*(&(#x?[0-9a-fA-F]{1,4};)*)(\\s)*\"(\\s)*>"
* <br/>
- * see <a href="http://www.w3.org/TR/REC-xml/#NT-EntityDecl">http://www.w3.org/TR/REC-xml/#NT-EntityDecl</a> */
+ * see <a href="http://www.w3.org/TR/REC-xml/#NT-EntityDecl">http://www.w3.org/TR/REC-xml/#NT-EntityDecl</a>.
+ */
private static final Pattern PATTERN_ENTITY_2 =
Pattern.compile( ENTITY_START + "(\\s)+([^>|^\\s]+)(\\s)+\"(\\s)*(&(#x?[0-9a-fA-F]{1,4};)*)(\\s)*\"(\\s)*>" );
- /** Doctype pattern i.e. ".*<!DOCTYPE([^>]*)>.*"
- * see <a href="http://www.w3.org/TR/REC-xml/#NT-doctypedecl">http://www.w3.org/TR/REC-xml/#NT-doctypedecl</a> */
+ /**
+ * Doctype pattern i.e. ".*<!DOCTYPE([^>]*)>.*"
+ * see <a href="http://www.w3.org/TR/REC-xml/#NT-doctypedecl">http://www.w3.org/TR/REC-xml/#NT-doctypedecl</a>.
+ */
private static final Pattern PATTERN_DOCTYPE = Pattern.compile( ".*" + DOCTYPE_START + "([^>]*)>.*" );
/** Tag pattern as defined in http://www.w3.org/TR/REC-xml/#NT-Name */
@@ -641,7 +649,8 @@
* <pre>
* <!DOCTYPE foo [
* <!-- These are the entity sets for ISO Latin 1 characters for the XHTML -->
- * <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+ * <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ * "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
* %HTMLlat1;
* ]>
* </pre>
@@ -867,7 +876,7 @@
else
{
// TODO How to refresh Doxia XSDs from temp dir?
- res = toByteArray( temp.toURL() );
+ res = toByteArray( temp.toURI().toURL() );
}
ENTITY_CACHE.put( systemId, res );
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java Wed Feb 25 10:43:09 2009
@@ -93,59 +93,33 @@
if ( isVerbatim() )
{
- if ( parser.getName().equals( Tag.PRE.toString() ) )
- {
- verbatim();
- }
-
- sink.text( getText( parser ) );
+ handleVerbatim( parser, sink );
}
else if ( parser.getName().equals( Tag.H2.toString() ) )
{
- closeOpenSections( Sink.SECTION_LEVEL_1, sink );
-
- sink.section( Sink.SECTION_LEVEL_1, attribs );
-
- sink.sectionTitle( Sink.SECTION_LEVEL_1, attribs );
+ handleSectionStart( sink, Sink.SECTION_LEVEL_1, attribs );
}
else if ( parser.getName().equals( Tag.H3.toString() ) )
{
- closeOpenSections( Sink.SECTION_LEVEL_2, sink );
-
- sink.section( Sink.SECTION_LEVEL_2, attribs );
-
- sink.sectionTitle( Sink.SECTION_LEVEL_2, attribs );
+ handleSectionStart( sink, Sink.SECTION_LEVEL_2, attribs );
}
else if ( parser.getName().equals( Tag.H4.toString() ) )
{
- closeOpenSections( Sink.SECTION_LEVEL_3, sink );
-
- sink.section( Sink.SECTION_LEVEL_3, attribs );
-
- sink.sectionTitle( Sink.SECTION_LEVEL_3, attribs );
+ handleSectionStart( sink, Sink.SECTION_LEVEL_3, attribs );
}
else if ( parser.getName().equals( Tag.H5.toString() ) )
{
- closeOpenSections( Sink.SECTION_LEVEL_4, sink );
-
- sink.section( Sink.SECTION_LEVEL_4, attribs );
-
- sink.sectionTitle( Sink.SECTION_LEVEL_4, attribs );
+ handleSectionStart( sink, Sink.SECTION_LEVEL_4, attribs );
}
else if ( parser.getName().equals( Tag.H6.toString() ) )
{
- closeOpenSections( Sink.SECTION_LEVEL_5, sink );
-
- sink.section( Sink.SECTION_LEVEL_5, attribs );
-
- sink.sectionTitle( Sink.SECTION_LEVEL_5, attribs );
+ handleSectionStart( sink, Sink.SECTION_LEVEL_5, attribs );
}
else if ( parser.getName().equals( Tag.U.toString() ) )
{
decoration.addAttribute( SinkEventAttributes.DECORATION, "underline" );
}
- else if ( parser.getName().equals( Tag.S.toString() )
- || parser.getName().equals( Tag.STRIKE.toString() )
+ else if ( parser.getName().equals( Tag.S.toString() ) || parser.getName().equals( Tag.STRIKE.toString() )
|| parser.getName().equals( "del" ) )
{
decoration.addAttribute( SinkEventAttributes.DECORATION, "line-through" );
@@ -160,44 +134,15 @@
}
else if ( parser.getName().equals( Tag.P.toString() ) )
{
- if ( !inFigure )
- {
- sink.paragraph( attribs );
- }
+ handlePStart( sink, attribs );
}
else if ( parser.getName().equals( Tag.DIV.toString() ) )
{
- String divclass = parser.getAttributeValue( null, Attribute.CLASS.toString() );
-
- if ( "figure".equals( divclass ) )
- {
- this.inFigure = true;
- SinkEventAttributeSet atts = new SinkEventAttributeSet( attribs );
- atts.removeAttribute( SinkEventAttributes.CLASS );
- sink.figure( atts );
- }
- else
- {
- visited = false;
- }
+ visited = handleDivStart( parser, attribs, sink );
}
- /*
- * The PRE element tells visual user agents that the enclosed text is
- * "preformatted". When handling preformatted text, visual user agents:
- * - May leave white space intact.
- * - May render text with a fixed-pitch font.
- * - May disable automatic word wrap.
- * - Must not disable bidirectional processing.
- * Non-visual user agents are not required to respect extra white space
- * in the content of a PRE element.
- */
else if ( parser.getName().equals( Tag.PRE.toString() ) )
{
- verbatim();
-
- attribs.removeAttribute( SinkEventAttributes.DECORATION );
-
- sink.verbatim( attribs );
+ handlePreStart( attribs, sink );
}
else if ( parser.getName().equals( Tag.UL.toString() ) )
{
@@ -205,48 +150,11 @@
}
else if ( parser.getName().equals( Tag.OL.toString() ) )
{
- int numbering = Sink.NUMBERING_DECIMAL;
-
- // this will have to be generalized if we handle styles
- String style = parser.getAttributeValue( null, Attribute.STYLE.toString() );
-
- if ( style != null )
- {
- if ( "list-style-type: upper-alpha".equals( style ) )
- {
- numbering = Sink.NUMBERING_UPPER_ALPHA;
- }
- else if ( "list-style-type: lower-alpha".equals( style ) )
- {
- numbering = Sink.NUMBERING_LOWER_ALPHA;
- }
- else if ( "list-style-type: upper-roman".equals( style ) )
- {
- numbering = Sink.NUMBERING_UPPER_ROMAN;
- }
- else if ( "list-style-type: lower-roman".equals( style ) )
- {
- numbering = Sink.NUMBERING_LOWER_ROMAN;
- }
- else if ( "list-style-type: decimal".equals( style ) )
- {
- numbering = Sink.NUMBERING_DECIMAL;
- }
- }
-
- sink.numberedList( numbering, attribs );
- orderedListDepth++;
+ handleOLStart( parser, sink, attribs );
}
else if ( parser.getName().equals( Tag.LI.toString() ) )
{
- if ( orderedListDepth == 0 )
- {
- sink.listItem( attribs );
- }
- else
- {
- sink.numberedListItem( attribs );
- }
+ handleLIStart( sink, attribs );
}
else if ( parser.getName().equals( Tag.DL.toString() ) )
{
@@ -264,94 +172,26 @@
else if ( ( parser.getName().equals( Tag.B.toString() ) )
|| ( parser.getName().equals( Tag.STRONG.toString() ) ) )
{
- // TODO: use SinkEventAttributes
sink.bold();
}
else if ( ( parser.getName().equals( Tag.I.toString() ) )
|| ( parser.getName().equals( Tag.EM.toString() ) ) )
{
- if ( inFigure )
- {
- sink.figureCaption( attribs );
- }
- else
- {
- // TODO: use SinkEventAttributes
- sink.italic();
- }
+ handleFigureCaptionStart( sink, attribs );
}
else if ( ( parser.getName().equals( Tag.CODE.toString() ) )
|| ( parser.getName().equals( Tag.SAMP.toString() ) )
|| ( parser.getName().equals( Tag.TT.toString() ) ) )
{
- // TODO: use SinkEventAttributes
sink.monospaced();
}
else if ( parser.getName().equals( Tag.A.toString() ) )
{
- String href = parser.getAttributeValue( null, Attribute.HREF.toString() );
-
- if ( href != null )
- {
- sink.link( href, attribs );
-
- isLink = true;
- }
- else
- {
- String name = parser.getAttributeValue( null, Attribute.NAME.toString() );
-
- if ( name != null )
- {
- sink.anchor( validAnchor( name ), attribs );
-
- isAnchor = true;
- }
- else
- {
- String id = parser.getAttributeValue( null, Attribute.ID.toString() );
-
- if ( id != null )
- {
- sink.anchor( validAnchor( id ), attribs );
-
- isAnchor = true;
- }
- }
- }
+ handleAStart( parser, sink, attribs );
}
-
- // ----------------------------------------------------------------------
- // Tables
- // ----------------------------------------------------------------------
-
else if ( parser.getName().equals( Tag.TABLE.toString() ) )
{
- sink.table( attribs );
-
- String border = parser.getAttributeValue( null, Attribute.BORDER.toString() );
-
- boolean grid = true;
-
- if ( "0".equals( border ) )
- {
- grid = false;
- }
-
- String align = parser.getAttributeValue( null, Attribute.ALIGN.toString() );
-
- int[] justif = { Sink.JUSTIFY_LEFT };
-
- if ( "center".equals( align ) )
- {
- justif[0] = Sink.JUSTIFY_CENTER;
- }
- else if ( "right".equals( align ) )
- {
- justif[0] = Sink.JUSTIFY_RIGHT;
- }
-
- sink.tableRows( justif, grid );
+ handleTableStart( sink, attribs, parser );
}
else if ( parser.getName().equals( Tag.TR.toString() ) )
{
@@ -369,11 +209,6 @@
{
sink.tableCaption( attribs );
}
-
- // ----------------------------------------------------------------------
- // Empty elements: <br/>, <hr/> and <img />
- // ----------------------------------------------------------------------
-
else if ( parser.getName().equals( Tag.BR.toString() ) )
{
sink.lineBreak( attribs );
@@ -384,12 +219,7 @@
}
else if ( parser.getName().equals( Tag.IMG.toString() ) )
{
- String src = parser.getAttributeValue( null, Attribute.SRC.toString() );
-
- if ( src != null )
- {
- sink.figureGraphics( src, attribs );
- }
+ handleImgStart( parser, sink, attribs );
}
else
{
@@ -417,23 +247,7 @@
if ( isVerbatim() )
{
- if ( parser.getName().equals( Tag.PRE.toString() ) )
- {
- verbatim_();
-
- if ( isVerbatim() )
- {
- sink.text( getText( parser ) );
- }
- else
- {
- sink.verbatim_();
- }
- }
- else
- {
- sink.text( getText( parser ) );
- }
+ handleVerbatimEnd( parser, sink );
}
else if ( parser.getName().equals( Tag.P.toString() ) )
{
@@ -479,14 +293,7 @@
}
else if ( parser.getName().equals( Tag.LI.toString() ) )
{
- if ( orderedListDepth == 0 )
- {
- sink.listItem_();
- }
- else
- {
- sink.numberedListItem_();
- }
+ handleListItemEnd( sink );
}
else if ( parser.getName().equals( Tag.DL.toString() ) )
{
@@ -509,14 +316,7 @@
else if ( ( parser.getName().equals( Tag.I.toString() ) )
|| ( parser.getName().equals( Tag.EM.toString() ) ) )
{
- if ( inFigure )
- {
- sink.figureCaption_();
- }
- else
- {
- sink.italic_();
- }
+ handleFigureCaptionEnd( sink );
}
else if ( ( parser.getName().equals( Tag.CODE.toString() ) )
|| ( parser.getName().equals( Tag.SAMP.toString() ) )
@@ -526,18 +326,7 @@
}
else if ( parser.getName().equals( Tag.A.toString() ) )
{
- if ( isLink )
- {
- sink.link_();
-
- isLink = false;
- }
- else if ( isAnchor )
- {
- sink.anchor_();
-
- isAnchor = false;
- }
+ handleAEnd( sink );
}
// ----------------------------------------------------------------------
@@ -819,4 +608,249 @@
return id;
}
+
+ private void handleAEnd( Sink sink )
+ {
+ if ( isLink )
+ {
+ sink.link_();
+ isLink = false;
+ }
+ else if ( isAnchor )
+ {
+ sink.anchor_();
+ isAnchor = false;
+ }
+ }
+
+ private void handleAStart( XmlPullParser parser, Sink sink, SinkEventAttributeSet attribs )
+ {
+ String href = parser.getAttributeValue( null, Attribute.HREF.toString() );
+
+ if ( href != null )
+ {
+ sink.link( href, attribs );
+ isLink = true;
+ }
+ else
+ {
+ String name = parser.getAttributeValue( null, Attribute.NAME.toString() );
+
+ if ( name != null )
+ {
+ sink.anchor( validAnchor( name ), attribs );
+ isAnchor = true;
+ }
+ else
+ {
+ String id = parser.getAttributeValue( null, Attribute.ID.toString() );
+ if ( id != null )
+ {
+ sink.anchor( validAnchor( id ), attribs );
+ isAnchor = true;
+ }
+ }
+ }
+ }
+
+ private boolean handleDivStart( XmlPullParser parser, SinkEventAttributeSet attribs, Sink sink )
+ {
+ boolean visited = true;
+
+ String divclass = parser.getAttributeValue( null, Attribute.CLASS.toString() );
+
+ if ( "figure".equals( divclass ) )
+ {
+ this.inFigure = true;
+ SinkEventAttributeSet atts = new SinkEventAttributeSet( attribs );
+ atts.removeAttribute( SinkEventAttributes.CLASS );
+ sink.figure( atts );
+ }
+ else
+ {
+ visited = false;
+ }
+
+ return visited;
+ }
+
+ private void handleFigureCaptionEnd( Sink sink )
+ {
+ if ( inFigure )
+ {
+ sink.figureCaption_();
+ }
+ else
+ {
+ sink.italic_();
+ }
+ }
+
+ private void handleFigureCaptionStart( Sink sink, SinkEventAttributeSet attribs )
+ {
+ if ( inFigure )
+ {
+ sink.figureCaption( attribs );
+ }
+ else
+ {
+ sink.italic();
+ }
+ }
+
+ private void handleImgStart( XmlPullParser parser, Sink sink, SinkEventAttributeSet attribs )
+ {
+ String src = parser.getAttributeValue( null, Attribute.SRC.toString() );
+
+ if ( src != null )
+ {
+ sink.figureGraphics( src, attribs );
+ }
+ }
+
+ private void handleLIStart( Sink sink, SinkEventAttributeSet attribs )
+ {
+ if ( orderedListDepth == 0 )
+ {
+ sink.listItem( attribs );
+ }
+ else
+ {
+ sink.numberedListItem( attribs );
+ }
+ }
+
+ private void handleListItemEnd( Sink sink )
+ {
+ if ( orderedListDepth == 0 )
+ {
+ sink.listItem_();
+ }
+ else
+ {
+ sink.numberedListItem_();
+ }
+ }
+
+ private void handleOLStart( XmlPullParser parser, Sink sink, SinkEventAttributeSet attribs )
+ {
+ int numbering = Sink.NUMBERING_DECIMAL;
+ // this will have to be generalized if we handle styles
+ String style = parser.getAttributeValue( null, Attribute.STYLE.toString() );
+
+ if ( style != null )
+ {
+ if ( "list-style-type: upper-alpha".equals( style ) )
+ {
+ numbering = Sink.NUMBERING_UPPER_ALPHA;
+ }
+ else if ( "list-style-type: lower-alpha".equals( style ) )
+ {
+ numbering = Sink.NUMBERING_LOWER_ALPHA;
+ }
+ else if ( "list-style-type: upper-roman".equals( style ) )
+ {
+ numbering = Sink.NUMBERING_UPPER_ROMAN;
+ }
+ else if ( "list-style-type: lower-roman".equals( style ) )
+ {
+ numbering = Sink.NUMBERING_LOWER_ROMAN;
+ }
+ else if ( "list-style-type: decimal".equals( style ) )
+ {
+ numbering = Sink.NUMBERING_DECIMAL;
+ }
+ }
+
+ sink.numberedList( numbering, attribs );
+ orderedListDepth++;
+ }
+
+ private void handlePStart( Sink sink, SinkEventAttributeSet attribs )
+ {
+ if ( !inFigure )
+ {
+ sink.paragraph( attribs );
+ }
+ }
+
+ /*
+ * The PRE element tells visual user agents that the enclosed text is
+ * "preformatted". When handling preformatted text, visual user agents:
+ * - May leave white space intact.
+ * - May render text with a fixed-pitch font.
+ * - May disable automatic word wrap.
+ * - Must not disable bidirectional processing.
+ * Non-visual user agents are not required to respect extra white space
+ * in the content of a PRE element.
+ */
+ private void handlePreStart( SinkEventAttributeSet attribs, Sink sink )
+ {
+ verbatim();
+ attribs.removeAttribute( SinkEventAttributes.DECORATION );
+ sink.verbatim( attribs );
+ }
+
+ private void handleSectionStart( Sink sink, int sectionLevel, SinkEventAttributeSet attribs )
+ {
+ closeOpenSections( sectionLevel, sink );
+ sink.section( sectionLevel, attribs );
+ sink.sectionTitle( sectionLevel, attribs );
+ }
+
+ private void handleTableStart( Sink sink, SinkEventAttributeSet attribs, XmlPullParser parser )
+ {
+ sink.table( attribs );
+ String border = parser.getAttributeValue( null, Attribute.BORDER.toString() );
+ boolean grid = true;
+
+ if ( "0".equals( border ) )
+ {
+ grid = false;
+ }
+
+ String align = parser.getAttributeValue( null, Attribute.ALIGN.toString() );
+ int[] justif = {Sink.JUSTIFY_LEFT};
+
+ if ( "center".equals( align ) )
+ {
+ justif[0] = Sink.JUSTIFY_CENTER;
+ }
+ else if ( "right".equals( align ) )
+ {
+ justif[0] = Sink.JUSTIFY_RIGHT;
+ }
+
+ sink.tableRows( justif, grid );
+ }
+
+ private void handleVerbatim( XmlPullParser parser, Sink sink )
+ {
+ if ( parser.getName().equals( Tag.PRE.toString() ) )
+ {
+ verbatim();
+ }
+
+ sink.text( getText( parser ) );
+ }
+
+ private void handleVerbatimEnd( XmlPullParser parser, Sink sink )
+ {
+ if ( parser.getName().equals( Tag.PRE.toString() ) )
+ {
+ verbatim_();
+ if ( isVerbatim() )
+ {
+ sink.text( getText( parser ) );
+ }
+ else
+ {
+ sink.verbatim_();
+ }
+ }
+ else
+ {
+ sink.text( getText( parser ) );
+ }
+ }
}
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java Wed Feb 25 10:43:09 2009
@@ -34,12 +34,12 @@
public abstract class AbstractSink
implements Sink, Markup
{
- private Log log;
+ private Log logger;
/** {@inheritDoc} */
public void enableLogging( Log log )
{
- this.log = log;
+ this.logger = log;
}
/**
@@ -51,12 +51,12 @@
*/
protected Log getLog()
{
- if ( log == null )
+ if ( logger == null )
{
- log = new SystemStreamLog();
+ logger = new SystemStreamLog();
}
- return log;
+ return logger;
}
/**
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java Wed Feb 25 10:43:09 2009
@@ -19,13 +19,13 @@
* under the License.
*/
-import org.codehaus.plexus.util.PathTool;
-import org.codehaus.plexus.util.StringUtils;
-
import java.io.File;
import java.util.HashMap;
import java.util.Map;
+import org.codehaus.plexus.util.PathTool;
+import org.codehaus.plexus.util.StringUtils;
+
/**
* <p>RenderingContext class.</p>
*
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java Wed Feb 25 10:43:09 2009
@@ -37,7 +37,7 @@
*/
public class HtmlTools
{
- private static final Tag[] allTags =
+ private static final Tag[] ALL_TAGS =
{
HtmlMarkup.A, HtmlMarkup.ABBR, HtmlMarkup.ACRONYM, HtmlMarkup.ADDRESS, HtmlMarkup.APPLET,
HtmlMarkup.AREA, HtmlMarkup.B, HtmlMarkup.BASE, HtmlMarkup.BASEFONT, HtmlMarkup.BDO,
@@ -59,13 +59,13 @@
HtmlMarkup.TR, HtmlMarkup.TT, HtmlMarkup.U, HtmlMarkup.UL, HtmlMarkup.VAR
};
- private static final Hashtable tagHashtable = new Hashtable( allTags.length );
+ private static final Hashtable TAG_HASHTABLE = new Hashtable( ALL_TAGS.length );
static
{
- for ( int i = 0; i < allTags.length; i++ )
+ for ( int i = 0; i < ALL_TAGS.length; i++ )
{
- tagHashtable.put( allTags[i].toString(), allTags[i] );
+ TAG_HASHTABLE.put( ALL_TAGS[i].toString(), ALL_TAGS[i] );
}
}
@@ -83,7 +83,7 @@
*/
public static Tag getHtmlTag( String tagName )
{
- Object t = tagHashtable.get( tagName );
+ Object t = TAG_HASHTABLE.get( tagName );
return ( t == null ? null : (Tag) t );
}
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/index/IndexEntryTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/index/IndexEntryTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/index/IndexEntryTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/index/IndexEntryTest.java Wed Feb 25 10:43:09 2009
@@ -28,6 +28,9 @@
public class IndexEntryTest
extends TestCase
{
+ /**
+ * Test IndexEntry.
+ */
public void testIndexEntry()
{
IndexEntry root = new IndexEntry( null );
@@ -56,7 +59,8 @@
assertIndexEntry( chapter2, root, 0, chapter1, null );
}
- private void assertIndexEntry( IndexEntry entry, IndexEntry parent, int childCount, IndexEntry prevEntry, IndexEntry nextEntry )
+ private void assertIndexEntry( IndexEntry entry, IndexEntry parent, int childCount,
+ IndexEntry prevEntry, IndexEntry nextEntry )
{
assertEquals( parent, entry.getParent() );
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/MacroManagerTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/MacroManagerTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/MacroManagerTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/MacroManagerTest.java Wed Feb 25 10:43:09 2009
@@ -26,6 +26,11 @@
public class MacroManagerTest
extends PlexusTestCase
{
+ /**
+ * Test MacroManager.
+ *
+ * @throws java.lang.Exception if any.
+ */
public void testMacroManager()
throws Exception
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java Wed Feb 25 10:43:09 2009
@@ -65,7 +65,7 @@
* Parse the model in the path specified by {@link #getDocument()},
* with parser from {@link #getParser()}, and output to sink from {@link #getSink()}
*
- * @throws Exception
+ * @throws Exception if any.
*/
public void testParser()
throws Exception
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java Wed Feb 25 10:43:09 2009
@@ -39,14 +39,18 @@
private XhtmlBaseParser parser;
private final SinkEventTestingSink sink = new SinkEventTestingSink();
- protected void setUp() throws Exception {
+ /** {@inheritDoc} */
+ protected void setUp() throws Exception
+ {
super.setUp();
parser = new XhtmlBaseParser();
sink.reset();
}
- protected void tearDown() throws Exception {
+ /** {@inheritDoc} */
+ protected void tearDown() throws Exception
+ {
super.tearDown();
}
@@ -160,8 +164,8 @@
// same test with EOL
- String EOL = System.getProperty( "line.separator" );
- text = "<p><b>word</b>" + EOL + "<i>word</i></p>";
+ String eol = System.getProperty( "line.separator" );
+ text = "<p><b>word</b>" + eol + "<i>word</i></p>";
sink.reset();
parser.parse( text, sink );
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java Wed Feb 25 10:43:09 2009
@@ -35,21 +35,23 @@
public abstract class AbstractSinkTest
extends AbstractModuleTest
{
- private final CharArrayWriter writer = new CharArrayWriter();
+ private final CharArrayWriter testWriter = new CharArrayWriter();
private Sink sink;
/**
* Resets the writer and creates a new sink with it.
*
* {@inheritDoc}
+ *
+ * @throws java.lang.Exception if something goes wrong.
*/
protected void setUp()
throws Exception
{
super.setUp();
- writer.reset();
- sink = createSink( writer );
+ testWriter.reset();
+ sink = createSink( testWriter );
}
// ---------------------------------------------------------------------
@@ -97,7 +99,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getTitleBlock( title );
assertEquals( "Wrong title!", expected, actual );
@@ -117,7 +119,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getAuthorBlock( author );
assertEquals( "Wrong author!", expected, actual );
@@ -137,7 +139,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getDateBlock( date );
assertEquals( "Wrong date!", expected, actual );
@@ -155,7 +157,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getHeadBlock();
assertEquals( "Wrong head!", expected, actual );
@@ -173,7 +175,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getBodyBlock();
assertEquals( "Wrong body!", expected, actual );
@@ -194,7 +196,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getSectionTitleBlock( title );
assertEquals( "Wrong sectionTitle!", expected, actual );
@@ -217,7 +219,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getSection1Block( title );
assertEquals( "Wrong section1 block!", expected, actual );
@@ -240,7 +242,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getSection2Block( title );
assertEquals( "Wrong section2 block!", expected, actual );
@@ -263,7 +265,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getSection3Block( title );
assertEquals( "Wrong section3 block!", expected, actual );
@@ -287,7 +289,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getSection4Block( title );
assertEquals( "Wrong section4 block!", expected, actual );
@@ -310,7 +312,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getSection5Block( title );
assertEquals( "Wrong section5 block!", expected, actual );
@@ -333,7 +335,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getListBlock( item );
assertEquals( "Wrong list!", expected, actual );
@@ -357,7 +359,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getNumberedListBlock( item );
assertEquals( "Wrong numbered list!", expected, actual );
@@ -388,7 +390,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getDefinitionListBlock( definum, definition );
assertEquals( "Wrong definition list!", expected, actual );
@@ -413,7 +415,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getFigureBlock( source, caption );
assertEquals( "Wrong figure!", expected, actual );
@@ -447,7 +449,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getTableBlock( cell, caption );
assertEquals( "Wrong table!", expected, actual );
@@ -467,7 +469,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getParagraphBlock( text );
assertEquals( "Wrong paragraph!", expected, actual );
@@ -487,7 +489,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getVerbatimBlock( text );
assertEquals( "Wrong verbatim!", expected, actual );
@@ -504,7 +506,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getHorizontalRuleBlock();
assertEquals( "Wrong horizontal rule!", expected, actual );
@@ -521,7 +523,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getPageBreakBlock();
assertEquals( "Wrong pageBreak!", expected, actual );
@@ -541,7 +543,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getAnchorBlock( anchor );
assertEquals( "Wrong anchor!", expected, actual );
@@ -562,7 +564,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getLinkBlock( link, text );
assertEquals( "Wrong link!", expected, actual );
@@ -582,7 +584,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getItalicBlock( text );
assertEquals( "Wrong italic!", expected, actual );
@@ -602,7 +604,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getBoldBlock( text );
assertEquals( "Wrong bold!", expected, actual );
@@ -622,7 +624,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getMonospacedBlock( text );
assertEquals( "Wrong monospaced!", expected, actual );
@@ -639,7 +641,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getLineBreakBlock();
assertEquals( "Wrong lineBreak!", expected, actual );
@@ -656,7 +658,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getNonBreakingSpaceBlock();
assertEquals( "Wrong nonBreakingSpace!", expected, actual );
@@ -674,7 +676,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getTextBlock( text );
assertEquals( "Wrong text!", expected, actual );
@@ -692,7 +694,7 @@
sink.flush();
sink.close();
- String actual = writer.toString();
+ String actual = testWriter.toString();
String expected = getRawTextBlock( text );
assertEquals( "Wrong rawText!", expected, actual );
@@ -718,7 +720,7 @@
*/
protected String getSinkContent()
{
- return writer.toString();
+ return testWriter.toString();
}
/**
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTestCase.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTestCase.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTestCase.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTestCase.java Wed Feb 25 10:43:09 2009
@@ -19,9 +19,6 @@
* under the License.
*/
-import org.apache.maven.doxia.parser.Parser;
-import org.codehaus.plexus.PlexusTestCase;
-
import java.io.File;
import java.io.FileWriter;
import java.io.InputStream;
@@ -29,6 +26,9 @@
import java.io.Reader;
import java.io.Writer;
+import org.apache.maven.doxia.parser.Parser;
+import org.codehaus.plexus.PlexusTestCase;
+
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
@@ -37,12 +37,18 @@
public abstract class AbstractSinkTestCase
extends PlexusTestCase
{
- protected Writer testWriter;
+ private Writer testWriter;
// ---------------------------------------------------------------------
// Test case
// ----------------------------------------------------------------------
+ /**
+ * Parses the test apt document (obtained via {@link #getTestReader()}) with the Parser returned
+ * by {@link #createParser()} into the Sink returned by {@link #createSink()}.
+ *
+ * @throws java.lang.Exception if anything goes wrong.
+ */
public void testApt()
throws Exception
{
@@ -55,10 +61,27 @@
// Abstract methods the individual SinkTests must provide
// ----------------------------------------------------------------------
+ /**
+ * Return the default extension of files created by the test Sink.
+ *
+ * @return the extension of files created by the test Sink.
+ * @see #createSink()
+ */
protected abstract String outputExtension();
+ /**
+ * Return a Parser for testing.
+ *
+ * @return a test Parser.
+ */
protected abstract Parser createParser();
+ /**
+ * Return a Sink for testing.
+ *
+ * @return a test Sink.
+ * @throws java.lang.Exception if the Sink cannot be constructed.
+ */
protected abstract Sink createSink()
throws Exception;
@@ -66,6 +89,14 @@
// Methods for creating the test reader and writer
// ----------------------------------------------------------------------
+ /**
+ * Returns a Writer to write a test output result. The Writer writes to a File
+ * <code>"target/output/test. + extension"</code>, where extension is returned by
+ * {@link #outputExtension()}, in the current base directory.
+ *
+ * @return a Writer to write a test output result.
+ * @throws java.lang.Exception if the Writer cannot be constructed.
+ */
protected Writer getTestWriter()
throws Exception
{
@@ -84,6 +115,12 @@
return testWriter;
}
+ /**
+ * Returns a Reader that gives access to a common test apt file.
+ *
+ * @return a Reader to access the test apt resource file.
+ * @throws java.lang.Exception if the Reader cannot be constructed.
+ */
protected Reader getTestReader()
throws Exception
{
@@ -98,6 +135,11 @@
// Utility methods
// ----------------------------------------------------------------------
+ /**
+ * Return the current base diretory as a File.
+ *
+ * @return the current base diretory as a File.
+ */
public File getBasedirFile()
{
return new File( getBasedir() );
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java Wed Feb 25 10:43:09 2009
@@ -247,7 +247,7 @@
*/
public static void generateDefinitionList( Sink sink )
{
- String EOL = System.getProperty( "line.separator" );
+ String eol = System.getProperty( "line.separator" );
sink.definitionList();
@@ -267,7 +267,7 @@
sink.definition();
sink.text( "of definition list." );
sink.verbatim( true );
- sink.text( "Verbatim text" + EOL + " in a box " );
+ sink.text( "Verbatim text" + eol + " in a box " );
sink.verbatim_();
sink.definition_();
sink.definitionListItem_();
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/render/RenderingContextTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/render/RenderingContextTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/render/RenderingContextTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/render/RenderingContextTest.java Wed Feb 25 10:43:09 2009
@@ -32,6 +32,11 @@
extends PlexusTestCase
{
+ /**
+ * Test getRelativePath() with various file names.
+ *
+ * @throws java.lang.Exception if any.
+ */
public void testFileNameWithDot()
throws Exception
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java Wed Feb 25 10:43:09 2009
@@ -86,7 +86,7 @@
*/
public void testIsId()
{
- assertFalse( HtmlTools.isId( null ));
+ assertFalse( HtmlTools.isId( null ) );
assertFalse( HtmlTools.isId( "" ) );
assertFalse( HtmlTools.isId( " " ) );
assertFalse( HtmlTools.isId( " _ " ) );
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java Wed Feb 25 10:43:09 2009
@@ -270,7 +270,7 @@
{
String key = it.next().toString();
- for (int i = 0; i < getIncludes().length; i++)
+ for ( int i = 0; i < getIncludes().length; i++ )
{
if ( !SelectorUtils.matchPath( getIncludes()[i], key.toLowerCase( Locale.ENGLISH ) ) )
{
@@ -287,7 +287,8 @@
*
* @return a map of test resources defined as follow:
* <ul>
- * <li>key, the full url of test documents, i.e. <code>jar:file:/.../doxia-test-docs-XXX.jar!/path/to/resource</code></li>
+ * <li>key, the full url of test documents,
+ * i.e. <code>jar:file:/.../doxia-test-docs-XXX.jar!/path/to/resource</code></li>
* <li>value, the content for the resource defined by the key</li>
* </ul>
* @throws IOException if any
@@ -304,7 +305,7 @@
if ( testJar == null )
{
throw new RuntimeException(
- "Could not find the Doxia test documents artefact i.e. doxia-test-docs-XXX.jar" );
+ "Could not find the Doxia test documents artefact i.e. doxia-test-docs-XXX.jar" );
}
JarURLConnection conn = (JarURLConnection) testJar.openConnection();
Modified: maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java (original)
+++ maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java Wed Feb 25 10:43:09 2009
@@ -72,7 +72,7 @@
/**
* Send a message to the user in the <b>debug</b> error level.
*
- * @param content
+ * @param content the message to log.
*/
void debug( CharSequence content );
@@ -81,8 +81,8 @@
* <br/>
* The error's stacktrace will be output when this error level is enabled.
*
- * @param content
- * @param error
+ * @param content the message to log.
+ * @param error the error to log.
*/
void debug( CharSequence content, Throwable error );
@@ -91,7 +91,7 @@
* <br/>
* The stack trace for this exception will be output when this error level is enabled.
*
- * @param error
+ * @param error the error to log.
*/
void debug( Throwable error );
@@ -105,7 +105,7 @@
/**
* Send a message to the user in the <b>info</b> error level.
*
- * @param content
+ * @param content the message to log.
*/
void info( CharSequence content );
@@ -114,8 +114,8 @@
* <br/>
* The error's stacktrace will be output when this error level is enabled.
*
- * @param content
- * @param error
+ * @param content the message to log.
+ * @param error the error to log.
*/
void info( CharSequence content, Throwable error );
@@ -124,7 +124,7 @@
* <br/>
* The stack trace for this exception will be output when this error level is enabled.
*
- * @param error
+ * @param error the error to log.
*/
void info( Throwable error );
@@ -138,7 +138,7 @@
/**
* Send a message to the user in the <b>warn</b> error level.
*
- * @param content
+ * @param content the message to log.
*/
void warn( CharSequence content );
@@ -147,8 +147,8 @@
* <br/>
* The error's stacktrace will be output when this error level is enabled.
*
- * @param content
- * @param error
+ * @param content the message to log.
+ * @param error the error to log.
*/
void warn( CharSequence content, Throwable error );
@@ -157,7 +157,7 @@
* <br/>
* The stack trace for this exception will be output when this error level is enabled.
*
- * @param error
+ * @param error the error to log.
*/
void warn( Throwable error );
@@ -171,7 +171,7 @@
/**
* Send a message to the user in the <b>error</b> error level.
*
- * @param content
+ * @param content the message to log.
*/
void error( CharSequence content );
@@ -180,8 +180,8 @@
* <br/>
* The error's stacktrace will be output when this error level is enabled.
*
- * @param content
- * @param error
+ * @param content the message to log.
+ * @param error the error to log.
*/
void error( CharSequence content, Throwable error );
@@ -190,7 +190,7 @@
* <br/>
* The stack trace for this exception will be output when this error level is enabled.
*
- * @param error
+ * @param error the error to log.
*/
void error( Throwable error );
}
Modified: maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/PlexusLoggerWrapper.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/PlexusLoggerWrapper.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/PlexusLoggerWrapper.java (original)
+++ maven/doxia/doxia/trunk/doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/PlexusLoggerWrapper.java Wed Feb 25 10:43:09 2009
@@ -37,7 +37,7 @@
/**
* <p>Constructor for PlexusLoggerWrapper.</p>
*
- * @param logger
+ * @param logger the Plexus logger to wrap.
*/
public PlexusLoggerWrapper( Logger logger )
{
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java Wed Feb 25 10:43:09 2009
@@ -23,6 +23,7 @@
import org.apache.maven.doxia.macro.MacroRequest;
import org.apache.maven.doxia.macro.manager.MacroNotFoundException;
import org.apache.maven.doxia.parser.AbstractTextParser;
+import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkAdapter;
import org.apache.maven.doxia.sink.SinkEventAttributeSet;
@@ -158,10 +159,13 @@
/** a line of AptSource. */
protected String line;
+ private static final int NUMBER_OF_SPACES = 85;
+
static
{
- SPACES = new char[85];
- for ( int i = 0; i < 85; i++ )
+ SPACES = new char[NUMBER_OF_SPACES];
+
+ for ( int i = 0; i < NUMBER_OF_SPACES; i++ )
{
SPACES[i] = ' ';
}
@@ -173,7 +177,7 @@
/** {@inheritDoc} */
public void parse( Reader source, Sink sink )
- throws AptParseException
+ throws ParseException
{
try
{
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java Wed Feb 25 10:43:09 2009
@@ -76,7 +76,7 @@
private boolean verbatimFlag;
/** boxed verbatim. */
- private boolean boxed;
+ private boolean isBoxed;
/** gridFlag for tables. */
private boolean gridFlag;
@@ -504,7 +504,7 @@
public void verbatim( boolean boxed )
{
verbatimFlag = true;
- this.boxed = boxed;
+ this.isBoxed = boxed;
write( EOL );
if ( boxed )
{
@@ -519,7 +519,7 @@
/** {@inheritDoc} */
public void verbatim_()
{
- if ( boxed )
+ if ( isBoxed )
{
write( EOL + BOXED_VERBATIM_END_MARKUP + EOL );
}
@@ -527,7 +527,7 @@
{
write( EOL + NON_BOXED_VERBATIM_END_MARKUP + EOL );
}
- boxed = false;
+ isBoxed = false;
verbatimFlag = false;
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java Wed Feb 25 10:43:09 2009
@@ -42,6 +42,9 @@
*
* @param text the String to check, may be null.
* @return the text with only letter and digit, null if null String input.
+ * @deprecated This method was used for the original apt format, which
+ * removed all non alphanumeric characters from anchors.
+ * Use {@link #encodeAnchor(String)} instead.
*/
public static String encodeFragment( String text )
{
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java Wed Feb 25 10:43:09 2009
@@ -45,7 +45,7 @@
private AptParser parser;
- /** @see junit.framework.TestCase#setUp() */
+ /** {@inheritDoc} */
protected void setUp()
throws Exception
{
@@ -54,7 +54,7 @@
parser = (AptParser) lookup( Parser.ROLE, "apt" );
}
- /** @see org.apache.maven.doxia.parser.AbstractParserTest#createParser() */
+ /** {@inheritDoc} */
protected Parser createParser()
{
return parser;
@@ -184,8 +184,9 @@
/**
* Parses the test document test.apt and re-emits
* it into parser/test.apt.
- * @throws java.io.IOException
- * @throws org.apache.maven.doxia.parser.ParseException
+ *
+ * @throws java.io.IOException if the test file cannot be read.
+ * @throws org.apache.maven.doxia.parser.ParseException if the test file cannot be parsed.
*/
public void testTestDocument()
throws IOException, ParseException
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java Wed Feb 25 10:43:09 2009
@@ -73,7 +73,7 @@
protected String getHeadBlock()
{
return AptMarkup.HEADER_START_MARKUP + EOL + AptMarkup.HEADER_START_MARKUP + EOL + AptMarkup.HEADER_START_MARKUP
- + EOL+ AptMarkup.HEADER_START_MARKUP + EOL;
+ + EOL + AptMarkup.HEADER_START_MARKUP + EOL;
}
/** {@inheritDoc} */
@@ -103,19 +103,22 @@
/** {@inheritDoc} */
protected String getSection3Block( String title )
{
- return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 2 ) + title + EOL + EOL + EOL;
+ return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 2 )
+ + title + EOL + EOL + EOL;
}
/** {@inheritDoc} */
protected String getSection4Block( String title )
{
- return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 3 ) + title + EOL + EOL + EOL;
+ return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 3 )
+ + title + EOL + EOL + EOL;
}
/** {@inheritDoc} */
protected String getSection5Block( String title )
{
- return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 4 ) + title + EOL + EOL + EOL;
+ return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 4 )
+ + title + EOL + EOL + EOL;
}
/** {@inheritDoc} */
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java Wed Feb 25 10:43:09 2009
@@ -242,8 +242,8 @@
String attribs = getConfig().getAttributeString( "list" );
String itemAttribs = getConfig().getAttributeString( "list.item" );
return EOL + EOL + "<fo:list-block" + attribs + ">" + EOL + "<fo:list-item" + itemAttribs
- + "><fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>" + EOL + EOL + "<fo:list-item-body"
- + itemAttribs + ">" + EOL + "<fo:block>" + item
+ + "><fo:list-item-label><fo:block>•</fo:block></fo:list-item-label>"
+ + EOL + EOL + "<fo:list-item-body" + itemAttribs + ">" + EOL + "<fo:block>" + item
+ "</fo:block>" + EOL + "</fo:list-item-body>" + EOL + "</fo:list-item>" + EOL + "</fo:list-block>" + EOL;
}
@@ -253,8 +253,8 @@
String attribs = getConfig().getAttributeString( "list" );
String itemAttribs = getConfig().getAttributeString( "list.item" );
return EOL + EOL + "<fo:list-block" + attribs + ">" + EOL + "<fo:list-item" + itemAttribs
- + ">" + EOL + "<fo:list-item-label>" + EOL + "<fo:block>i</fo:block>" + EOL + "</fo:list-item-label>" + EOL + EOL
- + "<fo:list-item-body" + itemAttribs
+ + ">" + EOL + "<fo:list-item-label>" + EOL + "<fo:block>i</fo:block>" + EOL
+ + "</fo:list-item-label>" + EOL + EOL + "<fo:list-item-body" + itemAttribs
+ ">" + EOL + "<fo:block>" + item + "</fo:block>" + EOL + "</fo:list-item-body>" + EOL
+ "</fo:list-item>" + EOL + "</fo:list-block>" + EOL;
}
@@ -296,7 +296,7 @@
+ "><fo:table-cell column-number=\"2\"" + deAtts
+ ">" + EOL + "<fo:block text-align=\"center\">" + EOL + cell
+ "</fo:block>" + EOL + "</fo:table-cell>" + EOL + "</fo:table-row>" + EOL + "</fo:table-body>"
- + EOL + caption + "</fo:table>" + EOL + "</fo:block>"+ EOL;
+ + EOL + caption + "</fo:table>" + EOL + "</fo:block>" + EOL;
}
/** {@inheritDoc} */
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=747735&r1=747734&r2=747735&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 Wed Feb 25 10:43:09 2009
@@ -240,6 +240,11 @@
return text.replaceAll( EOL, "" );
}
+ /**
+ * Test section with ids.
+ *
+ * @throws java.lang.Exception if any.
+ */
public void testSectionIdAnchor()
throws Exception
{
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.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/XdocSinkTest.java?rev=747735&r1=747734&r2=747735&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java Wed Feb 25 10:43:09 2009
@@ -148,8 +148,8 @@
/** {@inheritDoc} */
protected String getTableBlock( String cell, String caption )
{
- return "<table align=\"center\" border=\"0\"><caption>" + caption + "</caption><tr valign=\"top\"><td align=\"center\">"
- + cell + "</td></tr></table>";
+ return "<table align=\"center\" border=\"0\"><caption>" + caption
+ + "</caption><tr valign=\"top\"><td align=\"center\">" + cell + "</td></tr></table>";
}
/** {@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=747735&r1=747734&r2=747735&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 Wed Feb 25 10:43:09 2009
@@ -36,11 +36,13 @@
public class XhtmlParserTest
extends AbstractParserTest
{
+ /** {@inheritDoc} */
protected Parser createParser()
{
return new XhtmlParser();
}
+ /** {@inheritDoc} */
protected String outputExtension()
{
return "xhtml";
@@ -67,7 +69,8 @@
public void testHeadEventsList()
throws Exception
{
- String text = "<head><title>Title</title><meta name=\"author\" content=\"Author\" /><meta name=\"date\" content=\"Date\" /></head>";
+ String text = "<head><title>Title</title><meta name=\"author\" content=\"Author\" />"
+ + "<meta name=\"date\" content=\"Date\" /></head>";
SinkEventTestingSink sink = new SinkEventTestingSink();