From aae1fe00ed845db069fe9e09b8db171b80a53440 Mon Sep 17 00:00:00 2001 From: evenisse Date: Fri, 27 Feb 2004 06:22:27 +0000 Subject: [PATCH] MPGENAPP-6. Add struts, struts-jstl, web and web-jstl templates. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114759 13f79535-47bb-0310-9956-ffa450edef68 --- .../struts-jstl/template-resources/.cvsignore | 6 + .../template-resources/build.properties.jboss | Bin 0 -> 490 bytes .../struts-jstl/template-resources/maven.xml | 8 + .../template-resources/project.properties | 20 ++ .../template-resources/project.xml | 253 ++++++++++++++++++ .../src/conf/ApplicationResources.properties | 1 + .../src/conf/cactus-web.xml | 5 + .../src/java/InputAction.java | 55 ++++ .../src/merge/servlet-mappings.xml | 4 + .../template-resources/src/merge/servlets.xml | 9 + .../src/merge/struts-forms.xml | 13 + .../src/merge/struts-message-resources.xml | 1 + .../src/test-cactus/HttpUnitTest.java | 51 ++++ .../src/test-cactus/StrutsTest.java | 31 +++ .../src/test/SanityTest.java | 15 ++ .../src/webapp/WEB-INF/jsp/input.jsp | 26 ++ .../struts-jstl/template.properties | 4 + .../struts/template-resources/.cvsignore | 6 + .../template-resources/build.properties.jboss | Bin 0 -> 490 bytes .../struts/template-resources/maven.xml | 8 + .../template-resources/project.properties | 20 ++ .../struts/template-resources/project.xml | 236 ++++++++++++++++ .../src/conf/ApplicationResources.properties | 1 + .../src/conf/cactus-web.xml | 5 + .../src/java/InputAction.java | 55 ++++ .../src/merge/servlet-mappings.xml | 4 + .../template-resources/src/merge/servlets.xml | 9 + .../src/merge/struts-forms.xml | 13 + .../src/merge/struts-message-resources.xml | 1 + .../src/test-cactus/HttpUnitTest.java | 51 ++++ .../src/test-cactus/StrutsTest.java | 31 +++ .../src/test/SanityTest.java | 15 ++ .../src/webapp/WEB-INF/jsp/input.jsp | 21 ++ .../struts/template.properties | 4 + .../web-jstl/template-resources/.cvsignore | 6 + .../template-resources/build.properties.jboss | Bin 0 -> 490 bytes .../web-jstl/template-resources/maven.xml | 8 + .../template-resources/project.properties | 10 + .../web-jstl/template-resources/project.xml | 170 ++++++++++++ .../src/conf/app.properties | 2 + .../src/conf/cactus-web.xml | 5 + .../src/java/HelloWorldServlet.java | 35 +++ .../test-cactus/HelloWorldServletTest.java | 24 ++ .../src/test-cactus/HttpUnitTest.java | 52 ++++ .../src/test/SanityTest.java | 15 ++ .../template-resources/src/webapp/sample.jsp | 10 + .../web-jstl/template.properties | 4 + .../web/template-resources/.cvsignore | 6 + .../template-resources/build.properties.jboss | Bin 0 -> 490 bytes .../web/template-resources/maven.xml | 8 + .../web/template-resources/project.properties | 9 + .../web/template-resources/project.xml | 153 +++++++++++ .../src/conf/app.properties | 2 + .../src/conf/cactus-web.xml | 5 + .../src/java/HelloWorldServlet.java | 35 +++ .../test-cactus/HelloWorldServletTest.java | 24 ++ .../src/test-cactus/HttpUnitTest.java | 52 ++++ .../src/test/SanityTest.java | 15 ++ .../template-resources/src/webapp/sample.jsp | 1 + .../plugin-resources/web/template.properties | 4 + 60 files changed, 1637 insertions(+) create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/.cvsignore create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/build.properties.jboss create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/maven.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/project.properties create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/project.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/ApplicationResources.properties create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/cactus-web.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/java/InputAction.java create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlet-mappings.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlets.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-forms.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-message-resources.xml create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/HttpUnitTest.java create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/StrutsTest.java create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/test/SanityTest.java create mode 100644 genapp/src/plugin-resources/struts-jstl/template-resources/src/webapp/WEB-INF/jsp/input.jsp create mode 100644 genapp/src/plugin-resources/struts-jstl/template.properties create mode 100644 genapp/src/plugin-resources/struts/template-resources/.cvsignore create mode 100644 genapp/src/plugin-resources/struts/template-resources/build.properties.jboss create mode 100644 genapp/src/plugin-resources/struts/template-resources/maven.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/project.properties create mode 100644 genapp/src/plugin-resources/struts/template-resources/project.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/conf/ApplicationResources.properties create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/conf/cactus-web.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/java/InputAction.java create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/merge/servlet-mappings.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/merge/servlets.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/merge/struts-forms.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/merge/struts-message-resources.xml create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/test-cactus/HttpUnitTest.java create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/test-cactus/StrutsTest.java create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/test/SanityTest.java create mode 100644 genapp/src/plugin-resources/struts/template-resources/src/webapp/WEB-INF/jsp/input.jsp create mode 100644 genapp/src/plugin-resources/struts/template.properties create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/.cvsignore create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/build.properties.jboss create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/maven.xml create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/project.properties create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/project.xml create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/conf/app.properties create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/conf/cactus-web.xml create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/java/HelloWorldServlet.java create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HelloWorldServletTest.java create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HttpUnitTest.java create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/test/SanityTest.java create mode 100644 genapp/src/plugin-resources/web-jstl/template-resources/src/webapp/sample.jsp create mode 100644 genapp/src/plugin-resources/web-jstl/template.properties create mode 100644 genapp/src/plugin-resources/web/template-resources/.cvsignore create mode 100644 genapp/src/plugin-resources/web/template-resources/build.properties.jboss create mode 100644 genapp/src/plugin-resources/web/template-resources/maven.xml create mode 100644 genapp/src/plugin-resources/web/template-resources/project.properties create mode 100644 genapp/src/plugin-resources/web/template-resources/project.xml create mode 100644 genapp/src/plugin-resources/web/template-resources/src/conf/app.properties create mode 100644 genapp/src/plugin-resources/web/template-resources/src/conf/cactus-web.xml create mode 100644 genapp/src/plugin-resources/web/template-resources/src/java/HelloWorldServlet.java create mode 100644 genapp/src/plugin-resources/web/template-resources/src/test-cactus/HelloWorldServletTest.java create mode 100644 genapp/src/plugin-resources/web/template-resources/src/test-cactus/HttpUnitTest.java create mode 100644 genapp/src/plugin-resources/web/template-resources/src/test/SanityTest.java create mode 100644 genapp/src/plugin-resources/web/template-resources/src/webapp/sample.jsp create mode 100644 genapp/src/plugin-resources/web/template.properties diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/.cvsignore b/genapp/src/plugin-resources/struts-jstl/template-resources/.cvsignore new file mode 100644 index 00000000..0bc9c34e --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/.cvsignore @@ -0,0 +1,6 @@ +target +.classpath +.project +*.log +build.xml +build.properties diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/build.properties.jboss b/genapp/src/plugin-resources/struts-jstl/template-resources/build.properties.jboss new file mode 100644 index 0000000000000000000000000000000000000000..936f4802229bf4bf3a4fe4a368490a976e59b3b2 GIT binary patch literal 490 zcma)2K~BRk5ab*wf3VVX9B6w&@}X)$;s8PdA#TWVCat5yw$>Ze{2n(dT*GZ=cXnoX zR^lzd*me?H?6u)B3PxmMykl)0NamTD`|{)m$gcJ=Zq90dUv+DsnsK?2Yq|OAz&w@P zRNrm$Z1tziCy393H$7Mc@&UvaQM8`KWz--VvVlG2*`UAS + + + + + + + diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/project.properties b/genapp/src/plugin-resources/struts-jstl/template-resources/project.properties new file mode 100644 index 00000000..a0a92334 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/project.properties @@ -0,0 +1,20 @@ +maven.xdoc.date=left +maven.eclipse.classpath.include=src/test-cactus,src/conf +maven.war.webapp.dir=${maven.build.dir}/xdoclet/webdoclet +maven.xdoclet.webdoclet.0=true +maven.xdoclet.webdoclet.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.0.mergeDir=src/merge +maven.xdoclet.webdoclet.strutsconfigxml.0=true +maven.xdoclet.webdoclet.strutsconfigxml.0.validateXML=true +maven.xdoclet.webdoclet.strutsconfigxml.0.Version=1.1 +maven.xdoclet.webdoclet.strutsconfigxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.strutsconfigxml.0.mergeDir=src/merge +maven.xdoclet.webdoclet.strutsvalidationxml.0=true +maven.xdoclet.webdoclet.strutsvalidationxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.jbosswebxml.0=true +maven.xdoclet.webdoclet.jbosswebxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.deploymentdescriptor.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.deploymentdescriptor.0.mergeDir=src/merge +maven.xdoclet.webdoclet.fileset.0.include=**/*.java +maven.xdoclet.webdoclet.jsptaglib.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF/tld +cactus.src.mergewebxml = src/conf/cactus-web.xml diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/project.xml b/genapp/src/plugin-resources/struts-jstl/template-resources/project.xml new file mode 100644 index 00000000..a9f237f1 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/project.xml @@ -0,0 +1,253 @@ + + + + + + 3 + + + @ID@ + @ID@ + + + @NAME@ + + + 1.0 + + + + Apache Software Foundation + http://www.apache.org/ + http://maven.apache.org/images/jakarta-logo-blue.gif + + + + 2004 + @PACKAGE@ + http://maven.apache.org/images/maven.jpg + A collection of example projects showing how to use maven in different situations + + + How to use maven in different situations + + + http://maven.apache.org/reference/plugins/examples/ + http://nagoya.apache.org/scarab/servlet/scarab/ + jakarta.apache.org + /www/maven.apache.org/reference/plugins/examples/ + /www/maven.apache.org/builds/ + + + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/examples + http://cvs.apache.org/viewcvs/maven-plugins/examples/ + + + + + + + + + + + + + junit + 3.8.1 + + + + servletapi + 2.3 + + + + jstl + 1.0.2 + + true + + + + + taglibs + standard + 1.0.4 + + true + + + + + cactus + cactus + 13-1.6dev-20040115 + + + + commons-logging + commons-logging + 1.0.3 + + true + + + + + + struts + struts + 1.1 + + true + + + + + struts + struts-bean + 1.1 + tld + + true + + + + + struts + struts-html + 1.1 + tld + + true + + + + + struts + struts-logic + 1.1 + tld + + true + + + + + strutstestcase + strutstest + 2.1.0 + + true + + + + + commons-beanutils + commons-beanutils + 1.6 + + true + + + + + commons-digester + commons-digester + 1.5 + + true + + + + + commons-collections + commons-collections + 3.0 + + true + + + + + + xdoclet + 1.2 + + + + xdoclet + xdoclet-web-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xdoclet-ejb-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xdoclet-apache-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xjavadoc + 1.0.2 + http://xdoclet.sf.net/ + + + + + httpunit + httpunit + 1.5.4 + + true + + + + + jtidy + jtidy + 4aug2000r7-dev + + true + + + + + + + turbine-maven-dev@jakarta.apache.org + src/java + src/test + + + **/*Test.java + + + **/NaughtyTest.java + + + + + src/conf + + *.properties + + + + + diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/ApplicationResources.properties b/genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/ApplicationResources.properties new file mode 100644 index 00000000..72b211cc --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/ApplicationResources.properties @@ -0,0 +1 @@ +title.page=The title @PACKAGE@ \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/cactus-web.xml b/genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/cactus-web.xml new file mode 100644 index 00000000..1300e433 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/conf/cactus-web.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/java/InputAction.java b/genapp/src/plugin-resources/struts-jstl/template-resources/src/java/InputAction.java new file mode 100644 index 00000000..9743507f --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/java/InputAction.java @@ -0,0 +1,55 @@ +package @PACKAGE@; + +import java.io.IOException; +import java.util.Date; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; + + +/** + * This is a simple struts action that simply redirects the input back to itself. It + * also sets a bean value to the current date. + * + * @struts.action + * name="TestForm" + * path="/TestInput" + * @struts.action-forward + * name="success" + * path="/WEB-INF/jsp/input.jsp" + * + * @author Archimedes Trajano + * @version $Id: InputAction.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class InputAction extends Action { + /** + * Performs the simple action + * + * @param mapping + * the action mappings where you find the return value of the + * forward + * @param actionForm + * the action form used, in this example it will be an instance + * of the DynaActionForm class + * @param request + * the HTTP servlet request + * @param response + * the HTTP servlet response + */ + public ActionForward perform(ActionMapping mapping, ActionForm actionForm, + HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + if (actionForm != null) { + DynaActionForm form = (DynaActionForm) actionForm; + form.set("theDate", new Date()); + } + return (mapping.findForward("success")); + } +} diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlet-mappings.xml b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlet-mappings.xml new file mode 100644 index 00000000..37b247eb --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlet-mappings.xml @@ -0,0 +1,4 @@ + + action + *.do + diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlets.xml b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlets.xml new file mode 100644 index 00000000..08d4e9b7 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/servlets.xml @@ -0,0 +1,9 @@ + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + 1 + \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-forms.xml b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-forms.xml new file mode 100644 index 00000000..41298607 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-forms.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-message-resources.xml b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-message-resources.xml new file mode 100644 index 00000000..e53ea563 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/merge/struts-message-resources.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/HttpUnitTest.java b/genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/HttpUnitTest.java new file mode 100644 index 00000000..0c445fbd --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/HttpUnitTest.java @@ -0,0 +1,51 @@ +package @PACKAGE@; + +import org.apache.cactus.ServletTestCase; + +import com.meterware.httpunit.WebConversation; +import com.meterware.httpunit.WebForm; + +/** + * This tests the site using HttpUnit + * + * @author Archimedes Trajano + * @version $Id: HttpUnitTest.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class HttpUnitTest extends ServletTestCase { + /** + * This is a helper method to create the URL string for the initial web + * conversation request + * + * @param relativeUrl + * the relative URL including the leading"/" + * @return the context url with the relative URL appended to it + */ + private String requestUrl(String relativeUrl) { + StringBuffer url = request.getRequestURL(); + url.delete(url.lastIndexOf("/"), url.length()); + url.append(relativeUrl); + return url.toString(); + } + + /** + * This tests if the sample struts form works properly + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testStrutsPages() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/TestInput.do")); + { + WebForm form = wc.getCurrentPage().getForms()[0]; + form.setParameter("givenName", "Archie"); + form.setParameter("familyName", "Trajano"); + form.submit(); + } + { + WebForm form = wc.getCurrentPage().getForms()[0]; + assertEquals("Archie", form.getParameterValue("givenName")); + assertEquals("Trajano", form.getParameterValue("familyName")); + } + } +}; \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/StrutsTest.java b/genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/StrutsTest.java new file mode 100644 index 00000000..c55ad204 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/test-cactus/StrutsTest.java @@ -0,0 +1,31 @@ +package @PACKAGE@; + +import servletunit.struts.CactusStrutsTestCase; + +/** + * This tests the functionality of the StrutsTestCase + * + * @author Archimedes Trajano + * @version $Id: StrutsTest.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class StrutsTest extends CactusStrutsTestCase { + + /** + * Required constructor for CactusStrutsTestCase + * + * @param name + * name of the test + */ + public StrutsTest(String name) { + super(name); + } + + public void testInputForm() throws Exception { + setRequestPathInfo("/TestInput.do"); + addRequestParameter("givenName", "Archie"); + addRequestParameter("familyName", "Trajano"); + actionPerform(); + verifyForward("success"); + verifyNoActionErrors(); + } +} diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/test/SanityTest.java b/genapp/src/plugin-resources/struts-jstl/template-resources/src/test/SanityTest.java new file mode 100644 index 00000000..e931ebe1 --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/test/SanityTest.java @@ -0,0 +1,15 @@ +package @PACKAGE@; + +import junit.framework.TestCase; + +/** + * This is a simple JUnit test case to ensure that the environment is okay. + * + * @author Archimedes Trajano + * @version $Id: SanityTest.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class SanityTest extends TestCase { + public void testSanity() { + assertEquals( "test", "test" ); + } +} diff --git a/genapp/src/plugin-resources/struts-jstl/template-resources/src/webapp/WEB-INF/jsp/input.jsp b/genapp/src/plugin-resources/struts-jstl/template-resources/src/webapp/WEB-INF/jsp/input.jsp new file mode 100644 index 00000000..fff4fd8d --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template-resources/src/webapp/WEB-INF/jsp/input.jsp @@ -0,0 +1,26 @@ +<%@ page contentType="text/html; charset=utf-8" %> + +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> +<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %> +<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> + +<%@ taglib uri="/WEB-INF/tld/struts-bean-1.1.tld" prefix="bean" %> +<%@ taglib uri="/WEB-INF/tld/struts-html-1.1.tld" prefix="html" %> +<%@ taglib uri="/WEB-INF/tld/struts-logic-1.1.tld" prefix="logic" %> + + + + + <bean:message key="title.page"/> + + + +

