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/08/18 03:40:53 UTC

svn commit: r1515056 - in /jspwiki/trunk/jspwiki-it-tests: ./ jspwiki-it-test-container-jdbc/ jspwiki-it-test-custom-jdbc/ jspwiki-selenium-tests/src/main/config/tomcatconf/ jspwiki-selenium-tests/src/main/java/org/apache/wiki/ jspwiki-selenium-tests/s...

Author: gmazza
Date: Sun Aug 18 01:40:53 2013
New Revision: 1515056

URL: http://svn.apache.org/r1515056
Log:
More work towards activating IT JDBC tests.

Added:
    jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtilsIT.java
      - copied, changed from r1515042, jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtils.java
    jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/resources/jspwiki-custom.properties
Removed:
    jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtils.java
Modified:
    jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-container-jdbc/pom.xml
    jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-custom-jdbc/pom.xml
    jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml
    jspwiki/trunk/jspwiki-it-tests/pom.xml

Modified: jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-container-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-container-jdbc/pom.xml?rev=1515056&r1=1515055&r2=1515056&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-container-jdbc/pom.xml (original)
+++ jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-container-jdbc/pom.xml Sun Aug 18 01:40:53 2013
@@ -72,7 +72,7 @@
         <groupId>org.apache.tomcat.maven</groupId>
         <artifactId>tomcat7-maven-plugin</artifactId>
         <configuration>
-          <contextFile>target/${project.artifactId}/WEB-INF/tomcat7-context.xml</contextFile>
+          <contextFile>${project.basedir}/../jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml</contextFile>
         </configuration>
         <dependencies>
           <dependency>

Modified: jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-custom-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-custom-jdbc/pom.xml?rev=1515056&r1=1515055&r2=1515056&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-custom-jdbc/pom.xml (original)
+++ jspwiki/trunk/jspwiki-it-tests/jspwiki-it-test-custom-jdbc/pom.xml Sun Aug 18 01:40:53 2013
@@ -55,38 +55,42 @@
       </resource>
       <resource>
         <directory>${project.basedir}/../jspwiki-selenium-tests/src/main/resources</directory>
+        <filtering>true</filtering>
       </resource>
     </resources>
     
-    <plugins> <!-- selenium test execution -->
+    <plugins>
+
+      <!-- selenium test execution -->
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
       </plugin>
-      
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>selenium-maven-plugin</artifactId>
-      </plugin>
-      
+
       <plugin>
         <groupId>org.apache.tomcat.maven</groupId>
         <artifactId>tomcat7-maven-plugin</artifactId>
         <configuration>
-          <contextFile>target/${project.artifactId}/WEB-INF/tomcat7-context.xml</contextFile>
+          <contextFile>${project.basedir}/../jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml</contextFile>
         </configuration>
         <dependencies>
           <dependency>
             <groupId>org.hsqldb</groupId>
             <artifactId>hsqldb</artifactId>
-            <version>1.8.0.10</version>
+            <version>2.3.0</version>
           </dependency>
         </dependencies>
       </plugin>
+
+        <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>selenium-maven-plugin</artifactId>
+        </plugin>
+
     </plugins>
   </build>
   
-  <dependencies>    
-    <dependency>
+  <dependencies>
+   <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
     </dependency>

Modified: jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml?rev=1515056&r1=1515055&r2=1515056&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml (original)
+++ jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/config/tomcatconf/tomcat7-context.xml Sun Aug 18 01:40:53 2013
@@ -18,7 +18,7 @@
     under the License.  
 -->
 <Context>
-    <Resource name="jdbc/GroupDatabase" 
+    <Resource name="jdbc/GroupDatabase"
             auth="Container"
             type="javax.sql.DataSource"
             maxActive="10" 
@@ -26,7 +26,7 @@
             maxWait="5000"
             username="SA" 
             password=""
-            driverClassName="org.hsqldb.jdbcDriver"
+            driverClassName="org.hsqldb.jdbc.JDBCDriver"
             url="jdbc:hsqldb:hsql://localhost/jspwiki"
     />
     
@@ -38,7 +38,7 @@
             maxWait="5000"
             username="SA" 
             password=""
-            driverClassName="org.hsqldb.jdbcDriver"
+            driverClassName="org.hsqldb.jdbc.JDBCDriver"
             url="jdbc:hsqldb:hsql://localhost/jspwiki"
     />
-</Context>
\ No newline at end of file
+</Context>

Copied: jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtilsIT.java (from r1515042, jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtils.java)
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtilsIT.java?p2=jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtilsIT.java&p1=jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtils.java&r1=1515042&r2=1515056&rev=1515056&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtils.java (original)
+++ jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/java/org/apache/wiki/HsqlDbUtilsIT.java Sun Aug 18 01:40:53 2013
@@ -54,10 +54,10 @@ import org.hsqldb.cmdline.SqlFile;
  * </ol>
  * </code>
  */
