You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by gm...@apache.org on 2013/04/15 00:21:50 UTC

svn commit: r1467837 - in /incubator/jspwiki/trunk: ChangeLog build.xml pom.xml tests/etc/selenium/tests/all/TestSuite.html

Author: gmazza
Date: Sun Apr 14 22:21:49 2013
New Revision: 1467837

URL: http://svn.apache.org/r1467837
Log:
More work on Selenium webtests in Maven

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/build.xml
    incubator/jspwiki/trunk/pom.xml
    incubator/jspwiki/trunk/tests/etc/selenium/tests/all/TestSuite.html

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1467837&r1=1467836&r2=1467837&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Sun Apr 14 22:21:49 2013
@@ -1,3 +1,11 @@
+2013-04-14 Glen Mazza (glenmazza AT apache DOT org)
+
+       * Start of Selenium plugin (just testing prior to it moving into its own module)
+         
+       * Tomcat 5.x JSP precompilation option removed from build.xml
+
+       * Selenium TestSuite.html tests renamed to CamelCase to allow export-to-Java to work.
+
 2013-04-07  Juan Pablo Santos (juanpablo AT apache DOT org)
 
        * 2.9.1-incubating-0

Modified: incubator/jspwiki/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/build.xml?rev=1467837&r1=1467836&r2=1467837&view=diff
==============================================================================
--- incubator/jspwiki/trunk/build.xml (original)
+++ incubator/jspwiki/trunk/build.xml Sun Apr 14 22:21:49 2013
@@ -260,10 +260,6 @@
      	<!-- tests dependencies  -->
      	<get-element to-file="${libs.tests}/commons-el-1.0.jar" url="${central.url}/commons-el/commons-el/1.0/commons-el-1.0.jar" />
      	<get-element to-file="${libs.tests}/hsqldb-1.8.0.10.jar" url="${central.url}/org/hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.jar" />
-        <get-element to-file="${libs.tests}/jasper-compiler-5.5.23.jar" 
-                     url="${central.url}/tomcat/jasper-compiler/5.5.23/jasper-compiler-5.5.23.jar" />
-        <get-element to-file="${libs.tests}/jasper-runtime-5.5.23.jar" 
-                     url="${central.url}/tomcat/jasper-runtime/5.5.23/jasper-runtime-5.5.23.jar" />
         <get-element to-file="${libs.tests}/jetty-all-7.6.7.v20120910.jar" 
                      url="${central.url}/org/eclipse/jetty/aggregate/jetty-all/7.6.7.v20120910/jetty-all-7.6.7.v20120910.jar" />
         <get-element to-file="${libs.tests}/junit-3.8.2.jar" url="${central.url}/junit/junit/3.8.2/junit-3.8.2.jar" />
@@ -1113,179 +1109,13 @@ If all of the tests ran successfully, th
         <arg line="-htmlSuite" />
         <arg line='"${webtests.browser}"' />
         <arg line='"http://localhost:${webtests.port}"' />
+        <!-- pre-filtered TestSuite.htmlin tests/etc/selenium/tests/all -->
         <arg line="${basedir}/${webtests.build}/@{context}/selenium/TestSuite.html" />
         <arg line="${webtests.reports}/@{context}.html" />
       </java>
     </sequential>
   </macrodef>
