Author: jvanzyl Date: Wed Oct 24 20:19:14 2007 New Revision: 588124 URL: http://svn.apache.org/viewvc?rev=588124&view=rev Log: o using the correct wiki source data and cleaning up test, adding a test for the wiki source
Added: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java (with props) Modified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/WikiArchetypeDataSource.java maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/sources/wiki/wiki-source.txt Modified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/WikiArchetypeDataSource.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/WikiArchetypeDataSource.java?rev=588124&r1=588123&r2=588124&view=diff ============================================================================== --- maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/WikiArchetypeDataSource.java (original) +++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/main/java/org/apache/maven/archetype/source/WikiArchetypeDataSource.java Wed Oct 24 20:19:14 2007 @@ -86,6 +86,8 @@ Pattern ptn = Pattern.compile( "<br>\\|([-a-zA-Z0-9_. ]+)\\|([-a-zA-Z0-9_. ]+)\\|([-a-zA-Z0-9_. ]+)\\|([-a-zA-Z0-9_.:/ \\[\\],]+)\\|([^|]+)\\|" ); + System.out.println( "sb.toString() = " + sb.toString() ); + Matcher m = ptn.matcher( sb.toString() ); while ( m.find() ) Modified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java?rev=588124&r1=588123&r2=588124&view=diff ============================================================================== --- maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java (original) +++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/CatalogArchetypeDataSinkTest.java Wed Oct 24 20:19:14 2007 @@ -71,9 +71,15 @@ Properties p = new Properties(); - p.setProperty( WikiArchetypeDataSource.URL, new File( getBasedir(), "test/sources/wiki-source.txt" ).toURI().toURL().toExternalForm() ); + File wikiSource = new File( getBasedir(), "src/test/sources/wiki/wiki-source.txt" ); - sink.putArchetypes( new WikiArchetypeDataSource(), null , writer ); + assertTrue( wikiSource.exists() ); + + p.setProperty( WikiArchetypeDataSource.URL, wikiSource.toURI().toURL().toExternalForm() ); + + ArchetypeDataSource ads = new WikiArchetypeDataSource(); + + sink.putArchetypes( ads, p, writer ); StringReader reader = new StringReader( writer.toString() ); @@ -81,10 +87,8 @@ ArchetypeCatalog catalog = catalogReader.read( reader ); - Archetyper archetype = (Archetyper) lookup( Archetyper.ROLE ); - - int size = archetype.getAvailableArchetypes().size(); + int catalogSize = catalog.getArchetypes().size(); - assertEquals( size, catalog.getArchetypes().size() ); + assertEquals( 37, catalogSize ); } } Added: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java?rev=588124&view=auto ============================================================================== --- maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java (added) +++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java Wed Oct 24 20:19:14 2007 @@ -0,0 +1,30 @@ +package org.apache.maven.archetype.source; + +import org.codehaus.plexus.PlexusTestCase; + +import java.io.File; +import java.util.List; +import java.util.Properties; + +/** @author Jason van Zyl */ +public class WikiArchetypeDataSourceTest + extends PlexusTestCase +{ + public void testWikiArchetypeDataSource() + throws Exception + { + Properties p = new Properties(); + + File wikiSource = new File( getBasedir(), "src/test/sources/wiki/wiki-source.txt" ); + + assertTrue( wikiSource.exists() ); + + p.setProperty( WikiArchetypeDataSource.URL, wikiSource.toURI().toURL().toExternalForm() ); + + ArchetypeDataSource ads = new WikiArchetypeDataSource(); + + List archetypes = ads.getArchetypes( p ); + + assertEquals( 37, archetypes.size() ); + } +} Propchange: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/java/org/apache/maven/archetype/source/WikiArchetypeDataSourceTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/sources/wiki/wiki-source.txt URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/sources/wiki/wiki-source.txt?rev=588124&r1=588123&r2=588124&view=diff ============================================================================== --- maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/sources/wiki/wiki-source.txt (original) +++ maven/sandbox/trunk/archetypeng/archetypeng-common/src/test/sources/wiki/wiki-source.txt Wed Oct 24 20:19:14 2007 @@ -1,73 +1,123 @@ -This page will hold the complete list of archetype (even not hosted at apache). +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title>View Source - Codehaus</title> + + + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <META HTTP-EQUIV="Expires" CONTENT="-1"> + <script language="javascript"> + var contextPath = ''; + var i18n = []; + </script> + + <link rel="stylesheet" href="/s/811/1/3/_/styles/main-action.css" type="text/css" /> + + <meta name="robots" content="noindex,nofollow"> + <meta name="robots" content="noarchive"> + <link rel="shortcut icon" href="/images/icons/favicon.ico"> + <link rel="icon" type="image/png" href="/images/icons/favicon.png"> + + <script type="text/javascript" src="/s/811/1/_/decorators/effects.js"></script> + + + + +</head> +<body onload="placeFocus()"> + +<div id="PageContent"> + <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td valign="top" class="pagebody"> + <div class="pageheader"> + <span class="pagetitle">View Source</span> + </div> + + <div class="monospaceInput"><div class="padded"> + This page will hold the complete list of archetype (even not hosted at apache). +<br> +<br>Each archetype page should enforce the following pattern : +<br>* Archetype name +<br>* Command line to call the archetype +<br>* If the archetype can be used in an existing projects directory +<br>* A tree view of the resulting files +<br>* Some additional information like the additional properties used by the plugin +<br> +<br>To use an archetype: +<br>{code} +<br>mvn archetype:create -DgroupId=<your group> -DartifactId=<your artifact> -DarchetypeArtifactId=<wanted artifact> -DarchetypeGroupId=<wanted artifact group> +<br>{code} +<br>Read more [here|http://maven.apache.org/plugins/maven-archetype-plugin/usage.html]. +<br> +<br>h3. Quick Reference +<br> +<br>A quick reference of available archetypes and their repositories. This list is designed so it can be automatically retrieved from archetype front-ends such as Archy - [http://code.google.com/p/archy]. Only archetypes that don't have any "released" artifacts need a version number. +<br>|| Artifact || Group || Version || Repository || Description || +<br>| appfuse-basic-jsf | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and JSF | +<br>| appfuse-basic-spring | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and Spring MVC | +<br>| appfuse-basic-struts | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and Struts 2 | +<br>| appfuse-basic-tapestry | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and Tapestry 4 | +<br>| appfuse-core | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a jar application with Hibernate and Spring and XFire | +<br>| appfuse-modular-jsf | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and JSF | +<br>| appfuse-modular-spring | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and Spring MVC | +<br>| appfuse-modular-struts | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and Struts 2 | +<br>| appfuse-modular-tapestry | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and Tapestry 4 | +<br>| maven-archetype-j2ee-simple | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple J2EE Java application | +<br>| maven-archetype-marmalade-mojo | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A Maven plugin development project using marmalade | +<br>| maven-archetype-mojo | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A Maven Java plugin development project | +<br>| maven-archetype-portlet | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple portlet application | +<br>| maven-archetype-profiles | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | | +<br>| maven-archetype-quickstart | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | | +<br>| maven-archetype-simple | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | | +<br>| maven-archetype-site-simple | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple site generation project | +<br>| maven-archetype-site | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A more complex site project | +<br>| maven-archetype-webapp | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple Java web application | +<br>| struts2-archetype-starter | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A starter Struts 2 application with Sitemesh, DWR, and Spring | +<br>| struts2-archetype-blank | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A minimal Struts 2 application | +<br>| struts2-archetype-portlet | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A minimal Struts 2 application that can be deployed as a portlet | +<br>| struts2-archetype-dbportlet | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A starter Struts 2 portlet that demonstrates a simple CRUD interface with db backing | +<br>| struts2-archetype-plugin | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A Struts 2 plugin | +<br>| shale-archetype-blank | org.apache.shale | 1.0.3-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A blank Shale web application with JSF | +<br>| maven-adf-archetype | org.apache.myfaces.adfbuild | 1.0-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | Archetype to ease the burden of creating a new application based with ADF | +<br>| data-app | net.databinder | 0.4 | [http://repo1.maven.org/maven2] | A new Databinder application with sources and resources. | +<br>| jini-service-archetype | org.jini.maven-jini-plugin | 2.0 | [http://repo1.maven.org/maven2] | Archetype for Jini service project creation | +<br>| softeu-archetype-seam | org.apache.maven.archetypes | | [http://maven.softeu.cz/] | JSF+Facelets+Seam Archetype | +<br>| softeu-archetype-seam-simple | org.apache.maven.archetypes | | [http://maven.softeu.cz/] | JSF+Facelets+Seam (no persistence) Archetype | +<br>| softeu-archetype-jsf | org.apache.maven.archetypes | | [http://maven.softeu.cz/] | JSF+Facelets Archetype | +<br>| jpa-maven-archetype | com.rfc.maven.archetypes | | [http://maven.rodcoffin.com/repo] | JPA application | +<br>| spring-osgi-bundle-archetype | org.springframework.osgi | 1.0-m3-SNAPSHOT | [http://static.springframework.org/maven2-snapshots] | Spring-OSGi archetype | +<br>| confluence-plugin-archetype | com.atlassian.maven.archetypes | | [http://repository.atlassian.com/maven2] | Atlassian Confluence plugin archetype | +<br>| maven-archetype-har | net.sf.maven-har | 0.9 | [http://repo1.maven.org/maven2] | Hibernate Archive | +<br>| maven-archetype-sar | net.sf.maven-sar | 0.9 | [http://repo1.maven.org/maven2] | JBoss Service Archive | +<br>| wicket-archetype-quickstart | org.apache.wicket | 1.3.0-beta3 | [http://repo1.maven.org/maven2] | A simple Apache Wicket project | +<br> +<br>h3. Additional Information +<br> +<br>* There is a maven-archetypes project on java.net: +<br>** [https://maven-archetypes.dev.java.net/] +<br>** [https://maven-archetypes.dev.java.net/source/browse/maven-archetypes/trunk/archetypes/org/jvnet/archetypes/] +<br> +<br>* Webtide has some archetypes available for download and installation locally. (Not in a public repository as far as I know.) +<br>** [http://www.webtide.com/resources.jsp] +<br> +<br>* A SEAM archetype is available from Lunar Logic +<br>** [http://www.nabble.com/Announcement%3A-Seam-Archetype-t2735410s177.html] +<br>** [http://www.lunarlogic.com/blog/show/maven_archetype_for_jboss_seam] +<br>* JSF archetypes from SoftEU +<br>** [http://software.softeu.cz/archetypes/jsf/] JSF+Facelets +<br>** [http://software.softeu.cz/archetypes/seam/] JSF+Facelets+Seam ([http://software.softeu.cz/seam/] Maven Seam integration) +<br>** [http://software.softeu.cz/archetypes/seam-simple/] JSF+Facelets+Seam (no hibernate) + </div></div> + </td> + </tr> + </table> +</div> + + <div class="license license-nonprofit"> + Site powered by a free <b>Open Source Project / Non-profit License</b> (<a href="http://www.atlassian.com">more</a>) of <b><a href="/c/conf/10138">Confluence - the Enterprise wiki</a>.<br/> <a href="http://www.atlassian.com">Learn more</a> or <a href="/c/conf/10137">evaluate Confluence for your organisation</a>. + </div> + <div class="bottomshadow"></div> -Each archetype page should enforce the following pattern : -* Archetype name -* Command line to call the archetype -* If the archetype can be used in an existing projects directory -* A tree view of the resulting files -* Some additional information like the additional properties used by the plugin - -To use an archetype: -{code} -mvn archetype:create -DgroupId=<your group> -DartifactId=<your artifact> -DarchetypeArtifactId=<wanted artifact> -DarchetypeGroupId=<wanted artifact group> -{code} -Read more [here|http://maven.apache.org/plugins/maven-archetype-plugin/usage.html]. - -h3. Quick Reference - -A quick reference of available archetypes and their repositories. This list is designed so it can be automatically retrieved from archetype front-ends such as Archy - [http://code.google.com/p/archy]. Only archetypes that don't have any "released" artifacts need a version number. -|| Artifact || Group || Version || Repository || Description || -| appfuse-basic-jsf | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and JSF | -| appfuse-basic-spring | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and Spring MVC | -| appfuse-basic-struts | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and Struts 2 | -| appfuse-basic-tapestry | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a web application with Hibernate, Spring and Tapestry 4 | -| appfuse-core | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a jar application with Hibernate and Spring and XFire | -| appfuse-modular-jsf | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and JSF | -| appfuse-modular-spring | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and Spring MVC | -| appfuse-modular-struts | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and Struts 2 | -| appfuse-modular-tapestry | org.appfuse.archetypes | 2.0 | [http://static.appfuse.org/releases] | AppFuse archetype for creating a modular application with Hibernate, Spring and Tapestry 4 | -| maven-archetype-j2ee-simple | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple J2EE Java application | -| maven-archetype-marmalade-mojo | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A Maven plugin development project using marmalade | -| maven-archetype-mojo | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A Maven Java plugin development project | -| maven-archetype-portlet | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple portlet application | -| maven-archetype-profiles | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | | -| maven-archetype-quickstart | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | | -| maven-archetype-simple | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | | -| maven-archetype-site-simple | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple site generation project | -| maven-archetype-site | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A more complex site project | -| maven-archetype-webapp | org.apache.maven.archetypes | | [http://repo1.maven.org/maven2] | A simple Java web application | -| struts2-archetype-starter | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A starter Struts 2 application with Sitemesh, DWR, and Spring | -| struts2-archetype-blank | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A minimal Struts 2 application | -| struts2-archetype-portlet | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A minimal Struts 2 application that can be deployed as a portlet | -| struts2-archetype-dbportlet | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A starter Struts 2 portlet that demonstrates a simple CRUD interface with db backing | -| struts2-archetype-plugin | org.apache.struts | 2.0.9-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A Struts 2 plugin | -| shale-archetype-blank | org.apache.shale | 1.0.3-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | A blank Shale web application with JSF | -| maven-adf-archetype | org.apache.myfaces.adfbuild | 1.0-SNAPSHOT | [http://people.apache.org/repo/m2-snapshot-repository] | Archetype to ease the burden of creating a new application based with ADF | -| data-app | net.databinder | 0.4 | [http://repo1.maven.org/maven2] | A new Databinder application with sources and resources. | -| jini-service-archetype | org.jini.maven-jini-plugin | 2.0 | [http://repo1.maven.org/maven2] | Archetype for Jini service project creation | -| softeu-archetype-seam | org.apache.maven.archetypes | | [http://maven.softeu.cz/] | JSF+Facelets+Seam Archetype | -| softeu-archetype-seam-simple | org.apache.maven.archetypes | | [http://maven.softeu.cz/] | JSF+Facelets+Seam (no persistence) Archetype | -| softeu-archetype-jsf | org.apache.maven.archetypes | | [http://maven.softeu.cz/] | JSF+Facelets Archetype | -| jpa-maven-archetype | com.rfc.maven.archetypes | | [http://maven.rodcoffin.com/repo] | JPA application | -| spring-osgi-bundle-archetype | org.springframework.osgi | 1.0-m3-SNAPSHOT | [http://static.springframework.org/maven2-snapshots] | Spring-OSGi archetype | -| confluence-plugin-archetype | com.atlassian.maven.archetypes | | [http://repository.atlassian.com/maven2] | Atlassian Confluence plugin archetype | -| maven-archetype-har | net.sf.maven-har | 0.9 | [http://repo1.maven.org/maven2] | Hibernate Archive | -| maven-archetype-sar | net.sf.maven-sar | 0.9 | [http://repo1.maven.org/maven2] | JBoss Service Archive | -| wicket-archetype-quickstart | org.apache.wicket | 1.3.0-beta3 | [http://repo1.maven.org/maven2] | A simple Apache Wicket project | - -h3. Additional Information - -* There is a maven-archetypes project on java.net: -** [https://maven-archetypes.dev.java.net/] -** [https://maven-archetypes.dev.java.net/source/browse/maven-archetypes/trunk/archetypes/org/jvnet/archetypes/] - -* Webtide has some archetypes available for download and installation locally. (Not in a public repository as far as I know.) -** [http://www.webtide.com/resources.jsp] - -* A SEAM archetype is available from Lunar Logic -** [http://www.nabble.com/Announcement%3A-Seam-Archetype-t2735410s177.html] -** [http://www.lunarlogic.com/blog/show/maven_archetype_for_jboss_seam] -* JSF archetypes from SoftEU -** [http://software.softeu.cz/archetypes/jsf/] JSF+Facelets -** [http://software.softeu.cz/archetypes/seam/] JSF+Facelets+Seam ([http://software.softeu.cz/seam/] Maven Seam integration) -** [http://software.softeu.cz/archetypes/seam-simple/] JSF+Facelets+Seam (no hibernate) +</body> +</html> \ No newline at end of file