You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/10/15 13:30:35 UTC

svn commit: r584743 - in /maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src: site/ site/apt/ site/apt/examples/ test/java/org/ test/java/org/apache/ test/java/org/apache/maven/ test/java/org/apache/maven/jxr/ test/java/org/apache/maven/jxr/java/ tes...

Author: vsiveton
Date: Mon Oct 15 04:30:33 2007
New Revision: 584743

URL: http://svn.apache.org/viewvc?rev=584743&view=rev
Log:
o added test case
o added doc

Added:
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt   (with props)
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt   (with props)
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml   (with props)
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/
    maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java   (with props)

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt?rev=584743&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt Mon Oct 15 04:30:33 2007
@@ -0,0 +1,51 @@
+ ------
+ Ant Example
+ ------
+ Vincent Siveton
+ ------
+ October 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Ant Example
+
+ Here is a simple Ant example:
+
++-----+
+<project name="your-project" basedir=".">
+
+  <path id="task.classpath">
+    <fileset dir="${basedir}/lib">
+      <include name="maven-jxr-java-3.0-SNAPSHOT.jar" />
+    </fileset>
+  </path>
+
+  <target name="antdoc">
+    <taskdef name="javasrc"
+             classname="org.apache.maven.jxr.java.src.JavaSrcTask"
+             classpathref="task.classpath"/>
+
+    <javasrc srcDir="${basedir}/src/main/java"
+            destDir="${basedir}/target/javasrc" />
+  </target>
+</project>
++-----+

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/examples/ant.apt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt?rev=584743&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt Mon Oct 15 04:30:33 2007
@@ -0,0 +1,43 @@
+ ------
+ Introduction
+ ------
+ Vincent Siveton
+ ------
+ October 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Maven JXR Java
+
+ This project is a Java code documentation system.
+
+* Brief History
+
+ This original code comes from the defunct {{{http://jakarta.apache.org/alexandria/}Apache Jakarta Alexandria}} project,
+ and was maintained within {{{http://forrest.apache.org/}Apache Forrest}} project, as a subproject called Forrestdoc.
+ During the summer 2007, the Apache Forrest Team gave to the Apache Maven Team the Forrestdoc project.
+ See the {{{http://www.nabble.com/-Proposal--decide-the-future-of-forrestdoc-tf4060050.html}Forrest thread}} and the
+ {{{http://www.nabble.com/Forrestdoc-and-Maven-JXR-tf3864888s177.html}Maven thread}}.
+
+* Examples
+
+   * {{{examples/ant.html}Ant}}: Some Ant example.

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml?rev=584743&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml Mon Oct 15 04:30:33 2007
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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>
+  <bannerLeft>
+    <name>${project.name}</name>
+    <src>http://maven.apache.org/images/apache-maven-project-2.png</src>
+    <href>http://maven.apache.org/jxr/</href>
+  </bannerLeft>
+
+  <bannerRight>
+    <src>http://maven.apache.org/images/maven-logo-2.gif</src>
+  </bannerRight>
+
+  <publishDate format="dd MMM yyyy" />
+
+  <skin>
+    <groupId>org.apache.maven.skins</groupId>
+    <artifactId>maven-stylus-skin</artifactId>
+  </skin>
+
+  <body>
+    <links>
+      <item name="Apache" href="http://www.apache.org/"/>
+      <item name="Maven 1.x" href="http://maven.apache.org/maven-1.x"/>
+      <item name="Maven 2.x" href="http://maven.apache.org/"/>
+      <item name="Archiva" href="http://maven.apache.org/archiva"/>
+      <item name="Continuum" href="http://maven.apache.org/continuum"/>
+      <item name="SCM" href="http://maven.apache.org/scm"/>
+      <item name="Wagon" href="http://maven.apache.org/wagon"/>
+      <item name="JXR" href="http://maven.apache.org/jxr"/>
+      <item name="Doxia" href="http://maven.apache.org/doxia"/>
+    </links>
+
+    <head>
+      <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+      </script>
+      <script type="text/javascript">
+        _uacct = "UA-140879-1";
+        urchinTracker();
+        function expand( item ) {
+        var expandIt = document.getElementById( item );
+        if( expandIt.style.display == "block" ) {
+        expandIt.style.display = "none";
+        expandIt.parentNode.className = "collapsed";
+        } else {
+        expandIt.style.display = "block";
+        expandIt.parentNode.className = "expanded";
+        }
+        }
+      </script>
+    </head>
+
+    <menu name="Overview">
+      <item name="Introduction" href="index.html"/>
+    </menu>
+
+    <menu name="Examples">
+      <item name="Using Maven JXR Ant with Ant" href="/examples/ant.html"/>
+    </menu>
+
+    <menu ref="reports"/>
+  </body>
+</project>

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/site/site.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java?rev=584743&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java Mon Oct 15 04:30:33 2007
@@ -0,0 +1,121 @@
+package org.apache.maven.jxr.java.src;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class JavaSrcTaskTest
+    extends TestCase
+{
+    /**
+     * Call JavaSrc task
+     *
+     * @throws Exception if any.
+     */
+    public void testDefaultExecute()
+        throws Exception
+    {
+        final String basedir = new File( "" ).getAbsolutePath();
+
+        File srcDir = new File( basedir, "src/main/java" );
+        File destDir = new File( basedir, "target/unit/jxrdoc-default" );
+
+        Project antProject = new Project();
+        antProject.setBasedir( basedir );
+
+        JavaSrcTask task = new JavaSrcTask();
+        task.setProject( antProject );
+        task.setSrcDir( srcDir );
+        task.setDestDir( destDir );
+        task.execute();
+
+        // Generated files
+        File generated = new File( destDir, "index.html" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( destDir, "allclasses-frame.html" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( destDir, "overview-frame.html" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( destDir, "overview-summary.html" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( destDir, "styles.css" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        // Generated src files
+        generated = new File( destDir, "org/apache/maven/jxr/java/src/JavaSrcTask.def" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( destDir, "org/apache/maven/jxr/java/src/JavaSrcTask_java.html" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( destDir, "org/apache/maven/jxr/java/src/JavaSrcTask_java_ref.html" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+    }
+
+    /**
+     * Call JavaSrc task
+     *
+     * @throws Exception if any.
+     */
+    public void testNullExecute()
+        throws Exception
+    {
+        final String basedir = new File( "" ).getAbsolutePath();
+
+        File srcDir = new File( basedir, "src/main/java" );
+        File destDir = new File( basedir, "target/unit/jxrdoc-null" );
+
+        Project antProject = new Project();
+        antProject.setBasedir( basedir );
+
+        JavaSrcTask task = new JavaSrcTask();
+        task.setProject( antProject );
+
+        task.setSrcDir( null );
+        task.setDestDir( destDir );
+        task.execute();
+
+        task.setSrcDir( srcDir );
+        task.setDestDir( null );
+        try
+        {
+            task.execute();
+            assertTrue( "Doesnt handle null dest dir", false );
+        }
+        catch ( BuildException e )
+        {
+            assertTrue( true );
+        }
+    }
+}

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-java/src/test/java/org/apache/maven/jxr/java/src/JavaSrcTaskTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"