-
-  <!-- ============================================================== -->
-
-  <!-- Tomcat war pre-compilation -->
-
-  <!-- This target builds a WAR file that is specially pre-compiled
-       for use with Tomcat. By generating and pre-compiling JSPs
-       ahead of time (instead of having Tomcat do it on-the-fly
-       at runtime), we provide a slight runtime speed bump. In
-       addition, in security-conscious environments this means
-       that we can eliminate the need for the Jasper JSP compiler,
-       and can run Tomcat using just a JRE instead of a full JDK.
-
-       Pre-compilation involves three steps:
-       1) Generating the .java files that correspond to JSPWiki's JSPs.
-          The generated classes are actually servlets.
-       2) Compiling the .java files and creating a jar.file,
-          which is added to the WAR's WEB-INF/lib directory
-       3) Injecting servlet mappings into the WEB-INF/web.xml
-          file so that requests for the JSPs are mapped to the
-          servlets generated in step 1.
-
-       All of these steps are performed automatically by the
-       target "war-tomcat."
-
-       To use Tomcat pre-compilation, you need to specify
-       where Tomcat lives on your machine. This can be done
-       two ways:
-        1. Export the environment variable CATALINA_HOME, or:
-        2. Set the property "tomcat.home" in build.properties to
-           Tomcat's installation directory (e.g., /usr/local/tomcat)
-
-       NOTE: The Jasper compiler on older versions of Tomcat
-       (earlier than ~June 2004) is known to have bugs
-       that prevent the Ant "jasper2" task from running
-       successfully. So, you should probably try to use
-       a relatively recent build.
-
-       In addition to pre-compiling the servlets, "war-tomcat"
-       executes a sub-target that generates a tarball containing
-       all of JSPWiki's static content. This is quite handy for
-       environments that use Tomcat in conjunction with a front-end
-       web server such as Apache (via mod_jk/jk2 or mod_proxy).
-       The target strips out the static content (images, css, etc)
-       and adds it to a separate tar file that can be unpacked
-       in one of Apache's content directories.
-
-       To generate static content, set the properties
-       "static.user" and "static.group" in build.properties.
-       These should be set to the Unix runtime user and group
-       that should own the static files, for example the
-       user "apache" and "daemon" group. If the "static.user"
-       property is not supplied, war-tomcat skips the static
-       content generation step.
-  -->
-
-  <target name="war-tomcat"      depends="build-tomcat-war,staticzip"
-    description="Builds the WAR file for Tomcat (with pre-compiled JSPs)"/>
-
-  <target name="tomcat-init" depends="init">
-    <!-- Auto-detect whether Tomcat is available -->
-    <property name="war"               value="${code.build}/${ant.project.name}" />
-    <property name="war.tomcat"        value="${ant.project.name}-tomcat.war" />
-    <property name="tar.static"        value="${ant.project.name}-static.tar.gz" />
-    <check-property prop="env.CATALINA_HOME" />
-    <property name="tomcat.home" value="${env.CATALINA_HOME}" />
-    <echo message="Detected Tomcat: ${tomcat.home}" />
-
-    <!-- Set classpath for pre-compilation and deployment tasks -->
-    <path id="tomcat.classpath">
-      <pathelement location="${java.home}/../lib/tools.jar" />
-      <fileset dir="${tomcat.home}">
-        <!-- For Tomcat 5.5 -->
-        <include name="bin/commons-logging-api.jar" />
-        <include name="common/lib/*.jar" />
-        <include name="server/lib/*.jar" />
-        <!-- For Tomcat 6.0 -->
-        <include name="bin/tomcat-juli.jar" />
-        <include name="lib/*.jar" />
-      </fileset>
-    </path>
-  </target>
-
-  <!-- Use Jasper to generate Java class files for the JSPs.
-       Then compile and jar 'em up. Note that Tomcat's
-       Jasper task creates a web.xml "fragment" containing
-       the JSP-to-servlet mappings. We need to copy this into
-       our existing web.xml, which we do using a file
-       copy with token substitution.                       -->
-
-  <target name="compile-tomcat" depends="tomcat-init,opened-war">
-    <mkdir dir="${code.build}/jsp-java" />
-    <mkdir dir="${code.build}/jsp-classes"/>
-    <taskdef classname="org.apache.jasper.JspC" name="jasper2">
-      <classpath>
-        <path refid="tomcat.classpath" />
-        <path refid="path.base" />
-      </classpath>
-    </taskdef>
-    <jasper2
-      validateXml="false"
-      uriroot="${war}"
-      outputDir="${code.build}/jsp-java"
-      poolingEnabled="false"
-      webXmlFragment="${code.build}/web-fragment.xml" />
-    <javac srcdir="${code.build}/jsp-java" destdir="${code.build}/jsp-classes">
-      <classpath>
-        <path refid="tomcat.classpath" />
-        <path id="war.classpath">
-          <fileset dir="${war}/WEB-INF/lib">
-            <include name="*.jar" />
-          </fileset>
-        </path>
-      </classpath>
-    </javac>
-    <jar jarfile="${code.build}/jsp.jar">
-      <fileset dir="${code.build}/jsp-classes" includes="**/*.class" />
-    </jar>
-    <echo message="Adding JSP servlet mappings to web.xml" />
-    <loadfile property="generated-web.xml" srcFile="${code.build}/web-fragment.xml"/>
-    <copy file="${war}/WEB-INF/web.xml" toFile="${code.build}/web-merged.xml" overwrite="true">
-      <filterset begintoken="&lt;!--" endtoken="--&gt;">
-        <filter token=" PLACEHOLDER FOR PRE-COMPILED JSP SERVLETS " value="${generated-web.xml}" />
-      </filterset>
-    </copy>
-  </target>
-
-  <!-- Create a new war file with the new JSP jar and amended web.xml -->
-
-  <target name="build-tomcat-war" depends="compile-tomcat">
-    <war warfile="${code.build}/${war.tomcat}" webxml="${code.build}/web-merged.xml" defaultexcludes="true">
-      <webinf dir="${war}/WEB-INF">
-        <exclude name="web.xml" />
-        <exclude name="lib/*" />
-      </webinf>
-      <lib dir="${war}/WEB-INF/lib" excludes="servlet-api-2.4.jar,j2ee.jar"/>
-      <lib dir="${code.build}" includes="jsp-api-2.0.jar" />
-      <fileset dir="${war}">
-        <exclude name="WEB-INF/**" />
-        <exclude name="**/*.jsp" />
-      </fileset>
-    </war>
-  </target>
-
-  <!-- Create a tarball containing the static content.
-       User must set at least ${static.user} and preferably ${static.group}.
-       If not present, the target is skipped.
-       File permissions are owner and group read (440),
-       and for directories, owner and group read
-       and execute (550). -->
-
-  <target name="staticzip" depends="build-tomcat-war" if="static.user">
-    <property name="static.group" value="${static.user}" />
-    <tar destfile="${code.build}/${tar.static}" longfile="fail" compression="gzip">
-      <tarfileset dir="${war}" defaultexcludes="yes"
-        username="${static.user}" group="${static.group}"
-        mode="440" dirmode="550">
-        <include name="**/*.css" />
-        <include name="**/*.gif" />
-        <include name="**/*.htm" />
-        <include name="**/*.html" />
-        <include name="**/*.jpg" />
-        <include name="**/*.js" />
-        <include name="**/*.png" />
-      </tarfileset>
-    </tar>
-  </target>
-
+  
   <!-- ============================================================== -->
 
   <!-- Targets for signing JAR files -->

