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 jv...@apache.org on 2007/03/18 06:07:37 UTC
svn commit: r519545 - in /maven/doxia/trunk/doxia-modules/doxia-module-apt:
./ src/main/java/org/apache/maven/doxia/module/apt/ src/main/resources/
src/main/resources/META-INF/ src/main/resources/META-INF/plexus/
src/test/java/org/apache/maven/doxia/mo...
Author: jvanzyl
Date: Sat Mar 17 22:07:36 2007
New Revision: 519545
URL: http://svn.apache.org/viewvc?view=rev&rev=519545
Log:
decoupling module
Added:
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt (with props)
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt (with props)
Modified:
maven/doxia/trunk/doxia-modules/doxia-module-apt/pom.xml
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSiteModule.java
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
Modified: maven/doxia/trunk/doxia-modules/doxia-module-apt/pom.xml
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/pom.xml?view=diff&rev=519545&r1=519544&r2=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/pom.xml (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/pom.xml Sat Mar 17 22:07:36 2007
@@ -5,17 +5,5 @@
<version>1.0-alpha-9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-apt</artifactId>
- <name>doxia-module-apt</name>
- <version>1.0-SNAPSHOT</version>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: maven/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/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java?view=diff&rev=519545&r1=519544&r2=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java Sat Mar 17 22:07:36 2007
@@ -22,6 +22,7 @@
import org.apache.maven.doxia.macro.MacroExecutionException;
import org.apache.maven.doxia.macro.MacroRequest;
import org.apache.maven.doxia.macro.manager.MacroNotFoundException;
+import org.apache.maven.doxia.macro.manager.MacroManager;
import org.apache.maven.doxia.parser.AbstractParser;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkAdapter;
@@ -36,9 +37,7 @@
import java.util.Map;
import java.util.StringTokenizer;
-/**
- * @plexus.component role-hint="apt"
- */
+/** @plexus.component role="org.apache.maven.doxia.parser.Parser" role-hint="apt" */
public class AptParser
extends AbstractParser
{
@@ -108,7 +107,8 @@
// -----------------------------------------------------------------------
- public void parse( Reader source, Sink sink )
+ public void parse( Reader source,
+ Sink sink )
throws AptParseException
{
try
@@ -618,13 +618,13 @@
{
switch ( line.charAt( i ) )
{
- case ' ':
+ case' ':
++indent;
break;
- case '\t':
+ case'\t':
indent += 8;
break;
- case '~':
+ case'~':
if ( charAt( line, length, i + 1 ) == '~' )
{
// Comment.
@@ -651,7 +651,7 @@
block = null;
switch ( line.charAt( i ) )
{
- case '*':
+ case'*':
if ( indent == 0 )
{
if ( charAt( line, length, i + 1 ) == '-' && charAt( line, length, i + 2 ) == '-' )
@@ -686,7 +686,7 @@
block = new ListItem( indent, line );
}
break;
- case '[':
+ case'[':
if ( charAt( line, length, i + 1 ) == ']' )
{
block = new ListBreak( indent, line );
@@ -705,19 +705,19 @@
switch ( charAt( line, length, i + 2 ) )
{
- case 'a':
+ case'a':
numbering = Sink.NUMBERING_LOWER_ALPHA;
break;
- case 'A':
+ case'A':
numbering = Sink.NUMBERING_UPPER_ALPHA;
break;
- case 'i':
+ case'i':
numbering = Sink.NUMBERING_LOWER_ROMAN;
break;
- case 'I':
+ case'I':
numbering = Sink.NUMBERING_UPPER_ROMAN;
break;
- case '1':
+ case'1':
default:
// The first item establishes the numbering
// scheme for the whole list.
@@ -733,7 +733,7 @@
}
}
break;
- case '-':
+ case'-':
if ( charAt( line, length, i + 1 ) == '-' && charAt( line, length, i + 2 ) == '-' )
{
if ( indent == 0 )
@@ -749,25 +749,25 @@
}
}
break;
- case '+':
+ case'+':
if ( indent == 0 && charAt( line, length, i + 1 ) == '-' && charAt( line, length, i + 2 ) == '-' )
{
block = new Verbatim( indent, line );
}
break;
- case '=':
+ case'=':
if ( indent == 0 && charAt( line, length, i + 1 ) == '=' && charAt( line, length, i + 2 ) == '=' )
{
block = new HorizontalRule( indent, line );
}
break;
- case '\f':
+ case'\f':
if ( indent == 0 )
{
block = new PageBreak( indent, line );
}
break;
- case '%':
+ case'%':
if ( indent == 0 && charAt( line, length, i + 1 ) == '{' )
{
block = new MacroBlock( indent, line );
@@ -795,8 +795,7 @@
if ( blockType != type )
{
- throw new AptParseException(
- "expected " + typeNames[type] + ", found " + typeNames[blockType] );
+ throw new AptParseException( "expected " + typeNames[type] + ", found " + typeNames[blockType] );
}
}
@@ -812,20 +811,24 @@
return ( ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'f' ) || ( c >= 'A' && c <= 'F' ) );
}
- private static char charAt( String string, int length, int i )
+ private static char charAt( String string,
+ int length,
+ int i )
{
return ( i < length ) ? string.charAt( i ) : '\0';
}
- private static int skipSpace( String string, int length, int i )
+ private static int skipSpace( String string,
+ int length,
+ int i )
{
loop:
for ( ; i < length; ++i )
{
switch ( string.charAt( i ) )
{
- case ' ':
- case '\t':
+ case' ':
+ case'\t':
break;
default:
break loop;
@@ -834,7 +837,10 @@
return i;
}
- private static void doTraverseText( String text, int begin, int end, Sink sink )
+ private static void doTraverseText( String text,
+ int begin,
+ int end,
+ Sink sink )
throws AptParseException
{
boolean anchor = false;
@@ -849,19 +855,19 @@
char c = text.charAt( i );
switch ( c )
{
- case '\\':
+ case'\\':
if ( i + 1 < end )
{
char escaped = text.charAt( i + 1 );
switch ( escaped )
{
- case ' ':
+ case' ':
++i;
flushTraversed( buffer, sink );
sink.nonBreakingSpace();
break;
- case '\r':
- case '\n':
+ case'\r':
+ case'\n':
++i;
// Skip white space which may follow a line break.
while ( i + 1 < end && Character.isWhitespace( text.charAt( i + 1 ) ) )
@@ -871,23 +877,23 @@
flushTraversed( buffer, sink );
sink.lineBreak();
break;
- case '\\':
- case '|':
- case '~':
- case '=':
- case '-':
- case '+':
- case '*':
- case '[':
- case ']':
- case '<':
- case '>':
- case '{':
- case '}':
+ case'\\':
+ case'|':
+ case'~':
+ case'=':
+ case'-':
+ case'+':
+ case'*':
+ case'[':
+ case']':
+ case'<':
+ case'>':
+ case'{':
+ case'}':
++i;
buffer.append( escaped );
break;
- case 'x':
+ case'x':
if ( i + 3 < end && isHexChar( text.charAt( i + 2 ) ) &&
isHexChar( text.charAt( i + 3 ) ) )
{
@@ -908,7 +914,7 @@
buffer.append( '\\' );
}
break;
- case 'u':
+ case'u':
if ( i + 5 < end && isHexChar( text.charAt( i + 2 ) ) &&
isHexChar( text.charAt( i + 3 ) ) && isHexChar( text.charAt( i + 4 ) ) &&
isHexChar( text.charAt( i + 5 ) ) )
@@ -966,7 +972,7 @@
}
break;
- case '{': /*}*/
+ case'{': /*}*/
if ( !anchor && !link )
{
if ( i + 1 < end && text.charAt( i + 1 ) == '{' /*}*/ )
@@ -1025,7 +1031,7 @@
}
break;
- case '<':
+ case'<':
if ( !italic && !bold && !monospaced )
{
if ( i + 1 < end && text.charAt( i + 1 ) == '<' )
@@ -1058,7 +1064,7 @@
}
break;
- case '>':
+ case'>':
if ( monospaced && i + 2 < end && text.charAt( i + 1 ) == '>' && text.charAt( i + 2 ) == '>' )
{
i += 2;
@@ -1127,7 +1133,8 @@
flushTraversed( buffer, sink );
}
- private static void flushTraversed( StringBuffer buffer, Sink sink )
+ private static void flushTraversed( StringBuffer buffer,
+ Sink sink )
{
if ( buffer.length() > 0 )
{
@@ -1136,7 +1143,10 @@
}
}
- private static int skipTraversedLinkAnchor( String text, int begin, int end, StringBuffer linkAnchor )
+ private static int skipTraversedLinkAnchor( String text,
+ int begin,
+ int end,
+ StringBuffer linkAnchor )
throws AptParseException
{
int i;
@@ -1146,9 +1156,9 @@
char c = text.charAt( i );
switch ( c )
{
- case '}':
+ case'}':
break loop;
- case '\\':
+ case'\\':
if ( i + 1 < end )
{
++i;
@@ -1171,7 +1181,9 @@
return i;
}
- private static String getTraversedLink( String text, int begin, int end )
+ private static String getTraversedLink( String text,
+ int begin,
+ int end )
throws AptParseException
{
char previous2 = '{';
@@ -1197,7 +1209,9 @@
return doGetTraversedLink( text, begin, i - 1 );
}
- private static String getTraversedAnchor( String text, int begin, int end )
+ private static String getTraversedAnchor( String text,
+ int begin,
+ int end )
throws AptParseException
{
char previous = '{';
@@ -1221,7 +1235,9 @@
return doGetTraversedLink( text, begin, i );
}
- private static String doGetTraversedLink( String text, int begin, int end )
+ private static String doGetTraversedLink( String text,
+ int begin,
+ int end )
throws AptParseException
{
final StringBuffer buffer = new StringBuffer( end - begin );
@@ -1260,13 +1276,16 @@
protected int textLength;
- public Block( int type, int indent )
+ public Block( int type,
+ int indent )
throws AptParseException
{
this( type, indent, null );
}
- public Block( int type, int indent, String firstLine )
+ public Block( int type,
+ int indent,
+ String firstLine )
throws AptParseException
{
this.type = type;
@@ -1331,7 +1350,8 @@
traverseText( begin, text.length() );
}
- protected void traverseText( int begin, int end )
+ protected void traverseText( int begin,
+ int end )
throws AptParseException
{
AptParser.doTraverseText( text, begin, end, AptParser.this.sink );
@@ -1380,7 +1400,8 @@
private class ListBreak
extends AptParser.Block
{
- public ListBreak( int indent, String firstLine )
+ public ListBreak( int indent,
+ String firstLine )
throws AptParseException
{
super( AptParser.LIST_BREAK, indent );
@@ -1396,7 +1417,8 @@
private class Title
extends Block
{
- public Title( int indent, String firstLine )
+ public Title( int indent,
+ String firstLine )
throws AptParseException
{
super( TITLE, indent, firstLine );
@@ -1510,7 +1532,9 @@
private class Section
extends Block
{
- public Section( int type, int indent, String firstLine )
+ public Section( int type,
+ int indent,
+ String firstLine )
throws AptParseException
{
super( type, indent, firstLine );
@@ -1538,7 +1562,8 @@
private class Section1
extends Section
{
- public Section1( int indent, String firstLine )
+ public Section1( int indent,
+ String firstLine )
throws AptParseException
{
super( SECTION1, indent, firstLine );
@@ -1558,7 +1583,8 @@
private class Section2
extends Section
{
- public Section2( int indent, String firstLine )
+ public Section2( int indent,
+ String firstLine )
throws AptParseException
{
super( SECTION2, indent, firstLine );
@@ -1578,7 +1604,8 @@
private class Section3
extends Section
{
- public Section3( int indent, String firstLine )
+ public Section3( int indent,
+ String firstLine )
throws AptParseException
{
super( SECTION3, indent, firstLine );
@@ -1598,7 +1625,8 @@
private class Section4
extends Section
{
- public Section4( int indent, String firstLine )
+ public Section4( int indent,
+ String firstLine )
throws AptParseException
{
super( SECTION4, indent, firstLine );
@@ -1618,7 +1646,8 @@
private class Section5
extends Section
{
- public Section5( int indent, String firstLine )
+ public Section5( int indent,
+ String firstLine )
throws AptParseException
{
super( SECTION5, indent, firstLine );
@@ -1638,7 +1667,8 @@
private class Paragraph
extends Block
{
- public Paragraph( int indent, String firstLine )
+ public Paragraph( int indent,
+ String firstLine )
throws AptParseException
{
super( PARAGRAPH, indent, firstLine );
@@ -1658,7 +1688,8 @@
{
private boolean boxed;
- public Verbatim( int indent, String firstLine )
+ public Verbatim( int indent,
+ String firstLine )
throws AptParseException
{
super( VERBATIM, indent, null );
@@ -1737,7 +1768,8 @@
private class Figure
extends Block
{
- public Figure( int indent, String firstLine )
+ public Figure( int indent,
+ String firstLine )
throws AptParseException
{
super( FIGURE, indent, firstLine );
@@ -1766,7 +1798,8 @@
private class Table
extends Block
{
- public Table( int indent, String firstLine )
+ public Table( int indent,
+ String firstLine )
throws AptParseException
{
super( TABLE, indent, firstLine );
@@ -1904,7 +1937,8 @@
AptParser.this.sink.table_();
}
- private int[] parseJustification( String line, int lineLength )
+ private int[] parseJustification( String line,
+ int lineLength )
throws AptParseException
{
int columns = 0;
@@ -1913,9 +1947,9 @@
{
switch ( line.charAt( i ) )
{
- case '*':
- case '+':
- case ':':
+ case'*':
+ case'+':
+ case':':
++columns;
break;
}
@@ -1932,13 +1966,13 @@
{
switch ( line.charAt( i ) )
{
- case '*':
+ case'*':
justification[columns++] = JUSTIFY_CENTER;
break;
- case '+':
+ case'+':
justification[columns++] = JUSTIFY_LEFT;
break;
- case ':':
+ case':':
justification[columns++] = JUSTIFY_RIGHT;
break;
}
@@ -1947,7 +1981,8 @@
return justification;
}
- private boolean traverseRow( StringBuffer[] cells, boolean[] headers )
+ private boolean traverseRow( StringBuffer[] cells,
+ boolean[] headers )
throws AptParseException
{
// Skip empty row (a decorative line).
@@ -1999,7 +2034,8 @@
private class ListItem
extends Block
{
- public ListItem( int indent, String firstLine )
+ public ListItem( int indent,
+ String firstLine )
throws AptParseException
{
super( LIST_ITEM, indent, firstLine );
@@ -2019,7 +2055,9 @@
{
private int numbering;
- public NumberedListItem( int indent, String firstLine, int numbering )
+ public NumberedListItem( int indent,
+ String firstLine,
+ int numbering )
throws AptParseException
{
super( NUMBERED_LIST_ITEM, indent, firstLine );
@@ -2067,7 +2105,8 @@
private class DefinitionListItem
extends Block
{
- public DefinitionListItem( int indent, String firstLine )
+ public DefinitionListItem( int indent,
+ String firstLine )
throws AptParseException
{
super( DEFINITION_LIST_ITEM, indent, firstLine );
@@ -2099,7 +2138,8 @@
private class HorizontalRule
extends Block
{
- public HorizontalRule( int indent, String firstLine )
+ public HorizontalRule( int indent,
+ String firstLine )
throws AptParseException
{
super( HORIZONTAL_RULE, indent );
@@ -2115,7 +2155,8 @@
private class PageBreak
extends Block
{
- public PageBreak( int indent, String firstLine )
+ public PageBreak( int indent,
+ String firstLine )
throws AptParseException
{
super( PAGE_BREAK, indent );
@@ -2131,7 +2172,8 @@
private class MacroBlock
extends Block
{
- public MacroBlock( int indent, String firstLine )
+ public MacroBlock( int indent,
+ String firstLine )
throws AptParseException
{
super( MACRO, indent );
@@ -2188,7 +2230,9 @@
// -----------------------------------------------------------------------
- private static String replaceAll( String string, String oldSub, String newSub )
+ private static String replaceAll( String string,
+ String oldSub,
+ String newSub )
{
StringBuffer replaced = new StringBuffer();
int oldSubLength = oldSub.length();
Modified: maven/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/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java?view=diff&rev=519545&r1=519544&r2=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java Sat Mar 17 22:07:36 2007
@@ -23,13 +23,14 @@
import java.io.Writer;
import java.util.Stack;
-import org.apache.maven.doxia.module.HtmlTools;
+import org.apache.maven.doxia.util.HtmlTools;
import org.apache.maven.doxia.sink.SinkAdapter;
import org.codehaus.plexus.util.StringUtils;
/**
* APT Sink implementation.
* @author eredmond
+ * @plexus.component
*/
public class AptSink extends SinkAdapter
{
Modified: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSiteModule.java
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSiteModule.java?view=diff&rev=519545&r1=519544&r2=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSiteModule.java (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSiteModule.java Sat Mar 17 22:07:36 2007
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id:AptSiteModule.java 348605 2005-11-24 12:02:44 +1100 (Thu, 24 Nov 2005) brett $
- * @plexus.component
+ * @plexus.component role="org.apache.maven.doxia.site.module.SiteModule"
* role-hint="apt"
*/
public class AptSiteModule
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml Sat Mar 17 22:07:36 2007
@@ -0,0 +1,22 @@
+<component-set>
+ <components>
+ <component>
+ <role>org.apache.maven.doxia.parser.Parser</role>
+ <role-hint>apt</role-hint>
+ <implementation>org.apache.maven.doxia.module.apt.AptParser</implementation>
+ <description></description>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.doxia.macro.manager.MacroManager</role>
+ <field-name>macroManager</field-name>
+ </requirement>
+ </requirements>
+ </component>
+ <component>
+ <role>org.apache.maven.doxia.site.module.SiteModule</role>
+ <role-hint>apt</role-hint>
+ <implementation>org.apache.maven.doxia.module.apt.AptSiteModule</implementation>
+ <description></description>
+ </component>
+ </components>
+</component-set>
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/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/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java?view=diff&rev=519545&r1=519544&r2=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java Sat Mar 17 22:07:36 2007
@@ -38,9 +38,7 @@
private AptParser parser;
- /**
- * @see junit.framework.TestCase#setUp()
- */
+ /** @see junit.framework.TestCase#setUp() */
protected void setUp()
throws Exception
{
@@ -49,25 +47,19 @@
parser = (AptParser) lookup( Parser.ROLE, "apt" );
}
- /**
- * @see org.apache.maven.doxia.parser.AbstractParserTestCase#getParser()
- */
+ /** @see org.apache.maven.doxia.parser.AbstractParserTestCase#getParser() */
protected Parser getParser()
{
return parser;
}
- /**
- * @see org.apache.maven.doxia.parser.AbstractParserTestCase#getDocument()
- */
+ /** @see org.apache.maven.doxia.parser.AbstractParserTestCase#getDocument() */
protected String getDocument()
{
- return "src/test/site/apt/linebreak.apt";
+ return "src/test/resources/test/linebreak.apt";
}
- /**
- * @throws Exception
- */
+ /** @throws Exception */
public void testLineBreak()
throws Exception
{
@@ -91,9 +83,7 @@
}
}
- /**
- * @throws Exception
- */
+ /** @throws Exception */
public void testSnippetMacro()
throws Exception
{
@@ -103,7 +93,7 @@
try
{
output = new StringWriter();
- reader = new FileReader( getTestFile( getBasedir(), "src/test/site/apt/macro.apt" ) );
+ reader = new FileReader( getTestFile( getBasedir(), "src/test/resources/test/macro.apt" ) );
Sink sink = new AptSink( output );
getParser().parse( reader, sink );
@@ -117,9 +107,7 @@
}
}
- /**
- * @throws Exception
- */
+ /** @throws Exception */
public void testTocMacro()
throws Exception
{
@@ -129,7 +117,7 @@
try
{
output = new StringWriter();
- reader = new FileReader( getTestFile( getBasedir(), "src/test/site/apt/toc.apt" ) );
+ reader = new FileReader( getTestFile( getBasedir(), "src/test/resources/test/toc.apt" ) );
Sink sink = new AptSink( output );
getParser().parse( reader, sink );
@@ -140,8 +128,15 @@
}
finally
{
- output.close();
- reader.close();
+ if ( output != null )
+ {
+ output.close();
+ }
+
+ if ( reader != null )
+ {
+ reader.close();
+ }
}
}
}
Modified: maven/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/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java?view=diff&rev=519545&r1=519544&r2=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java Sat Mar 17 22:07:36 2007
@@ -21,6 +21,7 @@
import org.apache.maven.doxia.sink.AbstractSinkTestCase;
import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.parser.Parser;
public class AptSinkTest
extends AbstractSinkTestCase
@@ -39,6 +40,11 @@
sink.flush();
}
+
+ protected Parser createParser()
+ {
+ return new AptParser();
+ }
protected Sink createSink()
throws Exception
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,10 @@
+ -----
+ Test DOXIA-76
+ -----
+ Vincent Siveton
+ -----
+
+Test DOXIA-76
+
+ Line\
+ break.
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/linebreak.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,9 @@
+ -----
+ Test DOXIA-77
+ -----
+ Vincent Siveton
+ -----
+
+Test DOXIA-77
+
+%{snippet|id=superpom|url=http://svn.apache.org/repos/asf/maven/components/trunk/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml}
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/macro.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,16 @@
+ -----
+ Maven: the cute and fluffy build tool.
+ -----
+ Jason van Zyl
+ -----
+
+Maven: the cute and fluffy build tool that's good for the whole family
+
+ Maven will make you laugh; Maven will make you jump for joy; Maven will
+ make you put that dirty little tool called Ant in the litter box with
+ the cat treats where it belongs!
+
+* Say Goodbye the build time stains!
+
+ Maven helps you get rid of those <hard to get rid of> build stains. Wash with Maven
+ and go!
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,10 @@
+ -----
+ Test DOXIA-76
+ -----
+ Vincent Siveton
+ -----
+
+Test DOXIA-76
+
+ Line\
+ break.
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/linebreak.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,9 @@
+ -----
+ Test DOXIA-77
+ -----
+ Vincent Siveton
+ -----
+
+Test DOXIA-77
+
+%{snippet|id=superpom|url=http://svn.apache.org/repos/asf/maven/components/trunk/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml}
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/macro.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,16 @@
+ -----
+ Maven: the cute and fluffy build tool.
+ -----
+ Jason van Zyl
+ -----
+
+Maven: the cute and fluffy build tool that's good for the whole family
+
+ Maven will make you laugh; Maven will make you jump for joy; Maven will
+ make you put that dirty little tool called Ant in the litter box with
+ the cat treats where it belongs!
+
+* Say Goodbye the build time stains!
+
+ Maven helps you get rid of those <hard to get rid of> build stains. Wash with Maven
+ and go!
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/test.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,55 @@
+ ----
+ Test DOXIA-40
+ -----
+ Vincent Siveton
+ -----
+ January 2007
+ -----
+
+Test DOXIA-40
+
+Section 1
+
+%{toc|section=2|fromDepth=2|toDepth=4}
+
+* {SubSection 1}
+
+ SubSection 1
+
+** {SubSection 11}
+
+ SubSection 11
+
+** {SubSection 12}
+
+ SubSection 12
+
+*** {SubSection 121}
+
+ SubSection 121
+
+**** {SubSection 1211}
+
+ SubSection 1211
+
+*** {SubSection 122}
+
+ SubSection 122
+
+* {SubSection 2}
+
+ SubSection 2
+
+* {SubSection 3}
+
+ SubSection 3
+
+* {SubSection 4}
+
+ SubSection 4
+
+Section 2
+
+* {SubSection 1}
+
+ SubSection 1
\ No newline at end of file
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/test/toc.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt?view=auto&rev=519545
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt Sat Mar 17 22:07:36 2007
@@ -0,0 +1,55 @@
+ ----
+ Test DOXIA-40
+ -----
+ Vincent Siveton
+ -----
+ January 2007
+ -----
+
+Test DOXIA-40
+
+Section 1
+
+%{toc|section=2|fromDepth=2|toDepth=4}
+
+* {SubSection 1}
+
+ SubSection 1
+
+** {SubSection 11}
+
+ SubSection 11
+
+** {SubSection 12}
+
+ SubSection 12
+
+*** {SubSection 121}
+
+ SubSection 121
+
+**** {SubSection 1211}
+
+ SubSection 1211
+
+*** {SubSection 122}
+
+ SubSection 122
+
+* {SubSection 2}
+
+ SubSection 2
+
+* {SubSection 3}
+
+ SubSection 3
+
+* {SubSection 4}
+
+ SubSection 4
+
+Section 2
+
+* {SubSection 1}
+
+ SubSection 1
\ No newline at end of file
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-modules/doxia-module-apt/src/test/resources/toc.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"