You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2008/12/15 23:09:42 UTC

svn commit: r726838 - in /james/server/trunk: build-tools/imap-sieve.mpt build-tools/smoke.xml build-tools/vut-pop3.mpt build-tools/vut-smtp.mpt build-tools/vut.xsl phoenix-deployment/build.xml

Author: rdonkin
Date: Mon Dec 15 14:09:42 2008
New Revision: 726838

URL: http://svn.apache.org/viewvc?rev=726838&view=rev
Log:
Added VUT test and completed Sieve test

Added:
    james/server/trunk/build-tools/imap-sieve.mpt   (contents, props changed)
      - copied, changed from r726772, james/server/trunk/build-tools/imap.mpt
    james/server/trunk/build-tools/vut-pop3.mpt
      - copied, changed from r726772, james/server/trunk/build-tools/pop3-after-smtp.mpt
    james/server/trunk/build-tools/vut-smtp.mpt
      - copied, changed from r726772, james/server/trunk/build-tools/delivery-smtp.mpt
    james/server/trunk/build-tools/vut.xsl   (contents, props changed)
      - copied, changed from r726772, james/server/trunk/build-tools/smoke.xsl
Modified:
    james/server/trunk/build-tools/smoke.xml
    james/server/trunk/phoenix-deployment/build.xml

Copied: james/server/trunk/build-tools/imap-sieve.mpt (from r726772, james/server/trunk/build-tools/imap.mpt)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/imap-sieve.mpt?p2=james/server/trunk/build-tools/imap-sieve.mpt&p1=james/server/trunk/build-tools/imap.mpt&r1=726772&r2=726838&rev=726838&view=diff
==============================================================================
--- james/server/trunk/build-tools/imap.mpt (original)
+++ james/server/trunk/build-tools/imap-sieve.mpt Mon Dec 15 14:09:42 2008
@@ -22,8 +22,16 @@
 S: abcd OK CAPABILITY completed.
 C: 1 LOGIN user passwd 
 S: 1 OK LOGIN completed.
