james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r723118 - in /james/server/trunk: build-tools/sieve.xsl build-tools/smoke.xml imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java phoenix-deployment/build.xml
Date Wed, 03 Dec 2008 23:03:09 GMT
Author: rdonkin
Date: Wed Dec  3 15:03:08 2008
New Revision: 723118

URL: http://svn.apache.org/viewvc?rev=723118&view=rev
Log:
Sieve mailet improvements plus beginnings of a sieve smoke test. Failed to make phoenix xinfo
stuff work so gave up after spending too many hours on it.

Added:
    james/server/trunk/build-tools/sieve.xsl   (contents, props changed)
      - copied, changed from r722808, james/server/trunk/build-tools/smoke.xsl
Modified:
    james/server/trunk/build-tools/smoke.xml
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
    james/server/trunk/phoenix-deployment/build.xml

Copied: james/server/trunk/build-tools/sieve.xsl (from r722808, james/server/trunk/build-tools/smoke.xsl)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/sieve.xsl?p2=james/server/trunk/build-tools/sieve.xsl&p1=james/server/trunk/build-tools/smoke.xsl&r1=722808&r2=723118&rev=723118&view=diff
==============================================================================
--- james/server/trunk/build-tools/smoke.xsl (original)
+++ james/server/trunk/build-tools/sieve.xsl Wed Dec  3 15:03:08 2008
@@ -2,6 +2,7 @@
 <xsl:stylesheet version="1.1"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:strip-space elements = "*" />
+	<xsl:param name='MailetPackage'/>
 	<xsl:output method = "xml" indent='yes'/>
 <!-- 
 	Basically copy everything  
@@ -18,6 +19,36 @@
 	Ignore comments 
 -->
 	<xsl:template match="comment()"/>
+
+<!-- 
+	Ignore existing processors (for safety)
+-->
+	<xsl:template match="processor[@name='root']">
+		<xsl:element name='processor'>
+			<xsl:attribute name='name'>root</xsl:attribute>
+			<xsl:element name='mailet'>
+				<xsl:attribute name='match'>All</xsl:attribute>
+				<xsl:attribute name='class'>SieveMailet</xsl:attribute>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>		
+	
+<!-- 
+	Ignore existing processors (for safety)
+-->
+	<xsl:template match="processor"/>	
+	
+<!-- 
+	Substitute mailet packages
+-->
+	<xsl:template match="mailetpackages">
+		<xsl:element name='mailetpackages'>
+			<xsl:element name='mailetpackage'>
+			<xsl:text>org.apache.james.imapserver.sieve</xsl:text>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>	
+	
 <!--
 	Use high ports  
 -->

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

Modified: james/server/trunk/build-tools/smoke.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/smoke.xml?rev=723118&r1=723117&r2=723118&view=diff
==============================================================================
--- james/server/trunk/build-tools/smoke.xml (original)
+++ james/server/trunk/build-tools/smoke.xml Wed Dec  3 15:03:08 2008
@@ -94,6 +94,35 @@
     
         </sequential>   
     </macrodef> 
+ 
+    <macrodef name='SieveSmoke'>
+        <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'/>
+        <sequential>
+    
+            <VerifySmokePrerequisites zip='@{zip}'/>
+        
+            <property name='smoke.sieve.dir' location='@{build-dir}/sieve-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='sieve'/>   
+
+            <BootJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}'/>  
+            <!--<RunSmokeTests/> -->
+            <StopJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}'/>       
+        </sequential>   
+    </macrodef>    
     
     <macrodef name="ControlJames">
         <attribute name='action'/>
@@ -155,7 +184,8 @@
     	<attribute name='dir'/>
         <attribute name='app-path'/>
         <attribute name='conf-path'/>
-        <attribute name='conf-file-name'/>  
+        <attribute name='conf-file-name'/>
+        <attribute name='style' default="smoke"/>   
         <sequential>
             <unzip dest="@{dir}/@{app-path}/james">
             	<fileset dir='@{dir}/@{app-path}'>
@@ -163,7 +193,7 @@
             	</fileset>
             </unzip>
             <xslt 
-            	style="../build-tools/smoke.xsl" 
+            	style="../build-tools/@{style}.xsl" 
                 in='@{dir}/@{conf-path}/@{conf-file-name}' 
                 out='@{dir}/@{conf-path}/config-smoke.xml'></xslt>
             <move   

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java?rev=723118&r1=723117&r2=723118&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
(original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
Wed Dec  3 15:03:08 2008
@@ -26,7 +26,6 @@
 import org.apache.james.Constants;
 import org.apache.jsieve.mailet.Poster;
 import org.apache.jsieve.mailet.SieveMailboxMailet;
-import org.apache.mailet.MailetConfig;
 
 /**
  * Contains avalon bindings.
@@ -34,7 +33,8 @@
 public class SieveMailet extends SieveMailboxMailet {
 
     @Override
-    public void init(MailetConfig config) throws MessagingException {
+    public void init() throws MessagingException {
+        
         ServiceManager compMgr = (ServiceManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
         try {
             Poster poster = (Poster) compMgr.lookup("org.apache.jsieve.mailet.Poster");
@@ -42,6 +42,7 @@
         } catch (ServiceException e) {
             throw new MessagingException("IMAP not installed", e);
         }
-        super.init(config);
+        
+        super.init();
     }    
 }

Modified: james/server/trunk/phoenix-deployment/build.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/build.xml?rev=723118&r1=723117&r2=723118&view=diff
==============================================================================
--- james/server/trunk/phoenix-deployment/build.xml (original)
+++ james/server/trunk/phoenix-deployment/build.xml Wed Dec  3 15:03:08 2008
@@ -1103,6 +1103,17 @@
     </target>
  
     
+    <target name='sieve-smoke' depends='dist-properties'>
+        <SieveSmoke 
+            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'/>   
+    </target>      
+    
     <target name='smoke' depends='dist-properties'>
         <Smoke 
             build-dir='${build.dir}' 



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


Mime
View raw message