MNG-584 and MNG-585: updated the Velocity template and added test case

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@218985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2005-07-14 04:28:06 +00:00
parent 045b43f08e
commit 4001df5247
12 changed files with 248 additions and 2 deletions

View File

@ -41,13 +41,17 @@
#macro ( menuItem $item )
#if ( $item.getChildCount() > 0 )
#set ( $collapse = "expanded" )
#if ( $item.getAttribute( "collapse" ) == "true" )
#set ( $collapse = "collapsed" )
#else
#set ( $collapse = "expanded" )
#end
#else
#set ( $collapse = "none" )
#end
#set ( $currentItemHref = $PathTool.calculateLink( $item.getAttribute( "href" ), $relativePath ) )
<li class="$collapse">
#if ( $currentFileName == $currentItemHref )
#if ( $currentFileName.replaceAll('\\', '/') == $currentItemHref )
<strong><a href="$currentItemHref">$item.getAttribute( "name" )</a></strong>
#else
<a href="$currentItemHref">$item.getAttribute( "name" )</a>
@ -55,11 +59,13 @@
</li>
#if ( $item.getChildren() )
#if ( $item.getChildCount() > 0 )
#if ( $collapse != "collapsed" )
<ul>
#foreach( $subitem in $item.getChildren() )
#menuItem( $subitem )
#end
</ul>
#end
#end
#end
#end

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.plugin.site.test6</groupId>
<artifactId>site-plugin-test6</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<inceptionYear>2005</inceptionYear>
<name>Maven Site Plugin Test6 MNG-584 and MNG-585 issues</name>
<description>Test the MNG-584 and MNG-585 issues</description>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<developers>
<developer>
<id>vsiveton</id>
<name>Vincent Siveton</name>
<email>vsiveton@apache.org</email>
<organization>Apache Software Foundation</organization>
<roles>
<role>Java Developer</role>
</roles>
<timezone>-5</timezone>
</developer>
</developers>
</project>

View File

@ -0,0 +1,13 @@
package org.apache.maven.plugin.site.test6;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Index
From /alpha/index.apt

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Index
From /alpha/one/index.apt

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Index
From /alpha/two/index.apt

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Index
From /beta/index.apt

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Index
From /beta/one/index.apt

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Index
From /beta/beta/index.apt

View File

@ -0,0 +1,12 @@
------
Configuring Site Plugin
------
Vincent Siveton
------
13 July 2005
------
Site Plugin Item
Todo

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<project name="Maven Site">
<bannerLeft>
<name>Maven Site</name>
<src>http://maven.apache.org/images/apache-maven-project.png</src>
<href>http://maven.apache.org/</href>
</bannerLeft>
<bannerRight>
<src>http://maven.apache.org/images/maven-small.gif</src>
</bannerRight>
<body>
<links>
<item name="Maven 2" href="http://maven.apache.org/maven2/"/>
</links>
<!-- Menu in the Left Navigation -->
<menu name="Menu Name">
<!-- Standalone item -->
<item name="Item" href="/item.html" />
<!-- Uncollapsed Submenu -->
<item name="Alpha" href="/alpha/index.html">
<item name="Alpha One" href="/alpha/one/index.html"/>
<item name="Alpha Two" href="/alpha/two/index.html"/>
</item>
<!-- Collapsed Submenu -->
<item name="Beta" href="/beta/index.html" collapse="true">
<item name="Beta One" href="/beta/one/index.html" collapse="true"/>
<item name="Beta Two" href="/beta/two/index.html" collapse="true"/>
</item>
</menu>
${reports}
</body>
</project>

View File

@ -0,0 +1,38 @@
package org.apache.maven.plugin.site.test6;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}