-public class HsqlDbUtils
+public class HsqlDbUtilsIT
 {
     
-    private static final Logger LOG = Logger.getLogger( HsqlDbUtils.class );
+    private static final Logger LOG = Logger.getLogger( HsqlDbUtilsIT.class );
     
     Server hsqlServer = null;
     
@@ -91,7 +91,8 @@ public class HsqlDbUtils
      */
     public void start() throws Exception
     {
-        
+        LOG.info( "Attempting to start Hypersonic JDBC server on localhost..." );
+
         // start Hypersonic server
         Properties hProps = loadPropertiesFrom( "/jspwiki-custom.properties" );
         
@@ -105,8 +106,10 @@ public class HsqlDbUtils
         hsqlServer.setDatabasePath( 0, hProps.getProperty( "server.database.0" ) );
         hsqlServer.start();
         
-        Class.forName( "org.hsqldb.jdbcDriver" );
+        Class.forName( "org.hsqldb.jdbc.JDBCDriver" );
         hsqlServer.checkRunning( true ); // throws RuntimeException if not running
+
+        LOG.info( "Hypersonic JDBC server on localhost started" );
     }
     
     /**
@@ -205,7 +208,7 @@ public class HsqlDbUtils
      * @return {@link Properties} holding {@code fileLocation} properties.
      * @throws IOException if {@code fileLocation} cannot be readed.
      */
-    Properties loadPropertiesFrom( String fileLocation ) throws IOException 
+    Properties loadPropertiesFrom( String fileLocation ) throws IOException
     {
         Properties p = new Properties();
         InputStream inStream = this.getClass().getResourceAsStream( fileLocation );
@@ -216,14 +219,15 @@ public class HsqlDbUtils
     
     /* REFACTOR: copy of jspwiki-war/src/test/java/o.a.w.HsqlDbutil, with some minor modifications */
     public static void main( String[] args ) {
-        HsqlDbUtils hsqldb = new HsqlDbUtils();
-        try {
-        hsqldb.start();
-        } catch (Exception e) {}
-        hsqldb.exec(args[1]);
+        HsqlDbUtilsIT hsqldb = new HsqlDbUtilsIT();
+        System.out.println("args = " + ArrayUtils.toString(args));
         if( ArrayUtils.isNotEmpty( args ) && StringUtils.equals( "tearDown", args[0] ) ) {
-    		hsqldb.tearDown();
-    	}
+            hsqldb.tearDown();
+        } else {
+            try {
+                hsqldb.start();
+            } catch (Exception e) {}
+        }
     }
     
 }

Added: jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/resources/jspwiki-custom.properties
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/resources/jspwiki-custom.properties?rev=1515056&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/resources/jspwiki-custom.properties (added)
+++ jspwiki/trunk/jspwiki-it-tests/jspwiki-selenium-tests/src/main/resources/jspwiki-custom.properties Sun Aug 18 01:40:53 2013
@@ -0,0 +1,66 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+# VALUES INJECTED BY WEB TESTS
+#
+jspwiki.groupdatabase           = ${it-jspwiki.groupdatabase}
+jspwiki.referenceStyle          = ${it-jspwiki.referenceStyle}
+jspwiki.userdatabase            = ${it-jspwiki.userdatabase}
+
+jspwiki.baseURL                            = http://localhost:8080/${project.artifactId}/
+jspwiki.fileSystemProvider.pageDir         = ./${project.artifactId}/target/test-classes/test-repo
+jspwiki.basicAttachmentProvider.storageDir = ./${project.artifactId}/target/test-classes/test-repo/attachments
+jspwiki.workDir                            = ./${project.artifactId}/target/test-classes/workdir-${project.artifactId}
+log4j.appender.FileLog.File                = ./${project.artifactId}/target/test-classes/jspwiki-${project.artifactId}.log
+log4j.appender.TestContainerLog.File       = ./${project.artifactId}/target/test-classes/container-${project.artifactId}.log
+log4j.appender.SecurityAppender.File       = ./${project.artifactId}/target/test-classes/security-${project.artifactId}.log
+
+#
+# Other overrides of standard jspwiki.properties file
+#
+jspwiki.xmlGroupDatabaseFile = ${it-jspwiki.context}/target/test-classes/groupdatabase.xml
+jspwiki.xmlUserDatabaseFile = ${it-jspwiki.context}/target/test-classes/userdatabase.xml
+
+jspwiki.login.throttling        = false
+jspwiki-x.securityconfig.enable = true
+jspwiki.translatorReader.camelCaseLinks = true
+jspwiki.breakTitleWithSpaces = true
+jspwiki.translatorReader.useOutlinkImage = false
+jspwiki.encoding = ISO-8859-1
+jspwiki.searchProvider = BasicSearchProvider
+
+log4j.logger.SecurityLog=INFO, SecurityAppender
+
+log4j.appender.SecurityAppender = org.apache.log4j.RollingFileAppender
+log4j.appender.SecurityAppender.layout = org.apache.log4j.PatternLayout
+log4j.appender.SecurityAppender.layout.ConversionPattern=%d %p - %m%n
+
+log4j.appender.TestContainerLog = org.apache.log4j.RollingFileAppender
+log4j.appender.TestContainerLog.layout = org.apache.log4j.PatternLayout
+log4j.appender.TestContainerLog.layout.ConversionPattern=%d [%t] %p %c %x - %m%n
+
+server.port=9001
+server.database.0=file:jspwiki.hsqldb
+server.dbname.0=jspwiki
+
+jdbc.admin.id=SA
+jdbc.admin.password=
+jdbc.driver.class=org.hsqldb.jdbc.JDBCDriver
+jdbc.driver.id=hsql
+jdbc.driver.url=jdbc\:hsqldb\:hsql\://localhost/jspwiki
+jdbc.user.id=jspwiki
+jdbc.user.password=password