Modified: incubator/jspwiki/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/pom.xml?rev=1467837&r1=1467836&r2=1467837&view=diff
==============================================================================
--- incubator/jspwiki/trunk/pom.xml (original)
+++ incubator/jspwiki/trunk/pom.xml Sun Apr 14 22:21:49 2013
@@ -353,6 +353,7 @@
                         <!-- time-consuming tests excluded by default -->
                         <exclude>**/StressTestVersioningProvider.java</exclude>
                         <exclude>**/StressTestSpeed.java</exclude>
+                        <!--exclude>**/*Test.java</exclude-->
                     </excludes>
                     <includes>
                         <include>**/*Test.java</include>
@@ -479,6 +480,60 @@
                     </webResources>
                 </configuration>
             </plugin>
+            <!-- Below plugin for Selenium tests (mvn integration-test, not yet working) -->
+            <!--plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <version>8.0.0.M3</version>
+                <configuration>
+                        <scanIntervalSeconds>10</scanIntervalSeconds>
+                        <contextPath>/</contextPath>
+                        <scanIntervalSeconds>10</scanIntervalSeconds>
+                        <stopKey>STOP</stopKey>
+                        <stopPort>8005</stopPort>
+                        <port>8080</port>
+                </configuration>
+                <executions>
+                        <execution>
+                            <id>start-jetty</id>
+                            <phase>pre-integration-test</phase>
+                            <goals>
+                                <goal>stop</goal>
+                                <goal>run-exploded</goal>
+                            </goals>
+                            <configuration>
+                                <scanIntervalSeconds>0</scanIntervalSeconds>
+                                <daemon>true</daemon>
+                            </configuration>
+                        </execution>
+                        <execution>
+                            <id>stop-jetty</id>
+                            <phase>post-integration-test</phase>
+                            <goals>
+                                <goal>stop</goal>
+                            </goals>
+                        </execution>
+                    </executions>        
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>selenium-maven-plugin</artifactId>
+                <version>2.3</version>
+                <configuration>
+                    <browser>*firefox</browser>
+                    <suite>tests/build/webtests/test-custom/selenium/TestSuite.html</suite>
+                    <startURL>http://localhost:8080/JSPWiki</startURL>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>Run-Selenese-Scripts</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                           <goal>selenese</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin-->
         </plugins>
         <pluginManagement>
         	<plugins>

Modified: incubator/jspwiki/trunk/tests/etc/selenium/tests/all/TestSuite.html
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/selenium/tests/all/TestSuite.html?rev=1467837&r1=1467836&r2=1467837&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/selenium/tests/all/TestSuite.html (original)
+++ incubator/jspwiki/trunk/tests/etc/selenium/tests/all/TestSuite.html Sun Apr 14 22:21:49 2013
@@ -24,6 +24,11 @@
 <title>Test Suite</title>
 </head>
 