-C: 2 CREATE sub
-S: 2 OK CREATE completed.
-C: 3 CREATE sub/way
-S: 3 OK CREATE completed.
-
+C: 2 SELECT INBOX
+S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
+S: \* 1 EXISTS
+S: \* 0 RECENT
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[UNSEEN 1\]
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)\]
+S: 2 OK \[READ-WRITE\] SELECT completed.
+C: 3 FETCH 1 FULL
+S: \* 1 FETCH \(FLAGS \(\) INTERNALDATE \".*\" RFC822.SIZE .* ENVELOPE \(\"12 Dec 2008 GMT\" \"A Test Message\" \(\(NIL NIL "joe" "example.org"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"user\" \"localhost\"\)\) NIL NIL NIL NIL\) BODY \(\"TEXT\" \"PLAIN\" \(\"charset\" \"us-ascii\"\) NIL NIL \"7BIT\" 29 2\)\)
+S: 3 OK FETCH completed.
+C: END LOGOUT
+S: \* BYE IMAP4rev1 Server logging out

Propchange: james/server/trunk/build-tools/imap-sieve.mpt
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: james/server/trunk/build-tools/smoke.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/smoke.xml?rev=726838&r1=726837&r2=726838&view=diff
==============================================================================
--- james/server/trunk/build-tools/smoke.xml (original)
+++ james/server/trunk/build-tools/smoke.xml Mon Dec 15 14:09:42 2008
@@ -29,6 +29,13 @@
 		<echo>This is a library containing macros required for smoke tests.</echo>
 	</target>
  
+    <macrodef name='Imap'>
+        <attribute name='script' default='imap'/>
+        <sequential>
+            <mpt:mpt port='${org.apache.james.smoke.port.IMAP}' script='../build-tools/@{script}.mpt'/>   
+        </sequential>   
+    </macrodef>   
+    
     <macrodef name='TestDelivery'>   
         <attribute name='smtp' default='delivery-smtp'/>
         <attribute name='pop3' default='pop3-after-smtp'/>   
@@ -61,17 +68,17 @@
 S: User user a.*
 C: adduser john.smith passwd
 S: User john.smith a.*
-C: removemapping john.smith@localhost support@example.org
+C: removemapping support@example.org john.smith@localhost
 S: .*
-C: addmapping john.smith@localhost support@example.org
+C: addmapping support@example.org john.smith@localhost
 S: Adding mapping successful: true
 </addUser>
             </mpt:mpt>               
         </sequential>   
     </macrodef>   
     
-    <macrodef name='RunSmokeTests'>
-        <sequential>   
+    <macrodef name='InitMPT'>
+        <sequential>
             <taskdef 
                 uri="antlib:org.apache.james.mpt.ant" 
                 resource="org/apache/james/mpt/ant/antlib.xml">
@@ -79,7 +86,13 @@
                     <pathelement location="${lib.dir}/${mpt.jar}" />
                     <pathelement location='${lib.dir}/${mpt-antlib.jar}' />
                 </classpath>
-            </taskdef>  
+            </taskdef>     
+        </sequential>   
+    </macrodef>   
+    
+    <macrodef name='RunSmokeTests'>
+        <sequential>   
+            <InitMPT/>
             
             <TestProtocol port='${org.apache.james.smoke.port.POP3}' name='pop3'/>    
             <TestProtocol port='${org.apache.james.smoke.port.IMAP}' name='imap'/>
@@ -118,7 +131,38 @@
     
         </sequential>   
     </macrodef> 
- 
+    
+    <macrodef name='VUTSmoke'>
+        <attribute name='build-dir'/> 
+        <attribute name='zip'/>    
+        <attribute name='package'/>
+        <attribute name='app-path'/>
+        <attribute name='conf-path'/>
+        <attribute name='conf-file-name'/> 
+        <attribute name='cmd'/>
+        <attribute name='log'/>   
+        <sequential>
+    
+            <VerifySmokePrerequisites zip='@{zip}'/>
+        
+            <property name='smoke.sieve.dir' location='@{build-dir}/vut-smoke'/>
+            <UnpackDistribution zip='@{zip}' dir='${smoke.sieve.dir}'/>
+            
+            <property name='smoke.sieve.james.dir' location='${smoke.sieve.dir}/@{package}'/>               
+            <ConfigureJames 
+                dir='${smoke.sieve.james.dir}' 
+                app-path='@{app-path}' 
+                conf-path='@{conf-path}'
+                conf-file-name='@{conf-file-name}'
+                style='vut'/>   
+
+            <BootJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}' log='@{log}'/>  
+            <InitMPT/>   
+            <TestDelivery pop3="vut-pop3" smtp="vut-smtp"/>
+            <StopJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}'/>       
+        </sequential>   
+    </macrodef>    
+    
     <macrodef name='SieveSmoke'>
         <attribute name='build-dir'/> 
         <attribute name='zip'/>    
@@ -144,7 +188,9 @@
                 style='sieve'/>   
 
             <BootJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}' log='@{log}'/>  
-            <RunSmokeTests/>
+            <InitMPT/>   
+            <TestDelivery pop3="pop3" smtp="smtp"/>
+            <Imap script='imap-sieve'/>   
             <StopJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}'/>       
         </sequential>   
     </macrodef>    

Copied: james/server/trunk/build-tools/vut-pop3.mpt (from r726772, james/server/trunk/build-tools/pop3-after-smtp.mpt)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/vut-pop3.mpt?p2=james/server/trunk/build-tools/vut-pop3.mpt&p1=james/server/trunk/build-tools/pop3-after-smtp.mpt&r1=726772&r2=726838&rev=726838&view=diff
==============================================================================
--- james/server/trunk/build-tools/pop3-after-smtp.mpt (original)
+++ james/server/trunk/build-tools/vut-pop3.mpt Mon Dec 15 14:09:42 2008
@@ -22,7 +22,7 @@
 C: PASS passwd
 S: \+OK Welcome john.smith
 C: STAT
-S: \+OK 1 .*
+S: \+OK 2 .*
 C: RETR 1
 S: \+OK Message follows
 S: Message-ID: .*
@@ -43,6 +43,30 @@
 S: Simple plain mail content
 S:
 S: .
