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:21:38 UTC

svn commit: r584737 - in /maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/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/js/ test/ja...

Author: vsiveton
Date: Mon Oct 15 04:21:36 2007
New Revision: 584737

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

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

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/examples/ant.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/examples/ant.apt?rev=584737&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/examples/ant.apt (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/examples/ant.apt Mon Oct 15 04:21:36 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-js-3.0-SNAPSHOT.jar" />
+    </fileset>
+  </path>
+
+  <target name="antdoc">
+    <taskdef name="antdoc"
+             classname="org.apache.maven.jxr.js.doc.JSDocTask"
+             classpathref="task.classpath"/>
+
+    <antdoc jsDir="${basedir}/webapp/js"
+            destDir="${basedir}/target/js" />
+  </target>
+</project>
++-----+

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

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

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/index.apt?rev=584737&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/index.apt (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/apt/index.apt Mon Oct 15 04:21:36 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 Javascript
+
+ This project is a Javascript 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-js/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/site.xml?rev=584737&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/site.xml (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/site/site.xml Mon Oct 15 04:21:36 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 JS with Ant" href="/examples/ant.html"/>
+    </menu>
+
+    <menu ref="reports"/>
+  </body>
+</project>

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

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

Added: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/test/java/org/apache/maven/jxr/js/doc/JSDocTaskTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/test/java/org/apache/maven/jxr/js/doc/JSDocTaskTest.java?rev=584737&view=auto
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/test/java/org/apache/maven/jxr/js/doc/JSDocTaskTest.java (added)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-js/src/test/java/org/apache/maven/jxr/js/doc/JSDocTaskTest.java Mon Oct 15 04:21:36 2007
@@ -0,0 +1,108 @@
+package org.apache.maven.jxr.js.doc;
+
+/*
+ * 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 JSDocTaskTest
+    extends TestCase
+{
+    /**
+     * Call JSDoc task
+     *
+     * @throws Exception if any.
+     */
+    public void testDefaultExecute()
+    {
+        final String basedir = new File( "" ).getAbsolutePath();
+
+        File jsDocDir = new File( basedir, "target/unit/jsdoc-default" );
+
+        Project antProject = new Project();
+        antProject.setBasedir( basedir );
+
+        JSDocTask task = new JSDocTask();
+        task.setProject( antProject );
+        task.init();
+        task.setJSDir( this.getClass().getClassLoader().getResource( "jsdoc" ).getFile() );
+        task.setDestDir( jsDocDir.getAbsolutePath() );
+        task.execute();
+
+        // Generated files
+        File generated = new File( jsDocDir, "index.htm" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+        generated = new File( jsDocDir, "Test1.htm" );
+        assertTrue( generated.exists() );
+        assertTrue( generated.length() > 0 );
+    }
+
+    /**
+     * Call JSDoc task
+     *
+     * @throws Exception if any.
+     */
+    public void testNullExecute()
+    {
+        final String basedir = new File( "" ).getAbsolutePath();
+
+        File jsDocDir = new File( basedir, "target/unit/jsdoc-null" );
+
+        Project antProject = new Project();
+        antProject.setBasedir( basedir );
+
+        JSDocTask task = new JSDocTask();
+        task.setProject( antProject );
+        task.init();
+
+        task.setJSDir( null );
+        task.setDestDir( jsDocDir.getAbsolutePath() );
+        try
+        {
+            task.execute();
+            assertTrue( "Doesnt handle null JS dir", false );
+        }
+        catch ( BuildException e )
+        {
+            assertTrue( true );
+        }
+
+        task.setJSDir( this.getClass().getClassLoader().getResource( "jsdoc" ).getFile() );
+        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-js/src/test/java/org/apache/maven/jxr/js/doc/JSDocTaskTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

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