+<!-- Note: Selenium IDE's export-to-JUnit feature (so far not used by JSPWiki)
+uses the text contents of the anchor tags below in creating the Java class name,
+including invalid spaces and punctuation if part of the text contents.  Using 
+alphanumeric CamelCase in the text areas will keep any generated JUnit class
+names valid. -->
 <body>
 
     <table id="suiteTable"    cellpadding="1"
@@ -34,41 +39,41 @@
 		<tr><td><b>JSPWiki Test Suite for @selenium.context@</b></td></tr>
 		
         <!-- Anonymous user tests -->
-        <tr><td><a href="./AnonymousView.html">Anonymous View</a></td></tr>
-        <tr><td><a href="./AnonymousViewImage.html">Anonymous View Image</a></td></tr>
+        <tr><td><a href="./AnonymousView.html">AnonymousView</a></td></tr>
+        <tr><td><a href="./AnonymousViewImage.html">AnonymousViewImage</a></td></tr>
 
         <!-- Asserted user tests -->
-        <tr><td><a href="./AssertedName.html">Asserted Name</a></td></tr>
-        <tr><td><a href="./AssertedPermissions.html">Asserted Permissions</a></td></tr>
+        <tr><td><a href="./AssertedName.html">AssertedName</a></td></tr>
+        <tr><td><a href="./AssertedPermissions.html">AssertedPermissions</a></td></tr>
 
         <!-- Authentication tests -->
         <tr><td><a href="./Login.html">Login</a></td></tr>
         <tr><td><a href="./Logout.html">Logout</a></td></tr>
-        <tr><td><a href="./RedirectAfterLogin.html">Redirect After Login</a></td></tr>
+        <tr><td><a href="./RedirectAfterLogin.html">RedirectAfterLogin</a></td></tr>
 
         <!-- Page creation/rename tests -->
-        <tr><td><a href="./CreatePage.html">Create Page</a></td></tr>
-        <tr><td><a href="./RenamePage.html">Rename Page</a></td></tr>
+        <tr><td><a href="./CreatePage.html">CreatePage</a></td></tr>
+        <tr><td><a href="./RenamePage.html">RenamePage</a></td></tr>
         
         <!-- Page deletion tests -->
-        <tr><td><a href="./DeletePage.html">Delete Page</a></td></tr>
-        <tr><td><a href="./DeletePageNonAdmin.html">Delete Page (non admin)</a></td></tr>
+        <tr><td><a href="./DeletePage.html">DeletePage</a></td></tr>
+        <tr><td><a href="./DeletePageNonAdmin.html">DeletePageNonAdmin</a></td></tr>
         
         <!-- ACL tests -->
-        <tr><td><a href="./AclJanneEdit.html">Acl: Janne Edit (nobody else can view)</a></td></tr>
-        <tr><td><a href="./AclJanneEditAllView.html">Acl: Janne Edit (all view)</a></td></tr>
+        <tr><td><a href="./AclJanneEdit.html">AclJanneEditNobodyElseCanView</a></td></tr>
+        <tr><td><a href="./AclJanneEditAllView.html">AclJanneEditAllCanView</a></td></tr>
         
         <!-- Group creation tests -->
-        <tr><td><a href="./AnonymousCreateGroup.html">Anonymous Create Group</a></td></tr>
-        <tr><td><a href="./CreateGroupFullName.html">Create Group (FullName)</a></td></tr>
-        <tr><td><a href="./CreateGroupLoginName.html">Create Group (LoginName)</a></td></tr>
-        <tr><td><a href="./CreateGroupWikiName.html">Create Group (WikiName)</a></td></tr>
+        <tr><td><a href="./AnonymousCreateGroup.html">AnonymousCreateGroup</a></td></tr>
+        <tr><td><a href="./CreateGroupFullName.html">CreateGroupFullName</a></td></tr>
+        <tr><td><a href="./CreateGroupLoginName.html">CreateGroupLoginName</a></td></tr>
+        <tr><td><a href="./CreateGroupWikiName.html">CreateGroupWikiName</a></td></tr>
         
         <!-- User profile/preferences tests -->
-        <tr><td><a href="./RenameProfile.html">Rename Profile</a></td></tr>
+        <tr><td><a href="./RenameProfile.html">RenameProfile</a></td></tr>
 
         <!-- View Page Source Test -->
-        <tr><td><a href="./ViewPageSource.html">View Page Source</a></td></tr>
+        <tr><td><a href="./ViewPageSource.html">ViewPageSource</a></td></tr>
 
         </tbody>
     </table>