The name is , on

+ + + + + + +
diff --git a/genapp/src/plugin-resources/struts-jstl/template.properties b/genapp/src/plugin-resources/struts-jstl/template.properties new file mode 100644 index 00000000..17ccc68a --- /dev/null +++ b/genapp/src/plugin-resources/struts-jstl/template.properties @@ -0,0 +1,4 @@ +maven.genapp.repackage=java,test,test-cactus +maven.genapp.filter=project.xml,src/conf/cactus-web.xml,src/merge/** + +maven.genapp.default.package=example.web diff --git a/genapp/src/plugin-resources/struts/template-resources/.cvsignore b/genapp/src/plugin-resources/struts/template-resources/.cvsignore new file mode 100644 index 00000000..0bc9c34e --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/.cvsignore @@ -0,0 +1,6 @@ +target +.classpath +.project +*.log +build.xml +build.properties diff --git a/genapp/src/plugin-resources/struts/template-resources/build.properties.jboss b/genapp/src/plugin-resources/struts/template-resources/build.properties.jboss new file mode 100644 index 0000000000000000000000000000000000000000..936f4802229bf4bf3a4fe4a368490a976e59b3b2 GIT binary patch literal 490 zcma)2K~BRk5ab*wf3VVX9B6w&@}X)$;s8PdA#TWVCat5yw$>Ze{2n(dT*GZ=cXnoX zR^lzd*me?H?6u)B3PxmMykl)0NamTD`|{)m$gcJ=Zq90dUv+DsnsK?2Yq|OAz&w@P zRNrm$Z1tziCy393H$7Mc@&UvaQM8`KWz--VvVlG2*`UAS + + + + + + + diff --git a/genapp/src/plugin-resources/struts/template-resources/project.properties b/genapp/src/plugin-resources/struts/template-resources/project.properties new file mode 100644 index 00000000..65a1d505 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/project.properties @@ -0,0 +1,20 @@ +maven.xdoc.date=left +maven.eclipse.classpath.include=src/test-cactus,src/conf +maven.war.webapp.dir=${maven.build.dir}/xdoclet/webdoclet +maven.xdoclet.webdoclet.0=true +maven.xdoclet.webdoclet.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.0.mergeDir=src/merge +maven.xdoclet.webdoclet.strutsconfigxml.0=true +maven.xdoclet.webdoclet.strutsconfigxml.0.validateXML=true +maven.xdoclet.webdoclet.strutsconfigxml.0.Version=1.1 +maven.xdoclet.webdoclet.strutsconfigxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +#maven.xdoclet.webdoclet.strutsconfigxml.0.destDir=target +maven.xdoclet.webdoclet.strutsconfigxml.0.mergeDir=src/merge +maven.xdoclet.webdoclet.strutsvalidationxml.0=true +maven.xdoclet.webdoclet.strutsvalidationxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.jbosswebxml.0=true +maven.xdoclet.webdoclet.jbosswebxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.deploymentdescriptor.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.deploymentdescriptor.0.mergeDir=src/merge +maven.xdoclet.webdoclet.fileset.0.include=**/*.java +cactus.src.mergewebxml = src/conf/cactus-web.xml diff --git a/genapp/src/plugin-resources/struts/template-resources/project.xml b/genapp/src/plugin-resources/struts/template-resources/project.xml new file mode 100644 index 00000000..cc0c25fe --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/project.xml @@ -0,0 +1,236 @@ + + + + + + 3 + + + @ID@ + @ID@ + + + @NAME@ + + + 1.0 + + + + Apache Software Foundation + http://www.apache.org/ + http://maven.apache.org/images/jakarta-logo-blue.gif + + + + 2004 + @PACKAGE@ + http://maven.apache.org/images/maven.jpg + A collection of example projects showing how to use maven in different situations + + + How to use maven in different situations + + + http://maven.apache.org/reference/plugins/examples/ + http://nagoya.apache.org/scarab/servlet/scarab/ + jakarta.apache.org + /www/maven.apache.org/reference/plugins/examples/ + /www/maven.apache.org/builds/ + + + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/examples + http://cvs.apache.org/viewcvs/maven-plugins/examples/ + + + + + + + + + + + + + junit + 3.8.1 + + + + servletapi + 2.3 + + + + cactus + cactus + 13-1.6dev-20040115 + + + + commons-logging + commons-logging + 1.0.3 + + true + + + + + + struts + struts + 1.1 + + true + + + + + struts + struts-bean + 1.1 + tld + + true + + + + + struts + struts-html + 1.1 + tld + + true + + + + + struts + struts-logic + 1.1 + tld + + true + + + + + strutstestcase + strutstest + 2.1.0 + + true + + + + + commons-beanutils + commons-beanutils + 1.6 + + true + + + + + commons-digester + commons-digester + 1.5 + + true + + + + + commons-collections + commons-collections + 3.0 + + true + + + + + + xdoclet + 1.2 + + + + xdoclet + xdoclet-web-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xdoclet-ejb-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xdoclet-apache-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xjavadoc + 1.0.2 + http://xdoclet.sf.net/ + + + + + httpunit + httpunit + 1.5.4 + + true + + + + + jtidy + jtidy + 4aug2000r7-dev + + true + + + + + + + turbine-maven-dev@jakarta.apache.org + src/java + src/test + + + **/*Test.java + + + **/NaughtyTest.java + + + + + src/conf + + *.properties + + + + + diff --git a/genapp/src/plugin-resources/struts/template-resources/src/conf/ApplicationResources.properties b/genapp/src/plugin-resources/struts/template-resources/src/conf/ApplicationResources.properties new file mode 100644 index 00000000..72b211cc --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/conf/ApplicationResources.properties @@ -0,0 +1 @@ +title.page=The title @PACKAGE@ \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts/template-resources/src/conf/cactus-web.xml b/genapp/src/plugin-resources/struts/template-resources/src/conf/cactus-web.xml new file mode 100644 index 00000000..1300e433 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/conf/cactus-web.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/genapp/src/plugin-resources/struts/template-resources/src/java/InputAction.java b/genapp/src/plugin-resources/struts/template-resources/src/java/InputAction.java new file mode 100644 index 00000000..9743507f --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/java/InputAction.java @@ -0,0 +1,55 @@ +package @PACKAGE@; + +import java.io.IOException; +import java.util.Date; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; + + +/** + * This is a simple struts action that simply redirects the input back to itself. It + * also sets a bean value to the current date. + * + * @struts.action + * name="TestForm" + * path="/TestInput" + * @struts.action-forward + * name="success" + * path="/WEB-INF/jsp/input.jsp" + * + * @author Archimedes Trajano + * @version $Id: InputAction.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class InputAction extends Action { + /** + * Performs the simple action + * + * @param mapping + * the action mappings where you find the return value of the + * forward + * @param actionForm + * the action form used, in this example it will be an instance + * of the DynaActionForm class + * @param request + * the HTTP servlet request + * @param response + * the HTTP servlet response + */ + public ActionForward perform(ActionMapping mapping, ActionForm actionForm, + HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + if (actionForm != null) { + DynaActionForm form = (DynaActionForm) actionForm; + form.set("theDate", new Date()); + } + return (mapping.findForward("success")); + } +} diff --git a/genapp/src/plugin-resources/struts/template-resources/src/merge/servlet-mappings.xml b/genapp/src/plugin-resources/struts/template-resources/src/merge/servlet-mappings.xml new file mode 100644 index 00000000..37b247eb --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/merge/servlet-mappings.xml @@ -0,0 +1,4 @@ + + action + *.do + diff --git a/genapp/src/plugin-resources/struts/template-resources/src/merge/servlets.xml b/genapp/src/plugin-resources/struts/template-resources/src/merge/servlets.xml new file mode 100644 index 00000000..08d4e9b7 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/merge/servlets.xml @@ -0,0 +1,9 @@ + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + 1 + \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts/template-resources/src/merge/struts-forms.xml b/genapp/src/plugin-resources/struts/template-resources/src/merge/struts-forms.xml new file mode 100644 index 00000000..41298607 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/merge/struts-forms.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/genapp/src/plugin-resources/struts/template-resources/src/merge/struts-message-resources.xml b/genapp/src/plugin-resources/struts/template-resources/src/merge/struts-message-resources.xml new file mode 100644 index 00000000..e53ea563 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/merge/struts-message-resources.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts/template-resources/src/test-cactus/HttpUnitTest.java b/genapp/src/plugin-resources/struts/template-resources/src/test-cactus/HttpUnitTest.java new file mode 100644 index 00000000..0c445fbd --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/test-cactus/HttpUnitTest.java @@ -0,0 +1,51 @@ +package @PACKAGE@; + +import org.apache.cactus.ServletTestCase; + +import com.meterware.httpunit.WebConversation; +import com.meterware.httpunit.WebForm; + +/** + * This tests the site using HttpUnit + * + * @author Archimedes Trajano + * @version $Id: HttpUnitTest.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class HttpUnitTest extends ServletTestCase { + /** + * This is a helper method to create the URL string for the initial web + * conversation request + * + * @param relativeUrl + * the relative URL including the leading"/" + * @return the context url with the relative URL appended to it + */ + private String requestUrl(String relativeUrl) { + StringBuffer url = request.getRequestURL(); + url.delete(url.lastIndexOf("/"), url.length()); + url.append(relativeUrl); + return url.toString(); + } + + /** + * This tests if the sample struts form works properly + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testStrutsPages() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/TestInput.do")); + { + WebForm form = wc.getCurrentPage().getForms()[0]; + form.setParameter("givenName", "Archie"); + form.setParameter("familyName", "Trajano"); + form.submit(); + } + { + WebForm form = wc.getCurrentPage().getForms()[0]; + assertEquals("Archie", form.getParameterValue("givenName")); + assertEquals("Trajano", form.getParameterValue("familyName")); + } + } +}; \ No newline at end of file diff --git a/genapp/src/plugin-resources/struts/template-resources/src/test-cactus/StrutsTest.java b/genapp/src/plugin-resources/struts/template-resources/src/test-cactus/StrutsTest.java new file mode 100644 index 00000000..c55ad204 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/test-cactus/StrutsTest.java @@ -0,0 +1,31 @@ +package @PACKAGE@; + +import servletunit.struts.CactusStrutsTestCase; + +/** + * This tests the functionality of the StrutsTestCase + * + * @author Archimedes Trajano + * @version $Id: StrutsTest.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class StrutsTest extends CactusStrutsTestCase { + + /** + * Required constructor for CactusStrutsTestCase + * + * @param name + * name of the test + */ + public StrutsTest(String name) { + super(name); + } + + public void testInputForm() throws Exception { + setRequestPathInfo("/TestInput.do"); + addRequestParameter("givenName", "Archie"); + addRequestParameter("familyName", "Trajano"); + actionPerform(); + verifyForward("success"); + verifyNoActionErrors(); + } +} diff --git a/genapp/src/plugin-resources/struts/template-resources/src/test/SanityTest.java b/genapp/src/plugin-resources/struts/template-resources/src/test/SanityTest.java new file mode 100644 index 00000000..e931ebe1 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/test/SanityTest.java @@ -0,0 +1,15 @@ +package @PACKAGE@; + +import junit.framework.TestCase; + +/** + * This is a simple JUnit test case to ensure that the environment is okay. + * + * @author Archimedes Trajano + * @version $Id: SanityTest.java,v 1.1 2004/02/27 06:22:26 evenisse Exp $ + */ +public class SanityTest extends TestCase { + public void testSanity() { + assertEquals( "test", "test" ); + } +} diff --git a/genapp/src/plugin-resources/struts/template-resources/src/webapp/WEB-INF/jsp/input.jsp b/genapp/src/plugin-resources/struts/template-resources/src/webapp/WEB-INF/jsp/input.jsp new file mode 100644 index 00000000..483a3b83 --- /dev/null +++ b/genapp/src/plugin-resources/struts/template-resources/src/webapp/WEB-INF/jsp/input.jsp @@ -0,0 +1,21 @@ +<%@ page contentType="text/html; charset=utf-8" %> + +<%@ taglib uri="/WEB-INF/tld/struts-bean-1.1.tld" prefix="bean" %> +<%@ taglib uri="/WEB-INF/tld/struts-html-1.1.tld" prefix="html" %> +<%@ taglib uri="/WEB-INF/tld/struts-logic-1.1.tld" prefix="logic" %> + + + + + <bean:message key="title.page"/> + + + +