Modified: jspwiki/trunk/jspwiki-it-tests/pom.xml
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-it-tests/pom.xml?rev=1515056&r1=1515055&r2=1515056&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-it-tests/pom.xml (original)
+++ jspwiki/trunk/jspwiki-it-tests/pom.xml Sun Aug 18 01:40:53 2013
@@ -37,9 +37,9 @@
     <module>jspwiki-selenium-tests</module>
     <module>jspwiki-it-test-custom</module>
     <!--module>jspwiki-it-test-custom-absolute-urls</module>
-    <module>jspwiki-it-test-custom-jdbc</module>
-    <module>jspwiki-it-test-container</module>
-    <module>jspwiki-it-test-container-jdbc</module-->
+    <module>jspwiki-it-test-container</module-->
+    <!--module>jspwiki-it-test-container-jdbc</module-->
+    <!--module>jspwiki-it-test-custom-jdbc</module-->
   </modules>
   
   <profiles>
@@ -67,8 +67,9 @@
             <artifactId>maven-war-plugin</artifactId>
             <version>2.4</version>
           </plugin>
-          
-          <plugin> <!-- exec-maven-plugin does not accept forked executions (!) -->
+
+          <!-- exec-maven-plugin does not accept forked executions (!) -->
+          <plugin>
             <artifactId>maven-antrun-plugin</artifactId>
             <version>1.7</version>
             <executions>
@@ -79,11 +80,11 @@
                 <configuration>
                   <target>
                     <property name="compile_classpath" refid="maven.compile.classpath" />
-                    <echo message="starting hsqldb..." />
+                    <echo message="**** starting hsqldb..." />
                     <exec executable="java" dir="${env.JAVA_HOME}/bin" spawn="true">
                         <arg value="-classpath" />
                         <arg value="${compile_classpath}" />
-                        <arg value="org.apache.wiki.HsqlDbUtils"/>
+                        <arg value="org.apache.wiki.HsqlDbUtilsIT"/>
                         <arg value="setUp" />
                         <arg value="jspwiki-selenium-tests/src/main/config/hsql-userdb-setup.ddl" />
                     </exec>  
@@ -98,11 +99,11 @@
                 <configuration>
                   <target>
                     <property name="compile_classpath" refid="maven.compile.classpath" />
-                    <echo message="stopping hsqldb..." />
+                    <echo message="***** stopping hsqldb..." />
                     <exec executable="java" dir="${env.JAVA_HOME}/bin" spawn="true">
                         <arg value="-classpath" />
                         <arg value="${compile_classpath}" />
-                        <arg value="org.apache.wiki.HsqlDbUtils"/>
+                        <arg value="org.apache.wiki.HsqlDbUtilsIT"/>
                         <arg value="tearDown" />
                         <arg value="jspwiki-selenium-tests/src/main/config/hsql-userdb-teardown.ddl" />
                     </exec>  
@@ -111,15 +112,15 @@
               </execution>
             </executions>
           </plugin>
-          
+
+            <!-- <browser>*firefox</browser> -->
+            <!-- <browser>*iexplore</browser> -->
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>selenium-maven-plugin</artifactId>
             <version>2.3</version>
             <configuration>
               <browser>*googlechrome</browser>
-              <!-- <browser>*firefox</browser> -->
-              <!-- <browser>*iexplore</browser> -->
               <startURL>http://localhost:8080/${project.artifactId}/</startURL>
               <suite>target/test-classes/selenium/TestSuite.html</suite> 
               <background>true</background>