You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2012/06/03 11:16:33 UTC
svn commit: r1345635 -
/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Author: hboutemy
Date: Sun Jun 3 09:16:33 2012
New Revision: 1345635
URL: http://svn.apache.org/viewvc?rev=1345635&view=rev
Log:
extended test to check unknown sink event in head
Modified:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
Modified: maven/doxia/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/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java?rev=1345635&r1=1345634&r2=1345635&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java Sun Jun 3 09:16:33 2012
@@ -22,8 +22,10 @@ package org.apache.maven.doxia.module.xh
import java.io.StringWriter;
import java.io.Writer;
+import org.apache.maven.doxia.markup.HtmlMarkup;
import org.apache.maven.doxia.sink.AbstractSinkTest;
import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkEventAttributeSet;
/**
* @author Jason van Zyl
@@ -322,6 +324,9 @@ public class XhtmlSinkTest
// note: this is really illegal, there should be no un-resolved entities emitted into text()
sink.text( "ģ&" );
sink.author_();
+ SinkEventAttributeSet atts = new SinkEventAttributeSet( 1 );
+ atts.addAttribute( "href", "http://maven.apache.org/" );
+ sink.unknown( "base", new Object[] {new Integer( HtmlMarkup.TAG_TYPE_SIMPLE )}, atts );
sink.head_();
}
finally
@@ -329,9 +334,11 @@ public class XhtmlSinkTest
sink.close();
}
- String exp =
- "<head><title>Title</title><!-- A comment --><meta name=\"author\" content=\"ģ&\" /></head>";
- assertTrue( writer.toString().indexOf( exp ) != -1 );
+ String expected =
+ "<head><title>Title</title><!-- A comment --><meta name=\"author\" content=\"ģ&\" />"
+ + "<base href=\"http://maven.apache.org/\" /></head>";
+ String actual = writer.toString();
+ assertTrue( actual, actual.indexOf( expected ) != -1 );
}
/** {@inheritDoc} */