~ubuntu-branches/ubuntu/vivid/doxia/vivid-proposed

« back to all changes in this revision

Viewing changes to doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-10-08 14:20:22 UTC
  • mfrom: (2.3.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091008142022-f6ccxganfr2tbaig
Tags: 1.1-3build1
Upload to karmic, avoiding new version from unstable. LP: #443292.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
/**
29
29
 * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
30
 
 * @version $Id: XdocSinkTest.java 568110 2007-08-21 13:00:59Z vsiveton $
 
30
 * @version $Id: XdocSinkTest.java 747735 2009-02-25 10:43:09Z ltheussl $
31
31
 * @since 1.0
32
32
 */
33
33
public class XdocSinkTest
42
42
    /** {@inheritDoc} */
43
43
    protected Sink createSink( Writer writer )
44
44
    {
45
 
        return new XdocSink( writer );
 
45
        return new XdocSink( writer, "UTF-8" );
 
46
    }
 
47
 
 
48
    /** {@inheritDoc} */
 
49
    protected boolean isXmlSink()
 
50
    {
 
51
        return true;
46
52
    }
47
53
 
48
54
    /** {@inheritDoc} */
49
55
    protected String getTitleBlock( String title )
50
56
    {
51
 
        return title;
 
57
        return "<title>" + title + "</title>";
52
58
    }
53
59
 
54
60
    /** {@inheritDoc} */
66
72
    /** {@inheritDoc} */
67
73
    protected String getHeadBlock()
68
74
    {
69
 
        return "<?xml version=\"1.0\" ?><document><properties></properties>";
 
75
        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
 
76
            + "<document xmlns=\"http://maven.apache.org/XDOC/2.0\" "
 
77
            + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
 
78
            + "xsi:schemaLocation=\"http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd\">"
 
79
            + "<properties></properties>";
70
80
    }
71
81
 
72
82
    /** {@inheritDoc} */
138
148
    /** {@inheritDoc} */
139
149
    protected String getTableBlock( String cell, String caption )
140
150
    {
141
 
        return "<table align=\"center\"><table align=\"center\" border=\"0\"><tr valign=\"top\"><td>"
142
 
            + cell + "</td></tr></table><p><i>" + caption + "</i></p></table>";
143
 
    }
144
 
 
145
 
    // Disable testTable until the order of attributes issue is clarified
146
 
    // TODO: remove
147
 
    /** {@inheritDoc} */
148
 
    public void testTable()
149
 
    {
150
 
        assertEquals( "Dummy!", "", "" );
 
151
        return "<table align=\"center\" border=\"0\"><caption>" + caption
 
152
                + "</caption><tr valign=\"top\"><td align=\"center\">" + cell + "</td></tr></table>";
151
153
    }
152
154
 
153
155
    /** {@inheritDoc} */
171
173
    /** {@inheritDoc} */
172
174
    protected String getPageBreakBlock()
173
175
    {
174
 
        return "";
 
176
        return "<!-- PB -->";
175
177
    }
176
178
 
177
179
    /** {@inheritDoc} */
178
180
    protected String getAnchorBlock( String anchor )
179
181
    {
180
 
        return "<a name=\"" + anchor + "\" id=\""
181
 
            + anchor + "\">" + anchor + "</a>";
182
 
    }
183
 
 
184
 
    // Disable testAnchor until the order of attributes issue is clarified
185
 
    // TODO: remove
186
 
    /** {@inheritDoc} */
187
 
    public void testAnchor()
188
 
    {
189
 
        assertEquals( "Dummy!", "", "" );
 
182
        return "<a name=\"" + anchor + "\">" + anchor + "</a>";
190
183
    }
191
184
 
192
185
    /** {@inheritDoc} */
235
228
    /** {@inheritDoc} */
236
229
    protected String getRawTextBlock( String text )
237
230
    {
238
 
        // TODO
239
 
        return "";
 
231
        return "~,_=,_-,_+,_*,_[,_],_<,_>,_{,_},_\\";
240
232
    }
241
233
 
242
234