Package org.apache.maven.doxia.site.decoration

Examples of org.apache.maven.doxia.site.decoration.DecorationModel


     *
     */
    public void testLogoWithoutImage()
    {
        // This should actually be validated in the model, it doesn't really make sense
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", null ) );
        assembler.resolvePaths( model, "http://foo.apache.org" );
        assertEquals( "Check size", 1, model.getPoweredBy().size() );
        assertEquals( "Check item", createLogo( "Foo", "./", null ), model.getPoweredBy().get( 0 ) );
    }
View Full Code Here


     * @throws XmlPullParserException
     */
    public void testInheritence()
        throws IOException, XmlPullParserException
    {
        DecorationModel childModel = readModel( "child.xml" );
        DecorationModel parentModel = readModel( "parent.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );
        DecorationModel mergedModel = readModel( "merged.xml" );

        assertEquals( "Check result", mergedModel, childModel );

        // same with scp url, DOXIASITETOOLS-47
        childModel = readModel( "child.xml" );
View Full Code Here

     * @throws XmlPullParserException
     */
    public void testSuppressedInheritence()
            throws IOException, XmlPullParserException
    {
        DecorationModel unassembledChildModel = readModel( "child-no-inheritance.xml" );
        DecorationModel childModel = readModel( "child-no-inheritance.xml" );
        DecorationModel parentModel = readModel( "parent.xml" );
        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );
        assertEquals( "Check result", unassembledChildModel, childModel );

        // 2 levels of inheritance
        DecorationModel childOfchildModel = new DecorationModel();
        assembler.assembleModelInheritance( "Child of Child", childOfchildModel, childModel,
                                            "http://maven.apache.org/doxia/child", "http://maven.apache.org/doxia" );
        assembler.assembleModelInheritance( NAME, childOfchildModel, parentModel, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );
        // check that the 3 breadcrumb items from parent.xml are not inherited
        assertEquals( "child of child no inheritance: breadcrumbs count", 0,
                      childOfchildModel.getBody().getBreadcrumbs().size() );
    }
View Full Code Here

     */
    public void testPathsResolvedWhenEmpty()
        throws IOException, XmlPullParserException
    {
        // Test an empty model avoids NPEs
        DecorationModel childModel = readModel( "empty.xml" );
        DecorationModel parentModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );
        DecorationModel mergedModel = readModel( "empty.xml" );

        assertEquals( "Check result", mergedModel, childModel );

        // same with scp url, DOXIASITETOOLS-47
        childModel = readModel( "empty.xml" );
View Full Code Here

     * @throws XmlPullParserException
     */
    public void testPathsNotResolvedForExternalUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel parentModel = readModel( "external-urls.xml" );
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );
        assertPathsNotResolvedForExternalUrls( childModel );

View Full Code Here

     * @throws XmlPullParserException
     */
    public void testPathsResolvedForRelativeUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel parentModel = readModel( "relative-urls.xml" );
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia/",
                                            "http://maven.apache.org" );
        assertPathsResolvedForRelativeUrls( childModel );

View Full Code Here

     * @throws XmlPullParserException
     */
    public void testPathsResolvedForSubsiteUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel parentModel = readModel( "subsite-urls.xml" );
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia/",
                                            "http://maven.apache.org" );
        assembler.resolvePaths( childModel, "http://maven.apache.org/doxia" );

View Full Code Here

     * @throws XmlPullParserException
     */
    public void testPathsResolvedForRelativeUrlsDepthOfTwo()
        throws IOException, XmlPullParserException
    {
        DecorationModel parentModel = readModel( "relative-urls.xml" );
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia/core",
                                            "http://maven.apache.org" );
        assertPathsResolvedForRelativeUrlsDepthOfTwo( childModel );

View Full Code Here

     * @throws XmlPullParserException
     */
    public void testPathsResolvedForReverseRelativeUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel parentModel = readModel( "relative-urls.xml" );
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/",
                                            "http://maven.apache.org/doxia/" );
        assertPathsResolvedForReverseRelativeUrls( childModel );

View Full Code Here

     * @throws XmlPullParserException
     */
    public void testPathsResolvedForReverseRelativeUrlsDepthOfTwo()
        throws IOException, XmlPullParserException
    {
        DecorationModel parentModel = readModel( "relative-urls.xml" );
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/",
                                            "http://maven.apache.org/doxia/core/" );
        assertPathsResolvedForReverseRelativeUrlsDepthOfTwo( childModel );

View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.site.decoration.DecorationModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.