Author: jvanzyl
Date: Sat Mar 17 22:08:33 2007
New Revision: 519554
URL: http://svn.apache.org/viewvc?view=rev&rev=519554
Log:
decoupling module
Added:
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html
(with props)
Modified:
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/pom.xml
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Modified: maven/doxia/trunk/doxia-modules/doxia-module-xhtml/pom.xml
URL:
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-xhtml/pom.xml?view=diff&rev=519554&r1=519553&r2=519554
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-xhtml/pom.xml (original)
+++ maven/doxia/trunk/doxia-modules/doxia-module-xhtml/pom.xml Sat Mar 17
22:08:33 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-xhtml</artifactId>
- <name>doxia-module-xhtml</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-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
URL:
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java?view=diff&rev=519554&r1=519553&r2=519554
==============================================================================
---
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
(original)
+++
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
Sat Mar 17 22:08:33 2007
@@ -23,7 +23,7 @@
import java.io.Writer;
import java.util.Map;
-import org.apache.maven.doxia.module.HtmlTools;
+import org.apache.maven.doxia.util.HtmlTools;
import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
import org.apache.maven.doxia.parser.Parser;
import org.apache.maven.doxia.sink.Sink;
@@ -33,7 +33,7 @@
/**
* A doxia sink which produces xhtml
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
+ * @author Jason van Zyl
*/
public class XhtmlSink
extends AbstractXhtmlSink
Modified:
maven/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/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java?view=diff&rev=519554&r1=519553&r2=519554
==============================================================================
---
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
(original)
+++
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
Sat Mar 17 22:08:33 2007
@@ -40,7 +40,7 @@
protected String getDocument()
{
- return "src/test/site/xhtml/fun.html";
+ return "src/test/resources/fun.html";
}
public void testParser()
Modified:
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
URL:
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java?view=diff&rev=519554&r1=519553&r2=519554
==============================================================================
---
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
(original)
+++
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Sat Mar 17 22:08:33 2007
@@ -22,13 +22,19 @@
import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
import org.apache.maven.doxia.sink.AbstractSinkTestCase;
import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.parser.Parser;
import java.io.File;
import java.io.FileReader;
+import java.io.Reader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.Map;
+import java.util.Collections;
+import java.util.HashMap;
/**
- * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
+ * @author Jason van Zyl
* @version $Id:XhtmlSinkTest.java 348605 2005-11-24 12:02:44 +1100 (Thu, 24
Nov 2005) brett $
*/
public class XhtmlSinkTest
@@ -41,6 +47,11 @@
// START SNIPPET: foo
+ protected Parser createParser()
+ {
+ return new XhtmlParser();
+ }
+
protected Sink createSink()
throws Exception
{
@@ -49,14 +60,30 @@
RenderingContext renderingContext =
new RenderingContext( getBasedirFile(), new File(
getBasedirFile(), apt ).getPath(), "apt" );
- FileReader reader = new FileReader( new File( getBasedirFile(),
"src/test/resources/codehaus.dst" ) );
+ //PLXAPI: This horrible fake map is being used because someone
neutered the directives approach in the
+ // site renderer so that it half worked. Put it back and make it work
properly.
+
+ return new XhtmlSink( getTestWriter(), renderingContext, new FakeMap()
);
+ }
- SinkDescriptorReader sdr = new SinkDescriptorReader();
+ protected Reader getTestReader()
+ throws Exception
+ {
+ InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream( "fun.html"
);
- Map directives = sdr.read( reader );
+ InputStreamReader reader = new InputStreamReader( is );
- return new XhtmlSink( getTestWriter(), renderingContext, directives );
+ return reader;
}
// END SNIPPET: foo
+
+ class FakeMap
+ extends HashMap
+ {
+ public Object get( Object key )
+ {
+ return "fake";
+ }
+ }
}
Added:
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html
URL:
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html?view=auto&rev=519554
==============================================================================
---
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html
(added)
+++
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html
Sat Mar 17 22:08:33 2007
@@ -0,0 +1,66 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html>
+ <head>
+ <title>This is fun!</title>
+ </head>
+ <body>
+ <h1>This is the first first-level section</h1>
+ <p>
+ This paragraph belongs to section one.
+ </p>
+ <h2>This is the first second-level section</h2>
+ <p>
+ <a name="para1" />This paragraph belongs to subsection
one.
+ </p>
+ <h2>This is the second second-level section</h2>
+ <p>
+ This paragraph belongs to subsection two.
+ </p>
+ <h4>This is the first third-level section</h4>
+ <p>
+ To make the <em>task</em> <i>even</i> harder,
+ the <tt>h3</tt>-heading was dropped, but we
+ expect the parser to recognize this section
+ as level 3, not level 4.
+ </p>
+ <h2>This is the third second-level section</h2>
+ <p>
+ This paragraph belongs to subsection three.
+ </p>
+ <h1>This is the second first-level section</h1>
+ <p>
+ This paragraph belongs to section two.
+ </p>
+ <pre>
+ //what is source code?
+ </pre>
+ <p>
+ This is <em>also</em> a <strong>paragraph</strong>. Take a look
+ at the <a href="#para1">other paragraph</a>.
+ </p>
+ <p>
+ Just introduce some <img
src="http://maven.apache.org/images/logos/maven-feather.png"/>
+ images. <img
src="http://maven.apache.org/images/logos/maven-feather.png" alt="maven
feather"/>
+ <img src="http://maven.apache.org/images/logos/maven-feather.png"
alt="maven feather"
+ title="built by: maven"/>
+ </p>
+ </body>
+</html>
Propchange:
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/resources/fun.html
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"