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

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


     *
     */
    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" ) );
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" ) );
View Full Code Here

     *
     */
    public void testBadHref()
    {
        final DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.getBody().addBreadcrumb( createLinkItem( "Foo", "http://foo.apache.org/${property}" ) );
        assembler.resolvePaths( model, "http://foo.apache.org" );
        assertEquals( "Check size", 1, model.getBody().getBreadcrumbs().size() );
        assertEquals( "Check item", createLinkItem( "Foo", "http://foo.apache.org/${property}" ),
            model.getBody().getBreadcrumbs().get( 0 ) );
View Full Code Here

     *
     */
    public void testBreadcrumbWithoutHref()
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        model.getBody().addBreadcrumb( createLinkItem( "Foo", null ) );
        assembler.resolvePaths( model, "http://foo.apache.org" );
        assertEquals( "Check size", 1, model.getBody().getBreadcrumbs().size() );
        assertEquals( "Check item", createLinkItem( "Foo", null ), model.getBody().getBreadcrumbs().get( 0 ) );
    }
View Full Code Here

    public void testBreadcrumbs()
    {
        String parentHref = "http://parent.com/index.html";

        final DecorationModel parent = new DecorationModel();
        parent.setBody( new Body() );
        parent.getBody().addBreadcrumb( createLinkItem( "Parent", parentHref ) );

        DecorationModel child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child", "http://parent.com" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );


        // same with trailing slash
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child/", "http://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );

        // now mixed
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child/", "http://parent.com" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );

        // and other way round
        child = new DecorationModel();
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child", "http://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );


        // now with child breadcrumb
        child = new DecorationModel();
        child.setBody( new Body() );
        child.getBody().addBreadcrumb( createLinkItem( "Child", "" ) );
        assembler.assembleModelInheritance( "childName", child, parent,
                "http://parent.com/child/", "http://parent.com/" );
        assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "Child", parentHref );
View Full Code Here

     * http://jira.codehaus.org/browse/DOXIASITETOOLS-62
     */
    public void testBreadcrumbCutParentAfterDuplicate()
    {
        DecorationModel child = new DecorationModel(); // B > E
        child.setBody( new Body() );
        child.getBody().addBreadcrumb( createLinkItem( "B", null ) );
        child.getBody().addBreadcrumb( createLinkItem( "E", null ) );

        DecorationModel parent = new DecorationModel(); // A > B > C > D
        parent.setBody( new Body() );
        parent.getBody().addBreadcrumb( createLinkItem( "A", null ) );
        parent.getBody().addBreadcrumb( createLinkItem( "B", null ) );
        parent.getBody().addBreadcrumb( createLinkItem( "C", null ) );
        parent.getBody().addBreadcrumb( createLinkItem( "D", null ) );

View Full Code Here

     *
     */
    public void testBannerWithoutHref()
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );

        Banner banner = createBanner( "Left", null, "/images/src.gif", "alt" );

        model.setBannerLeft( banner );

View Full Code Here

     */
    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

            return;
        }

        try {
            DecorationModel model = new DecorationModel();
            model.setBody(new Body());
            Map<String, Object> attributes = new HashMap<String, Object>();
            attributes.put("outputEncoding", "UTF-8");
            attributes.put("project", project);
            Locale locale = Locale.getDefault();
View Full Code Here

     *             An error occurred while creating the report.
     */
    public void execute() throws MojoExecutionException, MojoFailureException
    {
        DecorationModel model = new DecorationModel();
        model.setBody( new Body() );
        Map attributes = new HashMap();
        attributes.put( "outputEncoding", "UTF-8" );
        Locale locale = Locale.getDefault();
        try
        {
View Full Code Here

TOP

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

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.