+C: RETR 1
+S: \+OK Message follows
+S: Message-ID: .*
+S: MIME-Version: 1.0
+S: Return-Path: <al...@example.org>
+S: Content-Type: text/plain; charset=us-ascii
+S: Content-Transfer-Encoding: 7bit
+S: Delivered-To: john.smith@localhost
+S: Received: from localhost.*
+S: .*by localhost.*
+S: .*for <jo...@localhost>;
+S: .*
+S: Date: 13 Dec 2008 GMT
+S: From: <al...@example.org>
+S: To: <su...@example.org>
+S: Subject: Virtual Host Test Message
+S:
+S: This message tests James virtual user mapping.
+S: support@example.org should be mapping to john.smith@localhost
+S: and delivered to that mailbox.
+S:
+S: .
+C: DELE 2
+S: \+OK Message deleted
 C: DELE 1
 S: \+OK Message deleted
 C: STAT

Copied: james/server/trunk/build-tools/vut-smtp.mpt (from r726772, james/server/trunk/build-tools/delivery-smtp.mpt)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/vut-smtp.mpt?p2=james/server/trunk/build-tools/vut-smtp.mpt&p1=james/server/trunk/build-tools/delivery-smtp.mpt&r1=726772&r2=726838&rev=726838&view=diff
==============================================================================
--- james/server/trunk/build-tools/delivery-smtp.mpt (original)
+++ james/server/trunk/build-tools/vut-smtp.mpt Mon Dec 15 14:09:42 2008
@@ -34,5 +34,22 @@
 C:
 C: .
 S: 250 2.6.0 Message received
+C: MAIL FROM:<al...@example.org>
+S: 250 2.1.0 Sender <al...@example.org> OK
+C: RCPT TO:<su...@example.org>
+S: 250 2.1.5 Recipient <su...@example.org> OK
+C: DATA
+S: 354 Ok Send data ending with <CRLF>.<CRLF>
+C: Date: 13 Dec 2008 GMT
+C: From: <al...@example.org>
+C: To: <su...@example.org>
+C: Subject: Virtual Host Test Message
+C:
+C: This message tests James virtual user mapping.
+C: support@example.org should be mapping to john.smith@localhost
+C: and delivered to that mailbox.
+C:
+C: .
+S: 250 2.6.0 Message received
 C: QUIT
 S: 221 2.0.0 .* Service closing transmission channel

Copied: james/server/trunk/build-tools/vut.xsl (from r726772, james/server/trunk/build-tools/smoke.xsl)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/vut.xsl?p2=james/server/trunk/build-tools/vut.xsl&p1=james/server/trunk/build-tools/smoke.xsl&r1=726772&r2=726838&rev=726838&view=diff
==============================================================================
--- james/server/trunk/build-tools/smoke.xsl (original)
+++ james/server/trunk/build-tools/vut.xsl Mon Dec 15 14:09:42 2008
@@ -15,6 +15,25 @@
 	But: 
 -->
 <!-- 
+Virtual hosting
+ -->
+    <!-- Enable -->
+ 	<xsl:template match="config/James/enableVirtualHosting">
+		<xsl:element name='enableVirtualHosting'>
+			<xsl:text>true</xsl:text>
+	    </xsl:element>
+	</xsl:template>
+	<xsl:template match="config/domainlist/domainnames">
+		<xsl:element name='domainnames'>
+			<xsl:element name='domainname'>
+				<xsl:text>localhost</xsl:text>
+		    </xsl:element>
+		    <xsl:element name='domainname'>
+				<xsl:text>example.org</xsl:text>
+		    </xsl:element>
+	    </xsl:element>
+	</xsl:template>
+<!-- 
 	Ignore comments 
 -->
 	<xsl:template match="comment()"/>

Propchange: james/server/trunk/build-tools/vut.xsl
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: james/server/trunk/phoenix-deployment/build.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/build.xml?rev=726838&r1=726837&r2=726838&view=diff
==============================================================================
--- james/server/trunk/phoenix-deployment/build.xml (original)
+++ james/server/trunk/phoenix-deployment/build.xml Mon Dec 15 14:09:42 2008
@@ -1109,6 +1109,17 @@
         </echoxml>
     </target>
  
+    <target name='vut-smoke' depends='dist-properties'>
+        <VUTSmoke 
+            build-dir='${build.dir}' 
+            zip='${dist.binary.file.zip}' 
+            package='${name}-${version}'
+            app-path='apps'
+            conf-path='apps/james/SAR-INF'
+            conf-file-name='config.xml'
+            cmd='phoenix'
+            log='temp/phoenix.console'/>   
+    </target>    
     
     <target name='sieve-smoke' depends='dist-properties'>
         <SieveSmoke 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org