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

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


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

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

View Full Code Here


     * @throws XmlPullParserException
     */
    public void testNullParent()
        throws IOException, XmlPullParserException
    {
        DecorationModel childModel = readModel( "empty.xml" );

        assembler.assembleModelInheritance( NAME, childModel, null, "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 testFullyPopulatedChild()
        throws IOException, XmlPullParserException
    {
        DecorationModel childModel = readModel( "fully-populated-child.xml" );
        DecorationModel parentModel = readModel( "fully-populated-child.xml" );

        assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://foo.apache.org/doxia",
                                            "http://foo.apache.org" );
        DecorationModel mergedModel = readModel( "fully-populated-child.xml" );

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

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

     * @throws XmlPullParserException
     */
    public void testFullyPopulatedParentAndEmptyChild()
        throws IOException, XmlPullParserException
    {
        DecorationModel childModel = readModel( "empty.xml" );
        DecorationModel parentModel = readModel( "fully-populated-child.xml" );

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

        DecorationModel unresolvedModel = readModel( "fully-populated-unresolved.xml" );
        assertEquals( "Check result", unresolvedModel, childModel );

        assembler.resolvePaths( childModel, "http://maven.apache.org/doxia" );
        DecorationModel mergedModel = readModel( "fully-populated-merged.xml" );

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

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

     * @throws XmlPullParserException
     */
    public void testResolvingAllExternalUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel model = readModel( "external-urls.xml" );

        assembler.resolvePaths( model, "http://foo.com/" );
        DecorationModel mergedModel = readModel( "external-urls.xml" );

        assertEquals( "Check result", mergedModel, model );
    }
View Full Code Here

     * @throws XmlPullParserException
     */
    public void testResolvingAllRelativeUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel model = readModel( "relative-urls.xml" );

        assembler.resolvePaths( model, "http://foo.com/" );

        DecorationModel resolvedModel = readModel( "relative-urls-resolved.xml" );

        assertEquals( "Check result", resolvedModel, model );
    }
View Full Code Here

     * @throws XmlPullParserException
     */
    public void testResolvingAllSiteUrls()
        throws IOException, XmlPullParserException
    {
        DecorationModel model = readModel( "subsite-urls.xml" );

        assembler.resolvePaths( model, "http://maven.apache.org/" );

        DecorationModel resolvedModel = readModel( "relative-urls-resolved.xml" );
        assertEquals( "Check result", resolvedModel, model );
    }
View Full Code Here

     * @throws XmlPullParserException
     */
    public void testResolvingEmptyDescriptor()
        throws IOException, XmlPullParserException
    {
        DecorationModel model = readModel( "empty.xml" );
        assembler.resolvePaths( model, "http://maven.apache.org" );
        DecorationModel mergedModel = readModel( "empty.xml" );

        assertEquals( "Check result", mergedModel, model );
    }
View Full Code Here

    /**
     *
     */
    public void testDuplicateParentElements()
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) );
        model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) );

        model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) );
        model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) );

        DecorationModel child = new DecorationModel();
        assembler.assembleModelInheritance( NAME, child, model, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );

        assertEquals( "Check size", 1, child.getBody().getLinks().size() );
        assertEquals( "Check item", createLinkItem( "Foo", "http://foo.apache.org" ),
                      child.getBody().getLinks().get( 0 ) );

        assertEquals( "Check size", 1, child.getPoweredBy().size() );
        assertEquals( "Check item", createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ),
                      child.getPoweredBy().get( 0 ) );
    }
View Full Code Here

    /**
     *
     */
    public void testDuplicateChildElements()
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) );
        model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) );

        model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) );
        model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) );

        DecorationModel parent = new DecorationModel();
        assembler.assembleModelInheritance( NAME, model, parent, "http://maven.apache.org/doxia",
                                            "http://maven.apache.org" );

        assertEquals( "Check size", 1, model.getBody().getLinks().size() );
        assertEquals( "Check item", createLinkItem( "Foo", "http://foo.apache.org" ),
                      model.getBody().getLinks().get( 0 ) );

        assertEquals( "Check size", 1, model.getPoweredBy().size() );
        assertEquals( "Check item", createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ),
                      model.getPoweredBy().get( 0 ) );

        assertEquals( "Modified parent!", new DecorationModel(), parent );
    }
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.