You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/02/09 17:23:07 UTC

svn commit: r505348 - in /lenya/trunk/src: modules-core/acusecases/test/ modules-core/acusecases/test/canoo/ modules-core/acusecases/test/canoo/test.xml resources/build/modules2build.xsl targets/modules-build.xml

Author: andreas
Date: Fri Feb  9 08:23:06 2007
New Revision: 505348

URL: http://svn.apache.org/viewvc?view=rev&rev=505348
Log:
Adding canoo webtest support and first test file

Added:
    lenya/trunk/src/modules-core/acusecases/test/
    lenya/trunk/src/modules-core/acusecases/test/canoo/
    lenya/trunk/src/modules-core/acusecases/test/canoo/test.xml
Modified:
    lenya/trunk/src/resources/build/modules2build.xsl
    lenya/trunk/src/targets/modules-build.xml

Added: lenya/trunk/src/modules-core/acusecases/test/canoo/test.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/acusecases/test/canoo/test.xml?view=auto&rev=505348
==============================================================================
--- lenya/trunk/src/modules-core/acusecases/test/canoo/test.xml (added)
+++ lenya/trunk/src/modules-core/acusecases/test/canoo/test.xml Fri Feb  9 08:23:06 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<project name="SimpleTest" basedir="." default="main">
+  
+  <import file="${webtest.home}/lib/taskdef.xml"/>
+  
+  <target name="main">
+    
+    <echo>Using WebTest home: ${webtest.home}</echo>
+    <webtest name="myTest">
+      <config
+        host="localhost"
+        port="8888"
+        protocol="http"
+        basepath="default/authoring" />
+      <steps>
+        <!-- login page -->
+        <invoke url="index.html" />
+        <verifyTitle text="LOGIN to the DEFAULT Publication" />
+        
+        <!-- missing fields -->
+        <setInputField name="username" value=""/>
+        <setInputField name="password" value=""/>
+        <clickButton name="submit"/>
+        <verifyText text="Please enter"/>
+        
+        <!-- wrong login -->
+        <setInputField name="username" value="foo"/>
+        <setInputField name="password" value="bar"/>
+        <clickButton name="submit"/>
+        <verifyText text="Authentication failed"/>
+        
+        <!-- correct login -->
+        <setInputField name="username" value="lenya"/>
+        <setInputField name="password" value="levi"/>
+        <clickButton name="submit"/>
+        <verifyText text="Welcome to the Default Publication from the Lenya community!"/>
+        
+        <!-- logout -->
+        <invoke url="index.html?lenya.usecase=ac.logout"/>
+        <verifyTitle text="LOGOUT from the Publication" />
+        
+      </steps>
+    </webtest>
+  </target>
+</project>
\ No newline at end of file

Modified: lenya/trunk/src/resources/build/modules2build.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/resources/build/modules2build.xsl?view=diff&rev=505348&r1=505347&r2=505348
==============================================================================
--- lenya/trunk/src/resources/build/modules2build.xsl (original)
+++ lenya/trunk/src/resources/build/modules2build.xsl Fri Feb  9 08:23:06 2007
@@ -85,6 +85,10 @@
         <xsl:apply-templates select="list:module" mode="call-test"/>
       </target>
       
+      <target name="test-modules-canoo">
+        <xsl:apply-templates select="list:module" mode="call-test-canoo"/>
+      </target>
+      
       <xsl:apply-templates select="list:module" mode="target"/>
       
     </project>
@@ -110,6 +114,15 @@
   </xsl:template>
   
   
+  <xsl:template match="list:module" mode="call-test-canoo">
+    <xsl:apply-templates select="document(concat(@src, '/module.xml'))/mod:module" mode="call-test-canoo"/>
+  </xsl:template>
+  
+  <xsl:template match="mod:module" mode="call-test-canoo">
+    <antcall target="canoo-module-{mod:id}"/>
+  </xsl:template>
+  
+  
   <xsl:template match="list:module" mode="call-javadocs">
     <xsl:apply-templates select="document(concat(@src, '/module.xml'))/mod:module" mode="call-javadocs"/>
   </xsl:template>
@@ -384,6 +397,16 @@
       </junit>
     </target>
     
+    <!-- ============================================================ -->
+    <!-- Canoo WebTest -->
+    <!-- ============================================================ -->
+    
+    <available file="{$src}/test/canoo/test.xml" property="canoo.module.{$id}"/>
+    
+    <target name="canoo-module-{$id}" if="canoo.module.{$id}">
+      <ant dir="{$src}/test/canoo" antfile="test.xml" inheritall="true"/>
+    </target>
+      
   </xsl:template>
   
   <xsl:template match="mod:depends" mode="dependencyWarning">

Modified: lenya/trunk/src/targets/modules-build.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/targets/modules-build.xml?view=diff&rev=505348&r1=505347&r2=505348
==============================================================================
--- lenya/trunk/src/targets/modules-build.xml (original)
+++ lenya/trunk/src/targets/modules-build.xml Fri Feb  9 08:23:06 2007
@@ -113,6 +113,14 @@
     </ant>
   </target>
   
+  <target name="modules.test.canoo" depends="init">
+    <ant antfile="${build.dir}/temp/modules-build.xml"
+      inheritall="true"
+      inheritrefs="true">
+      <target name="test-modules-canoo"/>
+    </ant>
+  </target>
+  
   <target name="patch-modules-test" depends="tests.prepare, prepare-module-test">
     <ant antfile="${build.dir}/temp/modules-build.xml"
       inheritall="true"



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org