The name is , on

+ + + + + + +
diff --git a/genapp/src/plugin-resources/struts/template.properties b/genapp/src/plugin-resources/struts/template.properties new file mode 100644 index 00000000..17ccc68a --- /dev/null +++ b/genapp/src/plugin-resources/struts/template.properties @@ -0,0 +1,4 @@ +maven.genapp.repackage=java,test,test-cactus +maven.genapp.filter=project.xml,src/conf/cactus-web.xml,src/merge/** + +maven.genapp.default.package=example.web diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/.cvsignore b/genapp/src/plugin-resources/web-jstl/template-resources/.cvsignore new file mode 100644 index 00000000..0bc9c34e --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/.cvsignore @@ -0,0 +1,6 @@ +target +.classpath +.project +*.log +build.xml +build.properties diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/build.properties.jboss b/genapp/src/plugin-resources/web-jstl/template-resources/build.properties.jboss new file mode 100644 index 0000000000000000000000000000000000000000..936f4802229bf4bf3a4fe4a368490a976e59b3b2 GIT binary patch literal 490 zcma)2K~BRk5ab*wf3VVX9B6w&@}X)$;s8PdA#TWVCat5yw$>Ze{2n(dT*GZ=cXnoX zR^lzd*me?H?6u)B3PxmMykl)0NamTD`|{)m$gcJ=Zq90dUv+DsnsK?2Yq|OAz&w@P zRNrm$Z1tziCy393H$7Mc@&UvaQM8`KWz--VvVlG2*`UAS + + + + + + + diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/project.properties b/genapp/src/plugin-resources/web-jstl/template-resources/project.properties new file mode 100644 index 00000000..1f41da45 --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/project.properties @@ -0,0 +1,10 @@ +maven.xdoc.date=left +maven.eclipse.classpath.include=src/test-cactus +maven.war.webapp.dir=${maven.build.dir}/xdoclet/webdoclet +maven.xdoclet.webdoclet.0=true +maven.xdoclet.webdoclet.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.0.mergeDir=src/merge +maven.xdoclet.webdoclet.deploymentdescriptor.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.deploymentdescriptor.0.mergeDir=src/merge +maven.xdoclet.webdoclet.jsptaglib.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF/tld +cactus.src.mergewebxml = src/conf/cactus-web.xml diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/project.xml b/genapp/src/plugin-resources/web-jstl/template-resources/project.xml new file mode 100644 index 00000000..d4b15220 --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/project.xml @@ -0,0 +1,170 @@ + + + + + + 3 + + + @ID@ + @ID@ + + + @NAME@ + + + 1.0 + + + + Apache Software Foundation + http://www.apache.org/ + http://maven.apache.org/images/jakarta-logo-blue.gif + + + + 2004 + @PACKAGE@ + http://maven.apache.org/images/maven.jpg + A collection of example projects showing how to use maven in different situations + + + How to use maven in different situations + + + http://maven.apache.org/reference/plugins/examples/ + http://nagoya.apache.org/scarab/servlet/scarab/ + jakarta.apache.org + /www/maven.apache.org/reference/plugins/examples/ + /www/maven.apache.org/builds/ + + + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/examples + http://cvs.apache.org/viewcvs/maven-plugins/examples/ + + + + + + + + + + + + + junit + 3.8.1 + + + + servletapi + 2.3 + + + + jstl + 1.0.2 + + true + + + + + taglibs + standard + 1.0.4 + + true + + + + + cactus + cactus + 13-1.6dev-20040115 + + + + commons-logging + commons-logging + 1.0.3 + + true + + + + + + xdoclet + 1.2 + + + + xdoclet + xdoclet-web-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xdoclet-ejb-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xjavadoc + 1.0.2 + http://xdoclet.sf.net/ + + + + + httpunit + httpunit + 1.5.4 + + true + + + + + jtidy + jtidy + 4aug2000r7-dev + + true + + + + + + + turbine-maven-dev@jakarta.apache.org + src/java + src/test + + + **/*Test.java + + + **/NaughtyTest.java + + + + + src/conf + + *.properties + + + + + diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/conf/app.properties b/genapp/src/plugin-resources/web-jstl/template-resources/src/conf/app.properties new file mode 100644 index 00000000..f2429655 --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/conf/app.properties @@ -0,0 +1,2 @@ +# Sample app properties. +foo=bar diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/conf/cactus-web.xml b/genapp/src/plugin-resources/web-jstl/template-resources/src/conf/cactus-web.xml new file mode 100644 index 00000000..1300e433 --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/conf/cactus-web.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/java/HelloWorldServlet.java b/genapp/src/plugin-resources/web-jstl/template-resources/src/java/HelloWorldServlet.java new file mode 100644 index 00000000..f8aa393c --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/java/HelloWorldServlet.java @@ -0,0 +1,35 @@ +package @PACKAGE@; + +import java.io.IOException; +import java.util.Date; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * This is a sample servlet, typically you would not use this, but it is useful + * for testing the sanity of your web application configuration. + * + * @web.servlet name="HelloWorld" + * @web.servlet-mapping url-pattern="/HelloWorld" + * + * @author Archimedes Trajano + * @version $Id: HelloWorldServlet.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class HelloWorldServlet extends HttpServlet { + /** + * This prints out the standard "Hello world" message with a date stamp. + * + * @param request + * the HTTP request object + * @param response + * the HTTP response object + * @throws IOException + * thrown when there is a problem getting the writer + */ + protected void doGet(HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.getWriter().println("Hello world on " + new Date()); + } +} diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HelloWorldServletTest.java b/genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HelloWorldServletTest.java new file mode 100644 index 00000000..5282547e --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HelloWorldServletTest.java @@ -0,0 +1,24 @@ +package @PACKAGE@; + +import org.apache.cactus.ServletTestCase; +import org.apache.cactus.WebResponse; + +import @PACKAGE@.HelloWorldServlet; + +/** + * This tests that the HelloWorld servlet is functioning + * + * @author Archimedes Trajano + * @version $Id: HelloWorldServletTest.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class HelloWorldServletTest extends ServletTestCase { + + public void testHelloWorld() throws Exception { + HelloWorldServlet servlet = new HelloWorldServlet(); + servlet.doGet(request,response); + } + + public void endHelloWorld(WebResponse response) { + assertTrue(response.getText().startsWith("Hello world on")); + } +} diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HttpUnitTest.java b/genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HttpUnitTest.java new file mode 100644 index 00000000..eb637f9f --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/test-cactus/HttpUnitTest.java @@ -0,0 +1,52 @@ +package @PACKAGE@; + +import org.apache.cactus.ServletTestCase; + +import com.meterware.httpunit.WebConversation; + +/** + * This tests the system using the HttpUnit + * @author Archimedes Trajano + * @version $Id: HttpUnitTest.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class HttpUnitTest extends ServletTestCase { + + /** + * This tests if the Hello World servlet provides the correct output + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testHelloWorldServlet() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/HelloWorld")); + assertTrue(wc.getCurrentPage().getText().startsWith("Hello world on")); + } + + /** + * This tests if the Hello World JSP provides the correct output + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testHelloWorldJsp() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/sample.jsp")); + assertTrue(wc.getCurrentPage().getText().indexOf("Hello world JSP on") != -1); + } + + /** + * This is a helper method to create the URL string for the initial web + * conversation request + * + * @param relativeUrl + * the relative URL including the leading"/" + * @return the context url with the relative URL appended to it + */ + private String requestUrl(String relativeUrl) { + StringBuffer url = request.getRequestURL(); + url.delete(url.lastIndexOf("/"), url.length()); + url.append(relativeUrl); + return url.toString(); + } +} diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/test/SanityTest.java b/genapp/src/plugin-resources/web-jstl/template-resources/src/test/SanityTest.java new file mode 100644 index 00000000..2a7fe06b --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/test/SanityTest.java @@ -0,0 +1,15 @@ +package @PACKAGE@; + +import junit.framework.TestCase; + +/** + * This is a simple JUnit test case to ensure that the environment is okay. + * + * @author Archimedes Trajano + * @version $Id: SanityTest.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class SanityTest extends TestCase { + public void testSanity() { + assertEquals( "test", "test" ); + } +} diff --git a/genapp/src/plugin-resources/web-jstl/template-resources/src/webapp/sample.jsp b/genapp/src/plugin-resources/web-jstl/template-resources/src/webapp/sample.jsp new file mode 100644 index 00000000..24de79b6 --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template-resources/src/webapp/sample.jsp @@ -0,0 +1,10 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> +<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %> +<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> + + + +Hello world JSP on + + diff --git a/genapp/src/plugin-resources/web-jstl/template.properties b/genapp/src/plugin-resources/web-jstl/template.properties new file mode 100644 index 00000000..f05e75d2 --- /dev/null +++ b/genapp/src/plugin-resources/web-jstl/template.properties @@ -0,0 +1,4 @@ +maven.genapp.repackage=java,test,test-cactus +maven.genapp.filter=project.xml,src/conf/cactus-web.xml + +maven.genapp.default.package=example.web diff --git a/genapp/src/plugin-resources/web/template-resources/.cvsignore b/genapp/src/plugin-resources/web/template-resources/.cvsignore new file mode 100644 index 00000000..0bc9c34e --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/.cvsignore @@ -0,0 +1,6 @@ +target +.classpath +.project +*.log +build.xml +build.properties diff --git a/genapp/src/plugin-resources/web/template-resources/build.properties.jboss b/genapp/src/plugin-resources/web/template-resources/build.properties.jboss new file mode 100644 index 0000000000000000000000000000000000000000..936f4802229bf4bf3a4fe4a368490a976e59b3b2 GIT binary patch literal 490 zcma)2K~BRk5ab*wf3VVX9B6w&@}X)$;s8PdA#TWVCat5yw$>Ze{2n(dT*GZ=cXnoX zR^lzd*me?H?6u)B3PxmMykl)0NamTD`|{)m$gcJ=Zq90dUv+DsnsK?2Yq|OAz&w@P zRNrm$Z1tziCy393H$7Mc@&UvaQM8`KWz--VvVlG2*`UAS + + + + + + + diff --git a/genapp/src/plugin-resources/web/template-resources/project.properties b/genapp/src/plugin-resources/web/template-resources/project.properties new file mode 100644 index 00000000..b457bc87 --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/project.properties @@ -0,0 +1,9 @@ +maven.xdoc.date=left +maven.eclipse.classpath.include=src/test-cactus +maven.war.webapp.dir=${maven.build.dir}/xdoclet/webdoclet +maven.xdoclet.webdoclet.0=true +maven.xdoclet.webdoclet.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.0.mergeDir=src/merge +maven.xdoclet.webdoclet.deploymentdescriptor.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF +maven.xdoclet.webdoclet.deploymentdescriptor.0.mergeDir=src/merge +cactus.src.mergewebxml = src/conf/cactus-web.xml diff --git a/genapp/src/plugin-resources/web/template-resources/project.xml b/genapp/src/plugin-resources/web/template-resources/project.xml new file mode 100644 index 00000000..d3cbf6f1 --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/project.xml @@ -0,0 +1,153 @@ + + + + + + 3 + + + @ID@ + @ID@ + + + @NAME@ + + + 1.0 + + + + Apache Software Foundation + http://www.apache.org/ + http://maven.apache.org/images/jakarta-logo-blue.gif + + + + 2004 + @PACKAGE@ + http://maven.apache.org/images/maven.jpg + A collection of example projects showing how to use maven in different situations + + + How to use maven in different situations + + + http://maven.apache.org/reference/plugins/examples/ + http://nagoya.apache.org/scarab/servlet/scarab/ + jakarta.apache.org + /www/maven.apache.org/reference/plugins/examples/ + /www/maven.apache.org/builds/ + + + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/examples + http://cvs.apache.org/viewcvs/maven-plugins/examples/ + + + + + + + + + + + + + junit + 3.8.1 + + + + servletapi + 2.3 + + + + cactus + cactus + 13-1.6dev-20040115 + + + + commons-logging + commons-logging + 1.0.3 + + true + + + + + + xdoclet + 1.2 + + + + xdoclet + xdoclet-web-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xdoclet-ejb-module + 1.2 + http://xdoclet.sf.net/ + + + + xdoclet + xjavadoc + 1.0.2 + http://xdoclet.sf.net/ + + + + + httpunit + httpunit + 1.5.4 + + true + + + + + jtidy + jtidy + 4aug2000r7-dev + + true + + + + + + + turbine-maven-dev@jakarta.apache.org + src/java + src/test + + + **/*Test.java + + + **/NaughtyTest.java + + + + + src/conf + + *.properties + + + + + diff --git a/genapp/src/plugin-resources/web/template-resources/src/conf/app.properties b/genapp/src/plugin-resources/web/template-resources/src/conf/app.properties new file mode 100644 index 00000000..f2429655 --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/conf/app.properties @@ -0,0 +1,2 @@ +# Sample app properties. +foo=bar diff --git a/genapp/src/plugin-resources/web/template-resources/src/conf/cactus-web.xml b/genapp/src/plugin-resources/web/template-resources/src/conf/cactus-web.xml new file mode 100644 index 00000000..1300e433 --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/conf/cactus-web.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/genapp/src/plugin-resources/web/template-resources/src/java/HelloWorldServlet.java b/genapp/src/plugin-resources/web/template-resources/src/java/HelloWorldServlet.java new file mode 100644 index 00000000..f8aa393c --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/java/HelloWorldServlet.java @@ -0,0 +1,35 @@ +package @PACKAGE@; + +import java.io.IOException; +import java.util.Date; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * This is a sample servlet, typically you would not use this, but it is useful + * for testing the sanity of your web application configuration. + * + * @web.servlet name="HelloWorld" + * @web.servlet-mapping url-pattern="/HelloWorld" + * + * @author Archimedes Trajano + * @version $Id: HelloWorldServlet.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class HelloWorldServlet extends HttpServlet { + /** + * This prints out the standard "Hello world" message with a date stamp. + * + * @param request + * the HTTP request object + * @param response + * the HTTP response object + * @throws IOException + * thrown when there is a problem getting the writer + */ + protected void doGet(HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.getWriter().println("Hello world on " + new Date()); + } +} diff --git a/genapp/src/plugin-resources/web/template-resources/src/test-cactus/HelloWorldServletTest.java b/genapp/src/plugin-resources/web/template-resources/src/test-cactus/HelloWorldServletTest.java new file mode 100644 index 00000000..5282547e --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/test-cactus/HelloWorldServletTest.java @@ -0,0 +1,24 @@ +package @PACKAGE@; + +import org.apache.cactus.ServletTestCase; +import org.apache.cactus.WebResponse; + +import @PACKAGE@.HelloWorldServlet; + +/** + * This tests that the HelloWorld servlet is functioning + * + * @author Archimedes Trajano + * @version $Id: HelloWorldServletTest.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class HelloWorldServletTest extends ServletTestCase { + + public void testHelloWorld() throws Exception { + HelloWorldServlet servlet = new HelloWorldServlet(); + servlet.doGet(request,response); + } + + public void endHelloWorld(WebResponse response) { + assertTrue(response.getText().startsWith("Hello world on")); + } +} diff --git a/genapp/src/plugin-resources/web/template-resources/src/test-cactus/HttpUnitTest.java b/genapp/src/plugin-resources/web/template-resources/src/test-cactus/HttpUnitTest.java new file mode 100644 index 00000000..df3c3513 --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/test-cactus/HttpUnitTest.java @@ -0,0 +1,52 @@ +package @PACKAGE@; + +import org.apache.cactus.ServletTestCase; + +import com.meterware.httpunit.WebConversation; + +/** + * This tests the system using the HttpUnit + * @author Archimedes Trajano + * @version $Id: HttpUnitTest.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class HttpUnitTest extends ServletTestCase { + + /** + * This tests if the Hello World servlet provides the correct output + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testHelloWorldServlet() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/HelloWorld")); + assertTrue(wc.getCurrentPage().getText().startsWith("Hello world on")); + } + + /** + * This tests if the Hello World JSP provides the correct output + * + * @throws Exception + * thrown when there is a problem with the test + */ + public void testHelloWorldJsp() throws Exception { + WebConversation wc = new WebConversation(); + wc.getResponse(requestUrl("/sample.jsp")); + assertTrue(wc.getCurrentPage().getText().startsWith("Hello world JSP on")); + } + + /** + * This is a helper method to create the URL string for the initial web + * conversation request + * + * @param relativeUrl + * the relative URL including the leading"/" + * @return the context url with the relative URL appended to it + */ + private String requestUrl(String relativeUrl) { + StringBuffer url = request.getRequestURL(); + url.delete(url.lastIndexOf("/"), url.length()); + url.append(relativeUrl); + return url.toString(); + } +} diff --git a/genapp/src/plugin-resources/web/template-resources/src/test/SanityTest.java b/genapp/src/plugin-resources/web/template-resources/src/test/SanityTest.java new file mode 100644 index 00000000..2a7fe06b --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/test/SanityTest.java @@ -0,0 +1,15 @@ +package @PACKAGE@; + +import junit.framework.TestCase; + +/** + * This is a simple JUnit test case to ensure that the environment is okay. + * + * @author Archimedes Trajano + * @version $Id: SanityTest.java,v 1.1 2004/02/27 06:22:27 evenisse Exp $ + */ +public class SanityTest extends TestCase { + public void testSanity() { + assertEquals( "test", "test" ); + } +} diff --git a/genapp/src/plugin-resources/web/template-resources/src/webapp/sample.jsp b/genapp/src/plugin-resources/web/template-resources/src/webapp/sample.jsp new file mode 100644 index 00000000..d6736526 --- /dev/null +++ b/genapp/src/plugin-resources/web/template-resources/src/webapp/sample.jsp @@ -0,0 +1 @@ +Hello world JSP on <%= new java.util.Date() %> diff --git a/genapp/src/plugin-resources/web/template.properties b/genapp/src/plugin-resources/web/template.properties new file mode 100644 index 00000000..f05e75d2 --- /dev/null +++ b/genapp/src/plugin-resources/web/template.properties @@ -0,0 +1,4 @@ +maven.genapp.repackage=java,test,test-cactus +maven.genapp.filter=project.xml,src/conf/cactus-web.xml + +maven.genapp.default.package=example.web