Catchup from default config
authordarios@symbian.org
Fri, 29 May 2009 17:20:47 +0100
changeset 192 d5964b46ccaf
parent 191 56e7098e1ace (current diff)
parent 119 18300635256d (diff)
child 193 19a76650e06d
Catchup from default config
common/build.xml
common/common_props.ant.xml
common/smoketest/ats3_testdrop.pl
common/smoketest/make_junction.pl
common/smoketest/smoke_test.ant.xml
sf-package/package_props.ant.xml
sf-platform/build.xml
--- a/common/build.xml	Wed May 20 14:26:55 2009 +0100
+++ b/common/build.xml	Fri May 29 17:20:47 2009 +0100
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project name="SF-COMMON-CONFIG">
+<project name="SF-COMMON-CONFIG" xmlns:hlm="http://www.nokia.com/helium">
 
     <property environment="env"/> <!-- make environment variables available via env -->
     
@@ -28,23 +28,17 @@
     <!-- import all core HELIUM targets -->
     <import file="${helium.dir}/helium.ant.xml" />
     
-    <!-- import other files -->
-    <import file="${sf.common.config.dir}/smoketest/smoke_test.ant.xml" />
-    
     <!-- import common references -->
     <import file="${sf.common.config.dir}/common_refs.ant.xml" />
              
     <!-- conditional import of generated source spec if available -->
     <if><available  file="${sf.common.config.dir}/generated/source-spec.ant.xml" />
-        <then>		    		
+        <then>
             <echo message="Generated source spec found, importing..." />
-    				<import file="${sf.common.config.dir}/generated/source-spec.ant.xml"/>
-    		</then>
+            <import file="${sf.common.config.dir}/generated/source-spec.ant.xml"/>
+        </then>
     </if>
-    
-    <!--
-    ** TARGET DEFINITIONS
-    -->   
+     
     
     <target name="sf-prep" depends="sf-generate-source-spec,prep-drive,init-build-area,check-tool-dependencies,create-bom,log-build-env">
         <echo>[SF-PREP]</echo>
@@ -141,15 +135,31 @@
                 <runtarget target="preparation-getenv"/>
                 
             </then>
+            <else>
+                <!-- record fact that no baseline used. required by diamondize-bom  -->
+                <touch file="${build.drive}/output/logs/BOM/baseline.txt"/>
+            </else>
         </if>
         
         <if>
             <istrue value="${sf.spec.sourcesync.enable}" />
             <then>
                 <runtarget target="sf-get-source"/>
+                
+                <if><istrue value="${sf.spec.package.src.enable}"/>
+                <then>
+                    <echo message="INFO Packaging Source"/>
+                    <runtarget target="sf-package-source"/>
+                </then>
+                </if>
+                
+                <runtarget target="sf-unpack-rnd"/>
             </then>
-        </if>
-        
+            <else>
+                <!-- record fact that no sources.csv used. required by diamondize-bom  -->
+                <touch file="${build.log.dir}/BOM/sources.csv"/> 
+            </else>
+        </if>        
       <if>
         <istrue value="${sf.spec.publish.enable}"/>
         <then>
@@ -158,115 +168,143 @@
       </if>
     </target>
     
-  <target name="sf-postbuild" depends="sf-zip-logs">
-    <echo>[SF-POSTBUILD]</echo>
+    <target name="sf-postbuild">
+        <echo>[SF-POSTBUILD]</echo>
+                
+        <!-- TAG SOURCE CODE -->
+        <if>
+            <istrue value="${sf.spec.tagafterbuild.enable}" />
+            <then>
+                <echo message="Apply tag to the source code used in this build"/>
+                <runtarget target="sf-tag-hg-code"/>
+            </then>
+        </if>
     
-    <!-- TAG SOURCE CODE -->
-    <if>
-      <istrue value="${sf.spec.tagafterbuild.enable}" />
-      <then>
-        <echo message="Apply tag to the source code used in this build"/>
-        <runtarget target="sf-tag-hg-code"/>
-      </then>
-    </if>
+        <if>
+            <istrue value="${sf.spec.package.bin.enable}"/>
+            <then>
+                <echo message="INFO Packaging Binaries"/>
+                <runtarget target="sf-package-binary"/>
+            </then>
+        </if>
 
-    <!-- PUBLISH LOGS/REPORTS -->
-    <if>
-      <istrue value="${sf.spec.publish.enable}" />
-      <then>
-        <echo message="Publish log files and reports to ${sf.spec.publish.rootdir}"/>
-        <runtarget target="publish"/>
-      </then>
-    </if>
-    
-    <!-- EXEC SMOKE TEST -->
-    <if>
-      <istrue value="${sf.spec.smoketest.enable}"/>
-      <then>
-        <runtarget target="sf-smoke-test"/>
-      </then>
-    </if>
-    
-  </target>
+        <if><istrue value="${sf.spec.test.sendpkg.enable}"/>
+            <then>
+                <runtarget target="sf-send-testpkg"/>
+            </then>
+        </if>
+
+        <!-- run build analysis tools -->
+        <runtarget target="sf-run-analysis"/>
+
+        <runtarget target="sf-zip-logs"/>
+
+        <!-- PUBLISH LOGS/REPORTS -->
+        <if>
+            <istrue value="${sf.spec.publish.enable}" />
+            <then>
+                <echo message="Publish log files and reports to ${sf.spec.publish.rootdir}"/>
+                <runtarget target="publish"/>
+            </then>
+        </if>
+    </target>
 
-  <!-- package all logs into zipfile before publish -->
-  <target name="sf-zip-logs">
-    <if>
-      <istrue value="${sf.spec.logs.zip.enable}"/>
-      <then>
-        <property name="temp.log.zip" value="${env.TEMP}/build_logs_${sf.spec.job.name}_${build.number}.zip"/>
-        <echo message="Zip log requested, zipping logs..."/>
-        <zip destfile="${temp.log.zip}" basedir="${build.log.dir}"/>
-        <move file="${temp.log.zip}" todir="${build.log.dir}" failonerror="false"/>
-      </then>
-    </if>
-  </target>
-
-  <!-- generate dir list using passed location and name 
-  if a baseline list is available then generate deltas too -->
-
-  <target name="sf-list-dir">
-    <property name="sf.currentlist.name"   value="${sf.list.name}"/> 
-    <property name="sf.dir.location" value="${build.drive}/epoc32"/> 
+    <!-- package all logs into zipfile before publish -->
+    <target name="sf-zip-logs">
+        <if>
+            <istrue value="${sf.spec.logs.zip.enable}"/>
+            <then>
+                <property name="temp.log.zip" value="${env.TEMP}/build_logs_${sf.spec.job.name}_${build.number}.zip"/>
+                <echo message="Zip log requested, zipping logs..."/>
+                <zip destfile="${temp.log.zip}" basedir="${build.log.dir}"/>
+                <move file="${temp.log.zip}" todir="${build.log.dir}" failonerror="false"/>
+            </then>
+        </if>
+    </target>
+    
+    <!-- generate dir list using passed location and name 
+    if a baseline list is available then generate deltas too -->
 
-    <if>
-      <istrue value="${sf.spec.dirlist.enable}"/>
-      <then>
-        <echo message="Dirlist name: ${sf.currentlist.name} requested for ${sf.dir.location}"/>
-        <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist.name}.log">
-          <arg value="${sf.common.config.dir}/tools/listdir.pl"/>
-          <arg value="${sf.dir.location}"/>
-        </exec>
-      </then>
-    </if>
-  </target>
-	
-  <target name="sf-delta-dir">
-    <property name="sf.currentlist_a.name"   value="${sf.list_b.name}"/> 
-    <property name="sf.currentlist_b.name"   value="${sf.list_b.name}"/>
-    <property name="sf.dir.location" value="${build.drive}/epoc32"/> 
-    		
-    <if>
-      <istrue value="${sf.spec.dirdelta.enable}"/>
-      <then>
-        <echo message="Delta requested for ${sf.currentlist_a.name} vs ${sf.currentlist_b.name} "/>
-        <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist_b.name}_delta.log">
-          <arg value="${sf.common.config.dir}/tools/difflist.pl"/>
-          <arg value="${build.log.dir}/listdir_${build.id}_${sf.currentlist_a.name}.log"/>
-          <arg value="${build.log.dir}/listdir_${build.id}_${sf.currentlist_b.name}.log"/>
-        </exec>
-      </then>
-    </if>
-  </target>
+    <target name="sf-list-dir">
+        <property name="sf.currentlist.name"   value="${sf.list.name}"/> 
+        <property name="sf.dir.location" value="${build.drive}/epoc32"/> 
+    
+        <if>
+            <istrue value="${sf.spec.dirlist.enable}"/>
+            <then>
+                <echo message="Dirlist name: ${sf.currentlist.name} requested for ${sf.dir.location}"/>
+                <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist.name}.log">
+                    <arg value="${sf.common.config.dir}/tools/listdir.pl"/>
+                    <arg value="${sf.dir.location}"/>
+                </exec>
+            </then>
+        </if>
+    </target>
+    
+    <target name="sf-delta-dir">
+        <property name="sf.currentlist_a.name"   value="${sf.list_a.name}"/> 
+        <property name="sf.currentlist_b.name"   value="${sf.list_b.name}"/>
+        <property name="sf.dir.location" value="${build.drive}/epoc32"/> 
+        
+        <if>
+            <istrue value="${sf.spec.dirdelta.enable}"/>
+            <then>
+                <echo message="Delta requested for ${sf.currentlist_a.name} vs ${sf.currentlist_b.name} "/>
+                <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist_b.name}_delta.log">
+                    <arg value="${sf.common.config.dir}/tools/difflist.pl"/>
+                    <arg value="${build.log.dir}/listdir_${build.id}_${sf.currentlist_a.name}.log"/>
+                    <arg value="${build.log.dir}/listdir_${build.id}_${sf.currentlist_b.name}.log"/>
+                </exec>
+            </then>
+        </if>
+    </target>
   
+    <target name="sf-intersect-dir">
+        <property name="sf.currentlist_a.name"   value="${sf.list_a.name}"/> 
+        <property name="sf.currentlist_b.name"   value="${sf.list_b.name}"/>
+        <property name="sf.dir.location" value="${build.drive}/epoc32"/> 
+    
+        <if>
+            <istrue value="${sf.spec.dirdelta.enable}"/>
+            <then>
+                <echo message="Inersection requested for ${sf.currentlist_a.name} vs ${sf.currentlist_b.name} "/>
+                <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_${sf.currentlist_b.name}_intersect.log">
+                    <arg value="${sf.common.config.dir}/tools/difflist.pl"/>
+                    <arg value="${build.log.dir}/listdir_${build.id}_${sf.currentlist_a.name}.log"/>
+                    <arg value="${build.log.dir}/listdir_${build.id}_${sf.currentlist_b.name}.log"/>
+                    <arg value="-I"/> <!-- run difflist in intersect mode -->
+                </exec>
+            </then>
+        </if>
+    </target>
+
     <target name="sf-build-noprep" depends="sf-compile">
         <echo>[SF-BUILD-NOPREP]</echo>
     </target>
     
     <target name="create-canonical-sysdef-file">
-      <if>
-        <istrue value="${sf.spec.systemdefinition.assemble}"/>
-        <then>
-          <echo message="Calling Helium create-canonical-sysdef-file target to assemble sysdef fragments."/>
-          <runtarget target="compile.create-canonical-sysdef-file"/>
-        </then>
-        <else>
-          <echo message="Will use ${build.drive}/${sf.spec.systemdefinition.location} as is as sysdef file"/>
-          <copy file="${build.drive}/${sf.spec.systemdefinition.location}" tofile="${build.drive}/output/build/canonical_system_definition.xml" failonerror="true" verbose="true"/>
-        </else>
-      </if>
+        <if>
+            <istrue value="${sf.spec.systemdefinition.assemble}"/>
+            <then>
+                <echo message="Calling Helium create-canonical-sysdef-file target to assemble sysdef fragments."/>
+                <runtarget target="compile.create-canonical-sysdef-file"/>
+            </then>
+            <else>
+                <echo message="Will use ${build.drive}/${sf.spec.systemdefinition.location} as is as sysdef file"/>
+                <copy file="${build.drive}/${sf.spec.systemdefinition.location}" tofile="${build.drive}/output/build/canonical_system_definition.xml" failonerror="true" verbose="true"/>
+            </else>
+        </if>
     </target>
     
     <target name="sf-compile">    
+        <!-- TODO: add here assigments to raptor-related ant references -->
     
-    	<!-- TODO: add here assigments to raptor-related ant references -->
- 	
-    	<!-- hlm:argSet id="sbs.tools.var">
-			<hlm:arg name="config" value="${sf.spec.sbs.config}" />
-			<hlm:arg name="singlejob" value="..." />
-			<hlm:arg name="enable-filter" value="..." />
-		</hlm:argSet -->
-    	
+        <!-- hlm:argSet id="sbs.tools.var">
+            <hlm:arg name="config" value="${sf.spec.sbs.config}" />
+            <hlm:arg name="singlejob" value="..." />
+            <hlm:arg name="enable-filter" value="..." />
+        </hlm:argSet -->
+        
         <!-- target name="compile-main-prebuild" -->
         <antcall target="compile-main" inheritAll="false">
             <param name="build.system" value="${sf.spec.build.system}"/>
@@ -280,29 +318,28 @@
     </target>
     
     <target name="sf-tag-hg-code">
-      <property name="sf.tagafterbuild.tag" value="${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}"/>
-      <fmpp sourceFile="${sf.common.config.dir}/templates/tag-hg-code.ant.xml.ftl"
-            outputFile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml">
-        <data expandProperties="yes">
-              ant: antProperties()
-              data: csv(${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
-        </data>
-      </fmpp>
-      <ant antfile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml"/>
+        <property name="sf.tagafterbuild.tag" value="${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}"/>
+        <fmpp sourceFile="${sf.common.config.dir}/templates/tag-hg-code.ant.xml.ftl"
+              outputFile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml">
+            <data expandProperties="yes">
+                ant: antProperties()
+                data: csv(${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
+            </data>
+        </fmpp>
+        <ant antfile="${sf.common.config.dir}/generated/tag-hg-code.ant.xml"/>
     </target>
     
     <target name="sf-diamondize-bom">
-      <fmpp sourceFile="${sf.common.config.dir}/templates/build-info.xml.ftl"
-            outputFile="${build.drive}/output/logs/BOM/build-info.xml">
-        <data expandProperties="yes">
-              ant: antProperties()
-              config: csv(${build.drive}/output/logs/BOM/config.csv,{separator:',',headers:[loc,dst,rev]})
-              project: csv(${build.drive}/output/logs/BOM/project.csv,{separator:',',headers:[loc,dst,rev]})
-              baseline: slicedText(${build.drive}/output/logs/BOM/baseline.txt,{trim})
-              sources: csv(${build.drive}/output/logs/BOM/sources.csv,{separator:',',headers:[loc,dst,rev]})
-              
-        </data>
-      </fmpp>
+        <fmpp sourceFile="${sf.common.config.dir}/templates/build-info.xml.ftl"
+              outputFile="${build.drive}/output/logs/BOM/build-info.xml">
+            <data expandProperties="yes">
+                ant: antProperties()
+                config: csv(${build.drive}/output/logs/BOM/config.csv,{separator:',',headers:[loc,dst,rev]})
+                project: csv(${build.drive}/output/logs/BOM/project.csv,{separator:',',headers:[loc,dst,rev]})
+                baseline: slicedText(${build.drive}/output/logs/BOM/baseline.txt,{trim})
+                sources: csv(${build.drive}/output/logs/BOM/sources.csv,{separator:',',headers:[loc,dst,rev]})              
+            </data>
+        </fmpp>
     </target>
     
   <target name="generate-layers">
@@ -323,6 +360,159 @@
     <delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
   </target>
 
+    <target name="sf-preprocess-package-config">
+        <mkdir dir="${sf.common.config.dir}/generated"/>
+        <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zipconfig.log">
+            <arg value="${sf.common.config.dir}/tools/populateziptemplate.pl"/>
+            <arg value="${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}"/>
+            <arg value="${sf.common.config.dir}/templates/zip.cfg.xml.ftl.template"/>
+            <arg value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
+        </exec>
+    </target>
+    
+    <target name="sf-zip-content" depends="preprocess-zip-config">
+        <property name="zip.${zip.target.name}.log.file" location="${build.log.dir}/${build.id}_${zip.target.name}_zip.log" />
+        <property name="zips.${zip.target.name}.spec.name" value="${zip.target.name}" />
+        <hlm:zipContentMacro type="${zip.target.name}" file="${zip.config.file}" />
+    </target>
+    
+    <target name="sf-package-source" depends="sf-preprocess-package-config">
+        <antcall target="sf-zip-content">
+            <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
+            <param name="zip.target.name" value="src" />
+        </antcall>
+    </target>
+    
+    <target name="sf-package-binary" depends="sf-preprocess-package-config,sf-package-postbuild-rnd">
+        <!--antcall target="sf-zip-content">
+            <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
+            <param name="zip.target.name" value="bin" />
+        </antcall-->
+
+        <if><available file="${build.drive}/rnd_excludefile.txt" />
+        <then>
+            <echo message="Packaging with exclude list"/>
+            <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_epoc32.log">
+            <arg value="a"/>
+            <arg value="-tzip"/>
+            <arg value="-x@${build.drive}/rnd_excludefile.txt"/> <!-- excludes -->
+            <arg value="-x!epoc32\build"/> 
+            <arg value="-xr!*.sym"/> 
+            <arg value="binaries_epoc.zip"/> 
+            <arg value="epoc32\"/>
+            </exec>
+            <move file="${build.drive}/rnd_excludefile.txt" todir="${build.log.dir}/"/>
+        </then>
+        <else>
+            <echo message="Packaging without exclude list"/>
+            <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/zip_${build.id}_binaries_epoc32.log">
+            <arg value="a"/>
+            <arg value="-tzip"/>
+            <arg value="-x!epoc32\build"/> <!-- excludes -->
+            <arg value="-xr!*.sym"/> 
+            <arg value="binaries_epoc.zip"/> 
+            <arg value="epoc32\"/>
+        </exec>
+        </else>
+        </if>
+        <if><available file="${build.drive}/binaries_epoc.zip"/>
+        <then><move file="${build.drive}/binaries_epoc.zip" todir="${build.drive}/output/zips/"/></then>
+        </if>
+    </target>
+
+    <target name="sf-package-postbuild-rnd" depends="sf-preprocess-package-config">
+
+        <!-- zip any RnD _includefile.txt files generated during source packaging -->
+        <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zip_postbuild.log">
+            <arg value="${sf.common.config.dir}/tools/zip_includefiles.pl"/>
+        </exec>
+        <!-- cleanup my moving includefiles to logs and zips to zips\postbuild -->
+        <move todir="${build.log.dir}">
+           <fileset dir="${build.drive}"><include name="*_includefile.txt"/></fileset>
+        </move>
+        <move todir="${build.drive}/output/zips/postbuild">
+           <fileset dir="${build.drive}"><include name="bin_rnd_*.zip"/></fileset>
+        </move>
+        <!-- TODO: merge with release_metadata.xml ? -->
+    </target>
+
+    <!-- unpack rnd zips if available -->
+    <target name="sf-unpack-rnd">
+        <echo message="Unpacking any available RnD binaries"/>
+        <exec executable="7za" dir="${build.drive}" output="${build.log.dir}/unzip_${build.id}_binaries_rnd.log">
+        <arg value="x"/>
+        <arg value="${build.drive}/output/zips/bin_rnd*.zip"/>
+        </exec>
+    </target>
+    
+    <target name ="sf-make-junction">
+        
+        <mkdir dir="${sf.spec.test.epocroot}"/>
+
+        <exec executable="perl" dir="${sf.common.config.dir}/tools/ats" failonerror="false" output="${build.log.dir}/ATS_${build.id}_make_junction.log">
+        <arg value="make_junction.pl"/>
+        <arg value="--link=${sf.spec.test.epocroot}/epoc32"/>
+        <arg value="--target=${build.drive}/epoc32"/>
+        <arg value="--force"/>
+      </exec>
+    </target>
+
+    <target name ="sf-delete-junction">
+        <exec executable="junction.exe" dir="${sf.spec.test.epocroot}" failonerror="false" output="${build.log.dir}/ATS_${build.id}_delete_junction.log">
+        <arg value="-d"/>
+        <arg value="epoc32"/>
+      </exec>
+    </target>  
+    
+    <target name="sf-send-testpkg" depends="sf-make-junction">
+        <mkdir dir="${sf.spec.test.package.droppath}"/>
+        <echo message="Sending test package ${sf.spec.test.package.name} to ${sf.spec.test.host.name} path ${sf.spec.test.host.droppath}"/>
+        <exec executable="perl" dir="${sf.common.config.dir}/tools/ats" failonerror="false" output="${build.log.dir}/ATS_${build.id}_testdrop.log">
+            <arg value="ats3_testdrop.pl"/>
+            <arg value="--host=${sf.spec.test.host.name}"/>
+            <arg value="--username=${sf.spec.test.host.username}"/>
+            <arg value="--password=${sf.spec.test.host.password}"/>
+            <arg value="--local-test-pkg=${sf.spec.test.package.name}"/>
+            <arg value="--local-drop-path=${sf.spec.test.package.droppath}"/>
+            <arg value="--host-drop-path=${sf.spec.test.host.droppath}"/>
+        </exec>
+    </target>
+  
+    <!-- runs analysis of missing bins and source -->
+    <target name="sf-run-analysis">
+        <mkdir dir="${build.log.dir}/analysis"/>
+
+        <echo message="Running source analysis of ANT output"/>
+        <exec executable="perl" dir="${build.log.dir}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_scan_ant.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/scan_antlogs.pl"/>
+            <arg value="*ant*"/>
+        </exec>
+
+        <echo message="Running list analysis"/>
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_list_results.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/parselistdirs.pl"/>
+            <arg value="..\"/>
+        </exec>
+
+        <echo message="Running whatlog analysis"/>
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_what_results.csv">
+            <arg value="${sf.common.config.dir}/tools/analysis/parsewhatlog.pl"/>
+            <arg value="..\"/>
+        </exec>
+
+        <echo message="Running summary analysis"/>
+        <exec executable="perl" dir="${build.log.dir}/analysis" failonerror="false" output="${build.log.dir}/analysis/${build.id}_summary.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/merge_csv.pl"/>
+            <arg value="${build.id}_what_results.csv"/>
+            <arg value="${build.id}_list_results.log"/>
+        </exec>
+
+        <echo message="Running collision analysis"/>
+        <exec executable="perl" dir="${build.drive}" failonerror="false" output="${build.log.dir}/analysis/${build.id}_collisions.log">
+            <arg value="${sf.common.config.dir}/tools/analysis/find_collisions.pl"/>
+            <arg value="${build.log.dir}/analysis/${build.id}_what_results.csv"/>
+        </exec>
+    </target>
+  
 </project>
 
-
--- a/common/common_props.ant.xml	Wed May 20 14:26:55 2009 +0100
+++ b/common/common_props.ant.xml	Fri May 29 17:20:47 2009 +0100
@@ -12,11 +12,10 @@
     <property name="sf.spec.job.freespace" value="10"/>
     <property name="sf.spec.email.from" value="fbf@symbian.org"/> <!-- needs to be defined for S60 platform builds -->
     
-    <property name="sf.spec.systemdefinition.assemble" value="false"/>
+    <property name="sf.spec.systemdefinition.assemble" value="true"/>
     <!-- property name="sf.spec.systemdefinition.file" value=""/ -->
     
-    <!-- property name="sf.spec.sbs.config" value="armv5"/ -->
-    <property name="sf.spec.sbs.config" value="winscw"/>
+    <property name="sf.spec.sbs.config" value="armv5"/>
     
     <property name="sf.spec.build.target" value="all"/>
     <property name="sf.spec.build.variant" value=""/>
@@ -46,8 +45,8 @@
     <property name="sf.spec.publish.unpackagedartefacts.enable" value="true"/>
     <property name="sf.spec.publish.packagedartefacts.enable" value="true"/>
     <property name="sf.spec.publish.network.freespace" value="10"/>
-    <property name="sf.spec.publish.networkdrive" value="\\sym-build01\F$\SF_builds"/>
-    <property name="sf.spec.publish.rootdir" value="\\sym-build01\F$\SF_builds"/>
+    <property name="sf.spec.publish.networkdrive" value="\\lon-engbuild87\d$\SF_builds"/>
+    <property name="sf.spec.publish.rootdir" value="\\lon-engbuild87\d$\SF_builds"/>
     
     <property name="sf.spec.tagafterbuild.enable" value="false"/>
 
@@ -63,17 +62,22 @@
     <!-- zip all logs before publish -->
     <property name="sf.spec.logs.zip.enable"  value="true"/>
     
-    <property name="sf.spec.smoketest.enable" value="false"/>
-    <property name="sf.spec.smoketest.host" value="sym-build01"/>
-    <property name="sf.spec.smoketest.epocroot" value="D:\ATS3\winscw_smoketest"/>
-    <property name="sf.spec.smoketest.localtestpkg" value="D:\ATS3\smoketest_package\9.zip"/>
-    <property name="sf.spec.smoketest.localdroppath" value="D:\ATS3\TestDrops"/>
-    <property name="sf.spec.smoketest.hostdroppath" value="T:\TestDrops"/>
-    <property name="sf.spec.smoketest.ats3.username" value="admin"/>
-    <property name="sf.spec.smoketest.ats3.password" value="admin"/>
-    
-    
-	
+    <!-- packaging options for bin/src-->
+    <property name="sf.spec.package.bin.enable"  value="false"/>
+    <property name="sf.spec.package.src.enable"  value="false"/>
+
+    <!-- ATS client properties -->
+    <property name="sf.spec.test.sendpkg.enable" value="false"/>
+    <property name="sf.spec.test.host.name"      value="172.16.11.11"/> <!-- sym-build01 -->
+    <property name="sf.spec.test.host.username"  value="admin"/>
+    <property name="sf.spec.test.host.password"  value="admin"/>
+    <property name="sf.spec.test.host.droppath"  value="T:\TestDrops"/>
+    <property name="sf.spec.test.epocroot"       value="D:\ATS3\winscw_smoketest"/>
+
+    <!-- ATS local properties -->
+    <property name="sf.spec.test.package.name"      value="D:\ATS3\smoketest_package\9.zip"/>
+    <property name="sf.spec.test.package.droppath"  value="D:\ATS3\TestDrops"/>
+
 </project>
 
 
--- a/common/smoketest/ats3_testdrop.pl	Wed May 20 14:26:55 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-#!/usr/bin/perl
-
-#curl "http://sym-build01:8080/ats3/XTestRunExecute.do?username=admin&password=admin&testrunpath=D:\smoketests\test_drops\9.zip
-use strict;
-use Getopt::Long;
-use File::Copy;
-use File::Spec;
-
-my $username = "admin";
-my $password = "admin";
-my $host;
-my $schedule;
-my $host_drop_path;
-my $local_drop_path;
-my $local_test_pkg;
-my $help;
-my $dev_null = $^O =~ /^MSWin/ ? "nul" : "/dev/null";
-
-sub usage($);
-sub help();
-sub usage_error();
-
-my %optmap = (  'host' => \$host,
-			    'local-test-pkg' => \$local_test_pkg,
-				'host-drop-path' => \$host_drop_path,
-				'local-drop-path' =>\$local_drop_path,
-				'username' => \$username,
-				'password' => \$password,
-				'schedule' => \$schedule,
-                'help' => \$help);
-
-GetOptions(\%optmap,
-          'host=s',
-          'local-test-pkg=s',
-          'host-drop-path=s',
-          'local-drop-path=s',
-          'username=s',
-          'password=s',
-          'schedule=s',
-          'help!') 
-          or usage_error();
-
-if ($help) {
-	help();
-}
-
-usage_error(), unless (defined($host) && defined($local_test_pkg) && defined($local_drop_path) && defined($host_drop_path));
-
-my $curl_version = $^O =~ /^MSWin/ ? `curl --version 1> $dev_null 2>&1` : `curl --version 1> $dev_null 2>&1`;
-die("Need program \"curl\". Not found"), if ($?);
-die("Test drop path \"$local_drop_path\" not found"), unless ( -d "$local_drop_path");
-
-$host .= ":8080", unless ($host =~ /:\d+$/);
-
-my ($vol,$dir,$pkg);
-my $local_test_drop;
-my $host_test_drop;
-
-if ($local_test_pkg =~ /^\.\.\.(.+)/ ) {
-    $pkg = $1;
-    $local_test_drop = File::Spec->catfile($local_drop_path,$pkg);
-    die("Test package file \"$local_test_drop\" not found"), unless ( -f "$local_test_drop");        
-}
-else {
-    die("Test package file \"$local_test_pkg\" not found"), unless ( -f "$local_test_pkg");
-    ($vol,$dir,$pkg) = File::Spec->splitpath($local_test_pkg);
-    $local_test_drop = File::Spec->catfile($local_drop_path,$pkg);
-    if ( -f "$local_test_drop") {
-        my $cmp_local_test_drop = $local_test_drop;
-        my $cmp_local_test_pkg = $local_test_pkg;
-        if ($^O =~ /^MSWin/) {
-            $cmp_local_test_drop = lc($local_test_drop);
-            $cmp_local_test_pkg = lc($local_test_pkg);        
-        }   
-        if ("$cmp_local_test_drop" eq "$cmp_local_test_pkg") {
-            if (unlink($local_test_drop) == 0) {
-                die("Can't delete stale test drop \"$local_test_drop\". $!");
-            }
-            else {
-                print("A stale test drop \"$local_test_drop\" existed. Deleted\n");
-            }
-        }
-    }
-    copy("$local_test_pkg","$local_test_drop")
-        or die("Cannot copy \"$local_test_pkg\" -> \"$local_test_drop\". $!");
-}
-$host_test_drop = File::Spec->catfile($host_drop_path,$pkg);
-my $url ="http://$host/ats3/XTestRunExecute.do?username=$username&password=$password&testrunpath=$host_test_drop";
-$url .= "&schedule=$schedule", if (defined($schedule));
-my $curl_cmd = "curl \"$url\"";
-system("$curl_cmd");
-die("\nTest drop failed: $!"), if ($?);
-print("\nTest drop done");
-
-exit 0;
-
-sub usage($)
-{
-    my $error = shift;
-    my $fh = $error == 0 ? *STDOUT : *STDERR;
-    print $fh "ats3_testdrop.pl\n" .
-            "Send a test drop to an ATS3 server for execution\n" .
-            "usage:\n" .
-            "  ats3_testdrop.pl --help\n" .
-            "  ats3_testdrop.pl --host=HOSTNAME --local-test-pkg=PKGFILE --local-drop-path=LOCALPATH " .
-                " --host-drop-path=HOSTPATH " .
-                "[--username=ATS3USERNAME] [--password=ATS3PASSWORD] [--schedule=DD.MM.YYYY-HH:MM]\n" .
-            "options:\n" .
-            "  --help                        Display this help and exit\n" .
-            "  --host=HOSTAME                HOSTNAME is ATS3 server\n" .
-            "  --local-test-pkg=PKGFILE      PKGFILE is the test package.\n" .
-            "                                If PKGFILE begins "..." a filename in LOCALPATH is assumed\n" .
-            "  --local-drop-path=LOCALPATH   Path to local directory where PKGFILE will be dropped\n" .            
-            "  --host-drop-path=HOSTPATH     Host directory that is mapped to LOCALPATH.\n" .
-            "                                Must agree with the properties of the registered device that the test package nominates\n" .
-            "  --username=ATS3USERNAME       ATS3 user to whome the test will belong. Default=admin\n" .
-            "  --password=ATS3PASSWORD       Password of ATS3 user. Default=admin\n" .
-            "  --schedule=DD.MM.YYYY-HH:MM   Date-time at which test is to run. Default=as soon as possible\n";
-    exit $error;            
-}
-
-sub help()
-{
-    usage(0);
-}
-
-sub usage_error()
-{
-    usage(1);
-}             
-
-# EOF
-   
\ No newline at end of file
--- a/common/smoketest/make_junction.pl	Wed May 20 14:26:55 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use Getopt::Long;
-use File::Spec;
-
-my $link;
-my $target;
-my $help;
-my $force = 0;
-
-sub usage($);
-sub help();
-sub usage_error();
-
-my %optmap = (  'link' => \$link,
-			    'target' => \$target,
-			    'force' => \$force, 
-                'help' => \$help);
-
-GetOptions(\%optmap,
-          'link=s',
-          'target=s',
-          'force!',
-          'help!') 
-          or usage_error();
-
-if ($help) {
-	help();
-}
-
-usage_error(), unless (defined($link) && defined($target));
-
-my $junction_help = `junction /?`;
-die("Need command \"junction\". Not found\n"), if ($junction_help =~ /is not recognised/);
-die("Directory \"$target\" not found\n"), unless -d "$target";
-
-my ($vol,$dir,$file) = File::Spec->splitpath($target);
-my @subst_lines = `subst`;
-
-foreach (@subst_lines) {
-    my $line = $_;
-    chomp($line);
-    $line =~ /^(.:)\\: => (.*)$/;
-    die("Cannot parse output of 'subst'. Bailing out confused."), unless (defined($1) and defined($2));    
-    my $subst_drive = $1;
-    my $subst_targ = $2;
-    if (lc($subst_drive) eq lc($vol)) {
-        print("Target $target is in a substituted drive: $line\n");
-        $target = File::Spec->catfile(($subst_targ,$dir),$file);
-        print("Target $target will be used\n");
-        last;
-    }
-}
-
-
-if ( -e "$link") {
-    print("\"$link\" already exists. ");
-    if (!$force) {
-        my $choice;
-        while($choice ne 'y' and $choice ne 'n') {
-            print "Delete? (y/n)? ";
-            $choice = <STDIN>;
-            chomp($choice);
-            $choice = lc($choice);
-        }
-        $force = $choice eq 'y';
-    }    
-    if ($force) {
-        system("junction -d \"$link\" > nul");
-        if ($?) {
-            die("Cannot delete \"$link\": $!\n");
-        }
-        else {
-            print "Deleted \"$link\"\n";
-        }
-    }
-} 
-
-system("junction \"$link\" \"$target\" > nul");
-if ($?) {
-    die("Cannot cteate junction \"$link\" -> \"$target\": $!\n");
-}
-else {
-    print("Created junction \"$link\" -> \"$target\"\n");
-}
-exit 0;
-
-sub usage($)
-{
-    my $error = shift;
-    my $fh = $error == 0 ? *STDOUT : *STDERR;
-    print $fh "make_junction.pl\n" .
-            "Create a Windows junction (a.k.a symbolic link)\n" .
-            "usage:\n" .
-            "  make_junction.pl --help\n" .
-            "  make_junction.pl --link=LINKDIR --target=TARGDIR\n " .
-            "options:\n" .
-            "  --help                        Display this help and exit\n" .
-            "  --link=LINKDIR                LINKDIR specifies the junction to be created. Last component is the junction. The rest must exist\n" .
-            "  --target=TARGDIR              TARGDIR is directory to which the junction will point.\n" .
-            "                                If TARGDIR is in a substed drive, the real path will be used.\n";
-    exit $error;            
-}
-
-sub help()
-{
-    usage(0);
-}
-
-sub usage_error()
-{
-    usage(1);
-}             
-
-# EOF
-   
\ No newline at end of file
--- a/common/smoketest/smoke_test.ant.xml	Wed May 20 14:26:55 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="SF-SMOKE-TEST">
-
-  <target name="sf-smoke-test">
-    <echo>[SF-SMOKE-TEST]</echo>
-    
-    <exec executable="perl" dir="${sf.common.config.dir}/smoketest" failonerror="true" output="${build.drive}/output/logs/smoke_test_1.log">
-      <arg value="make_junction.pl"/>
-      <arg value="--link=${sf.spec.smoketest.epocroot}/epoc32"/>
-      <arg value="--target=${build.drive}/epoc32"/>
-      <arg value="--force"/>
-    </exec>
-    
-    <exec executable="perl" dir="${sf.common.config.dir}/smoketest" failonerror="true" output="${build.drive}/output/logs/smoke_test_2.log">
-      <arg value="ats3_testdrop.pl"/>
-      <arg value="--host=${sf.spec.smoketest.host}"/>
-      <arg value="--username=${sf.spec.smoketest.ats3.username}"/>
-      <arg value="--password=${sf.spec.smoketest.ats3.password}"/>
-      <arg value="--local-test-pkg=${sf.spec.smoketest.localtestpkg}"/>
-      <arg value="--local-drop-path=${sf.spec.smoketest.localdroppath}"/>
-      <arg value="--host-drop-path=${sf.spec.smoketest.hostdroppath}"/>
-    </exec>
-    
-  </target>
-  
-</project>
\ No newline at end of file
--- a/common/templates/source-spec.ant.xml.ftl	Wed May 20 14:26:55 2009 +0100
+++ b/common/templates/source-spec.ant.xml.ftl	Fri May 29 17:20:47 2009 +0100
@@ -3,6 +3,7 @@
 
 <#assign fileset = "" />
 <#assign sync_list = "" />
+<#assign bom_list  = "" />
 <#assign dollar = "$"/>
 <#assign count = 0 />
 
@@ -28,6 +29,13 @@
                     </hlm:latestTag>
                 </hlm:update>
             </hlm:scm>
+        
+        </sequential>
+    </target>
+
+    <target name="sf-bom-info-${count}">
+
+        <sequential>
             
             <!-- record info on source code repo/rev in BOM file  -->
             <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.rev">
@@ -47,9 +55,11 @@
         
         </sequential>
     </target>
-    
+
+
     <#assign fileset = "${fileset}" + "<fileset dir=\"${ant['build.drive']}${pkg_detail.dst}\" includes=\"${pkg_detail.pattern}\"/>" />       
-    <#assign sync_list = "${sync_list}" + "<runtarget target=\"sf-prebuild-${count}\"/>\n"/>    
+    <#assign sync_list = "${sync_list}" + "<runtarget target=\"sf-prebuild-${count}\"/>\n"/>       
+    <#assign bom_list = "${bom_list}" + "<runtarget target=\"sf-bom-info-${count}\"/>\n"/>    
     <#assign count = count + 1 />
 
 </#list>
@@ -65,5 +75,8 @@
     ${sync_list}
   </parallel>
 
+
+  ${bom_list}
+
 </target>
 </project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/templates/zip.cfg.xml.ftl.template	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<build>
+	<config abstract="true">
+		<!-- Options that apply accross the board -->
+		<set name="archive.tool" value="7za" />
+		<set name="root.dir" value="${build.drive}/" />
+		<set name="temp.build.dir" value="${temp.build.dir}" />
+		<set name="casesensitive" value="false" />
+		<set name="archives.dir" value="${build.output.dir}/zips" />
+		<set name="policy.internal.name" value="removed" />
+		<!--set name="policy.csv" value="${policy.csv}" /-->
+		<set name="policy.zip2zip" value="false" />
+		<set name="policy.default.value" value="" />
+		
+		<!--  Metadata creation -->
+		<set name="grace.template" value="${temp.build.dir}/release_metadata_template.xml" />
+		<set name="grace.metadata" value="true" />
+		<set name="grace.service" value="${grace.service.name}" />
+		<set name="grace.product" value="${grace.product.name}" />
+		<set name="grace.release" value="${grace.release.name}" />
+		
+		<!-- Specify this config to package all inputs to the build -->
+		<config name="src" abstract="true">
+			<!-- Options that apply to all src configs -->
+			<set name="exclude" value="**/.hg/**"/>
+			<set name="exclude" value="**/.hgtags"/>
+			<set name="exclude" value="**/.hgignore"/>
+			<set name="exclude" value="**/.hg_archival.txt"/>
+			
+			<!-- These configs will be populated with tags for the source -->
+			<config name="sfl" abstract="true">
+				<set name="grace.filters" value="src" />
+			</config>
+			<config name="oss" abstract="true">
+				<set name="grace.filters" value="src" />
+			</config>
+			<config name="rnd" abstract="true">
+				<set name="grace.filters" value="rnd" />
+			</config>
+		</config>
+		<!-- Specify this config to package all outputs from the build -->
+		<config name="bin" abstract="true">
+			<!-- This config will be populated with exclusions for the rnd bins -->
+			<config>
+				<set name="name" value="binaries_epoc"/>
+				<set name="grace.filters" value="emu" />
+				<set name="include" value="epoc32/**"/>
+				<set name="exclude" value="epoc32/build/**"/>
+			</config>
+		</config>
+	</config>
+</build>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/find_collisions.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,179 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Adds info form a file to a CSV
+
+use strict;
+
+main();
+
+sub main()
+{
+  my $csvfile = shift @ARGV;
+  my $filelist = shift @ARGV;
+
+  if(! -e $csvfile)
+  {
+    die "cannot find $csvfile\n";
+  }
+
+  open(CSV,"<$csvfile") or die "Couldn't open $csvfile\n";
+  my $header = <CSV>;
+  $header =~ s/\n//;
+  print RESULTS $header.",status\n";
+  my @fields = split(',',$header);
+  my $targetindex = 0;
+  my $counter = 0;
+  my $bldinfindex = 0;
+  my $makefileindex = 0;
+  my $typeindex = 0;
+  my $extindex = 0;
+  my %failed;
+  my %bldinffiles;
+  
+  my %targets;
+  
+  foreach my $column (@fields)
+  {
+      if($column =~ m/target/)
+      {
+          $targetindex = $counter;
+      }
+      elsif($column =~ m/bldinf/)
+      {
+        $bldinfindex = $counter;
+      }
+      elsif($column =~ m/makefile/)
+      {
+        $makefileindex = $counter;
+      }
+      elsif($column =~ m/type/)
+      {
+        $typeindex = $counter;
+      }
+      elsif($column =~ m/extension/)
+      {
+        $extindex = $counter;
+      }
+      ++$counter;
+  }
+#        print "\ntarget:$targetindex\tbuildinf:$bldinfindex\n";
+    #header
+  my $resultsfile = $csvfile."_collisions.csv"; 
+  open(RESULTS, ">$resultsfile") or die "Coudn't open $resultsfile";
+  
+  print RESULTS "Collision,target,extension,type,source1,source2\n";
+  while(my $line = <CSV>)
+      {
+      $line =~ s/\n//;
+      @fields = split(',',$line);
+      my $target = $fields[$targetindex];
+      $target = lc($target);
+      my $makefile = $fields[$makefileindex];
+      my $bldinf =   $fields[$bldinfindex];
+                
+      if(defined $targets{$target})
+        {
+          my $currentmakefile = $targets{$target};
+          if($makefile eq "")
+          {
+            $makefile = $bldinf;
+          }
+          if (!($currentmakefile eq $makefile))
+            {
+            my $type = $fields[$typeindex]; #DODGY - smoe custom makefiles also clash with export headers...
+            my $ext = $fields[$extindex];
+            my $collision = "-";
+            if($type eq "export")
+            {
+              $collision = diffcollision($target,$currentmakefile,$makefile);
+            }   
+            print RESULTS "$collision,$target,$ext,$type,$currentmakefile,$makefile\n";
+            }
+        }
+      else
+        {
+          if($makefile eq "")
+          {
+             $targets{$target} = $bldinf;
+          }
+          else
+          {
+            $targets{$target} = $makefile;
+          }  
+        }      
+      }
+  close RESULTS;    
+  close CSV;
+}
+
+sub diffcollision($$$)
+{
+  my $target = shift;
+  my $left = shift;
+  my $right = shift;
+  
+  $target =~ s/\//\\/g;
+  $left  =~ s/\//\\/g;
+  $right =~ s/\//\\/g;  
+  my $ret = "unknown";
+  if(!-e $target)
+  {
+    $ret = "missing";
+  }
+  else
+  {
+    if(-e $left && -e $right)
+    {
+      my $leftdiff = 0;
+      my $rightdiff = 0;
+      open(DIFF,"diff $left $target|") or die "couldn't execute diff";
+      print "diff $left $target\n";
+      
+      while(my $line = <DIFF>)
+      {
+        if($line =~ m/\S+/)
+        {
+          $leftdiff = 1;
+          print "\t$line";
+        }
+      }
+      close DIFF;
+
+      open(DIFF,"diff $right $target|") or die "couldn't execute diff";
+      print "diff $right $target\n";
+      while( my $line = <DIFF>)
+      {
+        if($line =~ m/\S+/)
+        {
+          $rightdiff = 1;
+         print "\t$line";
+        }
+      }
+      close DIFF;
+
+     if($leftdiff && !$rightdiff )
+        {$ret = "match right";}
+     elsif($rightdiff && !$leftdiff)
+        {$ret = "match left";}
+     elsif($rightdiff && $leftdiff)
+        {$ret = "match neither";}
+     elsif(!$rightdiff && !$leftdiff)
+        {$ret = "match both";}                  
+    }
+  
+    
+  }
+  return $ret; 
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/merge_csv.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,124 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Adds info form a file to a CSV
+
+use strict;
+my $csvfile = shift @ARGV;
+my $filelist = shift @ARGV;
+
+
+if(! -e $csvfile)
+{
+  die "cannot find $csvfile\n";
+}
+
+  
+if(!-e $filelist)
+{
+  die "Cannot find $filelist\n";
+}
+        my %files;
+        open(FILES,"<$filelist") or die "Couldn't open $filelist\n";
+        while(my $line = <FILES>)
+        {
+            $line =~ s/\\/\//g;
+
+            if($line =~ m/^(.+)\s*:\s(.+\S)\s*$/)
+            {
+                my $group = $1;
+                my $file = $2;
+
+                $file = lc($file);
+                if($files{$file})
+                {
+           
+                    $files{$file} = $files{$file}.",".$group;                                        
+                       print "Multi:$file".$files{$file}."\n";
+
+                }
+                else
+                {
+                     $files{$file} = ",".$group;
+                }
+            }                
+        }
+        close FILE;
+
+        open(CSV,"<$csvfile") or die "Couldn't open $csvfile\n";
+        my $resultsfile = $csvfile."_results.csv"; 
+        open(RESULTS,">$resultsfile") or die "Couldn't open write to $resultsfile\n";
+        my $header = <CSV>;
+        $header =~ s/\n//;
+        print RESULTS $header.",status\n";
+        my @fields = split(',',$header);
+        my $targetindex = 0;
+        my $counter = 0;
+        my $bldinfindex = 0;
+        
+        my %failed;
+        my %bldinffiles;
+        foreach my $column (@fields)
+        {
+            if($column =~ m/target/)
+            {
+                $targetindex = $counter;
+            }
+            elsif($column =~ m/bldinf/)
+            {
+              $bldinfindex = $counter;
+            }
+            ++$counter;
+        }
+#        print "\ntarget:$targetindex\tbuildinf:$bldinfindex\n";
+        while(my $line = <CSV>)
+            {
+            $line =~ s/\n//;
+            @fields = split(',',$line);
+            my $target = $fields[$targetindex];
+            $target = lc($target);
+            my $bldinf = $fields[$bldinfindex];
+            if(!defined $bldinffiles{$bldinf})
+            {
+              $bldinffiles{$bldinf} = 1;
+            }
+ 
+            if(defined $files{$target})
+                {                    
+                    $line = $line.$files{$target};
+                    if($files{$target} =~ m/fail/i)
+                    {
+                      if(!defined $failed{$bldinf})
+                      {
+                        $failed{$bldinf} = 1;
+                      }
+                    }
+                }
+            print RESULTS $line."\n";
+            
+            }            
+        close RESULTS;
+        close CSV;
+        foreach my $bldinf (sort(keys %bldinffiles))
+        {
+          if(!defined $failed{$bldinf})
+          {
+            print "OK:\t$bldinf\n";
+          }
+        }
+        foreach my $bldinf (sort(keys %failed))
+        {
+            print "Failed:\t$bldinf\n";
+        }
+        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/parselistdirs.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,288 @@
+#!/usr/bin/perl
+use strict;
+
+#listdir_platform_MCL.PDK-3.5_baseline.log
+#listdir_platform_MCL.PDK-3.5_post-clean.log
+#listdir_platform_MCL.PDK-3.5_post-clean_delta.log
+#listdir_platform_MCL.PDK-3.5_post-build-tools2.log
+#listdir_platform_MCL.PDK-3.5_post-build-tools.log
+#listdir_platform_MCL.PDK-3.5_post-build-main.log
+#listdir_platform_MCL.PDK-3.5_s60-baseline.log
+#listdir_platform_MCL.PDK-3.5_post-s60-clean.log
+#listdir_platform_MCL.PDK-3.5_post-s60-clean_delta.log
+#listdir_platform_MCL.PDK-3.5_post-s60-build-tools.log
+#listdir_platform_MCL.PDK-3.5_post-s60-build-main.log
+
+
+
+my $lowercase = 1;
+my $useoutputfiles = 1;
+my $path = shift @ARGV;
+my $outputpath = shift @ARGV; 
+
+main();
+
+
+
+sub main()
+{
+  if($lowercase)
+  {
+    print "Running in lower case mode!\n";
+  }
+  my @listfiles = glob($path."listdir*");
+  
+  my $gt_base;
+  my $gt_clean;
+  my $gt_main;
+  my $s60_base;
+  my $s60_clean;
+  my $s60_main;
+  foreach my $file (@listfiles)
+  {
+    if($file =~ m/s60/)
+    {
+      if($file =~ m/baseline/)
+      {
+        $s60_base = parsefile($file);  
+      }
+      elsif($file =~ m/clean.log/)
+      {
+        $s60_clean = parsefile($file);
+      }
+      elsif($file =~ m/main.log/)
+      {
+        $s60_main = parsefile($file);
+      }
+    }
+    else
+    {
+      if($file =~ m/baseline/)
+      {
+        $gt_base = parsefile($file);  
+      }
+      elsif($file =~ m/clean.log/)
+      {
+        $gt_clean = parsefile($file);
+      }
+      elsif($file =~ m/main.log/)
+      {
+        $gt_main = parsefile($file);
+      } 
+    }
+  }
+
+ 
+  
+  my $gt_try = diff($gt_base, $gt_clean);
+  my $gt_fail = diff($gt_base, $gt_main);
+  my $gt_built = diff($gt_try, $gt_fail);
+
+#  printgroup($gt_fail,'fail');
+#  printgroup($gt_built,'built');
+
+
+  my $s60_try = diff($s60_base, $s60_clean);
+  my $s60_fail = diff($s60_base, $s60_main);
+  my $s60_built = diff($s60_try, $s60_fail);
+
+  my $s60_add = diff($s60_main,$s60_base); 
+  my $gt_add = diff($gt_main,$gt_base); 
+ 
+
+  my $try = union($gt_try,$s60_try); # All the stuff we try to build
+  my $untouched = diff($gt_base,$try); # all the stuff we didn't try.
+
+ #printgroup($try,"try");
+
+  my $uptodate = finduptodate($path); # this is a bit dicey, 'cos it might get deleted/rebuilt by another part...
+  my $exported = findexported($path);
+  
+  printgroup($exported,'exported');
+  $untouched = diff($untouched,union($exported,$uptodate)); 
+  printgroup($untouched,"untouched"); # 'clean' doesn't remove headers if they are 'uptodate'
+
+  #here's where the fun begins...
+
+  my $rebuildfail = intersect(union($gt_built,$gt_add), $s60_fail); #everything built in GT, minus stuff that failed in S60 
+  my $rebuilt = intersect($gt_built, $s60_built); # everything built in both
+  my $built = diff(diff(union($gt_built, $s60_built),$rebuilt),$rebuildfail); # everything built, minus rebuilt, minus rebuildfail  
+  my $fail = diff(union($gt_fail,$s60_fail),$rebuildfail); #everyhting that failed, minus the rebuild failures
+
+  my $added = diff(diff(union($gt_add,$s60_add),$exported),$rebuildfail); #all the stuff that got added, minus the stuff that filaed to rebuild
+
+  printgroup($built,"built"); 
+  printgroup($rebuilt,'rebuilt');
+  printgroup($rebuildfail,'rebuildfail');
+  printgroup($added,"added");
+  
+
+  printgroup($fail,"failed");
+  
+  $uptodate = diff($uptodate,union(union($added,$built),$exported)); #remove all stuff in other categories...'uptodate' was added late in the program
+  printgroup($uptodate,"uptodate"); # uptodate list isn't that good at the moment...put it last.
+}
+
+sub printgroup($$)
+{
+  my $group = shift;
+  my $label = shift;
+  foreach my $key (sort keys %$group)
+  {
+    print $label." : ".$key."\t".$group->{$key}."\n";
+  }
+  if($useoutputfiles)
+  {
+    my $filename = $outputpath."results_$label.log"; 
+    open(FILE,">$filename") or die "Couldn't open $filename\n";
+    foreach my $key (sort keys %$group)
+    {
+      print FILE $key."\n";
+    }    
+    close FILE;
+  }
+}
+
+sub diff($s1,$s2)
+{
+  my $s1 = shift;
+  my $s2 = shift;
+  my %r;
+  foreach my $key (keys %$s1)
+  {
+    if(!defined $s2->{$key})
+    {
+      $r{$key} = $s1->{$key};
+    }
+  }
+  return \%r;
+}
+
+
+
+sub intersect($s1,$s2)
+{
+  my $s1 = shift;
+  my $s2 = shift;
+  my %r;
+  foreach my $key (keys %$s1)
+  {
+    if(defined $s2->{$key})
+    {
+      $r{$key} = $s2->{$key};
+    }
+  }
+  return \%r;
+}
+
+sub union($s1,$s2)
+{
+  my $s1 = shift;
+  my $s2 = shift;
+  my %r;
+  foreach my $key (keys %$s1)
+  {
+    $r{$key} = $s1->{$key};
+  }
+  foreach my $key (keys %$s2) #lazy
+  {
+    $r{$key} = $s2->{$key};
+  }
+  return \%r;
+}
+
+
+sub finduptodate($path)
+{
+  my $path = shift;
+  my @files = glob($path."*compile.log");
+  my %results;
+  foreach my $file (@files)
+  {
+    print "Reading $file\n";
+    open(FILE,"<$file") or die "Cannot open $file\n";
+    while( my $line = <FILE>)
+    {
+      if($line =~ m/<info>Up-to-date:\s+(.+)<\/info>/)
+      {
+        my $str = $1;
+        $str =~ s/^\S:\///;
+        if($lowercase)
+        {
+          $str = lc($str);
+        }      
+ 
+        $results{$str} = "";
+#        print $str;
+      }
+    }     
+    close FILE;
+  }
+
+  return \%results;
+}
+
+sub findexported($)
+{
+  my $path = shift;
+  my @files = glob($path."*compile.log");
+  my %results;
+  foreach my $file (@files)
+  {
+    print "Reading $file\n";
+    open(FILE,"<$file") or die "Cannot open $file\n";
+    while( my $line = <FILE>)
+    {
+#<info>Copied u:/sf/app/conntools/emulatorlan/data/s60_32_default_snaps.xml to u:/epoc32/winscw/c/s60_32_default_snaps.xml</info>
+      if($line =~ m/<info>Copied\s+(\S+)\s+to\s+(\S+)<\/info>/)
+      {
+
+        my $str = $2; #we want the destination, not the source...
+        $str =~ s/^\S:\///;
+        if($lowercase)
+        {
+          $str = lc($str);
+        }      
+        $results{$str} = "";
+      }
+    }     
+    close FILE;
+  }
+  return \%results;
+}
+
+
+
+sub parsefile($file)
+{
+  my $file = shift;
+#  my @results;
+  my %results;
+  print "Reading $file\n";
+  open(FILE,"<$file") or die "Couldn't open $file\n";
+  while(my $line = <FILE>)
+  {
+    $line =~ s/\n//;
+    if($line =~ m/\S+/)
+    {
+      if( $line !~/^epoc32/ ) #latest lists sometimes don't have this...
+      {
+        $line = "epoc32/".$line;
+      }
+      if( $line !~/epoc32\/build\// ) #ignore epoc32/build
+      {
+        if($lowercase)
+        {
+          $line = lc($line);
+        }      
+        $results{$line} = "";
+#       $results{$line} = $file; #debugging
+      }  
+
+#     push(@results,$line)
+    }
+  }
+  close FILE;
+#  return \@results;
+  return \%results;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/parsewhatlog.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,146 @@
+#!/usr/bin/perl
+#parsewhatlog - parses a whatlog, gives csv output.
+use strict;
+
+#<whatlog bldinf='t:/sf/mw/ipappprotocols/sipconnproviderplugins/sipstatemachine/group/bld.inf' mmp='' config='winscw_udeb.whatlog'>
+#<export destination='t:/epoc32/rom/include/sipstatemachine.iby' source='t:/sf/mw/ipappprotocols/sipconnproviderplugins/sipstatemachine/group/SipStateMachine.iby'/>
+#</whatlog>
+#<whatlog bldinf='t:/sf/os/mm/mmplugins/3gplib/group/bld.inf' mmp='t:/sf/os/mm/mmplugins/3gplib/impl/group/3gpmp4lib.mmp' config='winscw_udeb.whatlog'>
+#<build>t:/epoc32/release/winscw/udeb/3gpmp4lib.lib</build>
+#<build>t:/epoc32/release/winscw/udeb/3gpmp4lib.lib</build>
+#<build>t:/epoc32/release/winscw/udeb/3gpmp4lib.dll</build>
+#</whatlog>
+#<whatlog bldinf='t:/sf/mw/messagingmw/messagingfw/msgconf/group/bld.inf' mmp='t:/sf/mw/messagingmw/messagingfw/msgconf/group/messaging_config.mmp' config='winscw_udeb.whatlog'>
+#<bitmap>t:/epoc32/data/z/resource/messaging/bif/vclp.mbm</bitmap>
+#<bitmap>t:/epoc32/release/winscw/udeb/z/resource/messaging/bif/vclp.mbm</bitmap>
+#<bitmap>t:/epoc32/release/winscw/urel/z/resource/messaging/bif/vclp.mbm</bitmap>
+#<bitmap>t:/epoc32/localisation/vclp/mbm/vclp0.bmp</bitmap>
+#<bitmap>t:/epoc32/localisation/group/vclp.info</bitmap>
+#</whatlog>
+#<whatlog bldinf='t:/sf/mw/mmmw/mmmiddlewarefws/mmfw/sounddev/group_pluginsupport/bld.inf' mmp='t:/sf/mw/mmmw/mmmiddlewarefws/mmfw/sounddev/PlatSec/MMPFiles/Sounddevice/aacdecoderconfigci.mmp' config='winscw_udeb.whatlog'>
+#<resource>t:/epoc32/data/z/resource/plugins/aacdecoderconfigci.rsc</resource>
+#<resource>t:/epoc32/release/winscw/udeb/z/resource/plugins/aacdecoderconfigci.rsc</resource>
+#<resource>t:/epoc32/release/winscw/urel/z/resource/plugins/aacdecoderconfigci.rsc</resource>
+#<resource>t:/epoc32/localisation/aacdecoderconfigci/rsc/aacdecoderconfigci.rpp</resource>
+#<resource>t:/epoc32/localisation/group/aacdecoderconfigci.info</resource>
+#</whatlog>
+
+
+my $keepgoing = 1;
+main();
+
+sub cleanpath($)
+{
+  my $str = lc(shift); #drop the case.
+  $str =~ s/^\S://; #remove drive letter
+  $str =~ s/^\///; # some custom makefiles report aboslute path
+  $str =~ s/\\/\//g; #switch the path
+  $str =~ s/\/\//\//g;#we have some double slashes in some resources... 
+  return $str;
+}
+sub ext($)
+{
+  my $str = shift;
+  $str =~ s/\S+\.//; #may fail...
+  return $str;
+}
+
+sub main()
+{
+  my $path = shift @ARGV;
+  my @files = glob($path."/*whatlog*WHAT_*compile.log"); 
+  foreach my $filename (@files)
+  {
+#    print $filename."\n";
+    parsefile($filename);
+  }  
+}
+sub parsefile($filename)
+{  
+  my $filename = shift;
+  open(FILE,"<$filename") or die "Couldn't open filename\n";
+  
+  #I'm using previous formatting stypes from the flm parsing...ie location, bld.inf, makefile, type, target,extension
+  print "location,bldinf,makefile,type,target,extension\n";
+  my $bldinf = "";
+  my $makefile = "";
+  my $inrecipe = 0;
+  
+  my $linecount = 0;
+  while(my $line = <FILE>)
+  {
+    ++$linecount;
+    if($line =~ m/^<whatlog bldinf='(\S+)' mmp='(\S*)' config='\S+'>/) #brittle
+    {
+      $bldinf = $1;
+      $makefile = $2;
+    }
+    elsif($line =~ m/^<\/whatlog>/)
+    {
+      $bldinf = "";
+      $makefile = "";
+    }
+    elsif($line =~ m/^<bitmap>(\S+)<\/bitmap>/)
+    {
+      if($bldinf eq "" || $makefile eq "" && !$keepgoing)
+      {
+        die "$filename($linecount) bldinf=$bldinf makefile=$makefile: $line\n";
+      }
+      print "$filename($linecount),".cleanpath($bldinf).",".cleanpath($makefile).",bitmap,".cleanpath($1).",".ext($1)."\n";        
+    }
+    elsif($line =~ m/^<build>(\S+)<\/build>/)
+    {
+      if($bldinf eq "" || $makefile eq "" && !$keepgoing)
+      {
+        die "$filename($linecount) bldinf=$bldinf makefile=$makefile : $line\n";
+      }
+      print "$filename($linecount),".cleanpath($bldinf).",".cleanpath($makefile).",binary,".cleanpath($1).",".ext($1)."\n";        
+    }
+    elsif($line =~ m/^<resource>(\S+)<\/resource>/)
+    {
+      if($bldinf eq "" || $makefile eq "" && !$keepgoing)
+      {
+        die "$filename($linecount) bldinf=$bldinf makefile=$makefile : $line\n";
+      }
+      print "$filename($linecount),".cleanpath($bldinf).",".cleanpath($makefile).",resource,".cleanpath($1).",".ext($1)."\n";        
+    }
+    
+    #<export destination='t:/epoc32/rom/include/sipstatemachine.iby' source='t:/sf/mw/ipappprotocols/sipconnproviderplugins/sipstatemachine/group/SipStateMachine.iby'/>
+    elsif($line =~ m/^<export destination='(\S+)' source='(\S+)'\/>/)
+    {
+      if($bldinf eq "" )
+      {
+        die "$filename($linecount) bldinf=$bldinf: $line\n";
+      }
+      print "$filename($linecount),".cleanpath($bldinf).",".cleanpath($2).",export,".cleanpath($1).",".ext($1)."\n";    
+    }
+  #<recipe name='tem' target='91e4e9b4af8b5c84bbac43a2419a4ce3_RELEASABLES' host='LON-ENGBUILD87' layer='os' component='localesupport' bldinf='t:/sf/os/kernelhwsrv/localisation/localesupport/bld.inf' mmp='' config='winscw_urel.whatlog' platform='WINSCW' phase='BITMAP' source='copy_default.mk_RELEASABLES'>
+    
+    elsif($line =~ m/<recipe.+bldinf='(\S+)'.+source='(\S+)'>/)
+    {
+      $bldinf = $1;
+      $makefile = $2;
+      $inrecipe = 1;    
+    }
+    elsif($inrecipe && $line =~ m/^(\S:\S+)/)
+    {
+      if($bldinf eq "" || $makefile eq "" && !$keepgoing)
+      {
+        die "$filename($linecount) bldinf=$bldinf makefile=$makefile : $line\n";
+      }
+      my $str = cleanpath($1);
+      
+      print "$filename($linecount),".cleanpath($bldinf).",".cleanpath($makefile).",custom,".cleanpath($str).",".ext($str)."\n";
+    }
+    
+    elsif($line =~ m/<\/recipe>/)
+    {
+      $bldinf = "";
+      $makefile = "";
+      $inrecipe = 0;
+    }
+    
+      
+  }
+  close FILE;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/readme.txt	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,29 @@
+Update 20090519 by MattD
+
+Can now run parselistdirs.pl from anywhere witout lots of intermediate output files:
+perl parselistdirs.pl <logs_dir> (<output_dir>)
+Note that it will still put most of it's output to the console as before. The second dir is optional.
+
+Added find_collisions.pl
+Prefers to be run from the root on the build machine (as it's looking for files to compare)
+It's a hacked up version of merge_csv.pl
+Usage:
+perl find_collisions.pl what_results.log >collision_result.txt
+It creates a CSV based on the name of the file passed to it (ie what_results.log_collisions.csv)
+
+Yes, They are all quick and dirty.
+
+Older stuff:
+
+F:\6.2\generated\parselistdirs.pl - creates sets from the listdirs outputs...
+F:\6.2\generated\parsewhatlog.pl - creates a CSV-style log from the whatlogs.
+F:\6.2\generated\merge_csv.pl - takes the output CSV from parsewhatlog.pl and merges in the output of parselistdirs.pl
+in generated>
+perl parselistdirs.pl ..\ >list_results.log
+perl parsewhatlog.pl ..\ >what_results.log
+perl merge_csv.pl what_results.log list_results.log >summary.txt
+
+The Test dir is a directory filled with test text files...
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/scan_antlogs.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,216 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Parse "ant" logs from SBS build to determine missing source files
+
+my $pdk_src = "../.."; # path to sf tree - correct from "build/output"
+
+my %missing_files;
+my %damaged_components;
+my %excluded_things;
+my %abld_import;
+my %damaged_bldinfs;
+
+sub canonical_path($)
+  {
+  my ($path) = @_;
+  my @bits = split /\//, $path;
+  my @newbits = ();
+  
+  foreach my $bit (@bits)
+    {
+    next if ($bit eq ".");
+    if ($bit eq "..")
+      {
+      pop @newbits;
+      next;
+      }
+      push @newbits, $bit;
+    }
+  return join("/", @newbits);
+  }
+
+sub excluded_thing($$$)
+  {
+  my ($path, $missing, $reason) = @_;
+  if (!defined $excluded_things{$path})
+    {
+    @{$excluded_things{$path}} = ();
+    }
+  push @{$excluded_things{$path}}, $missing;
+  # print "Missing $missing from excluded $path ($reason)\n";
+  }
+
+sub do_missing_file($$$)
+  {
+  my ($missing, $missing_from, $reason) = @_;
+  
+  $missing = canonical_path($missing);
+  $missing_from = canonical_path($missing_from);
+  
+  my $component = "??";
+  if ($missing_from ne "??")
+    {
+    my @dirs = split /\//, $missing_from;
+    shift @dirs if ($dirs[0] eq "sf");
+    
+    $path = $pdk_src . "/sf/$dirs[0]/$dirs[1]";
+    if (!-e $path)
+      {
+      # no sign of the package
+      excluded_thing($path, $missing, $reason);
+      return;
+      }
+    $path .= "/$dirs[2]";
+    if (!-e $path)
+      {
+      # no sign of the collection
+      excluded_thing($path, $missing, $reason);
+      return;
+      }
+    $path .= "/$dirs[3]";
+    if (!-e $path)
+      {
+      # no sign of the component
+      excluded_thing($path, $missing, $reason);
+      return;
+      }
+    $component = join("/", $dirs[0], $dirs[1], $dirs[2], $dirs[3]);
+    }
+  
+  $missing_files{$missing} = $reason if ($missing ne "??");
+  
+  if (!defined $damaged_components{$component})
+    {
+    @{$damaged_components{$component}} = ();
+    }
+  push @{$damaged_components{$component}}, $missing;
+  }
+
+sub scan_logfile($)
+{
+  my ($logfile) = @_;
+  
+  open FILE, "<$logfile" or print "Error: cannot open $logfile: $!\n" and return;
+  
+  my $line;
+  while ($line = <FILE>)
+    {
+    # Could not export s:/sf/mw/classicui/commonuisupport/uikon/docs/Uikon_1.2_Caps_Lock_Extension.doc to s:/epoc32/engdoc/application_framework/uikon/uikon_1.2_caps_lock_extension.doc
+    if ($line =~ /^Could not export .*\/(sf\/.*) to .:\/(epoc32\/.*)$/)
+      {
+      my $source = $1;
+      my $exported = $2;
+      if (-e "m:/$exported")
+        {
+        $abld_import{$source} = $exported;
+        }
+      next;
+      }
+    # Source of export does not exist:  s:/sf/mw/messagingmw/messagingfw/msgtests/group/msgerr.ra
+    # Source zip for export does not exist: s:/sf/os/deviceplatformrelease/S60LocFiles/data/96.zip
+    if ($line =~ /^Source (of|zip for) export does not exist.\s+.*\/(sf\/.*)$/)
+      {
+      do_missing_file($2, "??", "source of export");
+      next;
+      }
+    # No bld.inf found at sf/os/buildtools/toolsandutils/burtestserver/Group in s:/output/build/canonical_system_definition_GT_tb91sf.xml
+    # No bld.inf found at s:/sf/adaptation/stubs/licensee_tsy_stub/group in s:/output/build/canonical_system_definition_S60_5_1_clean.xml
+    if ($line =~ /No bld.inf found at (.*\/)?(sf\/.*) in /i)
+      {
+      my $bldinf = "$2/bld.inf";
+  
+      do_missing_file($bldinf, $bldinf, "no bld.inf");
+      $damaged_bldinfs{"$bldinf\t(missing)"} = 1;
+      next;
+      }
+    # D:/Symbian/Tools/PDT_1.0/raptor/win32/mingw/bin/cpp.exe: s:/sf/os/networkingsrv/networksecurity/ipsec/group/bld.inf:19:42: ../eventmediator/group/bld.inf: No such file or directory
+    if ($line =~ /cpp.exe: .*\/(sf\/[^:]*):.*\s+([^:]+): No such file/)
+      {
+      my $parent = $1;
+      my $relative = $2;
+  
+      if ($parent =~ /\.inf$/i)
+        {
+        my $parent = canonical_path($parent);
+        $damaged_bldinfs{"$parent\t$relative"} = 1;
+        }
+      do_missing_file("$parent/../$relative", $parent, "#include");
+      next;  
+      }
+    }
+    close FILE;
+  }
+  
+  my @logfiles = map(glob,@ARGV);
+  foreach my $logfile (@logfiles)
+    {
+    print "Scanning $logfile...\n";
+    scan_logfile($logfile);
+    }
+  
+  printf "%d Excluded things\n", scalar keys %excluded_things;
+  foreach my $component (sort keys %excluded_things)
+    {
+    my @list = @{$excluded_things{$component}};
+    my %hash;
+    foreach my $missing (@list)
+      {
+      $hash{$missing} = 1;
+      }
+    printf "%s\t%d\n", $component, scalar keys %hash;
+    print "\t", join("\n\t", sort keys %hash), "\n";
+    }
+  print "\nDamaged components\n";
+  foreach my $component (sort keys %damaged_components)
+    {
+    my @list = @{$damaged_components{$component}};
+    my %hash;
+    foreach my $missing (@list)
+      {
+      $hash{$missing} = 1;
+      }
+    printf "%s\t%d\n", $component, scalar keys %hash;
+    print "\t", join("\n\t", sort keys %hash), "\n";
+    }
+  print "\nMissing files\n";
+  foreach my $missing (sort keys %missing_files)
+    {
+    my $exported = $abld_import{$missing};
+    $exported = "(not in PDK)" if (!defined $exported);
+    my $reason = $missing_files{$missing};
+    my @dirs = split /\//, $missing;
+    my $path = shift @dirs;
+    my $dir;
+    
+    while ($dir = shift @dirs)
+      {
+      if (-e "$pdk_src/$path/$dir")
+        {
+        # still exists at this point
+        $path .= "/$dir";
+        next;
+        }
+      print "\t$reason\t$path\t\t", join("/", $dir,@dirs), "\t$exported\n";
+      last;
+      }    
+    }
+  
+  print "\nDamaged bld.infs\n";
+  print join("\n", sort keys %damaged_bldinfs, "");
+  
+  print "\n\n";
+  printf "%d files missing from ", scalar keys %missing_files;
+  printf "%d damaged components\n", scalar keys %damaged_components;
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/clean_compile.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,10 @@
+
+dddaaaa
+<info>Up-to-date: o:/epoc32/uptodate.txt</info>
+sdfla
+
+dgr
+g
+
+h
+gf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/listdirs_baseline.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,8 @@
+epoc32/untouched.txt
+epoc32/uptodate.txt
+epoc32/gt_fail.txt
+epoc32/gt_built.txt
+epoc32/s60_fail.txt
+epoc32/s60_built.txt
+epoc32/rebuilt.txt
+epoc32/rebuildfail.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/listdirs_clean.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,4 @@
+epoc32/untouched.txt
+epoc32/s60_fail.txt
+epoc32/s60_built.txt
+epoc32/uptodate.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/listdirs_main.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,8 @@
+epoc32/untouched.txt
+epoc32/gt_built.txt
+epoc32/gt_extra.txt
+epoc32/s60_fail.txt
+epoc32/s60_built.txt
+epoc32/rebuilt.txt
+epoc32/rebuildfail.txt
+epoc32/extra_rebuildfail.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/listdirs_s60_baseline.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,9 @@
+epoc32/untouched.txt
+epoc32/gt_built.txt
+epoc32/gt_extra.txt
+epoc32/s60_fail.txt
+epoc32/s60_built.txt
+epoc32/rebuilt.txt
+epoc32/rebuildfail.txt
+epoc32/extra_rebuildfail.txt
+epoc32/uptodate.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/listdirs_s60_clean.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,4 @@
+epoc32/untouched.txt
+epoc32/gt_built.txt
+epoc32/gt_extra.txt
+epoc32/uptodate.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/analysis/test/listdirs_s60_main.log	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,8 @@
+epoc32/untouched.txt
+epoc32/uptodate.txt
+
+epoc32/gt_built.txt
+epoc32/gt_extra.txt
+epoc32/s60_built.txt
+epoc32/s60_extra.txt
+epoc32/rebuilt.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/ats3_testdrop.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,147 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+#   Mike Kinghan, mikek@symbian.org
+#
+# Contributors:
+#
+# Description:
+#   This is a tool for sending an ATS3 testdrop to an ATS3 server.
+
+use strict;
+use Getopt::Long;
+use File::Copy;
+use File::Spec;
+
+my $username = "admin";
+my $password = "admin";
+my $host;
+my $schedule;
+my $host_drop_path;
+my $local_drop_path;
+my $local_test_pkg;
+my $help;
+my $dev_null = $^O =~ /^MSWin/ ? "nul" : "/dev/null";
+
+sub usage($);
+sub help();
+sub usage_error();
+
+my %optmap = (  'host' => \$host,
+			    'local-test-pkg' => \$local_test_pkg,
+				'host-drop-path' => \$host_drop_path,
+				'local-drop-path' =>\$local_drop_path,
+				'username' => \$username,
+				'password' => \$password,
+				'schedule' => \$schedule,
+                'help' => \$help);
+
+GetOptions(\%optmap,
+          'host=s',
+          'local-test-pkg=s',
+          'host-drop-path=s',
+          'local-drop-path=s',
+          'username=s',
+          'password=s',
+          'schedule=s',
+          'help!') 
+          or usage_error();
+
+if ($help) {
+	help();
+}
+
+usage_error(), unless (defined($host) && defined($local_test_pkg) && defined($local_drop_path) && defined($host_drop_path));
+
+my $curl_version = $^O =~ /^MSWin/ ? `curl --version 1> $dev_null 2>&1` : `curl --version 1> $dev_null 2>&1`;
+die("Need program \"curl\". Not found"), if ($?);
+die("Test drop path \"$local_drop_path\" not found"), unless ( -d "$local_drop_path");
+
+$host .= ":8080", unless ($host =~ /:\d+$/);
+
+my ($vol,$dir,$pkg);
+my $local_test_drop;
+my $host_test_drop;
+
+if ($local_test_pkg =~ /^\.\.\.(.+)/ ) {
+    $pkg = $1;
+    $local_test_drop = File::Spec->catfile($local_drop_path,$pkg);
+    die("Test package file \"$local_test_drop\" not found"), unless ( -f "$local_test_drop");        
+}
+else {
+    die("Test package file \"$local_test_pkg\" not found"), unless ( -f "$local_test_pkg");
+    ($vol,$dir,$pkg) = File::Spec->splitpath($local_test_pkg);
+    $local_test_drop = File::Spec->catfile($local_drop_path,$pkg);
+    if ( -f "$local_test_drop") {
+        my $cmp_local_test_drop = $local_test_drop;
+        my $cmp_local_test_pkg = $local_test_pkg;
+        if ($^O =~ /^MSWin/) {
+            $cmp_local_test_drop = lc($local_test_drop);
+            $cmp_local_test_pkg = lc($local_test_pkg);        
+        }   
+        if ("$cmp_local_test_drop" eq "$cmp_local_test_pkg") {
+            if (unlink($local_test_drop) == 0) {
+                die("Can't delete stale test drop \"$local_test_drop\". $!");
+            }
+            else {
+                print("A stale test drop \"$local_test_drop\" existed. Deleted\n");
+            }
+        }
+    }
+    copy("$local_test_pkg","$local_test_drop")
+        or die("Cannot copy \"$local_test_pkg\" -> \"$local_test_drop\". $!");
+}
+$host_test_drop = File::Spec->catfile($host_drop_path,$pkg);
+my $url ="http://$host/ats3/XTestRunExecute.do?username=$username&password=$password&testrunpath=$host_test_drop";
+$url .= "&schedule=$schedule", if (defined($schedule));
+my $curl_cmd = "curl \"$url\"";
+system("$curl_cmd");
+die("\nTest drop failed: $!"), if ($?);
+print("\nTest drop done");
+
+exit 0;
+
+sub usage($)
+{
+    my $error = shift;
+    my $fh = $error == 0 ? *STDOUT : *STDERR;
+    print $fh "ats3_testdrop.pl\n" .
+            "Send a test drop to an ATS3 server for execution\n" .
+            "usage:\n" .
+            "  ats3_testdrop.pl --help\n" .
+            "  ats3_testdrop.pl --host=HOSTNAME --local-test-pkg=PKGFILE --local-drop-path=LOCALPATH " .
+                " --host-drop-path=HOSTPATH " .
+                "[--username=ATS3USERNAME] [--password=ATS3PASSWORD] [--schedule=DD.MM.YYYY-HH:MM]\n" .
+            "options:\n" .
+            "  --help                        Display this help and exit\n" .
+            "  --host=HOSTAME                HOSTNAME is ATS3 server\n" .
+            "  --local-test-pkg=PKGFILE      PKGFILE is the test package.\n" .
+            "                                If PKGFILE begins \"...\" a filename in LOCALPATH is assumed\n" .
+            "  --local-drop-path=LOCALPATH   Path to local directory where PKGFILE will be dropped\n" .            
+            "  --host-drop-path=HOSTPATH     Host directory that is mapped to LOCALPATH.\n" .
+            "                                Must agree with the properties of the registered device that the test package nominates\n" .
+            "  --username=ATS3USERNAME       ATS3 user to whome the test will belong. Default=admin\n" .
+            "  --password=ATS3PASSWORD       Password of ATS3 user. Default=admin\n" .
+            "  --schedule=DD.MM.YYYY-HH:MM   Date-time at which test is to run. Default=as soon as possible\n";
+    exit $error;            
+}
+
+sub help()
+{
+    usage(0);
+}
+
+sub usage_error()
+{
+    usage(1);
+}             
+
+# EOF
+   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/make_junction.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,133 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+#   Mike Kinghan, mikek@symbian.org
+#
+# Contributors:
+#
+# Description:
+#   This is a tool for sending an ATS3 testdrop to an ATS3 server.
+
+use strict;
+use Getopt::Long;
+use File::Spec;
+
+my $link;
+my $target;
+my $help;
+my $force = 0;
+
+sub usage($);
+sub help();
+sub usage_error();
+
+my %optmap = (  'link' => \$link,
+			    'target' => \$target,
+			    'force' => \$force, 
+                'help' => \$help);
+
+GetOptions(\%optmap,
+          'link=s',
+          'target=s',
+          'force!',
+          'help!') 
+          or usage_error();
+
+if ($help) {
+	help();
+}
+
+usage_error(), unless (defined($link) && defined($target));
+
+my $junction_help = `junction /?`;
+die("Need command \"junction\". Not found\n"), if ($junction_help =~ /is not recognised/);
+die("Directory \"$target\" not found\n"), unless -d "$target";
+
+my ($vol,$dir,$file) = File::Spec->splitpath($target);
+my @subst_lines = `subst`;
+
+foreach (@subst_lines) {
+    my $line = $_;
+    chomp($line);
+    $line =~ /^(.:)\\: => (.*)$/;
+    die("Cannot parse output of 'subst'. Bailing out confused."), unless (defined($1) and defined($2));    
+    my $subst_drive = $1;
+    my $subst_targ = $2;
+    if (lc($subst_drive) eq lc($vol)) {
+        print("Target $target is in a substituted drive: $line\n");
+        $target = File::Spec->catfile(($subst_targ,$dir),$file);
+        print("Target $target will be used\n");
+        last;
+    }
+}
+
+
+if ( -e "$link") {
+    print("\"$link\" already exists. ");
+    if (!$force) {
+        my $choice;
+        while($choice ne 'y' and $choice ne 'n') {
+            print "Delete? (y/n)? ";
+            $choice = <STDIN>;
+            chomp($choice);
+            $choice = lc($choice);
+        }
+        $force = $choice eq 'y';
+    }    
+    if ($force) {
+        system("junction -d \"$link\" > nul");
+        if ($?) {
+            die("Cannot delete \"$link\": $!\n");
+        }
+        else {
+            print "Deleted \"$link\"\n";
+        }
+    }
+} 
+
+system("junction \"$link\" \"$target\" > nul");
+if ($?) {
+    die("Cannot cteate junction \"$link\" -> \"$target\": $!\n");
+}
+else {
+    print("Created junction \"$link\" -> \"$target\"\n");
+}
+exit 0;
+
+sub usage($)
+{
+    my $error = shift;
+    my $fh = $error == 0 ? *STDOUT : *STDERR;
+    print $fh "make_junction.pl\n" .
+            "Create a Windows junction (a.k.a symbolic link)\n" .
+            "usage:\n" .
+            "  make_junction.pl --help\n" .
+            "  make_junction.pl --link=LINKDIR --target=TARGDIR\n " .
+            "options:\n" .
+            "  --help                        Display this help and exit\n" .
+            "  --link=LINKDIR                LINKDIR specifies the junction to be created. Last component is the junction. The rest must exist\n" .
+            "                                If LINKDIR is an existing junction it is pre-emptively deleted\n" .
+            "  --target=TARGDIR              TARGDIR is directory to which the junction will point.\n" .
+            "                                If TARGDIR is in a substed drive, the real path will be used.\n";
+    exit $error;            
+}
+
+sub help()
+{
+    usage(0);
+}
+
+sub usage_error()
+{
+    usage(1);
+}             
+
+# EOF
+   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/8.0a/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.0a
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/8.0b/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.0b
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/8.1a/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.1a
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/8.1b/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.1b
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/9.0/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 9.0
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/9.1/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 9.1
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
Binary file common/tools/ats/smoketest/Group/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,24 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For automated smoketest
+// 
+//
+
+#include "../Utils/group/bld.inf"
+#include "../agenda/Group/bld.inf"
+#include "../apploader/Group/bld.inf"
+#include "../contacts/group/bld.inf"
+#include "../messaging/Group/bld.inf"
+#include "../System/Group/bld.inf"
+#include "../Timew/Group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/configuration.cfg	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,21 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Version 8.1b
+// 
+//
+
+#if !defined (CONFIGURATION_CFG)
+#define CONFIGURATION_CFG
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/testtools_smoketest.history.xml	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<relnotes name="SMOKETEST">
+  <purpose>
+  </purpose>
+</relnotes>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Group/testtools_smoketest.mrp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,11 @@
+component	testtools_smoketest
+source	\sf\app\techview\buildverification\smoketest
+exports \sf\app\techview\buildverification\smoketest\Group
+# binary	\sf\app\techview\buildverification\smoketest\group	all
+
+notes_source	\component_defs\release.src
+
+#  == IPR section auto-inserted from distribution.policy files  ==
+ipr T 
+
+# == end auto-inserted section ==
Binary file common/tools/ats/smoketest/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/SmokeTest.pm	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,433 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# SmokeTestSuite.pm 
+# The SmokeTestSuite package contains subroutines that are needed to build a 
+# testdriver test suite.
+# This script was born on 18/04/2005
+# 
+#
+
+#!/usr/bin/perl -w
+package SmokeTest;
+use SmokeTestROM;
+use SmokeTestSuite;
+use FindBin;
+use lib "$FindBin::Bin\\..\\..\\..\\..\\os\\buildtools\\bldsystemtools\\commonbldutils\\GenResult\\";
+use FileRead; #Need to include a Findbin::path
+use strict;
+
+#
+# Global Variables
+#
+our $BuildDir = $ENV{'BuildDir'}; # usually M:
+our $serverpool = $ENV{'SmokeTestServerPool'};
+our $buildNo = $ENV{'BuildShortName'}; # Eg. 9.1
+# The Client is run from the dir where SmokeTestClient.pl is located
+# This is to ensure that any ROMs and test packages created are stored there.
+our $sourceDir = "$BuildDir\\src\\common\\testtools";
+our $TestSuite = "SmokeTest";
+our $SmokeTestDir;
+our $NandDir;
+our $TestDriverLocation   = "\\epoc32\\tools\\TDEP";   # location for TD zips
+our $TestDriverDrive = "M:";
+our $TestDriverCmd = "$TestDriverDrive\\testdriver\\testdriver.cmd";
+our $TestDriverXML;
+
+# Publish details
+our $PublishServer = $ENV{'PublishLocation'};
+our $ProductType   = $ENV{'Type'};
+our $BuildNum      = $ENV{'BuildNumber'};
+our $LogsDir       = $ENV{'LogsDir'};
+
+# Epocwind.out
+my $tempDirLocation = $ENV{'TEMP'};
+
+#
+# CheckVars: ensures that the essential environment vars and directories exist
+#
+sub CheckVars
+{
+	print "\n** Settings **\n";
+	print "Build Drive                = $BuildDir\n";
+	print "Smoke Test Server Pool     = $serverpool\n";
+	print "Build Product              = $buildNo\n";
+	print "TestDriver Zip Location    = $TestDriverLocation\n";
+	print "TestDriver XML Location    = $TestDriverXML\n";
+	print "TestDriver Source Location = $sourceDir\n";
+	print "TestDriver Drive           = $TestDriverDrive\n";
+	print "SmokeTest working directory= $SmokeTestDir\n";
+	print "NAND build directory       = $NandDir\n";
+	
+	print "\n** Publishing Information **\n";
+	
+	print "Publish server = $PublishServer\n";
+	print "Product Type   = $ProductType\n";
+	print "Build Number   = $BuildNum\n";
+	
+	DieLog("CheckVars: \"Build Directory\" not defined") if !defined $BuildDir;
+	DieLog("CheckVars: \"Smoke Test Server Pool\" not defined") if !defined $serverpool;
+	DieLog("CheckVars: \"Build Product\" not defined") if !defined $buildNo;
+	DieLog("CheckVars: \"Publish server\" not defined") if !defined $PublishServer;
+	DieLog("CheckVars: \"Product Type\" not defined") if !defined $ProductType;
+	DieLog("CheckVars: \"Build Number\" not defined") if !defined $BuildNum;
+	DieLog("CheckVars: Directory \"SmokeTest working directory\" does not exist") if ! -e $SmokeTestDir;
+	DieLog("CheckVars: Directory \"TestDriver Zip Location\" does not exist") if ! -e $TestDriverLocation;
+}
+
+sub main
+{
+	print "\n\n*** START OF SMOKE TEST ***\n\n";
+
+	PrintDateTime();
+	
+	my ($iSourceDir,       $iTestSuite,   $iProduct, $iServerPool, $iProductType,
+	    $iPublishLocation, $iBuildNumber, $iXML,     $iUnzip,      $iBuildDrive, $iTDDrive) = @_;
+	
+	$TestSuite       = $iTestSuite           if defined $iTestSuite;
+	$BuildDir        = $iBuildDrive          if defined $iBuildDrive;
+	$sourceDir       = $BuildDir.$iSourceDir if defined $iSourceDir;
+	$buildNo         = $iProduct             if defined $iProduct;
+	$serverpool      = $iServerPool          if defined $iServerPool;
+	$ProductType     = $iProductType         if defined $iProductType;
+	$PublishServer   = $iPublishLocation     if defined $iPublishLocation;
+	$BuildNum        = $iBuildNumber         if defined $iBuildNumber;
+	$TestDriverDrive = $iTDDrive             if defined $iTDDrive;
+	
+	$SmokeTestDir    = "$sourceDir\\$TestSuite";
+	if (defined $iXML)
+	{
+		$TestDriverXML = $iXML;
+	}
+	else
+	{
+		$TestDriverXML = $SmokeTestDir."\\xml";
+	}
+	$NandDir = "$BuildDir\\src\\cedar\\generic\\base\\e32\\rombuild";
+	
+	CheckVars();
+	
+	# change dir to Smoketest dir
+	chdir "$SmokeTestDir" or DieLog("Can't cd to $SmokeTestDir");
+	
+	# unzip latest version of TD
+	if (defined $iUnzip)
+	{
+		unpackTestDriver2();
+	}
+	
+	# configure TD
+	configureTestDriver2();
+	
+	#
+	# Copy the correct configuration.cfg file
+	# But such source only exists for these products: 8.0a, 8.0b, 8.1a, 8.1b, 9.0, 9.1
+	#
+	print "\n#\n# Copy the correct configuration.cfg file\n#\n";
+	ExecCommand("COPY /Y $SmokeTestDir\\Group\\$buildNo\\configuration.cfg $SmokeTestDir\\Group\\configuration.cfg");
+	
+	#Read in hash of smoketests to be run for each product.
+	my ($iCfgFileLocation) = "$FindBin::Bin\\..\\..\\..\\..\\os\\buildtools\\bldsystemtools\\commonbldutils\\GenResult";
+	
+	#Read in the smoketest list from a cfg file
+	my $text = &FileRead::file_read ("$iCfgFileLocation\\Product.cfg");
+	#Search for an entry matching (At the beginning of line there should be 1 or more alphanumberic chars
+	#Followed by a "."(optional to allow codenames) followed by more alphanumberic chars followed by 0 or more spaces then an = then 0
+	#or more spaces then any amount of chars till the end of the line.
+	#8.1b = EMULATOR_WINSCW ARM4_LUBBOCK ARMV5_LUBBOCK
+	my %iProducts = $text =~ /^\s*(\w+\.?\w+)\s*=\s*(.+)$/mg ;
+	
+	#Get the list of platforms to be smoketested for the product.
+	#Need to turn the hash value into an array using split
+	my @iPlatforms = split (/ /,$iProducts{$buildNo});
+	#Build and Execute Test package for each platform as read from configuration file and create and zip rom.
+	ProcessPlatforms (@iPlatforms);
+	
+	#
+	# Build Test Package for ROMs
+	#
+	if ($buildNo eq '8.1a' || $buildNo eq '8.1b')
+	{
+		&SmokeTestSuite::BuildAndPackage("ARM4");
+	}
+	
+	if ($buildNo ne '8.1a')
+	{
+		&SmokeTestSuite::BuildAndPackage("ARMv5");
+	}
+	
+	#
+	# Find out which server to use
+	#
+	print "\n#\n# Find out which server to use\n#\n";
+	ProcessPlatformsforSmoketest(@iPlatforms);
+	
+	#
+	# End of Smoke Test
+	#
+	print "\n\n*** END OF SMOKE TEST ***\n\n";
+}
+	
+#
+# DieLog: Exits script and inserts a Remark in the build log, which will be picked up by htmlscanlog
+#
+sub DieLog
+{
+	die "\nREMARK: $_[0]\n $!\n\n\n";
+}
+
+
+#
+# Build and publish based on entries in the Product.cfg file
+#
+sub ProcessPlatforms 
+{
+
+my $i = 0;
+my @temp;
+my @iPlatforms = @_;
+
+foreach my $platform (@iPlatforms)
+ {  
+  undef @temp;
+  @temp = split (/_/,$iPlatforms[$i]);
+  $i++;
+  
+  if( $temp[0] eq "EMULATOR")
+  {
+	&SmokeTestSuite::BuildAndPublish("$temp[1]");
+	CheckPlatsecErrors("$temp[1]");
+  }
+  else
+  {
+		
+	if(3 == scalar(@temp)) # there are 3 arguments, so this will be a NAND ROM
+	{
+		if((lc($temp[1]) eq "h4hrp") && (lc($temp[2]) eq "nand\(dp\)" )) # H4HRP Demand Paging ROM options is -D_NAND2
+		{
+			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "pagedrom", "PlatSec", "$buildNo", "-D_NAND2" );
+		}
+		elsif((lc($temp[1]) eq "h4hrp") && (lc($temp[2]) eq "nand" )) # H4 options is -D_NAND2
+		{
+			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo", "-D_NAND2");
+		}
+		elsif(lc($temp[1]) eq "h2") # H2 options is -D_NAND# H2 option is NAND2 due to CR 0844 (Both H2 and H4 use -D_NAND2)
+                {
+			&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo", "-D_NAND2");		
+		}
+		else	# Bad option entered
+		{
+			die "SmokeTest::ProcessPlatforms error: invalid board type entered: $temp[1]. Check that Product.cfg is correct.\n";
+		}		
+	}
+	else # This is the NOR ROM.
+	{
+		&SmokeTestROM::CreateAndZipROM("$temp[0]", "$temp[1]", "-DRVCT", "PlatSec", "$buildNo");
+	}
+  }
+  
+ }
+
+}
+
+#
+# Build and publish based on entries in the Product.cfg file
+#
+sub ProcessPlatformsforSmoketest
+{
+
+my $i = 0;
+my @temp;
+my @iPlatforms = @_;
+
+foreach my $platform (@iPlatforms)
+ {  
+    undef @temp;
+    @temp = split (/_/,$iPlatforms[$i]);
+    $i++;
+    if( $temp[0] eq "EMULATOR")
+    {
+        next;
+    }
+	my $mServ = &SmokeTestSuite::PollServers("$temp[1]");
+	unless (defined $mServ)
+    {
+        next;
+    }
+	if(3 == scalar(@temp))
+	{
+		if(lc($temp[2]) eq "nand\(dp\)" ) 
+		{
+		    &SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ, "NAND\(DP\)\\");
+		}
+        elsif(lc($temp[2]) eq "nand") 
+	    {
+		    &SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ, "NAND\\");
+	    }
+	}
+	else
+	{
+		&SmokeTestSuite::RunRemote("$temp[0]", "$temp[1]", $mServ);
+	}
+ }
+}
+ 
+#
+# Check for platsec errors - checks the epocwind.out on build machine
+#
+sub CheckPlatsecErrors
+{
+	print "\n";
+	print "#\n# Check for platsec errors\n#\n";
+	print "\n";
+	PrintDateTime();
+	
+	# open epocwind.out and parse for both errors and warnings
+	open EPOCWIND, "$tempDirLocation\\epocwind.out" or print "\nERROR: Cannot open EPOCWIND.OUT\n";
+	my @epocWind = <EPOCWIND>;
+	close EPOCWIND;
+	
+	foreach my $tempEW (@epocWind)
+	{
+		if ($tempEW =~ m/(\*PlatSec\* ERROR)(.*)/i)
+		{
+			print "\nERROR: $_[0] - $1$2";
+		}
+		elsif ($tempEW =~ m/(\*PlatSec\* WARNING)(.*)/i)
+		{
+			print "\nWARNING: $_[0] - $1$2";
+		}
+	}
+}
+
+#
+# Take TestDriver and unpack into a given location.
+#
+sub unpackTestDriver2()
+{
+	#
+	# Unzip TestDriver
+	#
+	print "\n#\n# Unzip TestDriver\n#\n";
+	PrintDateTime();
+	
+	# first remove the "old" version of test driver
+	print "\n";
+	ExecCommand("RMDIR $TestDriverDrive\\testdriver\\ /Q /S");
+	
+	# now unzip the latest version of testdriver which has been synced down
+	ExecCommand("%EPOCROOT%epoc32\\tools\\unzip.exe $TestDriverLocation\\TestDriver2.zip -d $TestDriverDrive\\testdriver\\");
+	
+	# now copy the latest version of testdriver_new.cmd which has been obtained
+	ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\testdriver_new.cmd  $TestDriverCmd");
+	
+	# now copy the latest version of logging.properties which has been obtained
+	ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\logging.properties  $TestDriverDrive\\testdriver\\");
+	
+    # 11-08-08 - additional steps required for SITK1.2 version of TD2
+    ExecCommand("MKDIR $TestDriverDrive\\testdriver\\eclipse\\links\\");
+
+    ExecCommand("COPY \\\\builds01\\devbuilds\\buildteam\\testdriverv2\\testdriver.link $TestDriverDrive\\testdriver\\eclipse\\links\\");
+	
+	#
+	# Unzip JRE v1.5
+	#
+	print "\n";
+	print "#\n# Unzip JRE 1.5 required by TestDriver v2\n#\n";
+	print "\n";
+	
+	ExecCommand("%EPOCROOT%epoc32\\tools\\unzip.exe \\\\builds01\\devbuilds\\BuildPCs\\Software\\JDK1.5.0_13\\jre1.5.zip -d $TestDriverDrive\\testdriver\\");
+
+}
+
+sub configureTestDriver2()
+{
+	#
+	# Configure TestDriver
+	#
+	print "\n";
+	print "#\n# Configure TestDriver\n#\n";
+	print "\n";
+	my $localtimes = localtime;
+	PrintDateTime();
+	
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config -e $BuildDir\\
+								-x $TestDriverXML
+								-l $TestDriverDrive\\TestDriver\\Results
+								--source $sourceDir
+								-s smoketest
+								-r $TestDriverDrive\\TestDriver\\Repos
+								-c $TestDriverDrive\\TestDriver\\Results");
+
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config --commdb overwrite");
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config --bldclean off");
+
+	# platsec for > 9.x only
+	if ($buildNo ne "8.1a" && $buildNo ne "8.1b")
+	{
+		ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config -p ON");
+	}
+	
+	# Setup commdb for WINSCW smoketest
+	print "\n*** Setup commdb for WINSCW to use WinTAP ***\n";
+	
+	# export smoketest_commdb.xml to a place that ced.exe can see it
+	ExecCommand("copy $SmokeTestDir\\smoketest_commdb.xml $BuildDir\\epoc32\\WINSCW\\c\\");
+	ExecCommand("$BuildDir\\epoc32\\release\\WINSCW\\udeb\\ced.exe c:\\smoketest_commdb.xml");
+	
+	print "\n*** Confirm TestDriver Config ***\n";
+	ExecCommand("$TestDriverDrive\\testdriver\\testdriver.cmd config");
+	print "\n";
+}
+
+# ExecCommand
+#
+# Execute a system command, having first echoed it. Display and return the output of the command.
+#
+# Input: Command string (without final newline)
+#
+# Output: Command output (including STDERR) to STDOUT
+#
+# Return: Command output (including STDERR)
+#
+sub ExecCommand
+{
+    my $iCmd = shift;
+    print "\n================================================================\n";
+    print "Command: $iCmd\n";
+    print   "----------------------------------------------------------------\n";
+    my $iRet = `$iCmd 2>&1`;
+    chomp $iRet;
+    print "Return:  $iRet\n";
+    print   "================================================================\n";
+    return $iRet;
+}
+
+# PrintDateTime
+#
+# Print to STDOUT, Current Date and Time
+#
+# Input: none
+#
+# Output: text to STDOUT
+#
+sub PrintDateTime
+{
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+    #### my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
+    $year += 1900;
+    $mon += 1;
+	printf "\n*** Current Time: %04d/%02d/%02d %02d:%02d:%02d ***\n", $year,$mon,$mday,$hour,$min,$sec;
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/SmokeTestClient.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,80 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# This script was born on 07/10/2004
+# 
+#
+
+#!/usr/bin/perl -w
+use strict;
+use SmokeTest;
+use Getopt::Long;
+
+# Process the commandline
+my ($iSourceDir, $iTestSuite, $iProduct, $iServerPool, $iProductType, $iPublishLocation, $iBuildNumber, $iXML, $iUnzip, $iBuildDrive, $iTDDrive) = ProcessCommandLine();
+
+&SmokeTest::main($iSourceDir, $iTestSuite, $iProduct, $iServerPool, $iProductType, $iPublishLocation, $iBuildNumber, $iXML, $iUnzip, $iBuildDrive, $iTDDrive);
+
+# ProcessCommandLine
+#
+# Description
+# This function processes the commandline
+
+sub ProcessCommandLine
+{
+  my ($iHelp);
+  
+  GetOptions('h' => \$iHelp, 'src=s' => \$iSourceDir, 'pool=s' => \$iServerPool, 'product=s' => \$iProduct, 'suite=s' => \$iTestSuite, 'type=s' => \$iProductType, 'publish=s' => \$iPublishLocation, 'build=s' => \$iBuildNumber, , 'xml=s' => \$iXML, 'unziptd' => \$iUnzip, 'builddrive=s' => \$iBuildDrive, 'tddrive=s' => \$iTDDrive);
+
+  if (($iHelp) || (!defined $iSourceDir) || (!defined $iTestSuite) || (!defined $iProduct) || (!defined $iBuildDrive))
+  {
+    Usage();
+  }
+  
+  return ($iSourceDir, $iTestSuite, $iProduct, $iServerPool, $iProductType, $iPublishLocation, $iBuildNumber, $iXML, $iUnzip, $iBuildDrive, $iTDDrive);
+}
+
+# Usage
+#
+# Output Usage Information.
+#
+
+sub Usage 
+{
+  print <<USAGE_EOF;
+
+  Usage: SmokeTestClient.pl [switches]
+
+  [Switches]
+  --suite Test Driver test suite (e.g. SmokeTest)
+  --src source code directory (e.g .\\src\\common\\testtools)
+  		[NOTE: The test suite directory should be located in this directory]
+  --product product being tested (e.g. 9.1)
+  --builddrive The drive where the source and epoc32 is (e.g. M:)
+  
+  [Optional]
+  -h help
+  --pool hash separated smoketest server pool (e.g. lon-sysbuild05\#lon-sysbuild06)
+  --type type of build, either Master or Symbian_OS_v8.1
+  --publish Publish server for the smoke test results (e.g. \\\\builds01)
+  --build Build Number (e.g. 03555_Symbian_OS_v9.1)
+  --xml TestDriver XML tree. Default is \\src\\common\\testtools\\SmokeTest\\xml.
+  --unziptd Installs a stable version of TestDriver from \\\\builds01\\devbuilds\\BuildTeam\\TestDriver
+  --tddrive The drive where testdriver is installed (default is C: and TD directory is c:\\testdriver)
+  
+  All the optional arguments are either specified by the user or assumed to be set as environment variables.
+  These environment variables can be found in SmokeTest.pm
+
+USAGE_EOF
+	exit 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/SmokeTestROM.pm	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,259 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# The SmokeTestROM package contains all the subroutines needed to build a ROM for
+# automated smoke testing.
+# This script was born on 18/04/2005
+# Revision number 1: 11/08/2005
+# 
+#
+
+#!/usr/bin/perl -w
+
+package SmokeTestROM;
+use strict;
+
+# Define Core IMAGE file name as created by rombuild
+my $coreImage = "*techview.nand.img";
+
+# Define the target filename for the Core ROM
+my $newCoreImage = "core.img";
+
+# Define ROFS IMAGE file name as created by rombuild
+my $ROFSImage = "*techview.nand.rofs.img";
+
+# Define the target file name for the ROFS ROM
+my $newROFSImage = "rofs1.img";
+
+# Define NAND image file name.
+my $nandImage = "*ARMV5.IMG";
+#
+# CR 0844 (Both H2 and H4 use -D_NAND2)
+# PrepareNANDROM  - subroutine to create the NAND ROM for smoke testing; zero arguments
+# USAGE: PrepareNANDROM("h2"); 
+# USAGE: PrepareNANDROM("h4hrp"); 
+#
+sub PrepareNANDROM
+{
+	my ($arg) = @_; # Grab the first and only argument
+	
+	# Change dir to NAND Loader directory
+	chdir "$SmokeTest::NandDir" or &SmokeTest::DieLog("Can't cd to $SmokeTest::NandDir");
+	
+	if(lc($arg) eq "h2") # Here we are in the H2 NAND case
+	{
+		# Run the rom command to create the image ... H2 also to use -D_NAND2
+		SmokeTest::ExecCommand ("rom -v=h2 -i=armv5 -t=nandtest_load_noext -d=_NAND2 -b=urel");
+	}
+	elsif(lc($arg) eq "h4hrp") # Here we are in the H4 NAND case
+	{
+		SmokeTest::ExecCommand ("rom -v=h4hrp -i=armv5 -t=nandtest_load_noext -d=_NAND2 -b=urel");
+	}
+	
+	# Change directory to Smoketest directory
+	chdir "$SmokeTest::SmokeTestDir" or &SmokeTest::DieLog("Can't cd to $SmokeTest::SmokeTestDir");
+	
+	# Get the filename of the NAND image file
+	my @NANDname = glob("$SmokeTest::NandDir\\$nandImage");
+	
+	# There should be exactly one file matching $nandImage. If not give warning.
+	if(@NANDname != 1)
+	{
+		print "PrepareNANDROM: warning: " . scalar(@NANDname) . " files matching $nandImage in $SmokeTest::NandDir\\: [@NANDname].\n";
+	}
+	
+	# Attempt to delete any files already in this directory left over from previous runs
+	print "PrepareNANDROM: attempting to delete any debris from the last run:\n";
+	SmokeTest::ExecCommand ("DEL /Q $nandImage");
+
+	for my $filename(@NANDname)
+	{
+		if((lc($arg) eq "h2") && ($filename =~ /h2/i)) # This is the H2 NAND case, so copy H2 image
+		{
+			# Copy $nandImage to the current working directory
+			print "PrepareNANDROM: copying $filename to .\n";
+			SmokeTest::ExecCommand ("COPY $filename");
+		}
+		elsif((lc($arg) eq "h4hrp") && ($filename =~ /h4hrp/i)) # This is the H4 NAND case, so copy H4 image
+		{
+			# Copy $nandImage to the current working directory
+			print "PrepareNANDROM: copying $filename to .\n";
+			SmokeTest::ExecCommand ("COPY $filename");
+		}
+	}
+}
+
+#
+# CR 0844 (Both H2 and H4 use -D_NAND2)
+# CreateAndZipROM creates the various ROMS; up to 5 arguments.
+# Usage:
+# CreateAndZipROM("ARMV5", "lubbock", "-DRVCT", "PlatSec");
+# CreateAndZipROM("ARMV5", "h2", "-DRVCT", "PlatSec");
+# CreateAndZipROM("ARMV5", "h2", "-DRVCT", "PlatSec", "-D_NAND2");
+# CreateAndZipROM("ARMV5", "h4hrp", "-DRVCT", "PlatSec", "-D_NAND2");
+#
+sub CreateAndZipROM
+{
+	my @args = @_; # Array to hold the arguments
+	
+	# This sixth argument $args[5] determines whether to build the NAND version
+	# of the ROM or not. Set it equal to the empty string if the argument
+	# isn't defined otherwise it should equal the argument
+	my $nandROM;
+	if(defined $args[5])
+	{
+		if($args[5] =~  /-D_NAND/)
+		{
+			$nandROM = $args[5];
+		}
+		else
+		{
+			die "Invalid final argument in CreateAndZipROM. Exiting.\n";
+		}
+	}
+	else
+	{
+		$nandROM = "";
+	}
+	
+	print "\n";
+	# 
+	# Build ROM with STAT run automatically
+	#
+	print "\n";
+	print "#\n# Build $args[0] $args[1] ROM with STAT run automatically\n#\n"; 
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	my $eabi = "";
+	if ($args[0] eq "ARMV5")
+	{
+		$eabi = "-D_EABI=$args[0]";
+	}
+
+    my ($iProductNum,$buildrom);
+	$iProductNum = $args[4];
+	
+	if ($iProductNum eq 'Future' || $iProductNum  >= 9.5)
+	{
+####????DavidZjang#$buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 -D_EABI=ARMV5 -fm=\\epoc32\\rom\\include\\featuredatabase.xml h4hrp techview statauto.iby -osys$rom.bin");
+####????MCL########$buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 $eabi -fm=\\epoc32\\rom\\include\\featuredatabase.XML GTC_Standard statauto.iby testconfigfileparser.iby");
+	    $buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 $eabi -fm=\\epoc32\\rom\\include\\featuredatabase.XML GTC_Standard statauto.iby testconfigfileparser.iby");
+	}
+	else
+	{
+	    $buildrom = SmokeTest::ExecCommand ("buildrom -D_STARTUPMODE2 $eabi -fr=\\epoc32\\rom\\include\\featureUIDs.XML GTC_Standard statauto.iby testconfigfileparser.iby");
+	}
+	print $buildrom;
+	
+	if ( ($buildrom =~ m/rombuild.*failed/i) )
+	{
+		print "\n*** Error In Smoke Test ***\n Building the ROM failed\n$!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the ROM failed");
+	} 
+	else 
+	{
+		print "\n*** ROM built successfully ***\n";	
+	}
+	
+	if ($nandROM =~ /-D_NAND/)
+	{
+		# Need to rename each on individually as there are several files ending in ".img"
+		print "\n";
+		print "#\n# Renaming NAND ROMs\n#\n"; 
+		print "\n";
+		SmokeTest::ExecCommand ("MOVE /Y $ROFSImage $newROFSImage");
+		SmokeTest::ExecCommand ("MOVE /Y $coreImage $newCoreImage");
+
+		# Copy each of the image files to the \epoc32\rom directory
+		print "\n";
+		print "#\n# Copying NAND ROMs\n#\n"; 
+		print "\n";
+		SmokeTest::ExecCommand ("COPY $newROFSImage \\epoc32\\rom\\");
+		SmokeTest::ExecCommand ("COPY $newCoreImage \\epoc32\\rom\\");
+		
+		# Delete the images
+		print "\n";
+		print "#\n# Deleting images\n#\n"; 
+		print "\n";
+		SmokeTest::ExecCommand ("DEL *.img");
+
+#  passing $args[1] i.e. h2 / h4hrp to PrepareNANDROM due to CR 0844 (Both H2 and H4 use -D_NAND2)
+    	&PrepareNANDROM("$args[1]");
+	}
+	
+	# Rename the IMG file to sys$rom.bin
+	my $ImgDir = SmokeTest::ExecCommand ("DIR *.img");
+		
+	$ImgDir =~ /(\S+\.img)/i;
+		
+	#&SmokeTest::DieLog("Building ROMs failed: Cannot find .IMG file") unless defined $1;
+	print "Name of ROM : $1 \n";
+	SmokeTest::ExecCommand ("MOVE /Y $1 sys\$rom.bin");
+	print "\n";
+		
+	# 
+	# ZIP ROM using \epoc32\tools\zip.exe
+	# 
+	print "\n";
+	print "#\n# ZIP ROM using \\epoc32\\tools\\zip.exe\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	# Now zip the file
+	my $zipresult = SmokeTest::ExecCommand ("$SmokeTest::BuildDir$ENV{EPOCROOT}epoc32\\tools\\zip.exe -Tv sys\$rom sys\$rom.bin");
+	print "\n";
+	
+	# Test for zip errors
+	if ($zipresult =~ m/No errors detected/i) # Good case: no errors detected.
+	{
+		print "*** ROM zip successful: no errors detected ***\n";	
+	}
+	elsif ($zipresult =~ m/zip error/i) # Zip error
+	{
+		print "*** Error In Smoke Test ***\n Zipping the ROM failed $!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Zipping the ROM failed");
+	}
+	else # Worst case
+	{
+		print "*** Error In Smoke Test ***\n Zipping unable to start $!\n";
+	}
+	
+	# Form the string for the temporary zip file locations
+	my $tempZipLocation = "$SmokeTest::SmokeTestDir\\$args[0]\\$args[1]";
+	if ($nandROM =~ /-D_NAND/) # Add \NAND folder if a NAND ROM is being built
+	{
+		
+		if ($args[2] eq "pagedrom") # Add \NAND_DP folder if a Demand Paging NAND ROM is being built
+		{
+			$tempZipLocation .= "\\NAND\(DP\)";
+		}
+		else
+		{
+			$tempZipLocation .= "\\NAND";
+		}
+	}
+
+	# Make the temp zip folder
+	SmokeTest::ExecCommand ("MKDIR $tempZipLocation");
+	print "\n";
+	
+	# Copy the ROM to the appropriate directory to be copied later
+	SmokeTest::ExecCommand ("MOVE /Y sys\$rom.zip $tempZipLocation\\sys\$rom.zip");
+	
+	print "\n";
+	
+	SmokeTest::PrintDateTime();
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/SmokeTestServer.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,334 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# TestServer.pl 
+# This script was born on 19/10/2004
+# 
+#
+
+use strict;
+
+my $jobsfolder = "d:\\Jobs\\";
+
+# Loop forever
+while (1)
+{
+	open LogFile, ">>d:\\SmokeTestServerLog.txt" or die "Cannot open log file: $!";
+	
+	print "\n***********************\n";
+	print "\n*** START PUBLISHER ***\n";
+	print "\n***********************\n";
+	print "\n";
+	print LogFile "\n***********************\n";
+	print LogFile "\n*** START PUBLISHER ***\n";
+	print LogFile "\n***********************\n";
+	print LogFile "\n";
+	
+	my $localtimes = localtime;
+	print "\n*** Current Time: $localtimes ***\n";
+	print LogFile "\n*** Current Time: $localtimes ***\n";
+	
+	# 
+	# Check if there are any results ready for publishing
+	#
+	print "\n";
+	print "#\n# Check if there are any results ready for publishing\n#\n"; 
+	print "\n";	
+	print LogFile "\n";
+	print LogFile "#\n# Check if there are any results ready for publishing\n#\n"; 
+	print LogFile "\n";	
+	
+	opendir JobDir, $jobsfolder or die "Cannot open jobs dir $jobsfolder: $!";
+		
+	my @jobs = readdir(JobDir);
+	
+	# to remove "." and ".." from this list
+	shift @jobs;
+	shift @jobs;
+	
+	if (!scalar(@jobs))
+	{
+		print "\nNo Jobs to publish\n";
+		print LogFile "\nNo Jobs to publish\n";
+	}
+	else
+	{
+		# 
+		# Loop though each directory and publish logs
+		#
+		print "\n";
+		print "#\n# Loop though each directory and publish logs\n#\n"; 
+		print "\n";
+		print LogFile "\n";
+		print LogFile "#\n# Loop though each directory and publish logs\n#\n"; 
+		print LogFile "\n";
+			
+		foreach my $name (sort { $a <=> $b } @jobs)
+		{
+			if ( -d $jobsfolder.$name)
+			{
+				print "\n*** Found Job: $name ***\n";
+				print LogFile "\n*** Found Job: $name ***\n";
+				
+				# Check to see if job has been completed.
+				if (isJobFinished($name))
+				{
+					# 
+					# Publish the results
+					#
+					print "\n";
+					print "#\n# Publish the results\n#\n"; 
+					print "\n";
+					print LogFile "\n";
+					print LogFile "#\n# Publish the results\n#\n"; 
+					print LogFile "\n";
+					
+					my $publishfile = $jobsfolder.$name."\\publish.txt";
+					
+					if (-r $publishfile)
+					{
+						open (PUBLISH, $publishfile) or GoNext("Cannot find publish details for $name");
+						my $count = 0;
+						my $index = 0;
+						while (my $publishlocation = <PUBLISH>)
+						{
+							chomp $publishlocation;
+							
+							$index++;
+							
+							print "\nPublish Location = $publishlocation\n";
+							print LogFile "\nPublish Location = $publishlocation\n";
+							
+							`mkdir $publishlocation`; # or GoNext("$publishlocation\\$name\\");
+							
+							my $lookIn = "$jobsfolder$name\\output";
+							my ($source,$runid,$buildname) = getSourceDir($lookIn);
+							
+							my $srcdir = $source."\\xml";
+							my $trgtdir= $publishlocation."xml\\";
+							
+							my $xcopycmd= "xcopy /C /Y /E $srcdir $trgtdir ";
+							print `$xcopycmd`;
+							
+							#
+							# Copy the contents of Output and reports -
+							#
+							# runXX_<snapshot>_SymbianOS_vYY.xml/html to <snapshot>_Symbian_OS_vYY.xml/html
+							#
+							
+							my $xmlfile   = "$source\\run".$runid."_".$buildname."\.xml";
+							my $htmlfile  = "$source\\run".$runid."_".$buildname."\.html";
+							
+							if (-e $xmlfile)  {
+								
+								print "copy $xmlfile to $buildname.xml";
+								system "copy $xmlfile $publishlocation\\$buildname.xml";
+							}
+							
+							if (-e $htmlfile)  {
+								
+								print "copy $htmlfile to $buildname.html";
+								system "copy $htmlfile $publishlocation\\$buildname.html";
+							}
+							
+							print "\nNumber of Files Copied = $1\n" if $xcopycmd =~ m/(\d+)\s\w+/;
+							print LogFile "\nNumber of Files Copied = $1\n" if $xcopycmd =~ m/(\d+)\s\w+/;
+							
+							$count += $1;
+							
+							# The input should be copied onto \\devbuilds\master\.. but not \\devbuilds\logs\master\..
+							if ($index < 2)
+							{
+								print "\n\nCopy the Input\n";
+								$source = "$jobsfolder$name\\input\\*";
+								
+								# Copy the contents of Input
+								print "\ncmd: xcopy /C /Y /E $source $publishlocation 2>&1\n";
+								print LogFile "\ncmd: xcopy /C /Y /E $source $publishlocation 2>&1\n";
+								my $xcopy = `xcopy /C /Y /E $source $publishlocation 2>&1`;
+								print $xcopy;
+								
+								print "\nNumber of Files Copied = $1\n" if $xcopy =~ m/(\d+)\s\w+/;
+								print LogFile "\nNumber of Files Copied = $1\n" if $xcopy =~ m/(\d+)\s\w+/;
+								$count += $1;
+							}
+						}						
+						close Publish;
+						
+						print "\nTotal Number of files copied = $count\n";
+						print LogFile "\nTotal Number of files copied = $count\n";
+						
+						# Minimum 3 files have to be copied - Trace.txt, sys$rom.bin and armX.tpkg
+						if ($count >= 3)
+						{
+							# it is fine to delete the jobs dir
+							print "\ncmd: rd $jobsfolder$name /Q /S  2>&1\n";
+							print LogFile "\ncmd: rd $jobsfolder$name /Q /S  2>&1\n";
+							print `rd $jobsfolder$name /Q /S  2>&1`;
+						}
+					}
+					else
+					{
+						print "\n*** Error publishing results ***\n Cannot open publish file: $jobsfolder"."$name"."\\publish.txt\n";
+						print LogFile "\n*** Error publishing results ***\n Cannot open publish file: $jobsfolder"."$name"."\\publish.txt\n";
+					}
+				}
+				else
+				{
+					print "\nThe Job $name is either still running or has encountered an error\n";				
+					print LogFile "\nThe Job $name is either still running or has encountered an error\n";				
+				}
+			}
+			else
+			{
+				print "*** Error ***\nDir does not exist! $jobsfolder.$name\n";
+				print LogFile "*** Error ***\nDir does not exist! $jobsfolder.$name\n";
+			}
+		}
+	}
+	close JobDir;
+	
+	my $localtimes = localtime;
+	print "\n*** Current Time: $localtimes ***\n";
+	print LogFile "\n*** Current Time: $localtimes ***\n";
+	
+	print "\n";
+	print "\n*********************\n";
+	print "\n*** END PUBLISHER ***\n";
+	print "\n*********************\n";
+	print "\n";
+	print "\n";
+	print LogFile "\n";
+	print LogFile "\n*********************\n";
+	print LogFile "\n*** END PUBLISHER ***\n";
+	print LogFile "\n*********************\n";
+	print LogFile "\n";
+	print LogFile "\n";
+	
+	close LogFile;
+	sleep 900;
+}
+
+sub GoNext
+{
+	print "\n*** Error in Publisher ***\n $_[0] $!\n";
+	print LogFile "\n*** Error in Publisher ***\n $_[0] $!\n";
+	next;
+}
+
+# identify if a job has finished
+sub isJobFinished($) {
+	
+	my $jobid = shift;
+	my @cmd_out = `testdriver.cmd jobstatus -j $jobid 2>&1`;
+	
+	foreach (@cmd_out) {
+		if (m/completed/) { return 1; }
+	}
+	
+	return 0;
+}
+
+sub getSourceDir($)
+{
+	my $source = shift;
+	my $runid  = 0;
+	my $buildname;
+	
+	#
+	# Find the correct directory to publish
+	#
+	
+	if (opendir RESULTS, $source)
+	{	
+		my @dirArray = readdir(RESULTS);
+		
+		#print "@results";	
+		# to remove "." and ".." from this list
+		shift @dirArray;
+		shift @dirArray;
+		
+		if (!scalar(@dirArray))
+		{
+			print "REMARK: The result for $_[0] has an empty $source directory";
+			return;
+		}
+		else
+		{
+			print "\nContents of $source = @dirArray\n";
+			$source .= "\\$dirArray[0]"; 
+			# dirArray should always have just the one subdir - 0XXXX_Symbian_OS_vX.X
+			
+			$buildname = $dirArray[0];
+	
+			if (opendir tempDir, "$source")
+			{
+				# to remove "." and ".." from this list
+				my @dirArray = readdir(tempDir);
+				shift @dirArray;
+				shift @dirArray;
+				
+				print "\nContents of $source = @dirArray\n";
+				
+				foreach my $directory (@dirArray)
+				{
+					if ($directory =~ /(?:$_[0])/i)
+					{
+						$source .= "\\$directory";
+						
+						# added this to remove udeb/xx
+						if (opendir tempDir, "$source")
+						{
+							# to remove "." and ".." from this list
+							@dirArray = readdir(tempDir);
+							shift @dirArray;
+							shift @dirArray;
+				
+							print "\nContents of $source = @dirArray\n";
+				
+							foreach my $directory (@dirArray)
+							{
+								if ($directory =~ /(udeb|urel)/i)
+								{
+									$source .= "\\$directory";
+									if (opendir tempDir, "$source")
+									{
+										# to remove "." and ".." from this list
+										@dirArray = readdir(tempDir);
+										shift @dirArray;
+										shift @dirArray;
+				
+										print "\nContents of $source = @dirArray\n";
+				
+										foreach my $directory (@dirArray)
+										{
+											if ($directory =~ /(^[0-9]+)/i)
+											{
+												$source .= "\\$directory";
+												$runid = $directory;
+												last;
+											}
+										}
+									}
+									last;
+								}
+							}
+						}
+						
+					}
+				}
+			}
+		}
+	}
+	return ($source, $runid, $buildname);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/SmokeTestSuite.pm	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,501 @@
+# Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# The SmokeTestSuite package contains subroutines that are needed to build a 
+# testdriver test suite.
+# This script was born on 18/04/2005
+# 
+#
+
+#!/usr/bin/perl -w
+package SmokeTestSuite;
+use strict;
+
+my $servicename;
+
+#
+# BuildAndPackage: Used to create a test package for remote execution on the ROM
+#
+sub BuildAndPackage
+{
+	#
+	# Build Test Package for $_[0]
+	#
+	print "\n#\n# Build Test Package for $_[0]\n#\n";
+	SmokeTest::PrintDateTime();
+	my $testbuild = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd build -p $_[0] -b udeb -s $SmokeTest::TestSuite");
+
+	# now check for results
+	$testbuild =~ m/fail\:\s(\d+)\s\%/i;
+	
+	if ( ($testbuild =~ m/\*\*error\:/i) || $1 == 100 )
+	{
+		print "\nREMARK: Smoke Test *** Building the Test failed $!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test failed");
+	} 
+	else 
+	{
+		print "\n*** Test Building successful ***\n";	
+	}
+	
+	SmokeTest::PrintDateTime();
+	
+	my $testpackage = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd package -p $_[0] -b udeb -s $SmokeTest::TestSuite --tp $SmokeTest::SmokeTestDir\\$_[0].tpkg");
+	print "\n";
+	
+	if (($testpackage =~ m/\*\*error/i))
+	{
+		print "\nREMARK: Smoke Test *** Building the Test Package failed\n\"$1\"\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test Package failed");
+	} 
+	else 
+	{
+		print "\n*** Building the Test Package successful ***\n";	
+	}
+	
+	SmokeTest::PrintDateTime();
+}
+
+#
+# BuildAndPublish: used to build and test the smoketest test suite on an Emulator
+#
+sub BuildAndPublish
+{
+	my $runid = 0;
+	my $buildname;
+	
+	#
+	# Build Test Suite for $_[0]
+	#
+	print "\n#\n# Build Test Suite for $_[0]\n#\n";
+	SmokeTest::PrintDateTime();
+	my $testbuildwinscw = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd build -p $_[0] -b udeb -s $SmokeTest::TestSuite");
+
+	# now check for results
+	$testbuildwinscw =~ m/fail\:\s(\d+)\s\%/i;
+	
+	if ( ($testbuildwinscw =~ m/\*\*error\:/i) || $1 == 100 )
+	{
+		print "\nREMARK: Smoke Test *** Building the Test for $_[0] failed $!\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Building the Test failed");
+	} 
+	else 
+	{
+		print "\n*** Test Build successful ***\n";	
+	}
+	
+	#
+	# Run Test Suite for $_[0]
+	#
+	print "\n";
+	print "#\n# Run Test Package for $_[0]\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd run -p $_[0] -b udeb -s $SmokeTest::TestSuite");
+	
+	SmokeTest::PrintDateTime();
+	
+	#
+	# Publish results of emulator onto publish server
+	#
+	print "\n";
+	print "#\n# Publish results of emulator onto publish server\n#\n";
+	print "\n";
+	
+	#
+	# Find the correct directory to publish
+	#
+	my $source = "$SmokeTest::TestDriverDrive\\TestDriver\\Results";
+	if (opendir Results, $source)
+	{	
+		my @dirArray = readdir(Results);
+		
+		#print "@results";	
+		# to remove "." and ".." from this list
+		shift @dirArray;
+		shift @dirArray;
+		
+		if (!scalar(@dirArray))
+		{
+			print "REMARK: The emulator for $_[0] has an empty $source directory";
+			return;
+		}
+		else
+		{
+			print "\nContents of $source = @dirArray\n";
+			$source .= "\\$dirArray[0]"; 
+			# dirArray should always have just the one subdir - 0XXXX_Symbian_OS_vX.X
+			
+			$buildname = $dirArray[0];
+			
+			if (opendir tempDir, "$source")
+			{
+				# to remove "." and ".." from this list
+				@dirArray = readdir(tempDir);
+				shift @dirArray;
+				shift @dirArray;
+				
+				print "\nContents of $source = @dirArray\n";
+				
+				foreach my $directory (@dirArray)
+				{
+					if ($directory =~ /(?:$_[0])/i)
+					{
+						$source .= "\\$directory";
+						
+						# added this to remove udeb/xx
+						if (opendir tempDir, "$source")
+						{
+							# to remove "." and ".." from this list
+							@dirArray = readdir(tempDir);
+							shift @dirArray;
+							shift @dirArray;
+				
+							print "\nContents of $source = @dirArray\n";
+				
+							foreach my $directory (@dirArray)
+							{
+								if ($directory =~ /(udeb|urel)/i)
+								{
+									$source .= "\\$directory";
+									if (opendir tempDir, "$source")
+									{
+										# to remove "." and ".." from this list
+										@dirArray = readdir(tempDir);
+										shift @dirArray;
+										shift @dirArray;
+				
+										print "\nContents of $source = @dirArray\n";
+				
+										my @iNumericDirList = ();
+										foreach my $directory (@dirArray)
+										{
+											if ($directory =~ /(^[0-9]+)/i)
+											{
+    											push @iNumericDirList, $directory;
+											}
+										}
+									    @iNumericDirList = sort { $b <=> $a } @iNumericDirList;
+									    $runid = $iNumericDirList[0];
+                                        $source .= "\\$runid";
+									    last;
+									}
+									last;
+								}
+							}
+						}
+						
+					}
+				}
+				
+				print "\nThe final source directory = $source\n";
+			}
+			else
+			{
+				print "REMARK: The emulator for $_[0] has an empty $source directory";
+				return;
+			}
+		}
+		my $emulatorpublish = "$SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\SmokeTest\\Emulator\\$_[0]";
+		
+		SmokeTest::ExecCommand ("MKDIR $emulatorpublish"); # or GoNext("$publishlocation\\$name\\");
+		
+		SmokeTest::ExecCommand ("XCOPY /C /Y /E $source\\xml $emulatorpublish\\xml\\");
+		
+		#
+		# Copy runXX_<snapshot>_SymbianOS_vYY.xml/html to <snapshot>_Symbian_OS_vYY.xml/html
+		#
+		
+		my $xmlfile   = "$source\\run".$runid."_".$buildname."\.xml";
+		my $htmlfile  = "$source\\run".$runid."_".$buildname."\.html";
+		
+		if (-e $xmlfile)
+		{
+			SmokeTest::ExecCommand ("COPY $xmlfile $emulatorpublish\\$buildname.xml");
+		}
+		
+		if (-e $htmlfile)
+		{
+			SmokeTest::ExecCommand ("COPY $htmlfile $emulatorpublish\\$buildname.html");
+		}
+		
+		#
+		# Publish results of emulator onto logs dir
+		#
+		print "\n";
+		print "#\n# Publish results of emulator onto Logs Dir\n#\n";
+		print "\n";
+		
+		my $emulatorpublish = "$SmokeTest::LogsDir\\SmokeTest\\Emulator\\$_[0]\\";
+		
+		SmokeTest::ExecCommand ("MKDIR $emulatorpublish"); # or GoNext("$publishlocation\\$name\\");
+		
+		SmokeTest::ExecCommand ("XCOPY /C /Y /E $source $emulatorpublish");
+	}
+	else
+	{
+		print "REMARK: Cannot open dir $source: $!";
+		return;
+	}
+	SmokeTest::PrintDateTime();
+}
+
+#
+# PollServers: Polls all the servers from the Pool and picks out the one with the shortest queue.
+#
+sub PollServers
+{
+	#
+	# Parse ENV and create an array of smoketest servers for $_[0]
+	#
+	print "\n";
+	print "#\n# Parse ENV and create an array of smoketest servers for $_[0]\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	if (($_[0] eq "Lubbock") || ($_[0] eq "LUBBOCK"))
+	{
+		$SmokeTest::servicename = "RemoteTestDriverLubbock";
+	}
+	elsif ($_[0] eq "H2")
+	{
+		$SmokeTest::servicename = "RemoteTestDriverH2";
+	}
+        elsif ($_[0] eq "H4HRP")
+	{
+		$SmokeTest::servicename = "RemoteTestDriverH4HRP";
+	} 
+	else
+	{
+		&SmokeTest::DieLog("Cannot poll serverpool for pool \"$_[0]\"");
+	}
+	
+	my @servers = split /\#/, $SmokeTest::serverpool;
+	if (@servers < 1)
+	{
+		&SmokeTest::DieLog("*** Error In Smoke Test ***\nNo SmokeTest Servers specified for $_[0]$!\n");
+	}
+	else
+	{
+		print "\n*** Retrieved Pool of Smoke Test Servers from ENV for $_[0]***\n";
+	}
+	
+	#
+	# Poll each of the smoke test servers and parse the results
+	#
+	print "\n";
+	print "#\n# Poll each of the smoke test servers and parse the results\n#\n";
+	print "\n";
+	
+	my %serverlist;
+	
+    print "Checking TestDriver Version\n";
+    SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd version");
+
+	foreach my $server (@servers)
+	{
+		print "Polling Server: $server\n";
+        my $masterstatus = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd masterstatus --srv //$server/$SmokeTest::servicename");
+		
+		my $value = -2;
+		if ($masterstatus =~ m/Master: TestDriver is currently (....)/i)
+		{
+			if ($1 eq 'free')
+			{
+				#print "Free!\n";
+				$value = 0;
+			}
+			else
+			{
+				$masterstatus =~ m/are\s+(\w+)\s+jobs/i;
+				if ($1 =~ m/\D+/)
+				{
+					$value = 1;
+				}
+				else
+				{
+					$value = $1 + 1;
+				}
+			}
+		}
+		else
+		{
+			# The master is not running a service
+			$value = -1;
+		}
+		$serverlist{$server} = $value;
+		print "\n"; 
+	}
+	
+	#
+	# Decide which server to use
+	#
+	print "\n";
+	print "#\n# STEP8 Decide which server to use\n#\n";
+	print "\n";
+	
+	my $masterserver;
+	
+	# Loop through first time only to print out all the available servers
+	print "\nAvailable Servers\n";
+	foreach my $servername (sort { $serverlist{$a} <=> $serverlist{$b} } keys %serverlist)
+	{
+		print "\n$servername : number in queue are $serverlist{$servername}\n";
+	}
+	
+	# Loop through second time to actually select the correct server
+	foreach my $servername (sort { $serverlist{$a} <=> $serverlist{$b} } keys %serverlist)
+	{
+		if ($serverlist{$servername} > -1)
+		{
+			$masterserver = $servername;
+			last;
+		}
+	}
+	
+	if (defined $masterserver)
+	{
+		print "\n*** The Smoke Test Server to be used for $_[0] is $masterserver ***\n";
+	}
+	else
+	{
+		print "\nREMARK: Smoke Test *** No available Smoke Test Servers for $_[0] \n";
+		#&SmokeTest::DieLog("Error In Smoke Test: No available Smoke Test Servers for $_[0]");
+	}
+	SmokeTest::PrintDateTime();
+	return $masterserver;
+}
+
+#
+# Usage: RunRemote(Architecture, Testing Board, Server)
+#
+sub RunRemote
+{
+	my $masterserver = $_[2];
+	
+		
+	#
+	# Call TestDriver runremote for $_[0]
+	#
+	print "\n";
+	print "#\n# Call TestDriver runremote for $_[0]\n#\n";
+	print "\n";
+	SmokeTest::PrintDateTime();
+	
+	my $tempZipLocation = "$SmokeTest::SmokeTestDir\\$_[0]\\$_[1]";
+	if ($_[3] eq "NAND\\")
+	{
+		$tempZipLocation .= "\\NAND";
+	}
+	elsif ($_[3] eq "NAND\(DP\)\\")
+	{
+                $tempZipLocation .= "\\NAND\(DP\)";
+	}
+
+	SmokeTest::ExecCommand ("COPY /Y $tempZipLocation\\sys\$rom.zip $SmokeTest::SmokeTestDir\\sys\$rom.zip");
+	
+	# Decide whether this is a platsec ROM or not
+	my $platsec;
+	if ($SmokeTest::buildNo eq "9.1" || $SmokeTest::buildNo eq "9.2" || $SmokeTest::buildNo eq "9.3" || $SmokeTest::buildNo eq "Future" || $SmokeTest::buildNo eq "9.4" || $SmokeTest::buildNo eq "9.5" || $SmokeTest::buildNo eq "9.6" || $SmokeTest::buildNo eq "tb91")
+	{
+		$platsec = "ON";
+	}
+	else
+	{
+		$platsec = "OFF";
+	}
+	
+	# calling testdriver for $_[0]
+	my $runremote = SmokeTest::ExecCommand ("$SmokeTest::TestDriverCmd runremote -m async -i $SmokeTest::SmokeTestDir --tp $_[0].tpkg -r sys\$rom.zip --srv //$masterserver/$SmokeTest::servicename --platsec $platsec --testexec ON");
+	
+	#
+	# Parse output to get the job number or error
+	#
+	print "\n";
+	print "#\n# Parse output to get the job number or error\n#\n";
+	print "\n";
+	
+	my $jobid;
+	
+	if ($runremote =~ m/job id/i)
+	{
+		$runremote =~ m/job id: (\d+)/i;
+		$jobid = $1;
+		print "\n*** Job submitted successfully ***\n\nJob Id = $jobid\n";
+	}
+	else
+	{
+		print "\nREMARK: Smoke Test Job Submission failed\n";
+		#&SmokeTest::DieLog("Error In Smoke Test: Submitting the Job failed");
+		return;
+	}
+	
+	#
+	# Create a text file with publish details
+	#
+	print "\n";
+	print "#\n# Create a text file with publish details\n#\n";
+	print "\n";
+	
+	my $publishstring;
+	
+	$publishstring = "Publish: $SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\Smoketest\\$_[0]\\$_[1]\\";
+	print "$publishstring";
+	
+	if ( (defined $SmokeTest::PublishServer) && (defined $SmokeTest::ProductType) && (defined $SmokeTest::BuildNum) )
+	{
+		open PublishFile, ">$_[0]$_[1].txt" or &SmokeTest::DieLog("Cannot open File $_[0]$_[1].txt: $!\n");
+		$publishstring = "$SmokeTest::PublishServer\\$SmokeTest::ProductType\\$SmokeTest::BuildNum\\logs\\Smoketest\\$_[0]\\$_[1]\\";
+		if ($_[3] eq "NAND\\")
+		{
+			$publishstring .= "NAND\\";
+		}
+		elsif ($_[3] eq "NAND\(DP\)\\")
+		{
+            $publishstring .= "NAND\(DP\)\\";
+	    }
+		print PublishFile "$publishstring";
+		$publishstring = "\n$SmokeTest::PublishServer\\$SmokeTest::ProductType\\logs\\$SmokeTest::BuildNum\\Smoketest\\$_[0]\\$_[1]\\";
+		if ($_[3] eq "NAND\\")
+		{
+			$publishstring .= "NAND\\";
+		}
+		elsif ($_[3] eq "NAND\(DP\)\\")
+		{
+                $publishstring .= "NAND\(DP\)\\";
+        }
+		print PublishFile "$publishstring";
+		close PublishFile;
+		print "\n*** Publish file created successfully ***\n";
+	}
+	else
+	{
+		print "\nREMARK: Smoke Test *** Could not Create Publish File\n$!";
+		#&SmokeTest::DieLog("Error In Smoke Test: Could not Create Publish File");
+	}
+	
+	#
+	# Copy This publish file to the correct directory 
+	#
+	print "\n";
+	print "#\n# Copy This publish file to the correct directory \n#\n";
+	print "\n";
+	
+	###print "\nabout to move /Y $_[0]$_[1].txt \\\\$masterserver\\Jobs\\$jobid\\publish.txt\n";
+    SmokeTest::ExecCommand ("MOVE /Y $_[0]$_[1].txt \\\\$masterserver\\Jobs\\$jobid\\publish.txt");
+	
+	SmokeTest::PrintDateTime();
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/System/Group/Smoketest_System.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,40 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Smoketest_Agenda.mmp
+// using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET			Smoketest_System.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7773
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		WriteUserData ReadUserData
+
+SOURCEPATH		..\Src
+
+SOURCE		TestSystemBase.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\test
+
+LIBRARY	EUSER.LIB
+LIBRARY	EIKSRV.LIB
+LIBRARY	TESTEXECUTELOGCLIENT.LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/System/Group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,19 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For System smoketest
+// 
+//
+
+PRJ_TESTMMPFILES
+Smoketest_System.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/System/Inc/TestSystemBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,46 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#ifndef TEST_SYSTEM_BASE_H
+#define TEST_SYSTEM_BASE_H
+
+#include <eikunder.h>
+#include <TestExecuteLog.h>
+
+class CEikUndertaker;
+
+class CSystemTestBase : public MEikUndertakerObserver
+	{
+public:
+	static CSystemTestBase* NewL();
+	~CSystemTestBase();
+
+protected:	
+	CSystemTestBase();
+	void ConstructL();
+
+protected: // From MEikUndertakerObserver
+	void HandleThreadExitL(RThread& aThread);
+	
+protected:
+	CEikUndertaker* iUndertaker;
+	RTestExecuteLogServ iLogger;
+	TInt iExitReason;	
+	TExitCategoryName iExitCategory;
+	};
+
+
+#endif // TEST_SYSTEM_BASE_H
Binary file common/tools/ats/smoketest/System/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/System/Src/TestSystemBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,116 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestSystemBase.h"
+
+// Global Vars
+_LIT(KTestExecuteLog,"c:\\Logs\\TestExecute\\smoketest_system_temp.htm");
+_LIT(KPanicText,"The following Panic has occured: Thread Name = %S Exit Reason = %d Exit Category = %S");
+
+CSystemTestBase* CSystemTestBase::NewL()
+	{
+	CSystemTestBase* self=new(ELeave) CSystemTestBase;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self
+	return(self);
+	}
+
+void CSystemTestBase::ConstructL()
+	{
+	iUndertaker=CEikUndertaker::NewL(*this);
+	User::LeaveIfError(iLogger.Connect());
+	User::LeaveIfError(iLogger.CreateLog(KTestExecuteLog,RTestExecuteLogServ::ELogModeAppend));
+	}
+
+CSystemTestBase::CSystemTestBase()
+	{
+	// do nothing
+	}
+
+CSystemTestBase::~CSystemTestBase()
+	{
+	delete iUndertaker;
+	iLogger.Close();
+	}
+
+void CSystemTestBase::HandleThreadExitL(RThread& aThread)
+	{
+	TExitType exitType=aThread.ExitType();
+	if (exitType==EExitPanic)
+		{
+		CActiveScheduler::Stop();
+		iExitReason = aThread.ExitReason();
+		iExitCategory = aThread.ExitCategory();
+		TBuf<100> iName(aThread.FullName());
+		iLogger.WriteFormat(KPanicText, &iName, iExitReason, &iExitCategory);
+		User::Panic(iExitCategory,iExitReason);
+		}
+	}
+
+//LOCAL_C TInt PanicThread(TAny*)
+//	{
+//	_LIT(PanicReason, "Just, why not");
+//	TInt iPanicInt = 666;
+//	User::Panic(PanicReason, iPanicInt);
+//	return iPanicInt;
+//	}
+	
+LOCAL_C void MainL()
+	{
+	// Construct and install the active scheduler
+	CActiveScheduler*  myScheduler = new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(myScheduler);
+	CActiveScheduler::Install(myScheduler); 
+	
+	CSystemTestBase* iTempBase = CSystemTestBase::NewL();
+	
+	// The following is just test code that spawns a thread and makes it panic
+	//RThread iPanicThread;
+	//_LIT(PanicThreadTest, "Undertaker Panic Thread Test");
+		
+	//User::LeaveIfError(iPanicThread.Create(PanicThreadTest(), &PanicThread, KDefaultStackSize, 0x100, 0x100, NULL));
+	//iPanicThread.SetPriority(EPriorityAbsoluteHigh);
+	//iPanicThread.Resume();
+	
+	CActiveScheduler::Start();	
+	
+	for (;;)
+		{
+		User::After(100000);
+		}
+	}
+	
+GLDEF_C TInt E32Main()
+/**
+ * Executable Entry Point
+ * Top level always creates TRAP harness.
+ * Calls MainL() inside the TRAP harness
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	// should never reach this point if some thread has panicked already
+	_LIT(KTestPanicReason,"Trap");
+	__ASSERT_ALWAYS(!err, User::Panic(KTestPanicReason,err));
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/ConsoleAlarmAlertServer.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,44 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET					ConsoleAlarmAlertServer.dll
+TARGETTYPE				dll
+CAPABILITY   All -TCB
+UID						0x1000008D	0x101F502A
+VENDORID 0x70000001
+
+SOURCEPATH				..\ConsoleAlarmAlertServer\Source
+
+SOURCE					ConsoleAlarmAlertServer.cpp
+SOURCE					ConsoleAlarmAlertSession.cpp
+SOURCE					ConsoleAlarmAlertConsole.cpp
+SOURCE					ConsoleAlarmAlertServerMain.cpp
+SOURCE					ConsoleAlarmAlertLEDFlasher.cpp
+
+USERINCLUDE				..\ConsoleAlarmAlertServer\Include
+//USERINCLUDE				..\AlarmAlert\Shared
+//USERINCLUDE				..\Shared\Include
+
+SYSTEMINCLUDE			\Epoc32\Include
+
+LIBRARY					euser.lib
+LIBRARY					hal.lib
+LIBRARY					AlarmShared.lib
+
+DEFFILE					ConsoleAlarmAlertServer.DEF
+
+START WINS
+	baseaddress			0x40700000
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertConsole.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,91 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTCONSOLE_H__
+#define __CONSOLEALARMALERTCONSOLE_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "asaltdefs.h"
+
+// Type definitions
+
+// Constants
+
+// Classes referenced
+class CConsoleAlarmAlertSession;
+
+// Enumerations
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertConsole (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertConsole : public CActive
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// CONSTRUCT / DESTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertConsole(CConsoleAlarmAlertSession& aSession);
+	~CConsoleAlarmAlertConsole();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+	void									GetKey();
+	void									CancelKey();
+	void									DecCounter();
+	void									UpdateDisplay();
+	TInt									GetTimeInterval() const;
+	void									SetVisibility(TInt aVis);
+	void									SetAlertState(TInt aFlags);
+
+///////////////////////////////////////////////////////////////////////////////////////
+protected:									// FROM CActive
+///////////////////////////////////////////////////////////////////////////////////////
+	void									RunL();
+	void									DoCancel();
+
+///////////////////////////////////////////////////////////////////////////////////////
+protected:									// INTERNAL METHODS
+///////////////////////////////////////////////////////////////////////////////////////
+	void									Hide();
+	void									CreateWin();
+	void									DoDeferTime(TASAltAlertServerResponse aResponse);
+
+	static TBool							CountDownCallBack(TAny* aSelf);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TInt									iAlertState;
+
+	TInt									iTimeInterval;
+
+	CPeriodic*								iCountDown;
+
+	CConsoleBase*							iWin;
+
+	CConsoleAlarmAlertSession&				iSession;
+
+	friend class							CConsoleAlarmAlertSession;
+
+	TInt									iInstructionIndex;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertLEDFlasher.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,75 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTLEDFLASHER_H__
+#define __CONSOLEALARMALERTLEDFLASHER_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertLEDFlasher (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertLEDFlasher : public CTimer
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// STATIC CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	static CConsoleAlarmAlertLEDFlasher*	NewL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertLEDFlasher();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TInt									Start();
+
+	void									Stop();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// FROM CActive
+///////////////////////////////////////////////////////////////////////////////////////
+
+	void									RunL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TInt									SetRedLedOn(TBool aOn);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TBool									iLedOn;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,87 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TALARMALERTSERVER.H
+// 
+//
+
+#ifndef __CONSOLEALARMALERTSERVER_H__
+#define __CONSOLEALARMALERTSERVER_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+class CTestAlarmAlertConsole;
+class CConsoleAlarmAlertSession;
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertServer (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertServer : public CPolicyServer
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// STATIC CONSTRUCT / DESTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	static CConsoleAlarmAlertServer*		NewLC();
+	~CConsoleAlarmAlertServer();
+
+public:
+	inline void								AddResponseArray(TAny* aResponseArray);
+	void									SetAttachment(HBufC8* aData);
+	inline HBufC8*							Attachment() const;
+	inline TAny*							ResponseArray() const;
+	inline CConsoleAlarmAlertSession*		WaitingSession() const;
+	inline void								SetNotifying(TBool aIsNotifying);
+	inline TBool							IsNotifying() const;
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertServer();
+	void									ConstructL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// FROM CServer2
+///////////////////////////////////////////////////////////////////////////////////////
+	CSession2*								NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// FROM CActive
+///////////////////////////////////////////////////////////////////////////////////////
+	TInt									RunError(TInt aError);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+	TAny*									iInstructionSet;
+	HBufC8*									iAttachment;
+	CConsoleAlarmAlertSession*				iWaitingSession;
+	TBool									iIsNotifying;
+	};
+
+// inline functions
+void CConsoleAlarmAlertServer::AddResponseArray(TAny* aResponseArray)		{ iInstructionSet = aResponseArray; }
+HBufC8* CConsoleAlarmAlertServer::Attachment() const						{ return iAttachment; }
+TAny* CConsoleAlarmAlertServer::ResponseArray() const						{ return iInstructionSet; }
+CConsoleAlarmAlertSession* CConsoleAlarmAlertServer::WaitingSession() const	{ return iWaitingSession; }
+void CConsoleAlarmAlertServer::SetNotifying(TBool aIsNotifying)				{ iIsNotifying = aIsNotifying; }
+TBool CConsoleAlarmAlertServer::IsNotifying()	const						{ return iIsNotifying; }
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServerMain.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,54 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTSERVERMAIN_H__
+#define __CONSOLEALARMALERTSERVERMAIN_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> ConsoleAlarmAlertServer (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class ConsoleAlarmAlertServer
+/**
+@internalAll
+@released
+*/
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+	IMPORT_C static void					StartConsoleAlarmAlertServerL(TAny* instructionSet = NULL);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL
+///////////////////////////////////////////////////////////////////////////////////////
+	static TInt								StartServerThreadFunction(TAny* instructionSet = NULL);
+	static void								StartServerL(TAny* instructionSet = NULL);
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertSession.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,137 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __CONSOLEALARMALERTSESSION_H__
+#define __CONSOLEALARMALERTSESSION_H__
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "asaltdefs.h"
+#include "asshdalarm.h"
+
+// Type definitions
+
+// Constants
+
+// Classes referenced
+class CConsoleAlarmAlertConsole;
+class CConsoleAlarmAlertLEDFlasher;
+class CConsoleAlarmAlertServer;
+// Enumerations
+
+
+struct TAgnAlarmInfo
+	/**
+	Copy of System-Wide Unique Agenda Entry Reference defined in agmalarm.h
+	*/
+	{
+	TUid iAlarmCategory;
+	TUint32 iAgnUniqueId;
+	TFileName iFileName;
+	};
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertSession (header)
+///////////////////////////////////////////////////////////////////////////////////////
+class CConsoleAlarmAlertSession : public CSession2
+	{
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// STATIC CONSTRUCT / DESTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	static CConsoleAlarmAlertSession*		NewL(CConsoleAlarmAlertServer* aServer);
+	~CConsoleAlarmAlertSession();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL CONSTRUCT
+///////////////////////////////////////////////////////////////////////////////////////
+	CConsoleAlarmAlertSession(CConsoleAlarmAlertServer* aServer);
+	void									ConstructL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+public:										// ACCESS
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TTime									DeferTime() const;
+
+	inline const TASShdAlarm& 				Alarm() const { return iAlarm; }
+
+	inline TInt								AlarmDataSize() const { return iAlarmAssociatedDataSize; }
+
+	inline const TAgnAlarmInfo&				AlarmData() const { return iAlarmData; }
+
+	void									Notify(TASAltAlertServerResponse aFlag);
+
+	void									Notify(TASAltAlertServerResponse aFlag, const TTime& aDeferTime);
+
+	TAny *									InstructionSet();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// FROM CSession2
+///////////////////////////////////////////////////////////////////////////////////////
+	void									ServiceL(const RMessage2& aMessage);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// CMD - DEBUG ONLY
+///////////////////////////////////////////////////////////////////////////////////////
+	TBool									CmdL();
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// INTERNAL METHODS
+///////////////////////////////////////////////////////////////////////////////////////
+
+	void									SetAlarmL(const RMessage2& aMessage);
+
+	void									GetUserTimeL(const RMessage2& aMessage);
+
+	void									SetDeferTimeL(const RMessage2& aMessage);
+
+	static TBool							SoundPlaybackCallbackL(TAny* aSelf);
+
+///////////////////////////////////////////////////////////////////////////////////////
+private:									// MEMBER DATA
+///////////////////////////////////////////////////////////////////////////////////////
+
+	TTime									iDeferTime;
+
+	TASShdAlarm								iAlarm;
+
+	TInt									iAlarmAssociatedDataSize;
+
+	TAgnAlarmInfo							iAlarmData;
+
+	TBool									iLoggedOn;
+
+	TBool									iHasMessage;
+
+	TBool									iMsgComplete;
+
+	RMessage2								iMsgPtr;
+
+	CPeriodic*								iSoundCallbackTimer;
+
+	CConsoleAlarmAlertLEDFlasher*			iSoundLEDFlasher;
+
+	CConsoleAlarmAlertConsole*				iConsole;
+
+	CConsoleAlarmAlertServer*				iServer;
+
+	TAny*									iInstructionSet;
+
+	TBool									iInstructionSetFound;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertConsole.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,402 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertconsole.h"
+
+// System includes
+#include <e32twin.h>
+#include <e32base.h>
+#include <e32svr.h>
+
+// User includes
+#include "asaltdefs.h"
+#include "consolealarmalertsession.h"
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertConsole (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertConsole::CConsoleAlarmAlertConsole(CConsoleAlarmAlertSession& aSession)
+:	CActive(CActive::EPriorityLow), iSession(aSession), iInstructionIndex(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertConsole::~CConsoleAlarmAlertConsole()
+	{
+	Cancel();
+	Hide();
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::GetKey()
+	{
+	if	(iWin && !IsActive())
+		{
+		SetActive();
+		iWin->Read(iStatus);
+		}		
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::CancelKey()
+	{
+	if	(IsActive())
+		Cancel();
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::DecCounter()
+	{
+	if	(iTimeInterval > 0)
+		{
+		--iTimeInterval;
+		UpdateDisplay();
+		}
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::UpdateDisplay()
+	{
+	TBuf<180> buf;
+	_LIT(KEalwlAlarmSoundOff, "Off");
+	_LIT(KEalwlAlarmSoundOn, "On");
+	_LIT(KEalwlStatusEnabled, "Are");
+	_LIT(KEalwlStatusNotEnabled, "Are Not");
+	_LIT(KEalwlStatusIs, "Is");
+	_LIT(KEalwlStatusIsNo, "Is No");
+	//
+	if	(!iWin)
+		return;
+	iWin->SetCursorPosAbs(TPoint(0,0));
+
+	// MESSAGE
+	buf.Format(_L("Message : %S"), &iSession.Alarm().Message());
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// DATA
+	if	(iSession.Alarm().HasAssociatedData())
+		{
+		const TAgnAlarmInfo data = iSession.AlarmData();
+		const TUid KUidAgendaModelAlarmCategory = { 0x101F4A70 };
+		if (data.iAlarmCategory == KUidAgendaModelAlarmCategory)
+			{
+			_LIT(KEalwlAgendaData,"\ndata: agenda filename \"%S\"");
+			if (data.iFileName.Length() < 40)
+				buf.Format(KEalwlAgendaData,&data.iFileName);
+			else
+				{
+				TBuf<40> temp = data.iFileName.Left(40);
+				buf.Format(KEalwlAgendaData,&temp);
+				}
+			}
+		else
+			buf.Format(_L("\nAlarm has %d data bytes"), iSession.AlarmDataSize());
+		}
+	else
+		{
+		buf = _L("\nAlarm has no associated data");
+		}
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// DEFER TIME
+	if	(iSession.DeferTime() != Time::NullTTime())
+		{
+		TDateTime dateTime(iSession.DeferTime().DateTime());
+		buf.Format(_L("\nDefer   : %02d:%02d"), dateTime.Hour(), dateTime.Minute());
+		}
+	else
+		buf=_L("\nNULL defer time");
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// TIME INTERVAL
+	buf.Format(_L("\nCurrent time interval is %d minutes"), GetTimeInterval());
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// STATE FLAGS
+	buf.Format(_L("\nAlarm sounds are %S"),(iAlertState&EASAltStateFlagsSilentRunning)?&KEalwlAlarmSoundOff:&KEalwlAlarmSoundOn);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nAlarm sounds %S paused"),(iAlertState&EASAltStateFlagsSoundIsPaused)?&KEalwlStatusEnabled:&KEalwlStatusNotEnabled);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nAlarm sounds %S deferred"),(iAlertState&EASAltStateFlagsInQuietPeriod)?&KEalwlStatusEnabled:&KEalwlStatusNotEnabled);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nThere %S more than one unacknowledged alarms"),(iAlertState&EASAltStateFlagsMoreThanOneDueAlarm)?&KEalwlStatusEnabled:&KEalwlStatusNotEnabled);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nThere %S memory to snooze alarms"),(iAlertState&EASAltStateFlagsNoMemoryForSnoozeAlarm)?&KEalwlStatusIsNo:&KEalwlStatusIs);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+	buf.Format(_L("\nThere %S an alarm sound to play"),(iAlertState&EASAltStateFlagsAlarmHasNoSoundFileName)?&KEalwlStatusIsNo:&KEalwlStatusIs);
+	iWin->Write(buf);
+	iWin->ClearToEndOfLine();
+
+	// COMMAND PROMPTS
+	iWin->Write(_L("\nENTER = Silence alarm          SPACE = Quiet Period"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\nESCAPE = Acknowledge alarm     A = Acknowledge all"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\nP = Pause alarm sound          TAB = Snooze alarm"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n1 = 1 min sound interval		 0 = 0 mins sound interval"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n+ = Increase int. and pause    - = Decrease int. and pause"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n! = Kill alarm alert server"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\n"));
+	iWin->ClearToEndOfLine();
+	iWin->Write(_L("\r"));
+	//
+	if(!iSession.InstructionSet()) //Get user input if instruction set unspecified.
+		GetKey();
+	else if (iInstructionIndex >= static_cast<RArray<TInt>*>(iSession.InstructionSet())->Count()) //Get user input if program has already iterated thru entire instruction set.
+		GetKey();
+	else //Use the command in the instruction set, instead of waiting for user input.
+		{
+			if(!IsActive())
+			{
+			iStatus = KRequestPending;
+			TRequestStatus* ptrStatus = &iStatus;
+			User::RequestComplete( ptrStatus, KErrNone );
+			SetActive();
+			}
+		}
+	}
+
+//*************************************************************************************
+TInt CConsoleAlarmAlertConsole::GetTimeInterval() const
+	{
+	return(iTimeInterval);
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::SetVisibility(TInt aVis)
+	{
+	if	(!aVis)
+		Hide();
+	else if (!iWin)
+		{
+		// Create a new window, since cannot set order of console windows
+		CreateWin();
+		UpdateDisplay();
+		}
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::SetAlertState(TInt aFlags)
+	{
+	iAlertState = aFlags;
+	UpdateDisplay();
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::RunL()
+	{
+	if (iStatus.Int() == KErrCancel)
+		return;
+
+	__ASSERT_DEBUG(iWin, User::Invariant());
+	TInt key = iWin->KeyCode();
+	if(iSession.InstructionSet() && iInstructionIndex < static_cast<RArray<TInt>*>(iSession.InstructionSet())->Count())
+		{
+		RArray<TInt>* temp = static_cast<RArray<TInt>*>(iSession.InstructionSet());
+		key = (*temp)[iInstructionIndex++];
+		GetKey();
+		}
+	else
+		{
+		GetKey();
+		if ((key>=EKeyF1 && key<=EKeyF12) || key==EKeyTab)
+			{
+			DoDeferTime(EASAltAlertServerResponseSnooze);
+			}
+		}
+
+	switch (key)
+		{
+	// ACKNOWLEDGE CURRENT
+	case EKeyEscape:
+		iSession.Notify(EASAltAlertServerResponseClear);
+		return;
+	// ACKNOWLEDGE ALL
+	case 'a':
+	case 'A':
+		iSession.Notify(EASAltAlertServerResponseClearAll);
+		return;
+	// QUIET PERIOD
+	case EKeySpace:
+		DoDeferTime(EASAltAlertServerResponseQuietPeriod);
+		break;
+	// PAUSE SOUND
+	case 'p':
+	case 'P':
+		DoDeferTime(EASAltAlertServerResponsePauseSound);
+		break;
+	// SILENCE ALL SOUND
+	case EKeyEnter:
+		iSession.Notify(EASAltAlertServerResponseSilence);
+		break;
+	// INTERVAL 1 MINUTE
+	case '1':
+		iTimeInterval=1;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+	// INTERVAL 0 MINUTES
+	case '0':
+		iTimeInterval=0;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+	// PAUSE +
+	case '=':
+	case '+':
+		iTimeInterval++;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+	// PAUSE -
+	case '-':
+		iTimeInterval--;
+		iSession.Notify(EASAltAlertServerResponsePauseSound);
+		break;
+
+	// QUIT
+	case '!':
+		CActiveScheduler::Stop();
+		break;
+		}
+
+	TBuf<10> buf;
+	buf.Format(_L("'%c',"), key);
+	iWin->Write(buf);
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::DoCancel()
+	{
+	__ASSERT_DEBUG(iWin, User::Invariant());
+	iWin->ReadCancel();
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::Hide()
+	{
+	if	(iWin)
+		CancelKey(); 
+	//
+	delete iWin;
+	iWin = NULL;
+	//
+	if	(iCountDown)
+		iCountDown->Cancel();
+	//
+	delete iCountDown;
+	iCountDown=NULL;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::CreateWin()
+	{
+	_LIT(KAlarmAlertConsoleCaption, "Test Alarm Alert Server Console");
+	//
+	__ASSERT_DEBUG(!iWin, User::Invariant());
+	__ASSERT_DEBUG(!iCountDown, User::Invariant());
+	//
+	TRAPD(trapCheck, iWin = Console::NewL(KAlarmAlertConsoleCaption, TSize(KConsFullScreen, KConsFullScreen)));
+	if	(trapCheck)
+		{
+		iWin=NULL;
+		return;
+		}
+	
+	TRAP(trapCheck, iCountDown = CPeriodic::NewL(CActive::EPriorityIdle));
+	if	(trapCheck)
+		{
+		iCountDown=NULL;
+		return;
+		}
+	//
+	const TTimeIntervalMicroSeconds32 interval(60000000);
+	iCountDown->Start(interval, interval, TCallBack(&CountDownCallBack, this));
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertConsole::DoDeferTime(TASAltAlertServerResponse aResponse)
+	{
+	if	(++iTimeInterval > 60)
+		{
+		iTimeInterval = 5;
+		User::Beep(440, 12);
+		}
+	//
+	TTime now;
+	now.HomeTime();
+	now += TTimeIntervalMinutes(iTimeInterval);
+	//
+	iSession.Notify(aResponse, now);
+	}
+
+
+//*************************************************************************************
+TBool CConsoleAlarmAlertConsole::CountDownCallBack(TAny* aSelf)
+	{
+	CConsoleAlarmAlertConsole& self = *reinterpret_cast<CConsoleAlarmAlertConsole*>(aSelf);
+	self.DecCounter();
+	//
+	return EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertLEDFlasher.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,129 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertledflasher.h"
+
+// System includes
+#include <hal.h>
+
+// User includes
+#include "asaltdefs.h"
+
+// Type definitions
+
+// Constants
+const TInt KFlasherPeriodicity = 500000;
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertLEDFlasher (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertLEDFlasher::CConsoleAlarmAlertLEDFlasher()
+:	CTimer(CActive::EPriorityIdle)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertLEDFlasher* CConsoleAlarmAlertLEDFlasher::NewL()
+	{
+	CConsoleAlarmAlertLEDFlasher* self = new(ELeave) CConsoleAlarmAlertLEDFlasher();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+/**
+ * Start the flasher, if not busy
+ */
+TInt CConsoleAlarmAlertLEDFlasher::Start()
+	{
+	Stop();
+	After(KFlasherPeriodicity);
+	return(SetRedLedOn(ETrue));
+	}
+
+
+//*************************************************************************************
+/**
+ * Stop the LED flashing
+ */
+void CConsoleAlarmAlertLEDFlasher::Stop()
+	{
+	Cancel();
+	SetRedLedOn(EFalse);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+/**
+ * @see CActive
+ */
+void CConsoleAlarmAlertLEDFlasher::RunL()
+	{
+	if (iStatus!=KErrNone)
+		{
+		SetRedLedOn(EFalse);
+		return;
+		}
+	SetRedLedOn(!iLedOn);
+	After(KFlasherPeriodicity);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+/**
+ * Turn the LED on or off
+ */
+TInt CConsoleAlarmAlertLEDFlasher::SetRedLedOn(TBool aOn)
+	{
+	const TInt KClearAllLeds = 0;
+	const TInt KLedMaskRed1 = 1;
+
+	iLedOn = aOn;
+	if (iLedOn)
+		{
+		return HAL::Set(HAL::ELEDmask, KLedMaskRed1);
+		}
+	else
+		{
+		return HAL::Set(HAL::ELEDmask, KClearAllLeds);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,131 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertserver.h"
+
+// System includes
+
+// User includes
+#include "asaltdefs.h"
+//
+#include "consolealarmalertsession.h"
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+// The Console Alarm Alert Server is migrated to a secure server in EKA2
+#include <e32base.h>
+
+
+
+const TUint KRangeCount = 1; 
+
+const TInt KOpCodeRanges[KRangeCount] = 
+	{	
+	0 // All Op Codes  from 0 to KMaxInt should pass. No restrictions	
+	};
+
+
+const TUint8 KElementsIndex[KRangeCount] =
+	{
+	CPolicyServer::EAlwaysPass, 	//All OP Codes Allways passing no capability required 
+	};
+
+
+const CPolicyServer::TPolicy KConsoleAlarmAlertServerPolicy =
+	{
+	CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass
+	KRangeCount,
+	KOpCodeRanges,
+	KElementsIndex, 	// what each range is compared to 
+	KNullHandle			//Since we have no specific policy checking
+	};
+ 	
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertServer (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertServer::CConsoleAlarmAlertServer()
+ 	:CPolicyServer(CActive::EPriorityStandard, KConsoleAlarmAlertServerPolicy), iInstructionSet(NULL)
+	{
+	}
+
+
+
+//*************************************************************************************
+CConsoleAlarmAlertServer::~CConsoleAlarmAlertServer()
+	{
+	if (iAttachment)
+		delete iAttachment;	
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertServer::ConstructL()
+	{
+	StartL(KAlarmAlertServerName);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertServer* CConsoleAlarmAlertServer::NewLC()
+	{
+	CConsoleAlarmAlertServer* self = new(ELeave) CConsoleAlarmAlertServer();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+CSession2* CConsoleAlarmAlertServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
+	{
+	const TVersion KServerVersion(KASAltVersionMajor, KASAltVersionMinor, KASAltVersionBuild);
+	if	(!User::QueryVersionSupported(KServerVersion, aVersion))
+		User::Leave(KErrNotSupported);
+	//
+	return CConsoleAlarmAlertSession::NewL((CConsoleAlarmAlertServer*)this);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TInt CConsoleAlarmAlertServer::RunError(TInt /*Error*/)
+	{
+	return KErrNone;
+	}
+
+void CConsoleAlarmAlertServer::SetAttachment(HBufC8* data)
+	{
+	if (iAttachment)
+		delete iAttachment;
+	iAttachment = data;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServerMain.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,117 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertservermain.h"
+
+// System includes
+
+// User includes
+#include "asaltdefs.h"
+//
+#include "consolealarmalertserver.h"
+
+// Type definitions
+
+// Constants
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> ConsoleAlarmAlertServer (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+EXPORT_C void ConsoleAlarmAlertServer::StartConsoleAlarmAlertServerL(TAny* instructionSet)
+	{
+	_LIT(KAlarmAlertServerThreadName, "ConsoleAlarmAlertServerThread");
+	//
+	const TInt KStackSize		= 0x0002000;	//  8KB
+	const TInt KInitHeapSize	= 0x0001000;	//  4KB
+	const TInt KHeapSize		= 0x1000000;	// 16MB
+	//
+	// Is the alarm alert server already running? If so, don't
+	// start a new one...
+	TFullName name;
+	TFindServer finder(KAlarmAlertServerName);
+	if	(finder.Next(name) == KErrNone)
+		return;
+	
+	RThread serverThread;
+	const TInt error = serverThread.Create(KAlarmAlertServerThreadName,
+										   &StartServerThreadFunction,
+										   KStackSize,
+										   KInitHeapSize,
+										   KHeapSize,
+										   instructionSet
+										  );
+	User::LeaveIfError(error);
+	//
+	serverThread.SetPriority(EPriorityMore);
+	serverThread.Resume();
+	//
+	User::After(2000000); // 2 seconds
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TInt ConsoleAlarmAlertServer::StartServerThreadFunction(TAny* instructionSet)
+	{
+	__UHEAP_MARK;
+	//
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if	(!cleanup)
+		User::Invariant();
+	//
+	TRAPD(err, StartServerL(instructionSet));
+	delete cleanup;
+	//
+	__UHEAP_MARKEND;
+	return err;
+	}
+
+
+//*************************************************************************************
+void ConsoleAlarmAlertServer::StartServerL(TAny* instructionSet)
+	{
+	CActiveScheduler* scheduler = new CActiveScheduler();
+	CleanupStack::PushL(scheduler);
+	CActiveScheduler::Install(scheduler);
+	//
+
+	CConsoleAlarmAlertServer * tmp = CConsoleAlarmAlertServer::NewLC();
+	tmp->AddResponseArray(instructionSet);
+	CActiveScheduler::Start();
+	//
+	CleanupStack::PopAndDestroy(2, scheduler);
+	}
+
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> ConsoleAlarmAlertServer (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertSession.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,330 @@
+// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "consolealarmalertsession.h"
+
+// System includes
+
+#include "e32svr.h"
+// User includes
+#include "asaltdefs.h"
+//#include "..\..\Test\ConsoleANTestClient.h"
+//
+#include "consolealarmalertsession.h"
+#include "consolealarmalertconsole.h"
+#include "consolealarmalertledflasher.h"
+#include "consolealarmalertserver.h" //for inter-session communication
+
+// Type definitions
+
+// Constants
+const TInt KSlot0 = 0;
+const TInt KSlot1 = 1;
+const TInt KSlot2 = 2;
+
+// Enumerations
+
+// Classes referenced
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// ----> CConsoleAlarmAlertSession (source)
+///////////////////////////////////////////////////////////////////////////////////////
+
+//*************************************************************************************
+CConsoleAlarmAlertSession::CConsoleAlarmAlertSession(CConsoleAlarmAlertServer* aServer)
+:	iServer(aServer), iInstructionSet(NULL), iInstructionSetFound(EFalse)
+	{
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertSession::~CConsoleAlarmAlertSession()
+	{
+	CConsoleAlarmAlertSession* session = iServer->WaitingSession();
+	session = NULL;
+	delete iSoundLEDFlasher;
+	delete iSoundCallbackTimer;
+	delete iConsole;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::ConstructL()
+	{
+	iSoundLEDFlasher = CConsoleAlarmAlertLEDFlasher::NewL();
+	iSoundCallbackTimer = CPeriodic::NewL(CActive::EPriorityIdle);
+	iConsole = new(ELeave) CConsoleAlarmAlertConsole(*this);
+	}
+
+
+//*************************************************************************************
+CConsoleAlarmAlertSession* CConsoleAlarmAlertSession::NewL(CConsoleAlarmAlertServer* aServer)
+	{
+	CConsoleAlarmAlertSession* self = new(ELeave) CConsoleAlarmAlertSession(aServer);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TTime CConsoleAlarmAlertSession::DeferTime() const
+	{
+	return iDeferTime;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::Notify(TASAltAlertServerResponse aFlag)
+	{
+	if	(iHasMessage)
+		{
+		iMsgPtr.Complete(aFlag);
+		iHasMessage = EFalse;
+		}
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::Notify(TASAltAlertServerResponse aFlag, const TTime& aDeferTime)
+	{
+	if	(iHasMessage)
+		{
+		TPckgC<TTime> time(aDeferTime);
+		TRAPD(err, iMsgPtr.WriteL(KSlot0, time));
+		__ASSERT_DEBUG(err == KErrNone, User::Invariant());
+		Notify(aFlag);
+		}
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::ServiceL(const RMessage2& aMessage)
+	{
+	iMsgComplete = ETrue;
+	const TInt function = aMessage.Function();
+
+	//see if the server holds a set of instructions to be followed,
+	//rather than waiting for user input.
+	if(!iInstructionSetFound) //go look for it now.
+		{
+		//we will enter into this code only once
+		const CServer2* tmpServ = Server();
+		const CConsoleAlarmAlertServer* specific = reinterpret_cast<const CConsoleAlarmAlertServer*>(tmpServ);
+		iInstructionSet = const_cast<CConsoleAlarmAlertServer*>(specific)->ResponseArray();
+		iInstructionSetFound = ETrue;
+		}
+
+	//
+	switch(function)
+		{
+    case EASAltOpCodeNotify:
+    	{
+		__ASSERT_ALWAYS(!iHasMessage, User::Invariant());
+		iMsgComplete = EFalse;
+		iMsgPtr = aMessage;
+		iHasMessage = ETrue;
+		CConsoleAlarmAlertSession* session = iServer->WaitingSession();
+		session = this;
+		break;
+		}
+
+    case EASAltOpCodeNotifyCancel:
+		if	(iHasMessage)
+			{
+			iHasMessage=EFalse;
+			iMsgPtr.Complete(KErrCancel);
+			}
+		break;
+
+	case EASAltOpCodeVisible:
+		{
+		TBool isVisible = aMessage.Int0();
+		iConsole->SetVisibility(isVisible);
+		iServer->SetNotifying(isVisible);
+		break;
+		}
+
+    case EASAltOpCodeSetState:
+		iConsole->SetAlertState(aMessage.Int0());
+		break;
+
+    case EASAltOpCodeSetAlarm:
+		SetAlarmL(aMessage);
+		iConsole->iTimeInterval=0;
+		iConsole->UpdateDisplay();
+		break;
+
+	case EASAltOpCodeGetUserTime:
+		GetUserTimeL(aMessage);
+		break;
+
+	case EASAltOpCodeSetDeferTime:
+		SetDeferTimeL(aMessage);
+		iConsole->UpdateDisplay();
+		break;
+
+    case EASAltOpCodeLogon:
+		__ASSERT_ALWAYS(!iLoggedOn, User::Invariant());
+		iMsgComplete=EFalse;
+		iLoggedOn=ETrue;
+		break;
+
+	case EASAltOpCodeStartPlayingSound:
+		{
+		iSoundLEDFlasher->Start();
+		TCallBack callback(SoundPlaybackCallbackL, this);
+		iSoundCallbackTimer->Start(TTimeIntervalMicroSeconds32(0), TTimeIntervalMicroSeconds32(3000000), callback);
+		break;
+		}
+
+	case EASAltOpCodeStopPlayingSound:
+		iSoundLEDFlasher->Stop();
+		iSoundCallbackTimer->Cancel();
+		break;
+
+#if 0
+//Test code
+	case EASAltTestOpCodeAcknowledgeAlarm:
+		if (iServer->WaitingSession())
+			iServer->WaitingSession()->Notify(EASAltAlertServerResponseClear);
+		break;
+
+	case EASAltTestOpCodeGetAttachment:
+		{
+		if (iServer->Attachment() != NULL)
+			{
+			const TDes8& data = iServer->Attachment()->Des();
+			const TInt maxLength = static_cast<TInt>(aMessage.Int0());
+			if	(data.Size() > maxLength)
+				User::Panic(_L("Client's buffer is too short"), KErrOverflow);
+			else
+				{
+				if (data.Length() == 0)
+					{
+					_LIT8(KEmpty,"Empty");
+					aMessage.WriteL(KSlot1, KEmpty);
+					}
+				else
+					{
+					aMessage.WriteL(KSlot1, data);
+					}
+				iServer->SetAttachment(NULL);
+				}
+			}
+		}
+		break;
+
+	case EASAltTestOpCodeGetIsNotifying:
+		{
+		TPckgC<TBool> ret = iServer->IsNotifying();
+		aMessage.WriteL(KSlot0, ret);
+		break;
+		}
+#endif
+	default:
+		User::Invariant();
+		break;
+		}
+
+	if	(iMsgComplete)
+		aMessage.Complete(KErrNone);
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+TBool CConsoleAlarmAlertSession::CmdL()
+	{
+	return KErrNone;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::SetAlarmL(const RMessage2& aMessage)
+	{
+	TPckg<TASShdAlarm> pA(iAlarm);
+	aMessage.ReadL(KSlot0, pA);
+	if	(iAlarm.HasAssociatedData())
+		{
+		iAlarmAssociatedDataSize = aMessage.GetDesLength(2);
+		TPckg<TAgnAlarmInfo> pB(iAlarmData);
+		aMessage.ReadL(KSlot2, pB);
+
+		//Storing the data in the server for the test session to read..
+		HBufC8* data = HBufC8::NewLC(iAlarmAssociatedDataSize);
+		TPtr8 pData(data->Des());
+		aMessage.ReadL(KSlot2, pData);
+		iServer->SetAttachment(data);  //Server takes an ownership
+		CleanupStack::Pop(data);
+		}
+	else
+		iAlarmAssociatedDataSize = 0;
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::GetUserTimeL(const RMessage2& aMessage)
+	{
+	TTime time;
+	time.HomeTime();
+	time+=TTimeIntervalMinutes(iConsole->GetTimeInterval());
+	TPtrC8 pTime((TUint8 *)&time,sizeof(TTime));
+	aMessage.WriteL(KSlot0,pTime);
+	}
+
+
+//*************************************************************************************
+void CConsoleAlarmAlertSession::SetDeferTimeL(const RMessage2& aMessage)
+	{
+	TPckg<TTime> pTime(iDeferTime);
+	aMessage.ReadL(KSlot0, pTime);
+	}
+
+
+//*************************************************************************************
+TBool CConsoleAlarmAlertSession::SoundPlaybackCallbackL(TAny* /*aSelf*/)
+	{
+//	_LIT(KPlayingSound, "Playing sound");
+//	User::InfoPrint(KPlayingSound);
+	return ETrue;
+	}
+
+//**************************************************************************************
+TAny * CConsoleAlarmAlertSession::InstructionSet()
+	{
+	return iInstructionSet;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/ConsoleAlarmAlertServer/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,19 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For ConsoleAlarmAlertServer
+// 
+//
+
+PRJ_TESTMMPFILES
+ConsoleAlarmAlertServer.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Group/Smoketest_Timew.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,63 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+TARGET			Smoketest_Timew_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7775
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		WriteUserData ReadUserData
+
+SOURCEPATH		..\Src
+
+SOURCE			TestTimewServer.cpp
+SOURCE			TestTimewSetAlarm.cpp
+SOURCE			TestTimewBase.cpp
+SOURCE			SM_ALM.CPP
+SOURCE			SM_UTL.CPP
+SOURCE			SM_MOD.CPP
+SOURCE			SM_RSP.CPP
+
+USERINCLUDE		..\Inc ..\..\Group
+USERINCLUDE		..\ConsoleAlarmAlertServer\Include
+
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+SYSTEMINCLUDE	\Epoc32\include\ecom
+
+library  		BAFL.LIB
+library			FBSCLI.LIB
+library			WS32.LIB
+library			CONE.LIB
+library			DIAL.LIB
+library			FEPBASE.LIB
+LIBRARY			apparc.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+
+library			AlarmClient.lib
+library			AlarmShared.lib
+library			EUSER.LIB
+LIBRARY			ecom.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,25 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For Timew smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../Scripts/setup_Smoketest_Timew.script	z:/smoketest/setup_smoketest_timew.script
+../Scripts/Smoketest_Timew.script		z:/smoketest/smoketest_timew.script
+../TestData/Smoketest_Timew.ini			z:/smoketest/smoketest_timew.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Timew.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/ALMMOD.H	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,121 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __ALMMOD_H__
+#define __ALMMOD_H__
+
+// System includes
+#include <asclisession.h>
+
+// User includes
+#include "timewmod.h"
+
+// Constants
+const TInt KArrayOfAlarmIdsGranularity = 64;
+const TInt KPriorityAlarmIdleObserver=-0x0010;
+const TInt KPriorityAlarmResponder=-0x0005; // Idle observer priority must be lower than this
+
+//	The alarm model gives a general notification only
+//
+class CAlmIdleObserver : public CIdleObserver
+	{
+public:
+	static CAlmIdleObserver* NewL(MTimewModelObserver* aObserver,TInt aIdlePriority);
+	};
+
+class CAlmModel : public CModelBase
+	{
+public:
+	~CAlmModel();
+	static CAlmModel* NewL(MTimewModelObserver* aObserver,TInt aResponderPriority);
+	virtual void ProcessResponder(TInt aStatus);
+public:
+	TInt AlarmQuietPeriodMinutes() const;
+	TInt AlarmQuietPeriodSet(TInt aMinutes);
+	inline void AlarmQuietPeriodCancel();
+	TTime AlarmQuietPeriodEnd() const;
+	//
+	void AlarmSoundToggle();
+	TInt AlarmSoundStateSet(TBool aSoundOn);
+	TTimeWAlarmSoundState AlarmSoundState() const;
+	//
+	TInt ClockAlarmDelete(TInt aAlarmIndex);
+	TInt ClockAlarmEnable(TInt aAlarmIndex,TTimeWClockAlarmState aClockAlarmState);
+	TTimeWClockAlarmState ClockAlarmState(TInt aAlarmIndex) const;
+	TInt ClockAlarmSet(TInt aAlarmIndex,const TASShdAlarm& aInfo);
+	TInt ClockAlarmInfo(TInt aAlarmIndex,TASShdAlarm& aInfo);
+	//
+	void NextAlarmResetListL();
+	void NextAlarmClearList();
+	TInt NextAlarmNumber() const;
+	TInt NextAlarmDelete(TInt aIndex);
+	TBool NextAlarmCanDelete(TInt aIndex) const;
+	TInt NextAlarm(TFullName& aOwner, TASShdAlarm& aInfo) const;
+	TInt NextAlarmInfo(TInt aIndex, TFullName& aOwner, TASShdAlarm& aInfo) const;
+	//
+	TInt OrphanAlarmNumber() const;
+	inline TInt UnacknowledgedAlarmNumber() const;
+	//
+	void ReviewAlarmResetListL();
+	void ReviewAlarmClearList();
+	TInt ReviewAlarmNumber() const;
+	TInt ReviewAlarmInfo(TInt aIndex, TASShdAlarm& aInfo) const;
+
+private:
+	CAlmModel();
+	void ConstructL(MTimewModelObserver* aObserver,TInt aResponderPriority);
+
+private:
+
+	/**
+	 * The list of clock alarms. Note that although there is always 8
+	 * alarms in this list, not all will be active.
+	 */
+	RPointerArray<TASShdAlarm> iClockAlarms;
+
+	/**
+	 *
+	 */
+	RASCliSession iAlmSvr;
+
+	/**
+	 *
+	 */
+	TRequestStatus iStatus;
+
+	/**
+	 *
+	 */
+	RArray<TAlarmId> iNextAlarmIds;
+
+	/**
+	 *
+	 */
+	RArray<TAlarmId> iReviewAlarmIds;
+	};
+
+
+TInt CAlmModel::UnacknowledgedAlarmNumber() const
+	{
+	TInt count = iAlmSvr.AlarmCountByState(EAlarmStateWaitingToNotify);
+	return (count + iAlmSvr.AlarmCountByState(EAlarmStateNotifying));
+	}
+
+void CAlmModel::AlarmQuietPeriodCancel()
+	{
+	iAlmSvr.CancelAlarmSilence();
+	}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/ALMMOD.INL	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,79 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+//	class CAlmModel
+inline TAlarmSoundState CAlmModel::AlarmSoundState() const
+	{
+	return(iAlmSvr.AlarmSoundState());
+	}
+inline void CAlmModel::AlarmSoundStateSet(TBool aSoundOn)
+	{
+	iAlmSvr.SetAlarmSoundOn(aSoundOn);
+	}
+inline void CAlmModel::AlarmSoundToggle()
+	{
+	iAlmSvr.SetAlarmSoundOn(iAlmSvr.AlarmSoundState()==EAlarmSoundOff);
+	}
+inline TTime CAlmModel::AlarmQuietPeriodEnd() const
+	{
+	return(iAlmSvr.QuietPeriodUntil());
+	}
+inline void CAlmModel::AlarmQuietPeriodCancel()
+	{
+	iAlmSvr.QuietPeriodCancel();
+	}
+inline TInt CAlmModel::ClockAlarmDelete(TInt aClockAlarmNum)
+	{
+	__ASSERT_DEBUG(aClockAlarmNum<KMaxClockAlarms,Panic(EModelOutOfRange));
+	return(iAlmSvr.AlarmDelete(aClockAlarmNum));
+	}
+inline TAlarmSetState CAlmModel::ClockAlarmState(TInt aClockAlarmNum) const
+	{
+	__ASSERT_DEBUG(aClockAlarmNum<KMaxClockAlarms,Panic(EModelOutOfRange));
+	return(iAlmSvr.AlarmState(aClockAlarmNum));
+	}
+inline void CAlmModel::NextAlarmResetListL()
+	{
+	iAlmSvr.AlarmArrayPopulateL(*iNextAlarms,RAlarmServer::EArrayNext);
+	}
+inline void CAlmModel::NextAlarmClearList()
+	{
+	iNextAlarms->Reset();
+	}
+inline TInt CAlmModel::NextAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountNext));
+	}
+inline void CAlmModel::ReviewAlarmResetListL()
+	{
+	iAlmSvr.AlarmArrayPopulateL(*iReviewAlarms,RAlarmServer::EArrayReview);
+	}
+inline void CAlmModel::ReviewAlarmClearList()
+	{
+	iReviewAlarms->Reset();
+	}
+inline TInt CAlmModel::ReviewAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountReview));
+	}
+inline TInt CAlmModel::OrphanAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountOrphan));
+	}
+inline TInt CAlmModel::UnacknowledgedAlarmNumber() const
+	{
+	return(iAlmSvr.AlarmCount(RAlarmServer::ECountUnacknowledged));
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/SM_STD.H	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,68 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __SM_STD_H__
+#define __SM_STD_H__
+
+// System includes
+#include <e32base.h>
+#include <t32wld.h>
+#include <asclisession.h>
+#include <asshdalarm.h>
+
+// User includes
+#include "timewmod.h"
+
+class CModelResponder : public CActive
+	{
+public:
+	void Start();
+	virtual void RunL();
+	virtual void DoStart()=0;
+	virtual void DoCancel()=0;
+protected:
+	CModelResponder(CModelBase &aModel,TInt aPriority);
+private:
+	void NotifyModel(TInt aNotification);
+private:
+	CModelBase *iModel;
+	};
+
+class CAlmModel;
+class CAlmResponder : public CModelResponder
+	{
+public:
+	CAlmResponder(RASCliSession& aSvr,CAlmModel& aModel,TInt aResponderPriority);
+public:
+	virtual void DoStart();
+	virtual void DoCancel();
+private:
+	TAlarmId iAlarmId;
+	RASCliSession* iAlmSvr;
+	};
+
+class CWldModel;
+class CWldResponder : public CModelResponder
+	{
+public:
+	CWldResponder(RWorldServer& aSvr,CWldModel& aModel,TInt aResponderPriority);
+public:
+	virtual void DoStart();
+	virtual void DoCancel();
+protected:
+	RWorldServer* iWldSvr;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/TIMEWMOD.H	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,145 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __TIMEWMOD_H__
+#define __TIMEWMOD_H__
+
+// System includes
+#include <e32base.h>
+
+// Constants
+const TInt KMaxClockAlarms = 8;
+
+/**
+ * From the old T32Alm.h file. Encapsulates the idea of
+ * a "Not set" alarm, which the new AlarmServer doesn't
+ * support.
+ */
+enum TTimeWClockAlarmState
+	{
+	ETimeWClockAlarmStateNotSet = 0,
+	ETimeWClockAlarmStateSet,
+	ETimeWClockAlarmStateDisabled
+	};
+
+/**
+ *
+ */
+enum TTimeWAlarmSoundState
+	{
+	ETimeWAlarmSoundOn = 0,
+	ETimeWAlarmSoundOff,
+	ETimeWAlarmQuietPeriod
+	};
+
+/**
+ *
+ */
+enum TInternalClockAlarmFlags
+	{
+	EClockAlarmFlagsIsSet		= 1
+	};
+
+enum TModelPanic
+	{
+	EModelWorld = 0,
+	EModelObserver,
+	EModelOutOfRange,
+	EModel
+	};
+enum TModelFault
+	{
+	EModelfIdleObj = 0,
+	EModelfPriorityInvalid,
+	EModelfIdleArgument,
+	EModelfNoNotifier,
+	EModelfOutOfRange,
+	EModelfTime,
+	EModelfTryingToChangeStateOfNullClockAlarm,
+	EModelfTryingToGetInfoAboutNullClockAlarm,
+	EModelfTryingToOrphanClockAlarm
+	};
+
+GLREF_C void Panic(TModelPanic aPanic);
+GLREF_C void Fault(TModelFault aFault);
+
+class MTimewModelObserver
+	{
+public:
+	virtual void HandleUpdate(TInt aNotification)=0;
+	};
+
+class CIntermediateObserver : public CBase, public MTimewModelObserver
+	{
+public:
+	CIntermediateObserver();
+	virtual void HandleUpdate(TInt aNotification);
+	void SetTimewModelObserver(MTimewModelObserver* aObserver);
+protected:
+	void Notify(TInt aNotification);
+private:
+	MTimewModelObserver* iObserver;
+	};
+
+class CIdleObserver : public CIntermediateObserver
+	{
+public:
+	CIdleObserver();
+	~CIdleObserver();
+	void ConstructL(MTimewModelObserver* aObserver,TInt aPriority);
+public:
+	void CancelIdleRefresh();
+	virtual void HandleUpdate(TInt aNotification);
+protected:
+	virtual void DoIdleCancel();
+	virtual void DoIdleNotify();
+private:
+	void StartIdleRefresh();
+	static TInt IdleCallBack(TAny* aPtr);
+private:
+	TInt iNotification;
+	CIdle* iIdle;
+	};
+
+class CModelResponder;
+class CModelBase : public CBase
+	{
+protected:
+	CModelBase();
+
+public:
+	~CModelBase();
+
+public:
+	void Stop();
+	void Start();
+	void SetTimewModelObserver(MTimewModelObserver* aObserver);
+
+protected:
+	void Notify(TInt aNotification);
+	virtual void ProcessResponder(TInt aStatus)=0;
+	void SetResponderActive(CModelResponder* aResponder);
+
+private:
+	void DoObserverNotify(TInt aNotification);
+
+private:
+	TBool iDoingViewNotify;
+	MTimewModelObserver* iObserver;
+	CModelResponder* iResponder;
+	friend class CModelResponder;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/TestTimewBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,39 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewBase which is the base class for all
+// the Psd Agx suite test steps
+// 
+//
+
+#ifndef TEST_TIMEW_BASE_H
+#define TEST_TIMEW_BASE_H
+
+#include "almmod.h"
+#include <TestExecuteStepBase.h>
+
+
+class CTestTimewBase : public CTestStep
+{
+public:
+	CTestTimewBase();
+	~CTestTimewBase();
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();	CAlmModel*				Model();
+
+private:
+	CActiveScheduler*	iSchedular;
+
+protected:	CAlmModel*			iModel;};
+
+#endif /* TEST_TIMEW_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/TestTimewServer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewServer
+// 
+//
+
+#ifndef TEST_TIMEW_SERVER_H
+#define TEST_TIMEW_SERVER_H
+
+#include <TestExecuteServerBase.h>
+
+class  CTestTimewServer : public CTestServer
+{
+public:
+	static CTestTimewServer*	NewL();
+	virtual CTestStep*			CreateTestStep(const TDesC& aStepName);
+
+private:
+	void	ConstructL();
+};
+
+#endif /* TEST_TIMEW_SERVER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Inc/TestTimewSetAlarm.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,38 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewSetAlarm
+// 
+//
+
+#ifndef TEST_TIMEW_SET_ALARM_H
+#define TEST_TIMEW_SET_ALARM_H
+
+#include "TestTimewBase.h"
+#include <asshdalarm.h>
+
+class CTestTimewSetAlarm : public CTestTimewBase
+{
+public:
+	CTestTimewSetAlarm();
+	virtual ~CTestTimewSetAlarm();
+
+public:
+	virtual enum TVerdict doTestStepL( void );
+
+private:
+	void	SetAlarmL( void );
+	TASShdAlarm iAlarmData;
+};
+
+#endif /* TEST_TIMEW_SET_ALARM_H */
Binary file common/tools/ats/smoketest/Timew/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Scripts/Smoketest_Timew.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Timew smoketest
+//
+LOAD_SUITE Smoketest_Timew_Server
+//
+START_TESTCASE 8979
+RUN_TEST_STEP 1000	Smoketest_Timew_Server	SetAlarm		c:\Smoketest\Smoketest_Timew.ini	24560_SetAlarm
+END_TESTCASE 8979
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Scripts/setup_Smoketest_Timew.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\Smoketest\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_timew.ini	c:\smoketest\smoketest_timew.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_timew.ini
+
+// RUN_SCRIPT Smoketest_Timew.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/SM_ALM.CPP	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,489 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "almmod.h"
+#include "sm_std.h"
+#include <ecom.h>
+
+//
+//	class CAlmModel
+//
+
+CAlmModel::CAlmModel()
+//
+//	Constructor
+//
+	{
+	}
+
+CAlmModel::~CAlmModel()
+//
+//	Destructor
+//
+	{
+	Stop();
+	iClockAlarms.ResetAndDestroy();
+	iClockAlarms.Close();
+	iReviewAlarmIds.Close();
+	iNextAlarmIds.Close();
+	iAlmSvr.Close();
+ 	REComSession::FinalClose();
+	}
+
+void CAlmModel::ConstructL(MTimewModelObserver* aObserver,TInt aResponderPriority)
+//
+//	Construct the alarm engine components
+//
+	{
+	SetTimewModelObserver(aObserver);
+	//
+	iReviewAlarmIds = RArray<TAlarmId>(KArrayOfAlarmIdsGranularity);
+	iNextAlarmIds = RArray<TAlarmId>(KArrayOfAlarmIdsGranularity);
+	//
+	const TInt r = iAlmSvr.Connect();
+	User::LeaveIfError(r);
+	//
+	TInt i;
+	iClockAlarms = RPointerArray<TASShdAlarm>(KMaxClockAlarms);
+	for(i=0; i<KMaxClockAlarms; i++)
+		{
+		TASShdAlarm* blankAlarm = new(ELeave) TASShdAlarm();
+		CleanupStack::PushL(blankAlarm);
+		User::LeaveIfError(iClockAlarms.Append(blankAlarm));
+		CleanupStack::Pop(blankAlarm);
+		}
+
+	// Identify any clock alarms in the alarm server and put them
+	// into the slots.
+
+	// Fetch
+	RArray<TAlarmId> clockIds(KMaxClockAlarms);
+	CleanupClosePushL(clockIds);
+	iAlmSvr.GetAlarmIdListForCategoryL(KASCliCategoryClock, clockIds);
+
+	// Put them in the slots - we can only display KMaxClockAlarms alarms
+	// so any beyond that are ignored.
+	TInt slotsUsedSoFar = 0;
+	const TInt count = Min(KMaxClockAlarms, clockIds.Count());
+	for(i=0; i<count; i++)
+		{
+		TASShdAlarm* alarm = iClockAlarms[slotsUsedSoFar];
+		User::LeaveIfError(iAlmSvr.GetAlarmDetails(clockIds[i], *alarm));
+
+		// Only show alarms which haven't yet notified
+		if	(alarm->State() != EAlarmStateNotified)
+			{
+			// If we don't do this, then the alarm slot is treated
+			// as available.
+			++slotsUsedSoFar;
+			alarm->ClientFlags().Set(EClockAlarmFlagsIsSet);
+			}
+		}
+	CleanupStack::PopAndDestroy(&clockIds);
+	//
+	CAlmResponder* pR=new(ELeave) CAlmResponder(iAlmSvr,*this,aResponderPriority);
+	SetResponderActive(pR);
+	}
+
+CAlmModel* CAlmModel::NewL(MTimewModelObserver* aObserver,TInt aResponderPriority)
+//
+//	Create a new alarm engine
+//
+	{
+	CAlmModel* model=new(ELeave) CAlmModel;
+	CleanupStack::PushL(model);
+	model->ConstructL(aObserver,aResponderPriority);
+	CleanupStack::Pop(model);
+	return(model);
+	}
+
+void CAlmModel::ProcessResponder(TInt aStatus)
+//
+//	Interpret responder status
+//
+	{
+	// FIX
+	if (aStatus!=KErrCancel && aStatus!=KErrNone)
+		Notify(aStatus);
+	else
+		Notify(0);
+	}
+
+TInt CAlmModel::AlarmQuietPeriodMinutes() const
+//
+//	Return the time that sound is delayed until
+//
+	{
+	TTime timeNow;
+	timeNow.HomeTime();
+	TTime timeQuiet=AlarmQuietPeriodEnd();
+	TInt quietMinutes;
+	if (timeQuiet<=timeNow || timeQuiet==Time::NullTTime())
+		quietMinutes=0;
+	else
+		{
+		TTimeIntervalMinutes minutes;
+		timeQuiet.MinutesFrom(timeNow,minutes);
+		quietMinutes=minutes.Int()+1;
+		}
+	return(quietMinutes);
+	}
+
+TInt CAlmModel::AlarmQuietPeriodSet(TInt aMinutes)
+//
+//	Delay alarm sounds for a given number of minutes
+//
+	{
+	TInt ret = KErrNone;
+	//
+	if	(!aMinutes)
+		ret = iAlmSvr.CancelAlarmSilence();
+	else
+		ret = iAlmSvr.SetAlarmSoundsSilentFor(TTimeIntervalMinutes(aMinutes));
+	//
+	return ret;
+	}
+
+TInt CAlmModel::ClockAlarmEnable(TInt aAlarmIndex, TTimeWClockAlarmState aClockAlarmState)
+//
+//	Enable or disable a clock alarm
+//
+	{
+	__ASSERT_DEBUG(aAlarmIndex < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	TAlarmStatus newStatus;
+	switch(aClockAlarmState)
+		{
+	case ETimeWClockAlarmStateNotSet:
+		return ClockAlarmDelete(aAlarmIndex);
+
+	case ETimeWClockAlarmStateSet:
+		newStatus = EAlarmStatusEnabled;
+		break;
+
+	default:
+	case ETimeWClockAlarmStateDisabled:
+		newStatus = EAlarmStatusDisabled;
+		break;
+		}
+
+	TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+	__ASSERT_ALWAYS(alarm->Id() != KNullAlarmId, Fault(EModelfTryingToChangeStateOfNullClockAlarm));
+	TInt error = iAlmSvr.SetAlarmStatus(alarm->Id(), newStatus);
+	if	(error != KErrNone)
+		return error;
+
+	// Refetch alarm from server (will update status)
+	error = iAlmSvr.GetAlarmDetails(alarm->Id(), *alarm);
+	if	(error == KErrNone)
+		alarm->ClientFlags().Set(EClockAlarmFlagsIsSet);
+	return error;
+	}
+
+TInt CAlmModel::ClockAlarmSet(TInt aAlarmIndex, const TASShdAlarm& aInfo)
+//
+//	Set a clock alarm
+//
+	{
+	__ASSERT_DEBUG(aAlarmIndex < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	TInt error = KErrNone;
+	TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+	if	(alarm->Id() != KNullAlarmId)
+		{
+		// There is already an alarm set in this slot. Delete
+		// the old, replace it with the new.
+		error = iAlmSvr.AlarmDelete(alarm->Id());
+		if	(error != KErrNone)
+			return error;
+		alarm->ClientFlags().Clear(EClockAlarmFlagsIsSet);
+		}
+
+	// Add alarm (will also update cached alarm details)
+	*alarm = aInfo;
+	alarm->Category() = KASCliCategoryClock;
+	error = iAlmSvr.AlarmAdd(*alarm);
+	if	(error == KErrNone)
+		alarm->ClientFlags().Set(EClockAlarmFlagsIsSet);
+	return error;
+	}
+
+TInt CAlmModel::ClockAlarmInfo(TInt aAlarmIndex,TASShdAlarm& aInfo)
+//
+//	Get information about a clock alarm
+//
+	{
+	__ASSERT_DEBUG(aAlarmIndex < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	TInt error = KErrNone;
+	aInfo = *(iClockAlarms[aAlarmIndex]);
+	if	(aInfo.Id() != KNullAlarmId && aInfo.ClientFlags().IsSet(EClockAlarmFlagsIsSet))
+		{
+		// Preserve flags
+		const TBitFlags16 flags = aInfo.ClientFlags();
+
+		// Fetch alarm details
+		error = iAlmSvr.GetAlarmDetails(aInfo.Id(), aInfo);
+
+		// Restore flags
+		if	(error == KErrNone)
+			{
+			// Has the alarm already notified?
+			if	(aInfo.State() != EAlarmStateQueued && aInfo.State() != EAlarmStateNotifying)
+				{
+				// Treat this slot as free
+				TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+				alarm->Reset();
+				aInfo = *alarm;
+				}
+			else
+				aInfo.ClientFlags() = flags;
+			}
+		else if (error == KErrNotFound)
+			{
+			// Alarm has been deleted
+			TASShdAlarm* alarm = iClockAlarms[aAlarmIndex];
+			alarm->Reset();
+			aInfo = *alarm;
+			}
+		}
+	return error;
+	}
+
+TInt CAlmModel::ClockAlarmDelete(TInt aClockAlarmNum)
+	{
+	__ASSERT_DEBUG(aClockAlarmNum < KMaxClockAlarms, Panic(EModelOutOfRange));
+	TASShdAlarm* alarm = iClockAlarms[aClockAlarmNum];
+	__ASSERT_ALWAYS(alarm->Id() != KNullAlarmId, Fault(EModelfTryingToChangeStateOfNullClockAlarm));
+	const TInt error = iAlmSvr.AlarmDelete(alarm->Id());
+	if	(error == KErrNone || error == KErrNotFound)
+		{
+		// Update cached representation of deleted alarm
+		alarm->Reset();
+		}
+	return error;
+	}
+
+TTimeWClockAlarmState CAlmModel::ClockAlarmState(TInt aClockAlarmNum) const
+	{
+	__ASSERT_DEBUG(aClockAlarmNum < KMaxClockAlarms, Panic(EModelOutOfRange));
+	//
+	const TASShdAlarm* alarm = iClockAlarms[aClockAlarmNum];
+	if	(alarm->ClientFlags().IsSet(EClockAlarmFlagsIsSet))
+		{
+		switch(alarm->Status())
+			{
+		case EAlarmStatusEnabled:
+			return ETimeWClockAlarmStateSet;
+		case EAlarmStatusDisabled:
+			return ETimeWClockAlarmStateDisabled;
+			}
+		}
+	return ETimeWClockAlarmStateNotSet;
+	}
+
+void CAlmModel::NextAlarmResetListL()
+//
+//	Fetch a list of ids of all the alarms that are pending
+//	within the alarm server.
+//
+	{
+	iAlmSvr.GetAlarmIdListByStateL(EAlarmStateQueued, iNextAlarmIds);
+	}
+
+void CAlmModel::NextAlarmClearList()
+	{
+	iNextAlarmIds.Reset();
+	}
+
+TInt CAlmModel::NextAlarmNumber() const
+	{
+	return iAlmSvr.NumberOfAlarmsActiveInQueue();
+	}
+
+TInt CAlmModel::NextAlarmDelete(TInt aIndex)
+//
+//	Delete one of the next alarms
+//
+	{
+	TInt ret = KErrNotFound;
+	if	(aIndex < iNextAlarmIds.Count())
+		{
+		const TAlarmId id = iNextAlarmIds[aIndex];
+		ret = iAlmSvr.AlarmDelete(id);
+		}
+	return ret;
+	}
+
+TBool CAlmModel::NextAlarmCanDelete(TInt aIndex) const
+//
+//	Determine whether can delete the specified alarm.
+//
+	{
+	__ASSERT_DEBUG(aIndex < iNextAlarmIds.Count(), Panic(EModelOutOfRange));
+	//
+	const TAlarmId id = iNextAlarmIds[aIndex];
+	//
+	TASShdAlarm alarm;
+	if	(iAlmSvr.GetAlarmDetails(id, alarm) == KErrNone)
+		{
+		return (
+			alarm.Category() == KASCliCategoryClock ||
+			alarm.State() == EAlarmStateSnoozed ||
+			!alarm.HasOwningSession()
+			);
+		}
+	return EFalse;
+	}
+
+TInt CAlmModel::NextAlarm(TFullName& aOwner, TASShdAlarm& aInfo) const
+//
+//	Get information about the next alarm
+//
+	{
+	aOwner = KNullDesC;
+	//
+	TAlarmId id = KNullAlarmId;
+	TInt ret = iAlmSvr.GetNextDueAlarmId(id);
+	if	(ret == KErrNone)
+		{
+		if	(id == KNullAlarmId)
+			{
+			aInfo.Reset();
+			ret = KErrNotFound;
+			}
+		else
+			{
+			ret = iAlmSvr.GetAlarmDetails(id, aInfo);
+			if	(ret == KErrNone)
+				ret = iAlmSvr.GetAlarmOwner(id, aOwner);
+			}
+		}
+	return ret;
+	}
+
+TInt CAlmModel::NextAlarmInfo(TInt aIndex, TFullName& aOwner, TASShdAlarm& aInfo) const
+//
+//	Get info about the next alarm
+//
+	{
+	TInt ret = KErrNotFound;
+	if	(aIndex < iNextAlarmIds.Count())
+		{
+		const TAlarmId id = iNextAlarmIds[aIndex];
+		ret = iAlmSvr.GetAlarmDetails(id, aInfo);
+		if	(ret == KErrNone)
+			{
+			ret = iAlmSvr.GetAlarmOwner(id, aOwner);
+			}
+		}
+	return ret;
+	}
+
+void CAlmModel::ReviewAlarmResetListL()
+	{
+	iAlmSvr.GetAlarmIdListByStateL(EAlarmStateNotified, iReviewAlarmIds);
+	}
+
+void CAlmModel::ReviewAlarmClearList()
+	{
+	iReviewAlarmIds.Reset();
+	}
+
+TInt CAlmModel::ReviewAlarmNumber() const
+	{
+	return iAlmSvr.AlarmCountByState(EAlarmStateNotified);
+	}
+
+TInt CAlmModel::ReviewAlarmInfo(TInt aIndex, TASShdAlarm& aInfo) const
+//
+//	Get information about a past alarm
+//
+	{
+	TInt ret = KErrNotFound;
+	if	(aIndex < iReviewAlarmIds.Count())
+		{
+		const TAlarmId id = iReviewAlarmIds[aIndex];
+		ret = iAlmSvr.GetAlarmDetails(id, aInfo);
+		}
+	return ret;
+	}
+
+void CAlmModel::AlarmSoundToggle()
+	{
+	TTimeWAlarmSoundState soundState = AlarmSoundState();
+	if	(soundState == ETimeWAlarmSoundOn)
+		AlarmSoundStateSet(EFalse);
+	else
+		AlarmSoundStateSet(ETrue);
+	}
+
+TInt CAlmModel::AlarmSoundStateSet(TBool aSoundOn)
+	{
+	TAlarmGlobalSoundState state = EAlarmGlobalSoundStateOn;
+	if	(!aSoundOn)
+		state = EAlarmGlobalSoundStateOff;
+
+	return iAlmSvr.SetAlarmSoundState(state);
+	}
+
+TTimeWAlarmSoundState CAlmModel::AlarmSoundState() const
+	{
+	// First check whether we're in a silent period
+	if	(iAlmSvr.AlarmSoundsTemporarilySilenced())
+		return ETimeWAlarmQuietPeriod;
+
+	// We're not, so check global sound state and map
+	// to TimeW settings
+	TAlarmGlobalSoundState state = EAlarmGlobalSoundStateOff;
+	if	(iAlmSvr.GetAlarmSoundState(state) == KErrNone)
+		{
+		if	(state == EAlarmGlobalSoundStateOn)
+			return ETimeWAlarmSoundOn;
+		}
+	return ETimeWAlarmSoundOff;
+	}
+
+TTime CAlmModel::AlarmQuietPeriodEnd() const
+	{
+	TTime endTime;
+	if	(iAlmSvr.GetAlarmSoundsSilentUntil(endTime) == KErrNone)
+		return endTime;
+	//
+	endTime.HomeTime();
+	return endTime;
+	}
+
+TInt CAlmModel::OrphanAlarmNumber() const
+	{
+	// Get the alarms
+	RArray<TAlarmId> clockIds(KMaxClockAlarms);
+	CleanupClosePushL(clockIds);
+	iAlmSvr.GetAlarmIdListForCategoryL(KASCliCategoryClock, clockIds);
+
+	//which are orphaned?
+	TInt count = clockIds.Count();
+	TInt orphaned = 0;
+	for	(TInt ii=0; ii<count; ii++)
+		{
+		TASShdAlarm alarm;
+		iAlmSvr.GetAlarmDetails(clockIds[ii], alarm);
+		if	(alarm.HasBecomeOrphaned())
+			orphaned++;
+		}
+	CleanupStack::PopAndDestroy(&clockIds);
+
+	return orphaned;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/SM_MOD.CPP	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,87 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "sm_std.h"
+
+CModelBase::CModelBase()
+//
+//	Protected constructor
+//
+	{
+	}
+
+CModelBase::~CModelBase()
+//
+//	destructor
+//
+	{
+	delete(iResponder);
+	}
+
+void CModelBase::Notify(TInt aNotification)
+//
+//	Funnel for all calls to the notifier
+//
+	{
+	if (!iDoingViewNotify && iObserver)
+		DoObserverNotify(aNotification);
+	}
+
+void CModelBase::DoObserverNotify(TInt aNotification)
+//
+//	Single function that actually calls the view notifier
+//
+	{
+	__ASSERT_DEBUG(iObserver,Fault(EModelfNoNotifier));
+	iDoingViewNotify=ETrue;
+	iObserver->HandleUpdate(aNotification);
+	iDoingViewNotify=EFalse;
+	}
+
+void CModelBase::SetResponderActive(CModelResponder* aResponder)
+//
+//	Set the engines responder
+//
+	{
+	iResponder=aResponder;
+	if (iResponder)
+		CActiveScheduler::Add(iResponder);
+	}
+
+void CModelBase::Start()
+//
+//	Start the responder
+//	The engine requires that an active scheduler be installed
+//
+	{
+	iResponder->Start();
+	}
+
+void CModelBase::Stop()
+//
+//	Stop the responder and the engine
+//
+	{
+	if (iResponder)
+		iResponder->Cancel();
+	}
+
+void CModelBase::SetTimewModelObserver(MTimewModelObserver *aObserver)
+//
+//	Register the observer of the engine
+//
+	{
+	iObserver=aObserver;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/SM_RSP.CPP	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,90 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "sm_std.h"
+#include "almmod.h"
+
+//
+//	class CModelResponder
+//
+
+CModelResponder::CModelResponder(CModelBase& aModel,TInt aPriority)
+//
+//	Base class constructor
+//
+	: CActive(aPriority), iModel(&aModel)
+	{
+	}
+
+void CModelResponder::NotifyModel(TInt aStatus)
+//
+//	Funnel all response to the engine
+//
+	{
+	iModel->ProcessResponder(aStatus);
+	}
+
+void CModelResponder::RunL()
+//
+//	Handle changes in the servers
+//
+	{
+//	Reset the status request before notifiying the view
+//	so that it can catch anything untoward that the view does
+	TInt v=iStatus.Int();
+	Start();
+	NotifyModel(v);
+	}
+
+void CModelResponder::Start()
+//
+//	Start the response
+//
+	{
+	if (!IsActive())
+		{
+		SetActive();
+		DoStart();
+		}
+	}
+
+//
+//	class CAlmResponder
+//
+
+CAlmResponder::CAlmResponder(RASCliSession& aSvr,CAlmModel& aModel,TInt aResponderPriority)
+//
+//	Protected constructor
+//
+	: CModelResponder(aModel,aResponderPriority),iAlmSvr(&aSvr)
+	{
+	}
+
+void CAlmResponder::DoStart()
+//
+//	Start a repsonse
+//
+	{
+	iAlmSvr->NotifyChange(iStatus, iAlarmId);
+	}
+
+void CAlmResponder::DoCancel()
+//
+//	Stop the response
+//
+	{
+	if	(iStatus == KRequestPending)
+		iAlmSvr->NotifyChangeCancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/SM_UTL.CPP	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "sm_std.h"
+
+
+GLDEF_C void Panic(TModelPanic aPanic)
+//
+//	Panic in the engine
+//
+	{
+	User::Panic(_L("TW-ENG-PANIC"),aPanic);
+	}
+
+GLDEF_C void Fault(TModelFault aFault)
+//
+//	Fault in the engine
+//
+	{
+	User::Panic(_L("TW-ENG-FAULT"),aFault);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/TestTimewBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,62 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewCase which is the base class for all the Timew TestCase DLL
+// 
+//
+
+// EPOC includes
+#include <e32base.h>
+#include <Uri16.h>
+#include <UriUtils.h>
+#include <TestExecuteLog.h>
+#include "TestTimewbase.h"
+
+CTestTimewBase::CTestTimewBase()
+: CTestStep()
+, iSchedular(NULL)
+, iModel(NULL)
+	{
+	}
+
+// destructor
+CTestTimewBase::~CTestTimewBase()
+	{
+	delete iSchedular;
+	iSchedular=NULL;
+	}
+
+enum TVerdict CTestTimewBase::doTestStepPreambleL()
+	{
+	iSchedular=new CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+
+	return CTestStep::doTestStepPreambleL();
+	}
+
+enum TVerdict CTestTimewBase::doTestStepPostambleL()
+	{
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+
+	return CTestStep::doTestStepPostambleL();
+	}
+
+CAlmModel*	CTestTimewBase::Model(void)
+/**
+returns a pointer to an instance of CAgnModel
+*/
+	{
+  	return iModel;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/TestTimewServer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,106 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This main DLL entry point for the Smoketest_Timew.dll
+// 
+//
+
+
+// EPOC includes
+#include <e32base.h>
+
+#include "TestTimewServer.h"
+#include "TestTimewSetAlarm.h"
+
+
+_LIT(KServerName,"Smoketest_Timew_Server");
+
+CTestTimewServer* CTestTimewServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestTimewServer*	server = new (ELeave) CTestTimewServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestTimewServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestTimewServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+        if (!err) { }
+        
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+    }
+
+
+CTestStep* CTestTimewServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep*	testStep = NULL;
+
+	if(aStepName == _L("SetAlarm"))
+		testStep = new CTestTimewSetAlarm();
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/Src/TestTimewSetAlarm.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,84 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimewSetAlarm
+// 
+//
+
+#include <TestExecuteClient.h>
+
+#include "TestTimewSetAlarm.h"
+
+
+_LIT(KHour,	"hour");
+_LIT(KMinute,"minute");
+_LIT(KMessage,"message");
+_LIT(KBells,"bells");
+
+
+// constructor
+CTestTimewSetAlarm::CTestTimewSetAlarm()
+	{
+	SetTestStepName(_L("SetAlarm"));
+	}
+
+// destructor
+CTestTimewSetAlarm::~CTestTimewSetAlarm()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestTimewSetAlarm::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> SETTING AN ALARM"));
+		TRAPD(r, SetAlarmL());
+
+	if (r!=KErrNone)
+		SetTestStepResult(EFail);
+
+	// test steps return a result
+	return TestStepResult();
+	}
+
+void CTestTimewSetAlarm::SetAlarmL( void )
+	{
+	TInt	hour;
+	TInt	minute;
+	TPtrC	ptrMessage;
+
+	TTime alarmTime;
+	alarmTime.HomeTime();
+
+	if ( !GetIntFromConfig(ConfigSection(), KHour(), hour) )
+		hour=alarmTime.DateTime().Hour();
+
+	if ( !GetIntFromConfig(ConfigSection(), KMinute(), minute) )
+		minute=0;
+
+	GetStringFromConfig(ConfigSection(), KMessage(), ptrMessage);
+
+
+	TDateTime dateTime=alarmTime.DateTime();
+	dateTime.SetHour(hour);
+	dateTime.SetMinute(minute);
+	dateTime.SetSecond(0);
+	dateTime.SetMicroSecond(0);
+	iAlarmData.NextDueTime()=dateTime;
+	iAlarmData.RepeatDefinition()=(TAlarmRepeatDefinition)EAlarmRepeatDefintionRepeatNext24Hours;
+	iAlarmData.Message() = ptrMessage;
+	iAlarmData.SoundName()=KBells();
+	iModel = CAlmModel::NewL(NULL,KPriorityAlarmResponder);
+	Model()->ClockAlarmSet(0,iAlarmData);
+	delete iModel;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/TestData/Smoketest_Timew.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,5 @@
+[24560_SetAlarm]
+hour			=9
+min			=0
+message			=make a cup of tea
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/bmarm/CONSOLEALARMALERTSERVERU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,2 @@
+EXPORTS
+	StartConsoleAlarmAlertServerL__23ConsoleAlarmAlertServerPv @1 NONAME ; public: static void __cdecl ConsoleAlarmAlertServer::StartConsoleAlarmAlertServerL(void *)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/bwins/CONSOLEALARMALERTSERVERU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?StartConsoleAlarmAlertServerL@ConsoleAlarmAlertServer@@SAXPAX@Z @ 1 NONAME ; public: static void __cdecl ConsoleAlarmAlertServer::StartConsoleAlarmAlertServerL(void *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/bwins/SMOKETEST_TIMEW_SERVERU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Timew/eabi/ConsoleAlarmAlertServerU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,11 @@
+EXPORTS
+	_ZN23ConsoleAlarmAlertServer29StartConsoleAlarmAlertServerLEPv @ 1 NONAME
+	_ZTI24CConsoleAlarmAlertServer @ 2 NONAME ; #<TI>#
+	_ZTI25CConsoleAlarmAlertConsole @ 3 NONAME ; #<TI>#
+	_ZTI25CConsoleAlarmAlertSession @ 4 NONAME ; #<TI>#
+	_ZTI28CConsoleAlarmAlertLEDFlasher @ 5 NONAME ; #<TI>#
+	_ZTV24CConsoleAlarmAlertServer @ 6 NONAME ; #<VT>#
+	_ZTV25CConsoleAlarmAlertConsole @ 7 NONAME ; #<VT>#
+	_ZTV25CConsoleAlarmAlertSession @ 8 NONAME ; #<VT>#
+	_ZTV28CConsoleAlarmAlertLEDFlasher @ 9 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/SmokeTestActive.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,115 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestActive
+// 
+//
+
+#if (!defined __SMOKETEST_ACTIVE_H__)
+#define __SMOKETEST_ACTIVE_H__
+
+#include <e32base.h>
+
+/**
+ * Multimedia test timer completion callback
+ */
+class MTestActiveCallback
+	{
+public:
+	/**
+	* Method from which CTestActive informs the user RunL call
+	*/
+	virtual void	RunL() = 0;
+	/**
+	* Method from which CTestActive informs the user DoCancel call
+	*/
+	virtual void	DoCancel() = 0;
+	};
+
+/**
+ * Test Active Notification class
+ *
+ */
+class CTestActive : public CActive
+{
+public:
+	/**
+	* Destructor
+	*/
+	IMPORT_C virtual ~CTestActive();
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Active object whos actions are performed by a callback
+	*
+	* \param aTestActiveCallback object to inform on RunL.
+	* \param aPriority priority of active object.
+	* \return New Callback active object.
+	*/
+	IMPORT_C static CTestActive*	NewL(MTestActiveCallback& aTestActiveCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Active object whos actions are performed by a callback
+	*
+	* \param aTestActiveCallback object to inform on RunL.
+	* \param aPriority priority of active object.
+	* \return New Callback active object.
+	*/
+	IMPORT_C static CTestActive*	NewLC(MTestActiveCallback& aTestActiveCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Activate the object
+	*/
+	IMPORT_C void					Activate();
+
+	/**
+	* Active object RunL implementation.
+	*
+	* Calls the MTestActiveCallback::RunL to inform user that the RunL has been reached.
+	*/
+	void	RunL();
+	/**
+	* Active object DoCancel implementation.
+	*
+	* Calls the MTestActiveCallback::DoCancel to inform user that the DoCancel has been reached.
+	*/
+	void	DoCancel();
+
+protected:
+	/**
+	* Protected constructor with timer completion callback and priority.
+	*
+	* Called by two phase constructor.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	*/
+	CTestActive(MTestActiveCallback& aTestActiveCallback, TInt aPriority);
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*
+	* Second phase of two phase constructor.
+	*/
+	void	ConstructL();
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*/
+	MTestActiveCallback&	iTestActiveCallback;
+};
+
+#endif /* __SMOKETEST_ACTIVE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/SmokeTestProperty.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,93 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestProperty
+// 
+//
+
+#if (!defined __SMOKETEST_PROPERTY_H__)
+#define __SMOKETEST_PROPERTY_H__
+
+// EPOC includes
+#include <test/testexecutestepbase.h>
+#include <e32property.h>
+
+/**
+ This class contains generic utility method to set system wide variable usign publish and subscribe
+*/
+class CTestProperty : public CBase
+{
+public:
+	IMPORT_C CTestProperty(CTestStep& aTestStep);
+	IMPORT_C ~CTestProperty();
+
+	/**
+	* Set a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key
+	*/
+	IMPORT_C TInt SetPropertyL(const TUid aCategory, const TInt aKey, const TInt aValue);
+
+	/**
+	* Set a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key
+	*/
+	IMPORT_C TInt SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC8& aValue);
+
+	/**
+	* Set a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key
+	*/
+	IMPORT_C TInt SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC16& aValue);
+
+	/**
+	* Get a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key returned
+	*/
+	IMPORT_C TInt GetPropertyL(const TUid aCategory, const TInt aKey, TInt& aValue);
+
+	/**
+	* Get a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key returned
+	*/
+	IMPORT_C TInt GetPropertyL(const TUid aCategory, const TInt aKey, TDes8& aValue);
+
+	/**
+	* Get a property
+	*
+	* \param aCategory catagory of the RProperty
+	* \param aKey key of the catagory
+	* \param aValue value of the key returned
+	*/
+	IMPORT_C TInt GetPropertyL(const TUid aCategory, const TInt aKey, TDes16& aValue);
+
+private:
+	CTestStep&	iTestStep;
+	RProperty	iProperty;
+};
+
+#endif /* __SMOKETEST_PROPERTY_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/SmokeTestSecureFSclient.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __SMOKETEST_SECURE_FS_CLIENT_H__
+#define __SMOKETEST_SECURE_FS_CLIENT_H__
+
+#include <e32std.h>
+
+class RTestSecureFSclient : public RSessionBase
+	{
+public:
+	IMPORT_C TInt Connect();
+	IMPORT_C TInt SetHomeTime(const TTime& aTime);
+	IMPORT_C TInt DeleteFileL(const TDesC& aFileName);
+	IMPORT_C void KillProcessL(const TDesC& aProcessName);
+	IMPORT_C TInt ChangeLocaleName(const TDesC& aLocaleDllName);
+	IMPORT_C TInt CheckForFile(const TDesC& aFileName);
+    IMPORT_C TInt CopyFile(const TDesC& Source, const TDesC& Dest);
+    IMPORT_C void SetUpFbs();
+	};
+
+#endif // __SMOKETEST_SECURE_FS_CLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/SmokeTestSecureFSclientserver.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,40 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// clientserver - shared client/server definitions
+// 
+//
+
+#ifndef __SMOKETEST_SECURE_FS_CLIENT_SERVER_H__
+#define __SMOKETEST_SECURE_FS_CLIENT_SERVER_H__
+
+#include <e32std.h>
+
+_LIT(KTestServerName,"SmokeTestSecureFSserver");
+_LIT(KTestServerImg,"SmokeTestSecureFSserver");		// EXE name
+const TUid KServerUid3={0x101FF346};
+
+const TInt KMaxTestMessage=8;
+
+enum TTestIpc
+	{
+	ETestIpcSetHomeTime,
+	ETestIpcDeleteFile,
+	ETestIpcKillProcess,
+	ETestIpcChangeLocale,
+	ETestIpcCheckForFile,
+    ETestIpcCopyFile,
+    ETestIpcSetUpFbs,
+	};
+
+#endif // __SMOKETEST_SECURE_FS_CLIENT_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/SmokeTestSecureFSserver.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,91 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestServer - server classes
+// 
+//
+
+#ifndef __SMOKETEST_SECURE_FS_SERVER_H__
+#define __SMOKETEST_SECURE_FS_SERVER_H__
+
+#include <e32base.h>
+#include "SmokeTestSecureFSclientserver.h"
+
+enum TTestPanic
+	{
+	EPanicBadDescriptor,
+	EPanicIllegalFunction,
+	EPanicAlreadyReceiving
+	};
+
+void PanicClient(const RMessage2& aMessage,TTestPanic TMyPanic);
+
+class CTestSecureFSshutdown : public CTimer
+	{
+	enum {KMyShutdownDelay=0x500000};	// approx 5s
+public:
+	inline CTestSecureFSshutdown();
+	inline void ConstructL();
+	inline void Start();
+private:
+	void RunL();
+	};
+
+class CTestSecureFSserver : public CServer2
+	{
+public:
+	static CServer2* NewLC();
+	void AddSession();
+	void DropSession();
+	void Send(const TDesC& aMessage);
+private:
+	CTestSecureFSserver();
+	void ConstructL();
+	// CSharableSession* NewSessionL(const TVersion& aVersion, const RMessage& aMessage) const;
+        CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
+private:
+	TInt iSessionCount;
+	CTestSecureFSshutdown iShutdown;
+	};
+
+//class CTestSecureFSSession : public CSharableSession
+class CTestSecureFSSession : public CSession2
+	{
+public:
+	CTestSecureFSSession();
+	void CreateL();
+	void Send(const TDesC& aMessage);
+private:
+	~CTestSecureFSSession();
+	inline CTestSecureFSserver& Server();
+	void ServiceL(const RMessage2& aMessage);
+	void ServiceError(const RMessage2& aMessage,TInt aError);
+	inline TBool ReceivePending() const;
+private:
+	void DoSetHomeTime(const RMessage2& aMessage);
+	
+	// General File Manipulation
+	TInt DoDeleteFileL(const RMessage2& aMessage);
+
+	// Power User
+	void DoKillProcess(const RMessage2& aMessage);
+	TInt DoChangeLocale(const RMessage2& aMessage);
+	TInt DoCheckForFile(const RMessage2& aMessage);
+	TInt DoCopyFile(const RMessage2& aMessage);
+	void DoSetUpFbs();
+
+private:
+	RMessage2 iReceive;
+	};
+
+#endif // __SMOKETEST_SECURE_FS_SERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/SmokeTestTimeOutTimer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,102 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestTimeOutTimer
+// 
+//
+
+#if (!defined __SMOKETEST_TIMEOUT_TIMER_H_)
+#define __SMOKETEST_TIMEOUT_TIMER_H_
+
+#include <e32base.h>
+
+/**
+ * Multimedia test timer completion callback
+ */
+class MTestTimeOutTimerCallback
+	{
+public:
+	/**
+	* Method from which CTestTimeOutTimer informs the user of the timer completion.
+	*/
+	virtual void TimerCompleted() = 0;
+	};
+
+/**
+ * Multimedia test timer active object.
+ *
+ * On timer completion MTestTimeOutTimerCallback::TimerCompleted is called
+ * to inform the user off the completion
+ */
+class CTestTimeOutTimer : public CTimer  
+{
+public:
+	/**
+	* Destructor
+	*/
+	IMPORT_C virtual ~CTestTimeOutTimer();
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Multimedia timer a timer completion callback and priority.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	* \return New Multimedia test timer active object.
+	*/
+	IMPORT_C static CTestTimeOutTimer*	NewL(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Two phase constructor that allocates and constructs
+	* a new Multimedia timer a timer completion callback and priority.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	* \return New Multimedia test timer active object.
+	*/
+	IMPORT_C static CTestTimeOutTimer*	NewLC(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority=EPriorityStandard);
+
+	/**
+	* Active object RunL implementation.
+	*
+	* Calls the MTestTimeOutTimerCallback::TimerCompleted to inform user that the timer has completed.
+	*/
+	void	RunL();
+
+protected:
+	/**
+	* Protected constructor with timer completion callback and priority.
+	*
+	* Called by two phase constructor.
+	*
+	* \param aTestTimerCallback object to inform on timer completion.
+	* \param aPriority priority of active object.
+	*/
+	CTestTimeOutTimer(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority);
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*
+	* Second phase of two phase constructor.
+	*/
+	void	ConstructL();
+
+private:
+	/**
+	* This is internal and not intended for use.
+	*/
+	MTestTimeOutTimerCallback&	iTestTimerCallback;
+};
+
+#endif /* __SMOKETEST_TIMEOUT_TIMER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Inc/TestStepSmokeTest.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,80 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestStepSmokeTest
+// 
+//
+
+#if (!defined __TEST_STEP_SMOKETEST_H__)
+#define __TEST_STEP_SMOKETEST_H__
+
+//TEF include
+#include <test/testexecutestepbase.h>
+#include "Configuration.cfg"
+
+enum TTestLoggingDetail
+	{
+	ETestLoggingDetail_Min,
+	ETestLoggingDetail_Normal,
+	ETestLoggingDetail_Max,
+	};
+
+#if (defined __VERSION_70S__)
+enum TCapability
+	{
+	ECapabilityTCB				= 0,
+	};
+#endif
+
+/**
+ This class is the base class for all the test steps in smoketest.
+*/
+class CTestStepSmokeTest : public CTestStep
+	{
+public:
+	//Destructor
+	IMPORT_C virtual ~CTestStepSmokeTest();
+
+	/**
+	 Pure virtual, to be implemented by the derived test steps.
+	 It implements the required functionality of the test step.
+	 @return TVerdict - result of the test step
+	 @leave - System wide error codes
+	*/
+	IMPORT_C virtual enum TVerdict	doTestStepL() = 0;
+
+	//Implements the preoperational functionalities for a test step
+	IMPORT_C virtual enum TVerdict	doTestStepPreambleL();
+
+	//Implements the post operational fucntionalities for a test step
+	IMPORT_C virtual enum TVerdict	doTestStepPostambleL();
+
+	TTestLoggingDetail		LoggingDetail() const { return iLoggingDetail; }
+	TInt					Repetition() const { return iRepetition; }
+
+protected:
+	//Constructor
+	IMPORT_C CTestStepSmokeTest();
+
+	//Gets the TCapability value for the capabilty string literal
+	IMPORT_C TInt			GetCapability(TPtrC aCapability, TCapability& aCapabilityValue);
+
+	//Verifies the given time is nearly eaual to current UTC time
+	IMPORT_C TBool			VerifyUTCTime(TTime aTime);
+
+private:
+	TTestLoggingDetail			iLoggingDetail;
+	TInt						iRepetition;
+	};
+
+#endif /* __TEST_STEP_SMOKETEST_H__ */
Binary file common/tools/ats/smoketest/Utils/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Src/SmokeTestActive.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,69 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// SmokeTestTestActive.h
+// This contains CTestActive
+// 
+//
+
+#include "SmokeTestActive.h"
+
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+EXPORT_C CTestActive::~CTestActive()
+	{
+	}
+
+EXPORT_C CTestActive* CTestActive::NewL(MTestActiveCallback& aTestActiveCallback, TInt aPriority)
+	{
+	CTestActive*	self=NewLC(aTestActiveCallback, aPriority);
+	CleanupStack::Pop();
+	return self;
+	}
+
+EXPORT_C CTestActive* CTestActive::NewLC(MTestActiveCallback& aTestActiveCallback, TInt aPriority)
+	{
+	CTestActive*	self=new(ELeave) CTestActive(aTestActiveCallback, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+EXPORT_C void CTestActive::Activate()
+	{
+	SetActive();
+	}
+
+CTestActive::CTestActive(MTestActiveCallback& aTestActiveCallback, TInt aPriority)
+:	CActive(aPriority)
+,	iTestActiveCallback(aTestActiveCallback)
+	{
+	}
+
+void CTestActive::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CTestActive::RunL()
+	{
+	iTestActiveCallback.RunL();
+	}
+
+void CTestActive::DoCancel()
+	{
+	iTestActiveCallback.DoCancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Src/SmokeTestProperty.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,140 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestProperty
+// 
+//
+
+#include "SmokeTestProperty.h"
+
+// EPOC32 include
+#include <e32base.h>
+
+EXPORT_C CTestProperty::CTestProperty(CTestStep& aTestStep)
+:	CBase()
+,	iTestStep(aTestStep)
+	{
+	}
+
+EXPORT_C CTestProperty::~CTestProperty()
+	{
+	}
+
+EXPORT_C TInt CTestProperty::SetPropertyL(const TUid aCategory, const TInt aKey, const TInt aValue)
+	{
+	//Define the property, in case it is being used for the first time.
+	TInt	ret=RProperty::Define(aCategory, aKey, RProperty::EInt);
+	if ( (ret==KErrNone) || (ret== KErrAlreadyExists) )
+		{
+		//Attach to the property so that you can track any chnages to it.
+		ret=iProperty.Attach(aCategory, aKey);
+		if ( ret==KErrNone )
+			{
+			//Set the new test number and wait until the change is in effect.
+			TRequestStatus	status;
+			iProperty.Subscribe(status);
+			ret=iProperty.Set(aCategory, aKey, aValue);
+			if ( ret==KErrNone )
+				{
+				User::WaitForRequest(status);
+				ret=status.Int();
+				if ( ret != KErrNone )
+					{
+					iTestStep.INFO_PRINTF2(_L("request complete error=%d"), ret);
+					}
+				}
+			else
+				{
+				iTestStep.INFO_PRINTF2(_L("RProperty::Set error=%d"), ret);
+				}
+			iProperty.Close();
+			}
+		else
+			{
+			iTestStep.INFO_PRINTF2(_L("RProperty::Attach error=%d"), ret);
+			}
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF2(_L("RProperty::Define error=%d"), ret);
+		}
+
+	return ret;
+	}
+
+EXPORT_C TInt CTestProperty::SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC8& aValue)
+	{
+	//Define the property, in case it is being used for the first time.
+	TInt	ret=RProperty::Define(aCategory, aKey, RProperty::EByteArray);
+	if ( (ret==KErrNone) || (ret== KErrAlreadyExists) )
+		{
+		//Attach to the property so that you can track any chnages to it.
+		ret=iProperty.Attach(aCategory, aKey);
+		if ( ret==KErrNone )
+			{
+			//Set the new test number and wait until the change is in effect.
+			TRequestStatus	status;
+			iProperty.Subscribe(status);
+			ret=iProperty.Set(aCategory, aKey, aValue);
+			if ( ret==KErrNone )
+				{
+				User::WaitForRequest(status);
+				ret=status.Int();
+				}
+			iProperty.Close();
+			}
+		}
+
+	return ret;
+	}
+
+EXPORT_C TInt CTestProperty::SetPropertyL(const TUid aCategory, const TInt aKey, const TDesC16& aValue)
+	{
+	//Define the property, in case it is being used for the first time.
+	TInt	ret=RProperty::Define(aCategory, aKey, RProperty::EText);
+	if ( (ret==KErrNone) || (ret== KErrAlreadyExists) )
+		{
+		//Attach to the property so that you can track any chnages to it.
+		ret=iProperty.Attach(aCategory, aKey);
+		if ( ret==KErrNone )
+			{
+			//Set the new test number and wait until the change is in effect.
+			TRequestStatus	status;
+			iProperty.Subscribe(status);
+			ret=iProperty.Set(aCategory, aKey, aValue);
+			if ( ret==KErrNone )
+				{
+				User::WaitForRequest(status);
+				ret=status.Int();
+				}
+			iProperty.Close();
+			}
+		}
+
+	return ret;
+	}
+
+EXPORT_C TInt CTestProperty::GetPropertyL(const TUid aCategory, const TInt aKey, TInt& aValue)
+	{
+	return RProperty::Get(aCategory, aKey, aValue);
+	}
+
+EXPORT_C TInt CTestProperty::GetPropertyL(const TUid aCategory, const TInt aKey, TDes8& aValue)
+	{
+	return RProperty::Get(aCategory, aKey, aValue);
+	}
+
+EXPORT_C TInt CTestProperty::GetPropertyL(const TUid aCategory, const TInt aKey, TDes16& aValue)
+	{
+	return RProperty::Get(aCategory, aKey, aValue);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Src/SmokeTestSecureFSclient.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,112 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Test Server - client interface implementation
+// 
+//
+
+#include <e32std.h>
+#include <e32math.h>
+#include "SmokeTestSecureFSclientserver.h"
+#include "SmokeTestSecureFSclient.h"
+
+static TInt StartServer()
+//
+// Start the server process. Simultaneous launching
+// of two such processes should be detected when the second one attempts to
+// create the server object, failing with KErrAlreadyExists.
+//
+	{
+	const TUidType serverUid(KNullUid,KNullUid,KServerUid3);
+
+
+	RProcess server;
+	TInt r=server.Create(KTestServerImg, KNullDesC, serverUid);
+
+	if (r!=KErrNone)
+		return r;
+	TRequestStatus stat;
+
+	server.Rendezvous(stat);
+	
+	if (stat != KRequestPending)
+		server.Kill(0);		// abort startup
+	else
+		server.Resume();	// logon OK - start the server	
+	User::WaitForRequest(stat);	//wait for start or death
+	// we can't use the 'exit reason' if the server panicked as this
+	// is the panic 'reason' and may be '0' which cannot be distinguished
+	// from KErrNone
+	r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+	server.Close();
+	return r;
+	}
+
+EXPORT_C TInt RTestSecureFSclient::Connect()
+	{// Connect to the server, attempting to start it if necessary
+	TInt retry=2;
+	for (;;)
+		{
+		TInt r=CreateSession(KTestServerName,TVersion(0,0,0),1);
+		if (r!=KErrNotFound && r!=KErrServerTerminated)
+			return r;
+		if (--retry==0)
+			return r;
+		r=StartServer();
+		if (r!=KErrNone && r!=KErrAlreadyExists)
+			return r;
+		User::After(1000000); //Let server load up (in EKA2)
+
+		}
+	}
+
+EXPORT_C TInt RTestSecureFSclient::SetHomeTime(const TTime& aTime) 
+	{
+	TPckg<TTime> pckg(aTime);
+	return SendReceive(ETestIpcSetHomeTime,TIpcArgs(&pckg));
+	}
+
+EXPORT_C TInt RTestSecureFSclient::DeleteFileL(const TDesC& aFileName)
+	{
+	TIpcArgs args(&aFileName);
+	return SendReceive(ETestIpcDeleteFile,args);
+	}
+
+EXPORT_C void RTestSecureFSclient::KillProcessL(const TDesC& aProcessName)
+	{
+	TIpcArgs args(&aProcessName);
+	User::LeaveIfError(SendReceive(ETestIpcKillProcess,args));
+	}
+
+EXPORT_C TInt RTestSecureFSclient::ChangeLocaleName(const TDesC& aLocaleDllName)
+	{
+	TIpcArgs args(&aLocaleDllName);
+	return SendReceive(ETestIpcChangeLocale,args);
+	}
+
+EXPORT_C TInt RTestSecureFSclient::CheckForFile(const TDesC& aFileName)
+    {
+	TIpcArgs args(&aFileName); 
+	return SendReceive(ETestIpcCheckForFile,args);  
+    }
+    
+EXPORT_C TInt RTestSecureFSclient::CopyFile(const TDesC& Source, const TDesC& Dest)
+    {
+	TIpcArgs args(&Source, &Dest); 
+	return SendReceive(ETestIpcCopyFile,args);  
+    }
+    
+EXPORT_C void RTestSecureFSclient::SetUpFbs()
+    {
+	SendReceive(ETestIpcSetUpFbs);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Src/SmokeTestSecureFSserver.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,391 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestServer - server implementation
+// 
+//
+
+#include "e32std.h"
+#include "SmokeTestSecureFSserver.h"
+#include <f32file.h>
+
+TRequestStatus aStatus;
+TRequestStatus* aSt = &aStatus;
+
+
+inline CTestSecureFSshutdown::CTestSecureFSshutdown()
+	:CTimer(-1)
+	{CActiveScheduler::Add(this);}
+inline void CTestSecureFSshutdown::ConstructL()
+	{CTimer::ConstructL();}
+inline void CTestSecureFSshutdown::Start()
+	{After(KMyShutdownDelay);}
+
+inline CTestSecureFSserver::CTestSecureFSserver()
+	:CServer2(0,ESharableSessions)
+	{}
+
+inline CTestSecureFSSession::CTestSecureFSSession()
+	{}
+inline CTestSecureFSserver& CTestSecureFSSession::Server()
+	{return *static_cast<CTestSecureFSserver*>(const_cast<CServer2*>(CSession2::Server()));}
+inline TBool CTestSecureFSSession::ReceivePending() const
+	{return !iReceive.IsNull();}
+
+///////////////////////
+
+void CTestSecureFSSession::CreateL()
+//
+// 2nd phase construct for sessions - called by the CServer framework
+//
+	{
+	//RDebug::Print(_L("Server::CTestSecureFSSession::CreateL - start"));
+
+	Server().AddSession();
+	//RDebug::Print(_L("Server::CTestSecureFSSession::CreateL - end"));
+	}
+
+CTestSecureFSSession::~CTestSecureFSSession()
+	{
+	Server().DropSession();
+	}
+
+void CTestSecureFSSession::Send(const TDesC& aMessage)
+//
+// Deliver the message to the client, truncating if required
+// If the write fails, panic the client, not the sender
+//
+	{
+	if (ReceivePending())
+		{
+		TPtrC m(aMessage);
+		if (iReceive.Int1()<aMessage.Length())
+			m.Set(m.Left(iReceive.Int1()));
+		TInt r=iReceive.Write(0,m);
+		if (r==KErrNone)
+			iReceive.Complete(KErrNone);
+		else
+			PanicClient(iReceive,EPanicBadDescriptor);
+		}
+	}
+
+void CTestSecureFSSession::ServiceL(const RMessage2& aMessage)
+//
+// Handle a client request.
+// Leaving is handled by CMyServer::ServiceError() which reports
+// the error code to the client
+//
+	{
+	TInt result = KErrNone;
+
+	switch (aMessage.Function())
+		{
+	case ETestIpcSetHomeTime:
+		DoSetHomeTime(aMessage);
+		break;
+
+	case ETestIpcDeleteFile:
+		result = DoDeleteFileL(aMessage);
+		break;
+	
+	case ETestIpcKillProcess:
+		DoKillProcess(aMessage);
+		break;
+
+	case ETestIpcChangeLocale:
+		result = DoChangeLocale(aMessage);
+		break;
+		
+	case ETestIpcCheckForFile:
+	    result = DoCheckForFile(aMessage);
+	    break;
+	    
+	case ETestIpcCopyFile:
+	    result = DoCopyFile(aMessage);
+	    break; 
+	    
+	case ETestIpcSetUpFbs:
+	    DoSetUpFbs(); 
+	    break;
+	     
+	default:
+		PanicClient(aMessage,EPanicIllegalFunction);
+		break;
+		}
+	aMessage.Complete(result);
+	}
+
+////////////////////////////////////////
+
+void CTestSecureFSSession::DoSetHomeTime(const RMessage2& aMessage)
+	{
+	TPckgBuf<TTime> pckg;
+	aMessage.Read(0,pckg);
+	User::SetHomeTime(pckg());
+	}
+
+TInt CTestSecureFSSession::DoDeleteFileL(const RMessage2& aMessage)
+	{
+	RFs fs;
+	TFileName* const fileName=new(ELeave) TFileName;
+	CleanupStack::PushL(fileName);
+	User::LeaveIfError(fs.Connect());
+
+	CleanupClosePushL(fs);
+	aMessage.ReadL(0,*fileName);
+	TInt err=fs.Delete(*fileName);
+	if (!(err==KErrNone || err==KErrNotFound || err==KErrPathNotFound)) // ignore not found error
+		{
+		User::Leave(err);
+		}
+	CleanupStack::PopAndDestroy(&fs);
+	CleanupStack::PopAndDestroy(fileName);
+	return err;
+	}
+
+void CTestSecureFSSession::DoKillProcess(const RMessage2& aMessage)
+	{
+	TFullName* name = new(ELeave) TFullName;
+	CleanupStack::PushL(name);
+
+	aMessage.ReadL(0,*name);
+	TFindProcess* finder = new (ELeave) TFindProcess(*name);
+	CleanupStack::PushL(finder);
+	RProcess* process = new (ELeave) RProcess;
+	CleanupStack::PushL(process);
+
+	if (finder->Next(*name) == KErrNone)
+		{
+		if (process->Open(*name) == KErrNone)
+			{
+			process->Kill(KErrNone);
+			}
+		}
+
+	if (process != NULL)
+		{
+		process->Close();
+		}
+	CleanupStack::PopAndDestroy(process);
+	CleanupStack::PopAndDestroy(finder);
+	CleanupStack::PopAndDestroy(name);		
+	}
+
+
+TInt CTestSecureFSSession::DoChangeLocale(const RMessage2& aMessage)
+	{
+	TBuf<50> locname;
+	TInt result;
+	aMessage.ReadL(0,locname);
+
+	result = UserSvr::ChangeLocale(locname);
+
+	return result;
+	}
+
+TInt CTestSecureFSSession::DoCheckForFile(const RMessage2& aMessage)
+{
+    RFs fs;
+    TInt err;
+	TFileName* const fileName=new(ELeave) TFileName;
+	CleanupStack::PushL(fileName);
+	User::LeaveIfError(fs.Connect());
+
+	CleanupClosePushL(fs);
+	aMessage.ReadL(0,*fileName);
+	
+	TUint attribs;
+	err=fs.Att(*fileName, attribs);
+	fs.Close();
+		
+	CleanupStack::PopAndDestroy(&fs);
+	CleanupStack::PopAndDestroy(fileName);
+	return err;
+	
+}
+
+TInt CTestSecureFSSession::DoCopyFile(const RMessage2& aMessage)
+{
+
+    RFs fs;
+    TInt result;
+ 
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+
+    TFileName fileSource;
+    TFileName fileDest;
+
+    aMessage.ReadL(0,fileSource);
+    aMessage.ReadL(1,fileDest);
+    	   
+	CFileMan* fileMan = NULL;
+	
+	fileMan = CFileMan::NewL(fs);
+	CleanupStack::PushL( fileMan );
+	
+	fs.MkDirAll(fileDest);
+	result = fileMan->Copy( fileSource, fileDest, CFileMan::EOverWrite );
+	
+	User::LeaveIfError(fs.Connect());
+	fs.SetAtt(fileDest,KEntryAttNormal,KEntryAttReadOnly);
+	fs.Close();
+
+    CleanupStack::PopAndDestroy(fileMan);
+    CleanupStack::PopAndDestroy(&fs);
+	return result;
+	
+}
+
+void CTestSecureFSSession::DoSetUpFbs()
+{
+//	FbsStartup();
+//    User::LeaveIfError( RFbsSession::Connect() );
+//   CleanupStack::PushL( TCleanupItem( TCleanupOperation(&RFbsSession::Disconnect ), NULL ) );
+}
+
+////////////////////////////////////////
+
+void CTestSecureFSSession::ServiceError(const RMessage2& aMessage,TInt aError)
+//
+// Handle an error from CMySession::ServiceL()
+// A bad descriptor error implies a badly programmed client, so panic it;
+// otherwise use the default handling (report the error to the client)
+//
+	{
+	if (aError==KErrBadDescriptor)
+		PanicClient(aMessage,EPanicBadDescriptor);
+	CSession2::ServiceError(aMessage,aError);
+	}
+
+void CTestSecureFSshutdown::RunL()
+//
+// Initiate server exit when the timer expires
+//
+	{
+	CActiveScheduler::Stop();
+	}
+
+CServer2* CTestSecureFSserver::NewLC()
+	{
+	CTestSecureFSserver* self=new(ELeave) CTestSecureFSserver;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+void CTestSecureFSserver::ConstructL()
+//
+// 2nd phase construction - ensure the timer and server objects are running
+//
+	{
+	StartL(KTestServerName);
+	iShutdown.ConstructL();
+	// ensure that the server still exits even if the 1st client fails to connect
+	iShutdown.Start();
+	}
+
+
+CSession2* CTestSecureFSserver::NewSessionL(const TVersion&,const RMessage2&) const
+//
+// Cretae a new client session. This should really check the version number.
+//
+	{
+	return new(ELeave) CTestSecureFSSession();
+	}
+
+void CTestSecureFSserver::AddSession()
+//
+// A new session is being created
+// Cancel the shutdown timer if it was running
+//
+	{
+	++iSessionCount;
+	iShutdown.Cancel();
+	}
+
+void CTestSecureFSserver::DropSession()
+//
+// A session is being destroyed
+// Start the shutdown timer if it is the last session.
+//
+	{
+	if (--iSessionCount==0)
+		iShutdown.Start();
+	}
+
+void CTestSecureFSserver::Send(const TDesC& aMessage)
+//
+// Pass on the signal to all clients
+//
+	{
+	iSessionIter.SetToFirst();
+	CSession2* s;
+	while ((s=iSessionIter++)!=0)
+		static_cast<CTestSecureFSSession*>(s)->Send(aMessage);
+	}
+
+void PanicClient(const RMessage2& aMessage,TTestPanic aPanic)
+//
+// RMessage::Panic() also completes the message. This is:
+// (a) important for efficient cleanup within the kernel
+// (b) a problem if the message is completed a second time
+//
+	{
+	_LIT(KPanic,"TestServer");
+ 	aMessage.Panic(KPanic,aPanic);
+	}
+
+
+
+/**
+Perform all server initialisation, in particular creation of the
+scheduler and server and then run the scheduler
+*/
+
+static void RunServerL()
+	{
+	// naming the server thread after the server helps to debug panics
+  	User::LeaveIfError(RThread::RenameMe(KTestServerName));
+	// create and install the active scheduler we need
+	CActiveScheduler* s=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(s);
+	CActiveScheduler::Install(s);
+	CTestSecureFSserver::NewLC(); // create the server (leave it on the cleanup stack)
+	RProcess::Rendezvous(KErrNone);
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(2); 	// Cleanup the server and scheduler
+	}
+
+
+
+
+TInt E32Main()
+//
+// Server process entry-point
+//
+	{
+	__UHEAP_MARK;
+	//
+	RDebug::Print(_L("Server::E32Main Version 0.0.0"));
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	TInt r=KErrNoMemory;
+	if (cleanup)
+		{
+		TRAP(r,RunServerL());
+		delete cleanup;
+		}
+	//
+	__UHEAP_MARKEND;
+	return r;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Src/SmokeTestTimeOutTimer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,59 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// SmokeTestTimeOutTimer.h
+// This contains CTestTimeOutTimer
+// 
+//
+
+#include "SmokeTestTimeOutTimer.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+EXPORT_C CTestTimeOutTimer::~CTestTimeOutTimer()
+	{
+	}
+
+EXPORT_C CTestTimeOutTimer* CTestTimeOutTimer::NewL(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority)
+	{
+	CTestTimeOutTimer*	self=NewLC(aTestTimerCallback, aPriority);
+	CleanupStack::Pop();
+	return self;
+	}
+
+EXPORT_C CTestTimeOutTimer* CTestTimeOutTimer::NewLC(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority)
+	{
+	CTestTimeOutTimer*	self=new(ELeave) CTestTimeOutTimer(aTestTimerCallback, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+CTestTimeOutTimer::CTestTimeOutTimer(MTestTimeOutTimerCallback& aTestTimerCallback, TInt aPriority)
+:	CTimer(aPriority)
+,	iTestTimerCallback(aTestTimerCallback)
+	{
+	}
+
+void CTestTimeOutTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	CActiveScheduler::Add(this);
+	}
+
+void CTestTimeOutTimer::RunL()
+	{
+	iTestTimerCallback.TimerCompleted();
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/Src/TestStepSmokeTest.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,345 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestStepSmokeTest
+// 
+//
+
+//user include
+#include "TestStepSmokeTest.h"
+
+//Epoc include
+#include <testconfigfileparser.h>
+#include <f32file.h>
+#include <e32std.h>
+
+/*@{*/
+_LIT(KExpectedCapCheckResult,	"ExpectedCapCheckResult");
+_LIT(KConfigFile,				"C:\\plattest\\platsec\\plattest_capabilities.config");
+_LIT(KDefault,					"default");
+_LIT(KCapTest,					"CapabilityTest");
+_LIT(KNo,						"No");
+
+_LIT(KLogging,					"logging");
+_LIT(KLoggingMin,				"min");
+_LIT(KLoggingNormal,			"normal");
+_LIT(KLoggingMax,				"max");
+
+_LIT(KRepetition,				"repetition");
+/*@}*/
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+/**
+ Constructor
+*/
+EXPORT_C CTestStepSmokeTest::CTestStepSmokeTest()
+:	CTestStep()
+,	iLoggingDetail(ETestLoggingDetail_Normal)
+,	iRepetition(1)
+	{
+	}
+
+/**
+ Destructor
+*/
+EXPORT_C CTestStepSmokeTest::~CTestStepSmokeTest()
+	{
+	}
+
+	
+/**
+ The overriden implementation of CTestStep::doTestStepPreambleL()
+ @return TVerdict- result of the test step
+ @leave - system wide error codes
+*/
+EXPORT_C TVerdict CTestStepSmokeTest::doTestStepPreambleL()
+	{
+	TVerdict ret = CTestStep::doTestStepPreambleL();
+
+	//	Get logging
+	TPtrC	logging;
+	if ( GetStringFromConfig(ConfigSection(), KLogging, logging) )
+		{
+		INFO_PRINTF2(_L("Logging value %S"), &logging);
+		if ( logging.Compare(KLoggingMin) == 0 )
+			{
+			iLoggingDetail=ETestLoggingDetail_Min;
+			}
+		else if ( logging.Compare(KLoggingNormal) == 0 )
+			{
+			iLoggingDetail=ETestLoggingDetail_Normal;
+			}
+		else if ( logging.Compare(KLoggingMax) == 0 )
+			{
+			iLoggingDetail=ETestLoggingDetail_Max;
+			}
+		else
+			{
+			ERR_PRINTF1(_L("Illegal logging value, use min, normal or max."));
+			ret=EFail;
+			}
+		}
+
+	//	Get repetition count of test
+	GetIntFromConfig(ConfigSection(), KRepetition, iRepetition);
+	INFO_PRINTF2(_L("Repetition %d"), iRepetition);
+
+	return ret;
+	}
+
+/**
+ The overriden implementation of CTestStep::doTestStepPostambleL()
+ It implements the functionality of capability checking if
+ _PLATTEST_CAPTEST_ is ON.
+ @return TVerdict- result of the test step
+ @leave - system wide error codes
+*/
+
+EXPORT_C TVerdict CTestStepSmokeTest::doTestStepPostambleL()
+	{
+
+	//Read whether to do capability testing..
+	TPtrC captest(KNo);
+	GetStringFromConfig(KDefault, KCapTest, captest);
+	if( captest.Compare(_L("YES")) == 0)
+		{
+		INFO_PRINTF1(_L("---Capability Testing---"));
+		//Gets the capabilities config file
+		TBuf<KMaxTestExecuteCommandLength> scriptFile;
+		scriptFile.Copy(KConfigFile);
+		INFO_PRINTF2(_L("The config file %S"), &scriptFile);
+	
+		TBuf8<KMaxTestExecuteCommandLength> scriptSection;
+		scriptSection.Copy(_L("Capabilities"));
+			
+		TPtrC serverName = GetServerName();
+		INFO_PRINTF2(_L("The server name is  %S"), &serverName);
+		HBufC8 *scriptItem = HBufC8::NewLC(serverName.Length());
+		scriptItem->Des().Copy(serverName);
+		 
+		//Get the file server session object
+		RFs		rFs;
+		TInt	err=rFs.Connect();
+		if(err != KErrNone)
+			{
+			ERR_PRINTF1(_L("Failed to connect with File server"));
+			SetTestStepResult(EFail);
+			}
+		else
+			{
+			CleanupClosePushL(rFs);
+			//Get the config file
+			CTestConfig* configFile = CTestConfig::NewLC(rFs, KNullDesC, scriptFile);
+			if( configFile == NULL)
+				{
+				WARN_PRINTF1(_L("NO Config file found -- Plattest_capabilites.config"));
+				}
+			else
+				{
+				//Get the item value from config file
+				TBuf8<KMaxTestExecuteCommandLength> itemValue;
+				itemValue = configFile->Section(scriptSection)->Item(scriptItem->Des())->Value();
+				TLex8 capabilityParser(itemValue);
+				TBool capCheckResult= ETrue;
+				
+				while(!capabilityParser.Eos())
+					{
+					//Parse the capabilities
+					TPtrC8 capability(capabilityParser.NextToken());
+								
+					HBufC* capabilityRead = HBufC::NewLC(capability.Length());
+					capabilityRead->Des().Copy(capability);
+					INFO_PRINTF2(_L("Capability Read is %S"), capabilityRead);
+					
+					//Get the capability value
+					TCapability capabilityValue;
+					TPtrC ptrCapabilty(capabilityRead->Des());
+					TInt err = GetCapability(ptrCapabilty, capabilityValue);
+					if( err != KErrNone)
+						{
+						WARN_PRINTF1(_L("The capability is not found"));
+						}
+					else
+						{
+						//Check if the current process posses the required capability
+						if( !RProcess().HasCapability(capabilityValue) )
+							{
+							INFO_PRINTF2(_L("The capability %S is not possesed."), capabilityRead);
+							capCheckResult=EFalse;
+							}
+						else
+							{
+							INFO_PRINTF2(_L("The capability %S is possesed."), capabilityRead);
+							}
+						}
+					CleanupStack::PopAndDestroy(capabilityRead);
+					}
+					
+				//read the expected capability check result
+				TBool expectedCapCheckResult = ETrue;
+				GetBoolFromConfig(ConfigSection(), KExpectedCapCheckResult, expectedCapCheckResult);
+				INFO_PRINTF2(_L("The expected cap check result is %D"), expectedCapCheckResult);
+				INFO_PRINTF2(_L("The cap check result is %D"), capCheckResult);
+
+				if(expectedCapCheckResult == capCheckResult)
+					{
+					SetTestStepResult(EPass);
+					}
+				else
+					{
+					SetTestStepResult(EFail);
+					}
+				}
+			CleanupStack::PopAndDestroy(2, &rFs);
+			}
+		CleanupStack::PopAndDestroy(scriptItem);
+		if(TestStepError() == KErrPermissionDenied)
+			{
+			INFO_PRINTF1(_L(" The failure is due to Platform Security"));
+			}
+		}
+
+	TVerdict ret = CTestStep::doTestStepPostambleL();
+	return ret;
+	}
+
+/**
+ Get the capability id (enum value) for the capability name 
+ given as string.
+ @param aCapability - Capability name 
+ @param aCapabilityValue - value for the capability name
+ @return TInt - error codes
+ @leave - None
+*/
+EXPORT_C TInt CTestStepSmokeTest::GetCapability(TPtrC aCapability, TCapability& aCapabilityValue)
+	{
+	INFO_PRINTF2(_L("The capability get is %S"), &aCapability);
+	TInt	ret=KErrNone;
+
+	TBuf<KMaxTestExecuteCommandLength>	capCaseValue(aCapability);
+	capCaseValue.LowerCase();
+
+	if(!capCaseValue.Compare(_L("tcb" )))
+		{
+		aCapabilityValue=ECapabilityTCB;
+		}
+	else if(!capCaseValue.Compare(_L("commdd" )))
+		{
+		aCapabilityValue=ECapabilityCommDD;
+		}
+	else if(!capCaseValue.Compare(_L("powermgmt" )))
+		{
+		aCapabilityValue=ECapabilityPowerMgmt;
+		}
+	else if(!capCaseValue.Compare(_L("multimediadd" )))
+		{
+		aCapabilityValue=ECapabilityMultimediaDD;
+		}
+	else if(!capCaseValue.Compare(_L("readdevicedata" )))
+		{
+		aCapabilityValue=ECapabilityReadDeviceData;
+		}
+	else if(!capCaseValue.Compare(_L("writedevicedata" )))
+		{
+		aCapabilityValue=ECapabilityWriteDeviceData;
+		}
+	else if(!capCaseValue.Compare(_L("drm" )))
+		{
+		aCapabilityValue=ECapabilityDRM;
+		}
+	else if(!capCaseValue.Compare(_L("trustedui" )))
+		{
+		aCapabilityValue=ECapabilityTrustedUI;
+		}
+	else if(!capCaseValue.Compare(_L("protserv" )))
+		{
+		aCapabilityValue=ECapabilityProtServ;
+		}
+	else if(!capCaseValue.Compare(_L("diskadmin" )))
+		{
+		aCapabilityValue=ECapabilityDiskAdmin;
+		}
+	else if(!capCaseValue.Compare(_L("networkcontrol" )))
+		{
+		aCapabilityValue=ECapabilityNetworkControl;
+		}
+	else if(!capCaseValue.Compare(_L("allfiles" )))
+		{
+		aCapabilityValue=ECapabilityAllFiles;
+		}
+	else if(!capCaseValue.Compare(_L("swevent" )))
+		{
+		aCapabilityValue=ECapabilitySwEvent;
+		}
+	else if(!capCaseValue.Compare(_L("networkservices" )))
+		{
+		aCapabilityValue=ECapabilityNetworkServices;
+		}
+	else if(!capCaseValue.Compare(_L("localservices" )))
+		{
+		aCapabilityValue=ECapabilityLocalServices;
+		}
+	else if(!capCaseValue.Compare(_L("readuserdata" )))
+		{
+		aCapabilityValue=ECapabilityReadUserData;
+		}
+	else if(!capCaseValue.Compare(_L("writeuserdata")))
+		{
+		aCapabilityValue=ECapabilityWriteUserData;
+		}
+	else if(!capCaseValue.Compare(_L("location")))
+		{
+		aCapabilityValue=ECapabilityLocation;
+		}
+	else if(!capCaseValue.Compare(_L("none")))
+		{
+		aCapabilityValue=ECapability_None;
+		}
+	else
+		{
+		INFO_PRINTF2(_L("Unrecognised capability %S, will be rejected"), &capCaseValue);
+		ret=KErrNotFound;
+		}
+
+	return ret;
+	}
+
+
+/**
+ Verifies the given time is nearly equal to current UTC time.
+ @param aTime - Time needs to be verified 
+ @return TBool - Returns ETrue if aTime is nearly equal to current UTC 
+ time, otherwise EFalse
+ @leave - None
+*/
+EXPORT_C TBool CTestStepSmokeTest::VerifyUTCTime(TTime aTime)
+	{
+	TTime homeTime;
+	TTimeIntervalSeconds utcOffset;
+
+	homeTime.HomeTime();
+	homeTime.SecondsFrom(aTime, utcOffset);
+	INFO_PRINTF2(_L("Calculated utcOffset: %D"), utcOffset.Int());
+	if(Abs<TInt>(utcOffset.Int()) <= (User::UTCOffset().Int()+120) 
+		&& Abs<TInt>(utcOffset.Int()) >= (User::UTCOffset().Int()-120))
+		{
+		return ETrue;
+		}
+	else
+		{
+		return EFalse;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/bwins/SmokeTestSecureFSClientU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+	?ChangeLocaleName@RTestSecureFSclient@@QAEHABVTDesC16@@@Z @ 1 NONAME ; int RTestSecureFSclient::ChangeLocaleName(class TDesC16 const &)
+	?CheckForFile@RTestSecureFSclient@@QAEHABVTDesC16@@@Z @ 2 NONAME ; int RTestSecureFSclient::CheckForFile(class TDesC16 const &)
+	?Connect@RTestSecureFSclient@@QAEHXZ @ 3 NONAME ; int RTestSecureFSclient::Connect(void)
+	?CopyFile@RTestSecureFSclient@@QAEHABVTDesC16@@0@Z @ 4 NONAME ; int RTestSecureFSclient::CopyFile(class TDesC16 const &, class TDesC16 const &)
+	?DeleteFileL@RTestSecureFSclient@@QAEHABVTDesC16@@@Z @ 5 NONAME ; int RTestSecureFSclient::DeleteFileL(class TDesC16 const &)
+	?KillProcessL@RTestSecureFSclient@@QAEXABVTDesC16@@@Z @ 6 NONAME ; void RTestSecureFSclient::KillProcessL(class TDesC16 const &)
+	?SetHomeTime@RTestSecureFSclient@@QAEHABVTTime@@@Z @ 7 NONAME ; int RTestSecureFSclient::SetHomeTime(class TTime const &)
+	?SetUpFbs@RTestSecureFSclient@@QAEXXZ @ 8 NONAME ; void RTestSecureFSclient::SetUpFbs(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/bwins/SmokeTest_UtilsU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,23 @@
+EXPORTS
+	??0CTestProperty@@QAE@AAVCTestStep@@@Z @ 1 NONAME ; CTestProperty::CTestProperty(class CTestStep &)
+	??0CTestStepSmokeTest@@IAE@XZ @ 2 NONAME ; CTestStepSmokeTest::CTestStepSmokeTest(void)
+	??1CTestActive@@UAE@XZ @ 3 NONAME ; CTestActive::~CTestActive(void)
+	??1CTestProperty@@UAE@XZ @ 4 NONAME ; CTestProperty::~CTestProperty(void)
+	??1CTestStepSmokeTest@@UAE@XZ @ 5 NONAME ; CTestStepSmokeTest::~CTestStepSmokeTest(void)
+	??1CTestTimeOutTimer@@UAE@XZ @ 6 NONAME ; CTestTimeOutTimer::~CTestTimeOutTimer(void)
+	?Activate@CTestActive@@QAEXXZ @ 7 NONAME ; void CTestActive::Activate(void)
+	?GetCapability@CTestStepSmokeTest@@IAEHVTPtrC16@@AAW4TCapability@@@Z @ 8 NONAME ; int CTestStepSmokeTest::GetCapability(class TPtrC16, enum TCapability &)
+	?GetPropertyL@CTestProperty@@QAEHVTUid@@HAAH@Z @ 9 NONAME ; int CTestProperty::GetPropertyL(class TUid, int, int &)
+	?GetPropertyL@CTestProperty@@QAEHVTUid@@HAAVTDes16@@@Z @ 10 NONAME ; int CTestProperty::GetPropertyL(class TUid, int, class TDes16 &)
+	?GetPropertyL@CTestProperty@@QAEHVTUid@@HAAVTDes8@@@Z @ 11 NONAME ; int CTestProperty::GetPropertyL(class TUid, int, class TDes8 &)
+	?NewL@CTestActive@@SAPAV1@AAVMTestActiveCallback@@H@Z @ 12 NONAME ; class CTestActive * CTestActive::NewL(class MTestActiveCallback &, int)
+	?NewL@CTestTimeOutTimer@@SAPAV1@AAVMTestTimeOutTimerCallback@@H@Z @ 13 NONAME ; class CTestTimeOutTimer * CTestTimeOutTimer::NewL(class MTestTimeOutTimerCallback &, int)
+	?NewLC@CTestActive@@SAPAV1@AAVMTestActiveCallback@@H@Z @ 14 NONAME ; class CTestActive * CTestActive::NewLC(class MTestActiveCallback &, int)
+	?NewLC@CTestTimeOutTimer@@SAPAV1@AAVMTestTimeOutTimerCallback@@H@Z @ 15 NONAME ; class CTestTimeOutTimer * CTestTimeOutTimer::NewLC(class MTestTimeOutTimerCallback &, int)
+	?SetPropertyL@CTestProperty@@QAEHVTUid@@HABVTDesC16@@@Z @ 16 NONAME ; int CTestProperty::SetPropertyL(class TUid, int, class TDesC16 const &)
+	?SetPropertyL@CTestProperty@@QAEHVTUid@@HABVTDesC8@@@Z @ 17 NONAME ; int CTestProperty::SetPropertyL(class TUid, int, class TDesC8 const &)
+	?SetPropertyL@CTestProperty@@QAEHVTUid@@HH@Z @ 18 NONAME ; int CTestProperty::SetPropertyL(class TUid, int, int)
+	?VerifyUTCTime@CTestStepSmokeTest@@IAEHVTTime@@@Z @ 19 NONAME ; int CTestStepSmokeTest::VerifyUTCTime(class TTime)
+	?doTestStepPostambleL@CTestStepSmokeTest@@UAE?AW4TVerdict@@XZ @ 20 NONAME ; enum TVerdict CTestStepSmokeTest::doTestStepPostambleL(void)
+	?doTestStepPreambleL@CTestStepSmokeTest@@UAE?AW4TVerdict@@XZ @ 21 NONAME ; enum TVerdict CTestStepSmokeTest::doTestStepPreambleL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/eabi/SmokeTestSecureFSclientU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+	_ZN19RTestSecureFSclient11DeleteFileLERK7TDesC16 @ 1 NONAME
+	_ZN19RTestSecureFSclient11SetHomeTimeERK5TTime @ 2 NONAME
+	_ZN19RTestSecureFSclient12CheckForFileERK7TDesC16 @ 3 NONAME
+	_ZN19RTestSecureFSclient12KillProcessLERK7TDesC16 @ 4 NONAME
+	_ZN19RTestSecureFSclient16ChangeLocaleNameERK7TDesC16 @ 5 NONAME
+	_ZN19RTestSecureFSclient7ConnectEv @ 6 NONAME
+	_ZN19RTestSecureFSclient8CopyFileERK7TDesC16S2_ @ 7 NONAME
+	_ZN19RTestSecureFSclient8SetUpFbsEv @ 8 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/eabi/SmokeTest_UtilsU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,40 @@
+EXPORTS
+	_ZN11CTestActive4NewLER19MTestActiveCallbacki @ 1 NONAME
+	_ZN11CTestActive5NewLCER19MTestActiveCallbacki @ 2 NONAME
+	_ZN11CTestActive8ActivateEv @ 3 NONAME
+	_ZN11CTestActiveD0Ev @ 4 NONAME
+	_ZN11CTestActiveD1Ev @ 5 NONAME
+	_ZN11CTestActiveD2Ev @ 6 NONAME
+	_ZN13CTestProperty12GetPropertyLE4TUidiR5TDes8 @ 7 NONAME
+	_ZN13CTestProperty12GetPropertyLE4TUidiR6TDes16 @ 8 NONAME
+	_ZN13CTestProperty12GetPropertyLE4TUidiRi @ 9 NONAME
+	_ZN13CTestProperty12SetPropertyLE4TUidiRK6TDesC8 @ 10 NONAME
+	_ZN13CTestProperty12SetPropertyLE4TUidiRK7TDesC16 @ 11 NONAME
+	_ZN13CTestProperty12SetPropertyLE4TUidii @ 12 NONAME
+	_ZN13CTestPropertyC1ER9CTestStep @ 13 NONAME
+	_ZN13CTestPropertyC2ER9CTestStep @ 14 NONAME
+	_ZN13CTestPropertyD0Ev @ 15 NONAME
+	_ZN13CTestPropertyD1Ev @ 16 NONAME
+	_ZN13CTestPropertyD2Ev @ 17 NONAME
+	_ZN18CTestStepSmokeTest13GetCapabilityE7TPtrC16R11TCapability @ 18 NONAME
+	_ZN18CTestStepSmokeTest13VerifyUTCTimeE5TTime @ 19 NONAME
+	_ZN18CTestStepSmokeTest19doTestStepPreambleLEv @ 20 NONAME
+	_ZN18CTestStepSmokeTest20doTestStepPostambleLEv @ 21 NONAME
+	_ZN18CTestStepSmokeTestC2Ev @ 22 NONAME
+	_ZN18CTestStepSmokeTestD0Ev @ 23 NONAME
+	_ZN18CTestStepSmokeTestD1Ev @ 24 NONAME
+	_ZN18CTestStepSmokeTestD2Ev @ 25 NONAME
+	_ZN17CTestTimeOutTimer4NewLER25MTestTimeOutTimerCallbacki @ 26 NONAME
+	_ZN17CTestTimeOutTimer5NewLCER25MTestTimeOutTimerCallbacki @ 27 NONAME
+	_ZN17CTestTimeOutTimerD0Ev @ 28 NONAME
+	_ZN17CTestTimeOutTimerD1Ev @ 29 NONAME
+	_ZN17CTestTimeOutTimerD2Ev @ 30 NONAME
+	_ZTI11CTestActive @ 31 NONAME ; #<TI>#
+	_ZTI13CTestProperty @ 32 NONAME ; #<TI>#
+	_ZTI18CTestStepSmokeTest @ 33 NONAME ; #<TI>#
+	_ZTI17CTestTimeOutTimer @ 34 NONAME ; #<TI>#
+	_ZTV11CTestActive @ 35 NONAME ; #<VT>#
+	_ZTV13CTestProperty @ 36 NONAME ; #<VT>#
+	_ZTV18CTestStepSmokeTest @ 37 NONAME ; #<VT>#
+	_ZTV17CTestTimeOutTimer @ 38 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/group/SmokeTestSecureFSclient.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,32 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestSecureFSclient.mmp
+// 
+//
+
+TARGET			SmokeTestSecureFSclient.dll
+TARGETTYPE		dll
+CAPABILITY		All
+
+UID			0x1000008D  0x101FF347
+VENDORID 		0x70000001
+
+USERINCLUDE		..\Inc
+SYSTEMINCLUDE		\epoc32\include
+SYSTEMINCLUDE		\epoc32\include\test
+
+SOURCEPATH		..\src
+SOURCE			SmokeTestSecureFSclient.cpp
+
+LIBRARY			euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/group/SmokeTestSecureFSserver.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,36 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestSecureFSserver.mmp
+// 
+//
+
+
+UID			0x1000008D 0x101FF346
+VENDORID 0x70000001
+
+TARGET			SmokeTestSecureFSserver.exe
+TARGETTYPE		EXE
+CAPABILITY		ALL
+
+USERINCLUDE		..\Inc
+SYSTEMINCLUDE		\epoc32\include
+SYSTEMINCLUDE		\epoc32\include\test
+
+SOURCEPATH		..\SRC
+SOURCE			SmokeTestSecureFSserver.cpp
+
+SOURCEPATH .
+
+LIBRARY			euser.lib
+LIBRARY			efsrv.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/group/SmokeTest_Utils.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,50 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+#include "..\..\Group\Configuration.cfg"
+
+TARGET			SmokeTest_Utils.dll
+TARGETTYPE		dll
+UID           	0x1000008D 0x101FF341
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		All -TCB
+
+SOURCEPATH		..\Src
+
+SOURCE			SmokeTestTimeOutTimer.cpp
+SOURCE			SmokeTestActive.cpp
+SOURCE			TestStepSmokeTest.cpp
+SOURCE			SmokeTestProperty.cpp
+
+USERINCLUDE		..\Inc
+USERINCLUDE		..\..\Group
+
+SYSTEMINCLUDE	\epoc32\include
+SYSTEMINCLUDE	\epoc32\include\test
+
+LIBRARY			euser.lib
+LIBRARY			efsrv.lib
+LIBRARY			TestExecuteUtils.lib 
+LIBRARY			TestExecuteLogClient.lib
+LIBRARY			TestConfigFileParser.lib
+
+// We're quite heavy on the stack... 4k in WinS isn't enough...
+EPOCSTACKSIZE	0x6000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/Utils/group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Integration test system build description file for self test suite
+// 
+//
+
+PRJ_TESTEXPORTS
+// For Emulator
+../Inc/SmokeTestTimeOutTimer.h			/epoc32/include/test/smoketesttimeouttimer.h
+../Inc/SmokeTestActive.h					/epoc32/include/test/smoketestactive.h
+../Inc/TestStepSmokeTest.h			/epoc32/include/test/teststepsmoketest.h
+../Inc/SmokeTestProperty.h				/epoc32/include/test/smoketestproperty.h
+../Inc/SmokeTestSecureFSclientserver.h			/epoc32/include/test/smoketestsecurefsclientserver.h
+../Inc/SmokeTestSecureFSclient.h				/epoc32/include/test/smoketestsecurefsclient.h
+../Inc/SmokeTestSecureFSserver.h				/epoc32/include/test/smoketestsecurefsserver.h
+
+PRJ_TESTMMPFILES
+SmokeTestSecureFSclient.mmp
+SmokeTestSecureFSserver.mmp
+SmokeTest_Utils.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Group/Smoketest_Agenda.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,51 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+TARGET			Smoketest_Agenda_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7771
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+//CAPABILITY		WriteUserData ReadUserData
+CAPABILITY All -TCB
+
+
+SOURCEPATH		..\Src
+
+SOURCE			TestAgendaServer.cpp
+SOURCE			TestAgendaAddAppt.cpp
+SOURCE			TestAgendaBase.cpp
+SOURCE			TestAgendaCreateDB.cpp
+SOURCE			TestAgendaServerLaunchProgress.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			apparc.lib
+LIBRARY			euser.lib
+LIBRARY			calinterimapi.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,25 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For Agenda smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../Scripts/setup_Smoketest_Agenda.script	z:/smoketest/setup_smoketest_agenda.script
+../Scripts/Smoketest_Agenda.script			z:/smoketest/smoketest_agenda.script
+../TestData/Smoketest_Agenda.ini			z:/smoketest/smoketest_agenda.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Agenda.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Inc/TestAgendaAddAppt.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,37 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAgendaCreateDB.h
+// This contains CTestAgendaAddAppt
+// 
+//
+
+#ifndef TEST_AGENDA_ADD_APPT_H
+#define TEST_AGENDA_ADD_APPT_H
+
+#include "TestAgendaBase.h"
+
+class CTestAgendaAddAppt : public CTestAgendaBase
+{
+public:
+	CTestAgendaAddAppt();
+	virtual ~CTestAgendaAddAppt();
+
+public:
+	virtual enum TVerdict doTestStepL( void );
+
+private:
+	void	AddEntriesL( void );
+};
+
+#endif /* TEST_AGENDA_ADD_APPT_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Inc/TestAgendaBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,91 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaBase which is the base class for all
+// the Psd Agx suite test steps
+// 
+//
+
+#ifndef TEST_AGENDA_BASE_H
+#define TEST_AGENDA_BASE_H
+
+#include <TestExecuteStepBase.h>
+#include <calentryview.h>
+#include <gdi.h>
+
+
+
+//forward declarations
+class CCalSession;
+
+#define KMaxDateStringLength	30
+#define KMaxTimeStringLength	30
+
+#define KMaxDateStringLength	30
+#define KMaxTimeStringLength	30
+
+class CTestAgendaPicture :public MPictureFactory
+/**
+*  Picture class for the agenda model
+*/
+{
+/**************************************************************
+* An object of this class is used for setting the picture factory
+* of an Agenda model, although our code does not use any of the
+* functionality provided by this class, it is created with empty
+* implementation and set to satisfy the compiler as it uses
+* an assert macro to check if this object is set before saving
+* the agenda model entries into a file
+*************************************************************/
+
+public:
+	CTestAgendaPicture();
+	virtual ~CTestAgendaPicture();
+	virtual void NewPictureL(TPictureHeader& aHeader,const CStreamStore& aDeferredPictureStore)const;
+};
+
+
+class CTestAgendaBase : public CTestStep
+{
+public:
+	CTestAgendaBase();
+	~CTestAgendaBase();
+
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();
+
+	CCalSession& CTestAgendaBase::CalSession();
+	void SetCalEntryView(CCalEntryView* calEntryViewPtr);
+
+protected:
+	void	CreateDatabaseL();
+	void	OpenDatabaseL();
+	void	CleanupDatabase();
+
+private:
+	CActiveScheduler*	iSchedular;
+	TBool				iEnteredBlocked;
+	TBool				iExitedBlocked;
+
+protected:
+    RFs					iFs;
+	TBool				iSessionConnected;
+	CCalEntryView*      iCalEntryViewBase;
+	/**
+	To store the models entries
+	*/
+	CFileStore*			iStore;
+	CCalSession*        iCalSession;
+};
+
+#endif /* TEST_AGENDA_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Inc/TestAgendaCreateDB.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaCreateDB
+// 
+//
+
+#ifndef TEST_AGENDA_CREATE_DB_H
+#define TEST_AGENDA_CREATE_DB_H
+
+#include "TestAgendaBase.h"
+
+class CTestAgendaCreateDB : public CTestAgendaBase
+{
+public:
+	CTestAgendaCreateDB();
+	virtual ~CTestAgendaCreateDB();
+
+public:
+	virtual enum TVerdict doTestStepL( void );
+
+};
+
+#endif /* TEST_AGENDA_CREATE_DB_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Inc/TestAgendaServer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaServer
+// 
+//
+
+#ifndef TEST_AGENDA_SERVER_H
+#define TEST_AGENDA_SERVER_H
+
+#include <TestExecuteServerBase.h>
+
+class  CTestAgendaServer : public CTestServer
+{
+public:
+	static CTestAgendaServer*	NewL();
+	virtual CTestStep*			CreateTestStep(const TDesC& aStepName);
+
+private:
+	void	ConstructL();
+};
+
+#endif /* TEST_AGENDA_SERVER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Inc/TestAgendaServerLaunchProgress.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,75 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaServerLaunchProgress
+// 
+//
+
+#ifndef TEST_AGENDA_SERVER_LAUNCH_PROGRESS_H
+#define TEST_AGENDA_SERVER_LAUNCH_PROGRESS_H
+
+#include "TestAgendabase.h"
+#include <e32base.h>
+#include <calprogresscallback.h>
+
+
+//forward declaration
+//class CTestAgendaBase;
+class CCalEntryView;
+
+
+class CTestAgendaServerLaunchProgress : public CActive, private MCalProgressCallBack
+/**
+* This class provides an implementationfor the pure virtual functions
+* declared in MAgnProgressCallBack. The framework  makes calls to the
+* functions indidcating the status of the operation.
+*/
+{
+public:
+	static CTestAgendaServerLaunchProgress* NewL(CTestAgendaBase* aAgendaBase);
+	virtual ~CTestAgendaServerLaunchProgress();
+	void	Start();
+
+	//from CActive
+	virtual void	RunL();
+	virtual void	DoCancel();
+
+private:
+	CTestAgendaServerLaunchProgress(CTestAgendaBase* aAgendaBase);
+	void	ConstructL();
+
+	//from MAgnProgressCallBack
+	virtual void	Completed(TInt aError = KErrNone);
+	virtual void	Progress(TInt aPercentageCompleted);
+	virtual TBool NotifyProgress();
+
+private:
+	/**
+	pointer to the CTestAgendaBase object.
+	*/
+	CTestAgendaBase*			iAgendaBase;
+    CCalEntryView*              iCalEntryView;
+
+	/**
+	file in which the entries are present
+	*/
+	TPtrC						iFileName;
+
+	/**
+	file server session
+	*/
+	RFs							iFs;
+
+};
+
+#endif TEST_AGENDA_SERVER_LAUNCH_PROGRESS_H
Binary file common/tools/ats/smoketest/agenda/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Scripts/Smoketest_Agenda.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Agenda smoketest
+//
+LOAD_SUITE Smoketest_Agenda_Server
+//
+START_TESTCASE 8981
+RUN_TEST_STEP 100	Smoketest_Agenda_Server	CreateDB	c:\Smoketest\Smoketest_Agenda.ini	18920_CreateDB
+END_TESTCASE 8981
+START_TESTCASE 8979
+RUN_TEST_STEP 1000	Smoketest_Agenda_Server	AddAppt		c:\Smoketest\Smoketest_Agenda.ini	24560_AddAppts
+END_TESTCASE 8979
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Scripts/setup_Smoketest_Agenda.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\Smoketest\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_agenda.ini	c:\smoketest\smoketest_agenda.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_agenda.ini
+
+// RUN_SCRIPT Smoketest_Agenda.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Src/TestAgendaAddAppt.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,191 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaAddAppt
+// 
+//
+
+#include <TestExecuteClient.h>
+#include <calentry.h>
+#include <calalarm.h> 
+
+
+#include "TestAgendaAddAppt.h"
+
+_LIT(KCount,		"count");
+_LIT(KYear,			"year%d");
+_LIT(KMonth,		"month%d");
+_LIT(KDay,			"day%d");
+_LIT(KHour,			"hour%d");
+_LIT(KMinute,		"min%d");
+_LIT(KDuration,		"duration%d");
+_LIT(KMessage,		"message%d");
+_LIT(KAlarm,		"alarm%d");
+_LIT(KAlarmSound,	"alarmsound%d");
+
+// constructor
+CTestAgendaAddAppt::CTestAgendaAddAppt()
+	{
+	SetTestStepName(_L("AddAppt"));
+	}
+
+// destructor
+CTestAgendaAddAppt::~CTestAgendaAddAppt()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAgendaAddAppt::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> ADDING APPOINTMENT ENTRIES"));
+
+	OpenDatabaseL();
+	if ( TestStepResult() == EPass )
+		{
+		TRAPD(r, AddEntriesL());
+		if (r!=KErrNone)
+			SetTestStepResult(EFail);
+		}
+	CleanupDatabase();
+
+	// test steps return a result
+	return TestStepResult();
+	}
+	
+// Destroy the RPointerArray
+void DestroyRPointerArray(TAny* aPtr)
+        {
+        RPointerArray<CCalEntry>* self = static_cast<RPointerArray<CCalEntry>*> (aPtr);
+        self->ResetAndDestroy();
+        }
+
+
+void CTestAgendaAddAppt::AddEntriesL( void )
+	{
+	TInt	count=1;
+	if ( !GetIntFromConfig(ConfigSection(), KCount, count) )
+		count=1;
+
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	TInt	year;
+	TInt	month;
+	TInt	day;
+	TInt	hour;
+	TInt	minute;
+	TInt	duration;
+	TInt	alarm;
+	TPtrC	ptrAlarmSound;
+	TPtrC	ptrMessage;
+	TBuf<KMaxDateStringLength> dateString;
+	_LIT(KDateString,"%*E%*D%X%*N%*Y %1 %2 '%3");
+
+	RPointerArray<CCalEntry> array;
+    CleanupStack::PushL(TCleanupItem(DestroyRPointerArray, &array));
+
+	for (TInt entry=0; entry<count && TestStepResult() == EPass; )
+		{
+		TTime	today;
+		today.HomeTime();
+
+		tempStore.Format(KYear(), ++entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, year) )
+			year=today.DateTime().Year();
+
+		tempStore.Format(KMonth(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, month) )
+			month=today.DateTime().Month();
+
+		tempStore.Format(KDay(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, day) )
+			day=today.DateTime().Day();
+		else
+			--day;
+
+		tempStore.Format(KHour(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, hour) )
+			hour=today.DateTime().Hour();
+
+		tempStore.Format(KMinute(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, minute) )
+			minute=0;
+
+		tempStore.Format(KDuration(), entry);
+		if ( !GetIntFromConfig(ConfigSection(), tempStore, duration) )
+			duration=30;
+
+		tempStore.Format(KMessage(), entry);
+		GetStringFromConfig(ConfigSection(), tempStore, ptrMessage);
+
+		TTime		startTime(TDateTime(year, TMonth(month-1+EJanuary), day, hour, minute,0,0));
+		startTime.FormatL(dateString,KDateString);
+	  	INFO_PRINTF2(_L("Start date is  %S"), &dateString);
+
+		TTime		endTime = startTime + TTimeIntervalMinutes(duration);
+		endTime.FormatL(dateString,KDateString);
+	  	INFO_PRINTF2(_L("End date is  %S"), &dateString);
+
+		
+		HBufC8* uid = HBufC8::NewLC(255);
+		TPtr8 uidP = uid->Des();
+		uidP.Append(count);
+		
+		CCalEntry* calEntry = CCalEntry::NewL(CCalEntry::EAppt, uid, CCalEntry::EMethodNone, 0);
+		
+		CleanupStack::Pop(); //uid
+		CleanupStack::PushL(calEntry);
+		
+		TCalTime calStartTime, calEndTime;
+		
+		calStartTime.SetTimeLocalL(startTime);
+		calEndTime.SetTimeLocalL(endTime);
+		
+		calEntry->SetStartAndEndTimeL(calStartTime, calEndTime);
+		
+		tempStore.Format(KAlarm(), entry);
+		if ( GetIntFromConfig(ConfigSection(), tempStore, alarm) )
+			{
+			TTimeIntervalMinutes	currentTime((hour*60) + minute);
+			TTimeIntervalMinutes	alarmTime(currentTime.Int());
+			
+			CCalAlarm* calAlarm = CCalAlarm::NewL();
+			CleanupStack::PushL(calAlarm);
+			
+			calAlarm->SetTimeOffset(alarmTime);
+			
+			tempStore.Format(KAlarmSound(), entry);
+			if ( GetStringFromConfig(ConfigSection(), tempStore, ptrAlarmSound) )
+				calAlarm->SetAlarmSoundNameL(ptrAlarmSound);
+			else
+				calAlarm->SetAlarmSoundNameL(_L("Bells"));
+			
+			calEntry->SetAlarmL(calAlarm);
+			CleanupStack::PopAndDestroy(); //calAlarm
+			}
+		//Store in the array
+		array.AppendL(calEntry);
+		
+		CleanupStack::Pop(); //calEntry
+		}
+		INFO_PRINTF1(_L("About to store appointments now"));
+		TInt success(0);
+		TRAPD(storeError, iCalEntryViewBase->StoreL(array, success));
+		INFO_PRINTF2(_L("Store result is %d"), storeError);
+		if (success != count && storeError == KErrNone)
+		    {
+			SetTestStepResult(EFail);
+		    } 
+		
+		CleanupStack::PopAndDestroy(&array);
+		
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Src/TestAgendaBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,223 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaCase which is the base class for all the Agenda TestCase DLL
+// 
+//
+
+// EPOC includes
+#include <e32base.h>
+#include <Uri16.h>
+#include <UriUtils.h>
+#include <TestExecuteLog.h>
+#include "TestAgendabase.h"
+#include "TestAgendaServerLaunchProgress.h"
+
+#include <calsession.h>
+
+
+
+_LIT(KDef,		"default");
+_LIT(KFileName,		"filenameSecure");
+
+void CTestAgendaPicture::NewPictureL(TPictureHeader& /*aHeader*/,const CStreamStore& /*aDeferredPictureStore*/)const
+/**
+Creates a new Picture object for use by agenda model, currently the implementation is empty as our code
+does not use any the functionality.
+*/
+	{
+	//empty implementation
+	}
+
+CTestAgendaPicture::CTestAgendaPicture()
+/**
+constructor, currently the implementation is empty
+*/
+	{
+	//empty implementation
+	}
+
+CTestAgendaPicture::~CTestAgendaPicture()
+/**
+destructor, currently the implementation is empty
+*/
+	{
+	//empty implementation
+	}
+
+CTestAgendaBase::CTestAgendaBase()
+: CTestStep()
+, iSchedular(NULL)
+, iEnteredBlocked(EFalse)
+, iExitedBlocked(EFalse)
+, iSessionConnected(EFalse)
+, iCalEntryViewBase(NULL)
+, iStore(NULL)
+, iCalSession(NULL)
+	{
+	}
+
+// destructor
+CTestAgendaBase::~CTestAgendaBase()
+	{
+	delete iSchedular;
+	iSchedular=NULL;
+	
+	}
+
+enum TVerdict CTestAgendaBase::doTestStepPreambleL()
+	{
+	TVerdict	ret = CTestStep::doTestStepPreambleL();
+	
+	INFO_PRINTF1(_L("doTestStepPreambleL"));
+	iSchedular=new (ELeave) CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+	
+	iCalSession = CCalSession::NewL();
+
+	return ret;
+	}
+
+enum TVerdict CTestAgendaBase::doTestStepPostambleL()
+	{
+	
+	delete iCalEntryViewBase;
+	iCalEntryViewBase=NULL;
+	
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+	
+
+	return CTestStep::doTestStepPostambleL();
+	}
+
+// Create a new database
+void CTestAgendaBase::CreateDatabaseL( void )
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName, ptrFileName);
+	if ( !returnValue )
+		returnValue=GetStringFromConfig(KDef, KFileName, ptrFileName);
+	
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		}
+	else
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	//	Connect file server
+	User::LeaveIfError(iFs.Connect());
+	iSessionConnected=ETrue;
+	
+	TInt r;
+	if (iCalSession)
+	    {
+		TRAP(r, iCalSession->CreateCalFileL(ptrFileName));
+	    }
+	    
+	if (r == KErrAlreadyExists)
+	    {
+		TRAP_IGNORE(iCalSession->DeleteCalFileL(ptrFileName));
+		TRAP(r, iCalSession->CreateCalFileL(ptrFileName));
+	    }
+
+        
+	if (r!=KErrNone && r!=KErrAlreadyExists)
+		{
+		ERR_PRINTF2(_L("Creating Agenda file failed with error %d"), r);
+		SetTestStepResult(EFail);
+		}
+	}
+
+void CTestAgendaBase::OpenDatabaseL( void )
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName, ptrFileName);
+	if ( !returnValue )
+		returnValue=GetStringFromConfig(KDef, KFileName, ptrFileName);
+	
+
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		}
+	else
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	//	Connect file server
+	User::LeaveIfError(iFs.Connect());
+	iSessionConnected=ETrue;
+
+    
+	if (iCalSession)
+	    {
+		iCalSession->OpenL(ptrFileName);
+	    }	
+    
+	//open the database by creating an object of CTestAgendaServerLaunchProgress
+	CTestAgendaServerLaunchProgress*	progress = CTestAgendaServerLaunchProgress::NewL(this);
+	CleanupStack::PushL(progress);
+
+	//kick start the launching process
+	progress->Start();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(progress);
+
+	}
+
+void CTestAgendaBase::CleanupDatabase( void )
+	{
+	if (iCalEntryViewBase)
+	    {
+		delete iCalEntryViewBase;
+		iCalEntryViewBase = NULL;
+	    }
+
+/*	if (iCalSession)
+		{
+		delete iCalSession;
+		iCalSession=NULL;
+		}*/
+
+
+	if (iSessionConnected)
+		{
+		iFs.Close();
+		iSessionConnected=EFalse;
+		}
+	}
+	
+void CTestAgendaBase::SetCalEntryView(CCalEntryView* calEntryViewPtr)
+    {
+	iCalEntryViewBase = calEntryViewPtr;
+    }
+
+CCalSession& CTestAgendaBase::CalSession()
+    {
+	if (iCalSession)
+	    {
+		return *iCalSession;
+	    }
+	else
+	    {
+	    iCalSession = CCalSession::NewL();
+	    
+	    return *iCalSession;	
+	    }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Src/TestAgendaCreateDB.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,43 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaCreateDB
+// 
+//
+
+#include <TestExecuteLog.h>
+
+#include "TestAgendaCreateDB.h"
+
+// constructor
+CTestAgendaCreateDB::CTestAgendaCreateDB()
+	{
+	SetTestStepName(_L("CreateDB"));
+	}
+
+// destructor
+CTestAgendaCreateDB::~CTestAgendaCreateDB()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAgendaCreateDB::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> CREATING OUR AGENDA DATABASE"));
+
+	CreateDatabaseL();
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Src/TestAgendaServer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,107 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This main DLL entry point for the Smoketest_Agenda.dll
+// 
+//
+
+
+// EPOC includes
+#include <e32base.h>
+
+#include "TestAgendaServer.h"
+#include "TestAgendaAddAppt.h"
+#include "TestAgendaCreateDB.h"
+
+
+_LIT(KServerName,"Smoketest_Agenda_Server");
+
+CTestAgendaServer* CTestAgendaServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestAgendaServer*	server = new (ELeave) CTestAgendaServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestAgendaServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestAgendaServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+CTestStep* CTestAgendaServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep*	testStep = NULL;
+
+	if(aStepName == _L("AddAppt"))
+		testStep = new CTestAgendaAddAppt();
+	else if(aStepName == _L("CreateDB"))
+		testStep = new CTestAgendaCreateDB(); 
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Src/TestAgendaServerLaunchProgress.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,119 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAgendaServerLaunchProgress
+// 
+//
+
+#include "TestAgendaServerLaunchProgress.h"
+#include <calentryview.h>
+
+CTestAgendaServerLaunchProgress* CTestAgendaServerLaunchProgress::NewL(CTestAgendaBase* aAgendaBase)
+/**
+ * @return - Instance of the agenda progress callback
+ */
+	{
+	CTestAgendaServerLaunchProgress*	progress = new (ELeave) CTestAgendaServerLaunchProgress(aAgendaBase);
+	CleanupStack::PushL(progress);
+	progress->ConstructL();
+	CleanupStack::Pop(progress);
+	return progress;
+	}
+
+CTestAgendaServerLaunchProgress::CTestAgendaServerLaunchProgress(CTestAgendaBase* aAgendaBase)
+:	CActive(EPriorityStandard)
+,	iAgendaBase(aAgendaBase)
+/**
+constructor
+*/
+	{
+	}
+
+void CTestAgendaServerLaunchProgress::ConstructL()
+/**
+constructor
+*/
+	{
+	//adding this active object into an active scheduler
+	CActiveScheduler::Add(this);
+	}
+
+CTestAgendaServerLaunchProgress::~CTestAgendaServerLaunchProgress()
+/**
+destructor
+*/
+	{
+ 	}
+
+void CTestAgendaServerLaunchProgress::Completed(TInt aError)
+/**
+callback function invoked after the file is completely loaded.
+@param	TInt aError
+*/
+	{
+	if(aError != KErrNone)
+		{
+		iAgendaBase ->INFO_PRINTF2(_L("Opening the agenda database file failed with error %D"),aError);
+		iAgendaBase ->SetTestStepResult(EFail);
+		}
+	else
+		{
+		iAgendaBase ->INFO_PRINTF1(_L("Opening the Agenda database succesful"));
+		}
+		CActiveScheduler::Stop();
+	}
+
+void CTestAgendaServerLaunchProgress::Progress(TInt aPercentageCompleted)
+/**
+callback function invoked to indicate the progress
+@param aPercentageCompleted percent file loaded
+*/
+	{
+	//log the progress percentage of saving the entries
+	iAgendaBase ->INFO_PRINTF2(_L("%D%% completed opening the agenda database"),aPercentageCompleted);
+	}
+
+TBool CTestAgendaServerLaunchProgress::NotifyProgress()
+    {
+	return ETrue;
+    }
+    
+void CTestAgendaServerLaunchProgress::RunL()
+/**
+RunL from CActive class, opens the agenda database file, and builds the indices
+@leave system wide error code
+*/
+	{
+	CCalEntryView* calEntryViewPtr = CCalEntryView::NewL(iAgendaBase->CalSession(), *this);
+	iAgendaBase->SetCalEntryView(calEntryViewPtr);
+	}
+
+void CTestAgendaServerLaunchProgress::DoCancel()
+/**
+DoCancel of the active object
+*/
+	{
+	iAgendaBase ->INFO_PRINTF1(_L("Inside do cancel of the active object"));
+	}
+
+
+void CTestAgendaServerLaunchProgress::Start(void)
+/**
+starts the saving process
+*/
+	{
+	TRequestStatus *threadStatus=&iStatus;
+	User::RequestComplete(threadStatus,KErrNone);
+	SetActive();
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/Src/sm_agenda.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,1 @@
+[Files MRU]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/TestData/Smoketest_Agenda.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,35 @@
+[default]
+filename		=c:\smoketest\Smoketest_Agenda
+filenameSecure		=c:Smoketest_Agenda
+
+[18920_CreateDB]
+
+[24560_AddAppts]
+count			=3
+
+year1			=2002
+month1			=9
+day1			=15
+hour1			=9
+min1			=0
+duration1		=15
+message1		=make a cup of tea
+
+year2			=2002
+month2			=9
+day2			=16
+hour2			=14
+min2			=0
+duration2		=60
+message2		=football
+alarm2			=15
+
+year3			=2002
+month3			=9
+day3			=15
+hour3			=12
+min3			=0
+duration3		=30
+message3		=have lunch
+alarm3			=15
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/agenda/bwins/SMOKETEST_AGENDA_SERVERU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,24 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For Agenda smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+..\scripts\setup_smoketest_apploader.script	z:\smoketest\setup_smoketest_apploader.script
+..\scripts\smoketest_apploader.script		z:\smoketest\smoketest_apploader.script
+..\testdata\smoketest_apploader.ini			z:\smoketest\smoketest_apploader.ini
+
+PRJ_TESTMMPFILES
+smoketest_apploader.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Group/smoketest_apploader.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,53 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+
+TARGET          smoketest_apploader.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7776
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		All -TCB
+
+
+SOURCEPATH		..\Src
+
+SOURCE			TestAppLoaderServer.cpp
+SOURCE			TestAppLoaderBase.cpp
+SOURCE			TestAppLoaderAppStart.cpp
+SOURCE			TestAppLoaderEndTask.cpp
+SOURCE			TestAppLoaderKillProcess.cpp
+SOURCE			TestAppLoaderTaskRunning.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			apparc.lib
+LIBRARY			euser.lib
+LIBRARY			etext.lib
+LIBRARY			estor.lib
+LIBRARY			efsrv.lib
+LIBRARY			apgrfx.lib
+LIBRARY			ws32.lib
+LIBRARY			cone.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Inc/TestAppLoaderAppStart.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderAppStart.h
+// This contains CTestAppLoaderAppStart
+// 
+//
+
+#ifndef TEST_APP_LOADER_APP_START_H
+#define TEST_APP_LOADER_APP_START_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderAppStart : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderAppStart();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_APP_START_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Inc/TestAppLoaderBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,34 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderBase which is the base class for all
+// the Psd Agx suite test steps
+// 
+//
+
+#ifndef TEST_APP_LOADER_BASE_H
+#define TEST_APP_LOADER_BASE_H
+
+#include <TestExecuteStepBase.h>
+
+class CTestAppLoaderBase : public CTestStep
+	{
+public:
+	CTestAppLoaderBase();
+	~CTestAppLoaderBase();
+
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();
+	};
+
+#endif /* TEST_APP_LOADER_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Inc/TestAppLoaderEndTask.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderEndTask.h
+// This contains CTestAppLoaderEndTask
+// 
+//
+
+#ifndef TEST_APP_LOADER_END_TASK_H
+#define TEST_APP_LOADER_END_TASK_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderEndTask : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderEndTask();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_END_TASK_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Inc/TestAppLoaderKillProcess.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderKillProcess.h
+// This contains CTestAppLoaderKillProcess
+// 
+//
+
+#ifndef TEST_APP_LOADER_KILL_PROCESS_H
+#define TEST_APP_LOADER_KILL_PROCESS_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderKillProcess : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderKillProcess();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_KILL_PROCESS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Inc/TestAppLoaderServer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderServer
+// 
+//
+
+#ifndef TEST_APP_LOADER_SERVER_H
+#define TEST_APP_LOADER_SERVER_H
+
+#include <TestExecuteServerBase.h>
+
+class  CTestAppLoaderServer : public CTestServer
+{
+public:
+	static CTestAppLoaderServer*	NewL();
+	~CTestAppLoaderServer();
+	virtual CTestStep*				CreateTestStep(const TDesC& aStepName);
+
+private:
+	CTestAppLoaderServer();
+	void	ConstructL();
+};
+
+#endif /* TEST_APP_LOADER_SERVER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Inc/TestAppLoaderTaskRunning.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestAppLoaderEndTask.h
+// This contains CTestAppLoaderTaskRunning
+// 
+//
+
+#ifndef TEST_APP_LOADER_TASK_RUNNING_H
+#define TEST_APP_LOADER_TASK_RUNNING_H
+
+// User includes
+#include "TestAppLoaderBase.h"
+
+class CTestAppLoaderTaskRunning : public CTestAppLoaderBase
+	{
+public:
+	CTestAppLoaderTaskRunning();
+
+	virtual enum TVerdict doTestStepL( void );
+	};
+
+#endif /* TEST_APP_LOADER_TASK_RUNNING_H */
Binary file common/tools/ats/smoketest/apploader/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Src/TestAppLoaderAppStart.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,74 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderAppStart
+// 
+//
+
+// USER includes
+#include "TestAppLoaderAppStart.h"
+
+// EPOC includes
+#include <apacmdln.h>
+#include <apgcli.h>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Error messages
+_LIT(KErrCode,					"Error %d");
+_LIT(KErrMissingParameter ,		"Misssing Parameter %S");
+/*@}*/
+
+// constructor
+CTestAppLoaderAppStart::CTestAppLoaderAppStart()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("AppStart"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderAppStart::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> APP START"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		RApaLsSession		apaLsSession;
+		User::LeaveIfError(apaLsSession.Connect());
+		CleanupClosePushL(apaLsSession);
+
+		CApaCommandLine*	cmdLine=CApaCommandLine::NewLC();
+		cmdLine->SetExecutableNameL(program);
+		cmdLine->SetCommandL(EApaCommandRun);
+
+		TInt	err=apaLsSession.StartApp(*cmdLine);
+		if ( err!=KErrNone )
+			{
+			ERR_PRINTF2(KErrCode, err);
+			SetTestStepError(err);
+			}
+		CleanupStack::PopAndDestroy(2, &apaLsSession);
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Src/TestAppLoaderBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,39 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderBase which is the base class for all the AppLoader TestCase DLL
+// 
+//
+
+// USER includes
+#include "TestAppLoaderBase.h"
+
+CTestAppLoaderBase::CTestAppLoaderBase()
+	{
+	}
+
+// destructor
+CTestAppLoaderBase::~CTestAppLoaderBase()
+	{
+	}
+
+enum TVerdict CTestAppLoaderBase::doTestStepPreambleL()
+	{
+	TVerdict	ret = CTestStep::doTestStepPreambleL();
+	return ret;
+	}
+
+enum TVerdict CTestAppLoaderBase::doTestStepPostambleL()
+	{
+	return CTestStep::doTestStepPostambleL();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Src/TestAppLoaderEndTask.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,140 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderEndTask
+// 
+//
+
+// USER includes
+#include "TestAppLoaderEndTask.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <apgwgnam.H>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Log messages
+_LIT(KLogTask,					"Caption '%S'.");
+
+/// Error messages
+_LIT(KErrCode,					"Error %d");
+_LIT(KErrMissingParameter,		"Misssing Parameter %S");
+_LIT(KErrTaskNotFound,			"Task '%S' not found");
+/*@}*/
+
+// constructor
+CTestAppLoaderEndTask::CTestAppLoaderEndTask()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("EndTask"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderEndTask::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> END TASK"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		RApaLsSession	apaLsSession;
+		User::LeaveIfError(apaLsSession.Connect());
+		CleanupClosePushL(apaLsSession);
+	    User::LeaveIfError(apaLsSession.GetAllApps());
+
+		RWsSession	ws;
+		User::LeaveIfError(ws.Connect());
+		CleanupClosePushL(ws);
+		
+	    TInt					numWindowGroups = ws.NumWindowGroups();
+	    CArrayFixFlat<TInt>*	windowGroupList = new(ELeave) CArrayFixFlat<TInt>(numWindowGroups);
+	    CleanupStack::PushL(windowGroupList);
+
+	    // Populate array with current group list ids
+	    User::LeaveIfError(ws.WindowGroupList(windowGroupList));
+
+	    CApaWindowGroupName*	windowGroupName = CApaWindowGroupName::NewLC(ws);
+
+	    /* Note: we use windowGroupList->Count() instead of numWindowGroups, as in the middle of the
+	     * update the list could change in length (or worse, be reduced) thus producing an out of bounds
+	     * error if numWindowGroups were used
+	     */
+	    TBool	searching=ETrue;
+	    for ( TInt i=0; (i<windowGroupList->Count()) && searching; ++i )
+	    	{
+	        TInt	wgId = windowGroupList->At(i);
+	        windowGroupName->ConstructFromWgIdL(wgId);
+
+	        TUid	appUid = windowGroupName->AppUid();
+
+	        TApaAppInfo	appInfo;
+	        HBufC* 		appCaption = NULL;
+	        // Some applications, like midlets, may not provide any info
+	        if (apaLsSession.GetAppInfo(appInfo, appUid) == KErrNone)
+	        	{
+	            appCaption = appInfo.iCaption.AllocL();
+	        	}
+	        else
+	        	{
+	            appCaption = windowGroupName->Caption().AllocL();
+	        	}
+            CleanupStack::PushL(appCaption);
+
+	        // Only list 'visible' applications
+	        if ( appCaption->Length() )
+	        	{
+	            TPtrC	caption=*appCaption;
+		        INFO_PRINTF2(KLogTask, &caption);
+
+		        if ( program.CompareC(caption)==0 )
+		        	{
+					searching=EFalse;
+					TApaTask	task(ws);
+					task.SetWgId(wgId);
+					if (task.Exists())
+						{
+						task.EndTask();
+						}
+					else
+						{
+						ERR_PRINTF2(KErrTaskNotFound, &program);
+						SetTestStepResult(EFail);
+						}
+		        	}
+				}
+            CleanupStack::Pop(1, appCaption); // taskEntry, appCaption
+	    	}
+
+	    if ( searching )
+	    	{
+			ERR_PRINTF2(KErrTaskNotFound, &program);
+			SetTestStepResult(EFail);
+	    	}
+	    CleanupStack::PopAndDestroy(4, &apaLsSession);    // windowGroupName, windowGroupList
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Src/TestAppLoaderKillProcess.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,90 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderKillProcess
+// 
+//
+
+// USER includes
+#include "TestAppLoaderKillProcess.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <apgwgnam.H>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Log messages
+_LIT(KLogProcess,				"Process '%S'.");
+
+/// Error messages
+_LIT(KErrMissingParameter,		"Misssing Parameter %S");
+_LIT(KErrProcessNotFound,		"Process '%S' not found");
+/*@}*/
+
+// constructor
+CTestAppLoaderKillProcess::CTestAppLoaderKillProcess()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("KillProcess"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderKillProcess::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> KILL PROCESS"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+	    TFindProcess	findProcess;
+	    TFullName		currentProcessName;
+	    RProcess		process;
+	    TBool			searching=ETrue;
+	    while ( (findProcess.Next(currentProcessName)==KErrNone) && searching )
+	    	{
+	        User::LeaveIfError(process.Open(currentProcessName));
+	        CleanupClosePushL(process);
+
+	        HBufC*	fileName = process.FileName().AllocLC();
+
+	        TPtrC	name=*fileName;
+	        INFO_PRINTF2(KLogProcess, &name);
+	        if ( program.CompareC(name)==0 )
+	        	{
+	        	searching=EFalse;
+	        	process.Kill(0);
+	        	}
+	        CleanupStack::PopAndDestroy(2, &process);   // cmdLine, fileName, process
+			}
+	    if ( searching )
+	    	{
+	        ERR_PRINTF2(KErrProcessNotFound, &program);
+			SetTestStepResult(EFail);
+	    	}
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Src/TestAppLoaderServer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,132 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This main DLL entry point for the Smoketest_AppLoader.dll
+// 
+//
+
+// USER includes
+#include "TestAppLoaderServer.h"
+#include "TestAppLoaderAppStart.h"
+#include "TestAppLoaderKillProcess.h"
+#include "TestAppLoaderEndTask.h"
+#include "TestAppLoaderTaskRunning.h"
+
+/*@{*/
+_LIT(KServerName,	"smoketest_apploader");
+/*@}*/
+
+CTestAppLoaderServer* CTestAppLoaderServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestAppLoaderServer*	server = new (ELeave) CTestAppLoaderServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->ConstructL();
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+CTestAppLoaderServer::CTestAppLoaderServer()
+	:	CTestServer()
+	{
+	}
+
+void CTestAppLoaderServer::ConstructL()
+	{
+	}
+
+CTestAppLoaderServer::~CTestAppLoaderServer()
+	{
+	}
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*		sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestAppLoaderServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestAppLoaderServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+CTestStep* CTestAppLoaderServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep*	testStep = NULL;
+
+	if(aStepName == _L("AppStart"))
+		{
+		testStep = new CTestAppLoaderAppStart();
+		}
+	else if(aStepName == _L("KillProcess"))
+		{
+		testStep = new CTestAppLoaderKillProcess();
+		}
+	else if(aStepName == _L("EndTask"))
+		{
+		testStep = new CTestAppLoaderEndTask();
+		}
+	else if(aStepName == _L("TaskRunning"))
+		{
+		testStep = new CTestAppLoaderTaskRunning();
+		}
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/Src/TestAppLoaderTaskRunning.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,136 @@
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestAppLoaderTaskRunning
+// 
+//
+
+// USER includes
+#include "TestAppLoaderTaskRunning.h"
+
+// EPOC includes
+#include <w32std.h>
+#include <coemain.h>
+#include <apgtask.h>
+#include <apgcli.h>
+#include <apgwgnam.H>
+
+/*@{*/
+/// Parameters
+_LIT(KProgram,					"program");
+
+/// Log messages
+_LIT(KLogTask,					"Caption '%S'.");
+
+/// Error messages
+_LIT(KErrCode,					"Error %d");
+_LIT(KErrMissingParameter,		"Misssing Parameter %S");
+_LIT(KErrTaskNotFound,			"Task '%S' not found");
+/*@}*/
+
+// constructor
+CTestAppLoaderTaskRunning::CTestAppLoaderTaskRunning()
+:	CTestAppLoaderBase()
+	{
+	SetTestStepName(_L("TaskRunning"));
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestAppLoaderTaskRunning::doTestStepL( void )
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("TEST-> TASK RUNNING"));
+
+	TPtrC	program;
+	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
+		{
+		ERR_PRINTF2(KErrMissingParameter, &KProgram());
+		SetTestStepResult(EFail);
+		}
+	else
+		{
+		RApaLsSession	apaLsSession;
+		User::LeaveIfError(apaLsSession.Connect());
+		CleanupClosePushL(apaLsSession);
+	    User::LeaveIfError(apaLsSession.GetAllApps());
+
+		RWsSession	ws;
+		User::LeaveIfError(ws.Connect());
+		CleanupClosePushL(ws);
+		
+	    TInt					numWindowGroups = ws.NumWindowGroups();
+	    CArrayFixFlat<TInt>*	windowGroupList = new(ELeave) CArrayFixFlat<TInt>(numWindowGroups);
+	    CleanupStack::PushL(windowGroupList);
+
+	    // Populate array with current group list ids
+	    User::LeaveIfError(ws.WindowGroupList(windowGroupList));
+
+	    CApaWindowGroupName*	windowGroupName = CApaWindowGroupName::NewLC(ws);
+
+	    /* Note: we use windowGroupList->Count() instead of numWindowGroups, as in the middle of the
+	     * update the list could change in length (or worse, be reduced) thus producing an out of bounds
+	     * error if numWindowGroups were used
+	     */
+	    TBool	searching=ETrue;
+	    for ( TInt i=0; (i<windowGroupList->Count()) && searching; ++i )
+	    	{
+	        TInt	wgId = windowGroupList->At(i);
+	        windowGroupName->ConstructFromWgIdL(wgId);
+
+	        TUid	appUid = windowGroupName->AppUid();
+
+	        TApaAppInfo	appInfo;
+	        HBufC* 		appCaption = NULL;
+	        // Some applications, like midlets, may not provide any info
+	        if (apaLsSession.GetAppInfo(appInfo, appUid) == KErrNone)
+	        	{
+	            appCaption = appInfo.iCaption.AllocL();
+	        	}
+	        else
+	        	{
+	            appCaption = windowGroupName->Caption().AllocL();
+	        	}
+            CleanupStack::PushL(appCaption);
+
+	        // Only list 'visible' applications
+	        if ( appCaption->Length() )
+	        	{
+	            TPtrC	caption=*appCaption;
+		        INFO_PRINTF2(KLogTask, &caption);
+
+		        if ( program.CompareC(caption)==0 )
+		        	{
+					searching=EFalse;
+					TApaTask	task(ws);
+					task.SetWgId(wgId);
+					if (!task.Exists())
+						{
+						ERR_PRINTF2(KErrTaskNotFound, &program);
+						SetTestStepResult(EFail);
+						}
+		        	}
+				}
+            CleanupStack::Pop(1, appCaption); // taskEntry, appCaption
+	    	}
+
+	    if ( searching )
+	    	{
+			ERR_PRINTF2(KErrTaskNotFound, &program);
+			SetTestStepResult(EFail);
+	    	}
+	    CleanupStack::PopAndDestroy(4, &apaLsSession);    // windowGroupName, windowGroupList
+		}
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/scripts/setup_smoketest_apploader.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir			c:\smoketest\
+
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_apploader.ini	c:\smoketest\smoketest_apploader.ini
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_apploader.ini
+RUN_UTILS CopyFile 		z:\smoketest\smoketest_apploader.script	c:\smoketest\smoketest_apploader.script
+RUN_UTILS MakeReadWrite	c:\smoketest\smoketest_apploader.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/scripts/smoketest_apploader.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,63 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+LOAD_SUITE smoketest_apploader -SharedData
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0001
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0001
+//! @SYMTestCaseDesc	Start Smoketest_system.exe, and kill the process
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0001
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	KillProcess	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0001
+END_TESTCASE 			SMOKE_APP_LAUNCH_0001
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0002
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0002
+//! @SYMTestCaseDesc	Verify the "Telephone" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0002
+END_TESTCASE 			SMOKE_APP_LAUNCH_0002
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0003
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0003
+//! @SYMTestCaseDesc	Verify the "Clock" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0003
+END_TESTCASE 			SMOKE_APP_LAUNCH_0003
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0004
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0004
+//! @SYMTestCaseDesc	Verify the "Messaging" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0004
+END_TESTCASE 			SMOKE_APP_LAUNCH_0004
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0005
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0005
+//! @SYMTestCaseDesc	Start the SymcML task and end it.
+	RUN_TEST_STEP		1000	smoketest_apploader	AppStart	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_LAUNCH_0005
+	DELAY				5000
+	RUN_TEST_STEP		1000	smoketest_apploader	EndTask		c:\smoketest\smoketest_apploader.ini	SMOKE_APP_END_0005
+END_TESTCASE 	SMOKE_APP_LAUNCH_0005
+
+START_TESTCASE			SMOKE_APP_LAUNCH_0006
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0006
+//! @SYMTestCaseDesc	Verify the "Calendar" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0006
+END_TESTCASE 			SMOKE_APP_LAUNCH_0006
+
+START_TESTCASE	SMOKE_APP_LAUNCH_0007
+//! @SYMTestCaseID		SMOKE_APP_LAUNCH_0007
+//! @SYMTestCaseDesc	Verify the "Contacts" task is running
+	RUN_TEST_STEP		1000	smoketest_apploader	TaskRunning	c:\smoketest\smoketest_apploader.ini	SMOKE_APP_RUNNING_0007
+END_TESTCASE 	SMOKE_APP_LAUNCH_0007
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/apploader/testdata/smoketest_apploader.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,26 @@
+[SMOKE_APP_LAUNCH_0001]
+program	=Smoketest_System.exe
+
+[SMOKE_APP_END_0001]
+program	=Z:\sys\bin\Smoketest_System.exe
+
+[SMOKE_APP_RUNNING_0002]
+program	=Telephone
+
+[SMOKE_APP_RUNNING_0003]
+program	=Clock
+
+[SMOKE_APP_RUNNING_0004]
+program	=Messaging
+
+[SMOKE_APP_LAUNCH_0005]
+program	=NSmlDSSync.exe
+
+[SMOKE_APP_END_0005]
+program	=Sync
+
+[SMOKE_APP_RUNNING_0006]
+program	=Calendar
+
+[SMOKE_APP_RUNNING_0007]
+program	=Contacts
Binary file common/tools/ats/smoketest/contacts/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/TestData/Smoketest_Contacts.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,52 @@
+[default]
+filename		=c:\smoketest\smoketest_contacts.cdb
+filenameSecure		=c:smoketest_contacts.cdb
+
+[18807_CreateDB]
+
+[18927_AddEntries]
+count			=5
+
+firstname1		=Feroz
+lastname1		=Uddin
+company1		=Symbian
+job1			=Cricket fan
+workphone1		=0207
+workemail1		=feroz.uddin@symbian.com
+
+firstname2		=Louis
+lastname2		=Nayegon
+company2		=Symbian
+job2			=Lazy Git
+workphone2		=01452 812178
+workemail2		=louis.nayegon@symbian.com
+
+firstname3		=Alf
+lastname3		=Garnett
+company3		=BBC
+job3			=star
+workphone3		=0207 777
+homephone3		=0208 888
+fax3			=0208 999
+workemail3		=alf.garnett@bbc.co.uk
+internet3		=www.bbc.co.uk
+street3			=Marylebone Road
+town3			=London
+county3			=LondonCounty
+postcode3		=W1
+country3		=England
+notes3			=Small minded bigot
+
+firstname4		=Tom
+lastname4		=Jones
+company4		=Music
+job4			=Singer
+workemail4		=tom.jones@music.com
+
+firstname5		=Alan
+lastname5		=Shearer
+company5		=Newcastle United FC
+job5			=Footballer
+FirstNamePrn5	=Al-an
+LastNamePrn5	=Shea-rer
+CompanyNamePrn5	=New-cas-el You-Nigh-Ted
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/bwins/SMOKETEST_CONTACTS_SERVERU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/group/Smoketest_Contacts.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,51 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET			Smoketest_Contacts_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7772
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		ReadUserData WriteUserData
+
+SOURCEPATH		..\Src
+
+SOURCE			SmoketestContactsServer.cpp
+SOURCE			TestContact.cpp
+SOURCE			TestContactsAddEntries.cpp
+SOURCE			TestContactsBase.cpp
+SOURCE			TestContactsCreateDB.cpp
+
+USERINCLUDE		..\Inc ..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			efsrv.lib
+LIBRARY			estor.lib
+LIBRARY			charconv.lib
+LIBRARY			cntview.lib
+LIBRARY			euser.lib
+LIBRARY			cntmodel.lib
+LIBRARY			TestExecuteUtils.lib
+LIBRARY			TestExecuteLogClient.lib
+
+// We're quite heavy on the stack... 4k in WinS isn't enough...
+EPOCSTACKSIZE	0x6000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,25 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// For automated contacts smoketest
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../scripts/Smoketest_Contacts.script		z:/smoketest/smoketest_contacts.script
+../scripts/setup_Smoketest_Contacts.script	z:/smoketest/setup_smoketest_contacts.script
+../TestData/Smoketest_Contacts.ini			z:/smoketest/smoketest_contacts.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Contacts.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/inc/SmoketestContactsServer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,38 @@
+/**
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+
+
+/**
+ @file SmoketestContactsServer.h
+*/
+#if (!defined __SMOKETESTCONTACTS_SERVER_H__)
+#define __SMOKTETESTCONTACTS_SERVER_H__
+#include <TestExecuteServerBase.h>
+
+class CSmoketestContactsServer : public CTestServer
+	{
+public:
+	static CSmoketestContactsServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+
+private:
+	void ConstructL();
+	};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/inc/TestContact.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,100 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContact
+// 
+//
+
+#ifndef TEST_CONTACT_H
+#define TEST_CONTACT_H
+
+#include <cntitem.h>
+
+class MTestContactInstrumentation
+{
+public:
+	virtual void			RaiseInstrumentationEventNotificationL(TInt aEventTag) = 0;
+};
+
+class CTestContact : public CBase
+	{
+public:
+	static CTestContact*	NewL(CContactItem& aSeedContact);
+	static CTestContact*	NewLC(CContactItem& aSeedContact);
+	static CTestContact*	NewL(CContactItem* aSeedContact);
+	static CTestContact*	NewLC(CContactItem* aSeedContact);
+	~CTestContact();
+
+	CContactItem&	ContactItem();
+	const TPtrC		FirstNameL();
+	const TPtrC		LastNameL();
+	const TPtrC		CompanyNameL();
+	const TPtrC		JobTitleL();
+	const TPtrC		WorkPhoneL();
+	const TPtrC		WorkMobileL();
+	const TPtrC		HomePhoneL();
+	const TPtrC		HomeMobileL();
+	const TPtrC		FaxL();
+	const TPtrC		EmailAddressL();
+	const TPtrC		InternetAddressL();
+	const TPtrC		StreetL();
+	const TPtrC		TownL();
+	const TPtrC		CountyL();
+	const TPtrC		PostCodeL();
+	const TPtrC		CountryL();
+	const TPtrC		NotesL();
+	const TPtrC		NickNameL();
+	const TPtrC		PictureL();
+
+	void	SetFirstNameL(const TDesC& aFirstName);
+	void	SetLastNameL(const TDesC& aLastName);
+	void	SetCompanyNameL(const TDesC& aCompanyName);
+	void	SetJobTitleL(const TDesC& aJobTitle);
+	void	SetWorkPhoneL(const TDesC& aWorkPhone);
+	void	SetWorkMobileL(const TDesC& aWorkMobile);
+	void	SetHomePhoneL(const TDesC& aHomePhone);
+	void	SetHomeMobileL(const TDesC& aHomeMobile);
+	void	SetFaxL(const TDesC& aFax);
+	void	SetHomeEmailAddressL(const TDesC& aEmailAddress);
+	void	SetWorkEmailAddressL(const TDesC& aEmailAddress);
+	void	SetInternetAddressL(const TDesC& aInternetAddress);
+	void	SetStreetL(const TDesC& aStreet);
+	void	SetTownL(const TDesC& aTown);
+	void	SetCountyL(const TDesC& aCounty);
+	void	SetPostCodeL(const TDesC& aPostCode);
+	void	SetCountryL(const TDesC& aCountry);
+	void	SetNotesL(const TDesC& aNotes);
+	void	SetNickNameL(const TDesC& aNickName);
+	void 	SetPictureL(const TDesC8& aPicture);
+
+private:
+	CTestContact();
+	void				ConstructL(CContactItem& aSeedContact);
+	void				ConstructL(CContactItem* aSeedContact);
+	const TPtrC			TextFieldL(TFieldType aFieldType) const;
+	const TPtrC			TextFieldL(const CContentType& aTypesToMatch) const;
+  	void 				SetTextFieldL(const CContentType& aTypesToMatch,const TDesC& aText) const;
+  	void 				SetTextFieldL(TFieldType aFieldType, const TDesC& aText);
+  	void 				SetTextFieldL(TFieldType aFieldType, const TDesC& aText, TUid aAddOnContentType);
+	CContactItemField&	FindFieldL(TFieldType aFieldType) const;
+	CContactItemField&	FindFieldL(const CContentType& aTypesToMatch) const;
+	void SetPictureFieldL(const TDesC8& aPicture) const;
+	TInt FindField(TFieldType aFieldType) const;
+  	void InsertTextFieldL(TUid aID, const TDesC& aStringOfStuff);
+
+private:
+	CContactItem*	iContactItem;
+	TBool			iDestroyOnExit;
+	};
+
+#endif /* __TEST_CONTACT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/inc/TestContactsAddEntries.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,35 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestSuiteContacts
+// 
+//
+
+#ifndef TEST_CONTACTS_ADD_ENTRIES_H
+#define TEST_CONTACTS_ADD_ENTRIES_H
+
+#include "TestContactsBase.h"
+
+class CTestContactsAddEntries : public CTestContactsBase
+{
+public:
+	CTestContactsAddEntries();
+	virtual ~CTestContactsAddEntries();
+
+	virtual enum TVerdict doTestStepL( void );
+
+private:
+	void	AddEntriesL( void );
+};
+
+#endif TEST_CONTACTS_ADD_ENTRIES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/inc/TestContactsBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,53 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsBase
+// 
+//
+
+#ifndef TEST_CONTACTS_BASE_H
+#define TEST_CONTACTS_BASE_H
+
+
+#include <cntdb.h>
+#include <TestExecuteStepBase.h>
+#include <cntitem.h>
+
+#include "TestContact.h"
+
+const TInt KMaxScriptLineLength = 200;
+
+class CTestContactsBase : public CTestStep, protected MTestContactInstrumentation
+{
+public:
+	CTestContactsBase();
+	~CTestContactsBase();
+	virtual enum TVerdict	doTestStepPreambleL();
+	virtual enum TVerdict	doTestStepPostambleL();
+
+protected:
+	void				CreateDatabase();
+	void				OpenDatabase();
+	void				CleanupDatabase();
+	void				RaiseInstrumentationEventNotificationL(TInt aEventTag);
+	CContactIdArray*	SearchEntriesL();
+
+protected:
+	CContactDatabase*			iDatabase;
+	CContactItemFieldDef*		iFieldDef;
+
+private:
+	CActiveScheduler*			iSchedular;
+};
+
+#endif /* TEST_CONTACTS_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/inc/TestContactsCreateDB.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsCreateDB
+// 
+//
+
+#ifndef TEST_CONTACTS_CREATE_DB_H
+#define TEST_CONTACTS_CREATE_DB_H
+
+#include "TestContactsBase.h"
+
+class CTestContactsCreateDB : public CTestContactsBase
+{
+public:
+	CTestContactsCreateDB();
+	virtual ~CTestContactsCreateDB();
+
+	virtual enum TVerdict doTestStepL( void );
+
+};
+
+#endif /* TEST_CONTACTS_CREATE_DB_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/scripts/Smoketest_Contacts.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Contacts smoketest
+//
+LOAD_SUITE Smoketest_Contacts_Server
+//
+START_TESTCASE 9094
+RUN_TEST_STEP 100	Smoketest_Contacts_Server	CreateDB		c:\smoketest\Smoketest_Contacts.ini	18807_CreateDB
+END_TESTCASE 9094
+START_TESTCASE 9082
+RUN_TEST_STEP 1000	Smoketest_Contacts_Server	AddEntries		c:\smoketest\Smoketest_Contacts.ini	18927_AddEntries
+END_TESTCASE 9082
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/scripts/setup_Smoketest_Contacts.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,22 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\smoketest\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_contacts.ini	c:\smoketest\smoketest_contacts.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_contacts.ini
+
+// RUN_SCRIPT Smoketest_Contacts.script
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/src/SmoketestContactsServer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,110 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ @file SmoketestContactsServer.cpp
+*/
+
+#include "SmoketestContactsServer.h"
+#include "TestContactsCreateDB.h"
+#include "TestContactsAddEntries.h"
+
+// __EDIT_ME__ - Substitute the name of the test server
+_LIT(KServerName,"Smoketest_Contacts_Server");
+// __EDIT_ME__ - Use your own server class name
+CSmoketestContactsServer* CSmoketestContactsServer::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CSmoketestContactsServer * server = new (ELeave) CSmoketestContactsServer();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CSmoketestContactsServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CSmoketestContactsServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+        
+        if (!err) { }
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+    }
+
+
+// __EDIT_ME__ - Use your own server class name
+CTestStep* CSmoketestContactsServer::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep* testStep = NULL;
+// __EDIT_ME__ - Create your own test steps here
+	if(aStepName == _L("AddEntries"))
+		testStep = new CTestContactsAddEntries();
+	if(aStepName == _L("CreateDB"))
+		testStep = new CTestContactsCreateDB();
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/src/TestContact.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,491 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContact
+// 
+//
+
+#include <cntfldst.h>
+
+#include "TestContact.h"
+
+CTestContact* CTestContact::NewL(CContactItem& aSeedContact)
+	{
+	CTestContact* self=CTestContact::NewLC(aSeedContact);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestContact* CTestContact::NewLC(CContactItem& aSeedContact)
+	{
+	CTestContact* self=new(ELeave) CTestContact();
+	CleanupStack::PushL(self);
+	self->ConstructL(aSeedContact);
+	return self;
+	}
+
+CTestContact* CTestContact::NewL(CContactItem* aSeedContact)
+	{
+	CTestContact* self=CTestContact::NewLC(aSeedContact);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestContact* CTestContact::NewLC(CContactItem* aSeedContact)
+	{
+	CTestContact* self=new(ELeave) CTestContact();
+	CleanupStack::PushL(self);
+	self->ConstructL(aSeedContact);
+	return self;
+	}
+
+CTestContact::CTestContact() : iDestroyOnExit(EFalse)
+	{
+	}
+
+void CTestContact::ConstructL(CContactItem& aSeedContact)
+	{
+	iDestroyOnExit=ETrue;
+	iContactItem=CContactCard::NewL(&aSeedContact);
+	}
+
+void CTestContact::ConstructL(CContactItem* aSeedContact)
+	{
+	iDestroyOnExit=EFalse;
+	iContactItem=aSeedContact;
+	}
+
+CTestContact::~CTestContact()
+	{
+	if (iDestroyOnExit)
+		delete iContactItem;
+	iContactItem=NULL;
+	}
+
+CContactItem& CTestContact::ContactItem()
+	{
+	return *iContactItem;
+	}
+
+const TPtrC CTestContact::FirstNameL()
+	{
+	return TextFieldL(KUidContactFieldGivenName);
+	}
+
+const TPtrC CTestContact::LastNameL()
+	{
+	return TextFieldL(KUidContactFieldFamilyName);
+	}
+
+const TPtrC CTestContact::CompanyNameL()
+	{
+	return TextFieldL(KUidContactFieldCompanyName);
+	}
+
+const TPtrC CTestContact::JobTitleL()
+	{
+	return TextFieldL(KUidContactFieldJobTitle);
+	}
+
+const TPtrC CTestContact::WorkPhoneL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::WorkMobileL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::HomePhoneL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::HomeMobileL()
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	const TPtrC text=TextFieldL(*contentType);
+	CleanupStack::PopAndDestroy(); // contentType.
+	return text;
+	}
+
+const TPtrC CTestContact::FaxL()
+	{
+	return TextFieldL(KUidContactFieldFax);
+	}
+
+const TPtrC CTestContact::EmailAddressL()
+	{
+	return TextFieldL(KUidContactFieldEMail);
+	}
+
+const TPtrC CTestContact::InternetAddressL()
+	{
+	return TextFieldL(KUidContactFieldUrl);
+	}
+
+const TPtrC CTestContact::StreetL()
+	{
+	return TextFieldL(KUidContactFieldAddress);
+	}
+
+const TPtrC CTestContact::TownL()
+	{
+	return TextFieldL(KUidContactFieldLocality);
+	}
+
+const TPtrC CTestContact::CountyL()
+	{
+	return TextFieldL(KUidContactFieldRegion);
+	}
+
+const TPtrC CTestContact::PostCodeL()
+	{
+	return TextFieldL(KUidContactFieldPostcode);
+	}
+
+const TPtrC CTestContact::CountryL()
+	{
+	return TextFieldL(KUidContactFieldCountry);
+	}
+
+const TPtrC CTestContact::NotesL()
+	{
+	return TextFieldL(KUidContactFieldNote);
+	}
+
+const TPtrC CTestContact::NickNameL()
+	{
+	return TextFieldL(KUidContactFieldSecondName);
+	}
+
+const TPtrC CTestContact::PictureL()
+	{
+	return TextFieldL(KUidContactFieldPicture);
+	}
+
+void CTestContact::SetFirstNameL(const TDesC& aFirstName)
+	{
+ 	SetTextFieldL(KUidContactFieldGivenName, aFirstName, KUidContactFieldVCardMapUnusedN);
+	}
+
+void CTestContact::SetLastNameL(const TDesC& aLastName)
+	{
+ 	SetTextFieldL(KUidContactFieldFamilyName, aLastName, KUidContactFieldVCardMapUnusedN);
+	}
+
+void CTestContact::SetCompanyNameL(const TDesC& aCompanyName)
+	{
+	SetTextFieldL(KUidContactFieldCompanyName, aCompanyName, KUidContactFieldVCardMapORG);
+	}
+
+void CTestContact::SetJobTitleL(const TDesC& aJobTitle)
+	{
+	SetTextFieldL(KUidContactFieldJobTitle,aJobTitle);
+	}
+
+void CTestContact::SetWorkPhoneL(const TDesC& aWorkPhone)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	SetTextFieldL(*contentType,aWorkPhone);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetWorkMobileL(const TDesC& aWorkMobile)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	SetTextFieldL(*contentType,aWorkMobile);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetHomePhoneL(const TDesC& aHomePhone)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	SetTextFieldL(*contentType,aHomePhone);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetHomeMobileL(const TDesC& aHomeMobile)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPhoneNumber);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapVOICE);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapCELL);
+	SetTextFieldL(*contentType,aHomeMobile);
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetFaxL(const TDesC& aFax)
+	{
+	SetTextFieldL(KUidContactFieldFax,aFax);
+	}
+
+void CTestContact::SetHomeEmailAddressL(const TDesC& aEmailAddress)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldEMail);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapHOME);
+	SetTextFieldL(*contentType,aEmailAddress);
+	CleanupStack::PopAndDestroy(contentType);
+	}
+
+void CTestContact::SetWorkEmailAddressL(const TDesC& aEmailAddress)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldEMail);
+	contentType->AddFieldTypeL(KUidContactFieldVCardMapWORK);
+	SetTextFieldL(*contentType,aEmailAddress);
+	CleanupStack::PopAndDestroy(contentType);
+	}
+
+
+void CTestContact::SetInternetAddressL(const TDesC& aInternetAddress)
+	{
+	SetTextFieldL(KUidContactFieldUrl,aInternetAddress);
+	}
+
+void CTestContact::SetStreetL(const TDesC& aStreet)
+	{
+	SetTextFieldL(KUidContactFieldAddress,aStreet);
+	}
+
+void CTestContact::SetTownL(const TDesC& aTown)
+	{
+	SetTextFieldL(KUidContactFieldLocality,aTown);
+	}
+
+void CTestContact::SetCountyL(const TDesC& aCounty)
+	{
+	SetTextFieldL(KUidContactFieldRegion,aCounty);
+	}
+
+void CTestContact::SetPostCodeL(const TDesC& aPostCode)
+	{
+	SetTextFieldL(KUidContactFieldPostcode,aPostCode);
+	}
+
+void CTestContact::SetCountryL(const TDesC& aCountry)
+	{
+	SetTextFieldL(KUidContactFieldCountry,aCountry);
+	}
+
+void CTestContact::SetNotesL(const TDesC& aNotes)
+	{
+	SetTextFieldL(KUidContactFieldNote,aNotes);
+	}
+
+void CTestContact::SetNickNameL(const TDesC& aNickName)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldSecondName);
+	TRAPD(err, SetTextFieldL(*contentType,aNickName));
+        if (!err) { }
+	CleanupStack::PopAndDestroy(); // contentType.
+	}
+
+void CTestContact::SetPictureL(const TDesC8& aPicture)
+	{
+	CContentType* contentType=CContentType::NewL();
+	CleanupStack::PushL(contentType);
+	contentType->AddFieldTypeL(KUidContactFieldPicture);
+	SetPictureFieldL(aPicture);
+	CleanupStack::PopAndDestroy(contentType);
+	}
+
+const TPtrC CTestContact::TextFieldL(TFieldType aFieldType) const
+	{
+	CContactItemField& field=FindFieldL(aFieldType);
+	ASSERT(field.StorageType()==KStorageTypeText);
+	return STATIC_CAST(CContactTextField*,(field.Storage()))->Text();
+	}
+
+const TPtrC CTestContact::TextFieldL(const CContentType& aTypesToMatch) const
+	{
+	CContactItemField& field=FindFieldL(aTypesToMatch);
+	ASSERT(field.StorageType()==KStorageTypeText);
+	return STATIC_CAST(CContactTextField*,field.Storage())->Text();
+	}
+
+void CTestContact::InsertTextFieldL(TFieldType aID, const TDesC& aStringOfStuff )
+	{
+ 	CContactItemField* itemFieldPtr = NULL;
+ 	CContactTextField* textStoragePtr = NULL;
+
+ 	itemFieldPtr = CContactItemField::NewLC( KStorageTypeText, aID );
+ 	textStoragePtr = itemFieldPtr->TextStorage(); // we don't have ownership here, hence no stack.
+
+ 	textStoragePtr->SetTextL( aStringOfStuff );
+ 	textStoragePtr = NULL; // we've finished with this ptr now.
+
+ 	iContactItem->AddFieldL( *itemFieldPtr ); // hand ownership over here
+ 	CleanupStack::Pop( itemFieldPtr ); // and pop,
+	}
+
+void CTestContact::SetTextFieldL(TFieldType aFieldType,const TDesC& aText)
+	{
+ 	TInt	fieldIndex=FindField(aFieldType);
+
+ 	if ( fieldIndex > KErrNotFound )
+		{
+ 		CContactItemField&	field=FindFieldL(aFieldType);
+ 		ASSERT(field.StorageType()==KStorageTypeText);
+ 		STATIC_CAST(CContactTextField*,field.Storage())->SetText(aText.AllocL());
+		}
+ 	else
+		{
+ 		InsertTextFieldL(aFieldType, aText);
+		}
+	}
+
+void CTestContact::SetTextFieldL(const CContentType& aTypesToMatch,const TDesC& aText) const
+	{
+	CContactItemField& field=FindFieldL(aTypesToMatch);
+	ASSERT(field.StorageType()==KStorageTypeText);
+	STATIC_CAST(CContactTextField*,field.Storage())->SetText(aText.AllocL());
+	}
+
+CContactItemField& CTestContact::FindFieldL(TFieldType aFieldType) const
+	{
+	CContactItemFieldSet& fields=iContactItem->CardFields();
+	TInt index=fields.Find(aFieldType);
+	User::LeaveIfError(index);
+	return fields[index];
+	}
+
+void CTestContact::SetTextFieldL(TFieldType aFieldType, const TDesC& aText, TUid aAddOnContentType)
+	{
+	CContactItemFieldSet& fields = iContactItem->CardFields();
+	CContactTextField* textField = NULL;
+	TInt fieldIndex = 0;
+
+	fieldIndex = FindField( aFieldType );
+
+	if (fieldIndex == KErrNotFound )
+		{
+		InsertTextFieldL( aFieldType, aText );
+		fieldIndex = FindField( aFieldType );
+		CContactItemField& field = fields[ fieldIndex ];
+		field.AddFieldTypeL( aAddOnContentType );
+		}
+		else if (fieldIndex >= KErrNone )
+		{
+		CContactItemField& field = fields[ fieldIndex ];
+		ASSERT(field.StorageType()==KStorageTypeText);
+		textField = static_cast<CContactTextField*>(field.Storage());
+		textField->SetText( aText.AllocL() );
+		field.AddFieldTypeL( aAddOnContentType );
+		}
+	}
+
+TInt CTestContact::FindField(TFieldType aFieldType) const
+	{
+	return iContactItem->CardFields().Find( aFieldType );
+	}
+
+CContactItemField& CTestContact::FindFieldL(const CContentType& aTypesToMatch) const
+	{
+	CContactItemFieldSet& fields=iContactItem->CardFields();
+	const TInt numTypesToMatch(aTypesToMatch.FieldTypeCount());
+	const TFieldType mainFieldType(aTypesToMatch.FieldType(0));
+	TInt index=-1;
+	FOREVER
+		{
+		index=fields.FindNext(mainFieldType,index+1);
+		User::LeaveIfError(index);
+
+		CContactItemField& thisPhoneField=fields[index];
+		const CContentType& thisPhoneFieldTypes=thisPhoneField.ContentType();
+		const TInt numFieldTypes(thisPhoneFieldTypes.FieldTypeCount());
+
+		if (numFieldTypes!=numTypesToMatch)
+			{
+			continue;
+			}
+
+		TInt numTypesLeftToMatch=numTypesToMatch;
+		for (TInt ii=0;ii<numFieldTypes;++ii)
+			{
+			TFieldType thisFieldType(thisPhoneFieldTypes.FieldType(ii));
+			for (TInt jj=0;jj<numTypesToMatch;++jj)
+				{
+				TFieldType thisFieldTypeToMatch(aTypesToMatch.FieldType(jj));
+				if (thisFieldType==thisFieldTypeToMatch)
+					{
+					if (--numTypesLeftToMatch<=0)
+						{
+						return thisPhoneField;
+						}
+
+					break;
+					}
+				}
+			}
+		}
+	}
+
+void CTestContact::SetPictureFieldL(const TDesC8& aPicture) const
+	{
+
+	CContactItemFieldSet& fieldSet=iContactItem->CardFields();
+	TInt pos;
+	pos=fieldSet.Find(KUidContactFieldPicture);
+	User::LeaveIfError(pos);
+	fieldSet[pos].StoreStorage()->SetThingL(aPicture);
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/src/TestContactsAddEntries.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,408 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsAddEntries
+// 
+//
+
+// Epoc include
+#include <TestExecuteLog.h>
+
+// User include
+#include "TestContactsAddEntries.h"
+#include "TestContact.h"
+
+/*@{*/
+/// Literal constants
+_LIT(KCardTemplateName,	"TestTemplate");
+_LIT(KCount,			"count");
+_LIT(KFirstName,		"firstname%d");
+_LIT(KLastName,			"lastname%d");
+_LIT(KCompanyName,		"company%d");
+_LIT(KJobTitle,			"job%d");
+_LIT(KWorkPhone,		"workphone%d");
+_LIT(KWorkMobile,		"workmobile%d");
+_LIT(KHomePhone,		"homephone%d");
+_LIT(KHomeMobile,		"homemobile%d");
+_LIT(KFax,				"fax%d");
+_LIT(KWorkEmailAddress,	"workemail%d");
+_LIT(KInternetAddress,	"internet%d");
+_LIT(KStreet,			"street%d");
+_LIT(KTown,				"town%d");
+_LIT(KCounty,			"county%d");
+_LIT(KPostCode,			"postcode%d");
+_LIT(KCountry,			"country%d");
+_LIT(KNotes,			"notes%d");
+_LIT(KNickName,			"nickName%d");
+_LIT(KPictureName,		"picturename%d");
+_LIT(KGroupName,		"groupname%d");
+_LIT(KTemplateName,		"templatename%d");
+_LIT(KOneFieldTemplate,	"OneFieldTemplate");
+/*@}*/
+
+
+CTestContactsAddEntries::CTestContactsAddEntries()
+/**
+Default Constructor
+ */
+	{
+	SetTestStepName(_L("AddEntries"));
+	}
+
+CTestContactsAddEntries::~CTestContactsAddEntries()
+/**
+Destructor
+ */
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestContactsAddEntries::doTestStepL()
+/**
+invoked by the test execute framework for exercising the
+functionality under test
+@return	EPass: The test passed succesfully;
+		EFail: The test failed;
+		EInconclusive: The result of the test was inconclusive;
+		ETestSuiteError: Error in the test suite;
+		EAbort: The test was aborted;
+		EIgnore: The test was unexecuted
+@leave system wide error codes
+*/
+	{
+
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Contacts Add Entries Test"));
+
+	OpenDatabase();
+	if ( TestStepResult() == EPass )
+		{
+		TRAPD(r, AddEntriesL());
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Test step failed with error code = %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	CleanupDatabase();
+
+	// test steps return a result
+	return TestStepResult();
+	}
+
+void CTestContactsAddEntries::AddEntriesL()
+/**
+This function adds contact entries to the database depending on entry type.
+If the entry contains the group name then the contact will be added to the
+particular group specified in the entry. If the entry contains the template
+name then the contact item depending on the specified template name will be
+created and added to the database.
+
+@leave system wide error code
+ */
+	{
+	TBool	groupExists = EFalse;
+	TBool	templateFound = EFalse;
+	TInt	count=1;
+
+	if ( !GetIntFromConfig(ConfigSection(), KCount, count) )
+		{
+		count=1;
+		}
+
+	INFO_PRINTF2(_L("Number of Entries to Add = %d"), count);
+
+	TBuf<KMaxScriptLineLength>	tempStore;
+	TPtrC						ptrString;
+
+	/*******************************************************************
+	 To Create a contact card template depending upon the contact item
+	 on which the new template's field set is based. The template name
+	 on which the new template is based is read from the ini file.
+	 *******************************************************************/
+
+	for (TInt entry=0; entry<count; )
+		{
+		CContactItem* item = NULL;
+
+		// The entry contains the template name
+		tempStore.Format(KTemplateName(), ++entry);
+		if (!GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("Entry %d has no Template Name"), entry);
+			item = iDatabase->CreateContactCardTemplateLC(KCardTemplateName);
+			}
+		else
+			{
+			INFO_PRINTF2(_L("Template Name = %S"), &ptrString);
+			CContactIdArray* templateList = NULL;
+			CContactItem* tempTemplate = NULL;
+
+			// Returns a copy of the database's template ID list
+			templateList = iDatabase->GetCardTemplateIdListL();
+			CleanupStack::PushL(templateList);
+
+			// Returns the number of contact card templates that currently exist in the database.
+			TInt tCount = iDatabase->TemplateCount();
+			INFO_PRINTF2(_L("Number of existing templates = %d"), tCount);
+
+			// Search for template in the template ID list
+			for(TInt i = 0; i<tCount && templateFound == EFalse;i++)
+				{
+				// Reads a contact item
+				tempTemplate = STATIC_CAST(CContactItem*, iDatabase->ReadContactLC((*templateList)[i]));
+
+				// Gets the label for a contact card template.
+				TPtrC tempLabel = STATIC_CAST(CContactCardTemplate*,tempTemplate)->GetTemplateLabelL();
+
+							// Compare the template label
+				if(!(tempLabel.Compare(ptrString)))
+					{
+					INFO_PRINTF2(_L("Template %S found"), &tempLabel);
+
+					// Creates a contact card template and adds it to the database
+					item = iDatabase->CreateContactCardTemplateLC(tempTemplate,tempLabel);
+
+					// Compare the template label with OneFieldTemplate and add field to it.
+					if(!(tempLabel.Compare(KOneFieldTemplate)))
+						{
+						// Allocates and constructs a contact item field
+						CContactItemField* field=CContactItemField::NewLC(KStorageTypeText,KUidContactFieldGivenName);
+						item->AddFieldL(*field);
+						CleanupStack::Pop(field); // field
+						}
+					CleanupStack::Pop(item);
+					templateFound = ETrue;
+					}
+				  CleanupStack::PopAndDestroy(tempTemplate);
+				}
+
+			if (!templateFound)
+				{
+				ERR_PRINTF2(_L("Ini Template %S does not match existing templates"), &ptrString);
+				SetTestStepResult(EFail);
+				}
+
+			// Set templateFound to false for next entry
+			templateFound = EFalse;
+
+			CleanupStack::PopAndDestroy(templateList);
+			CleanupStack::PushL(item);
+			}
+
+		CTestContact*	contact=CTestContact::NewLC(*item);
+
+		tempStore.Format(KFirstName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("firstname = %S"), &ptrString);
+			contact->SetFirstNameL(ptrString);
+			}
+
+		tempStore.Format(KNickName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("NickName = %S"), &ptrString);
+			TRAPD(err, contact->SetNickNameL(ptrString));
+			if ( err != KErrNone )
+				{
+				ERR_PRINTF2(_L("SetNickNameL Leave = %d"), err);
+				SetTestStepResult(EFail);
+				}
+			}
+
+		tempStore.Format(KLastName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("lastname = %S"), &ptrString);
+			contact->SetLastNameL(ptrString);
+			}
+
+		tempStore.Format(KCompanyName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("company = %S"), &ptrString);
+			contact->SetCompanyNameL(ptrString);
+			}
+
+		tempStore.Format(KJobTitle(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("job = %S"), &ptrString);
+			contact->SetJobTitleL(ptrString);
+			}
+
+		tempStore.Format(KWorkPhone(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("work phone = %S"), &ptrString);
+			contact->SetWorkPhoneL(ptrString);
+			}
+
+		tempStore.Format(KWorkMobile(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("work mobile = %S"), &ptrString);
+			contact->SetWorkMobileL(ptrString);
+			}
+
+		tempStore.Format(KHomePhone(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("home phone = %S"), &ptrString);
+			contact->SetHomePhoneL(ptrString);
+			}
+
+		tempStore.Format(KHomeMobile(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("home mobile = %S"), &ptrString);
+			contact->SetHomeMobileL(ptrString);
+			}
+
+		tempStore.Format(KFax(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("fax = %S"), &ptrString);
+			contact->SetFaxL(ptrString);
+			}
+
+		tempStore.Format(KWorkEmailAddress(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("work email = %S"), &ptrString);
+			contact->SetWorkEmailAddressL(ptrString);
+			}
+
+		tempStore.Format(KInternetAddress(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("internet = %S"), &ptrString);
+			contact->SetInternetAddressL(ptrString);
+			}
+
+		tempStore.Format(KStreet(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("street = %S"), &ptrString);
+			contact->SetStreetL(ptrString);
+			}
+
+		tempStore.Format(KTown(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("town = %S"), &ptrString);
+			contact->SetTownL(ptrString);
+			}
+
+		tempStore.Format(KCounty(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("county = %S"), &ptrString);
+			contact->SetCountyL(ptrString);
+			}
+
+		tempStore.Format(KPostCode(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("post code = %S"), &ptrString);
+			contact->SetPostCodeL(ptrString);
+			}
+
+		tempStore.Format(KCountry(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("country = %S"), &ptrString);
+			contact->SetCountryL(ptrString);
+			}
+
+		tempStore.Format(KNotes(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("notes = %S"), &ptrString);
+			contact->SetNotesL(ptrString);
+			}
+
+		tempStore.Format(KPictureName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("Picture Name = %S"), &ptrString);
+
+			HBufC8*	pictureName8 = HBufC8::NewLC(ptrString.Length());
+			pictureName8->Des().Copy(ptrString);
+
+			contact->SetPictureL(*pictureName8);
+
+			CleanupStack::PopAndDestroy(pictureName8);
+			}
+
+		tempStore.Format(KGroupName(), entry);
+		if (GetStringFromConfig(ConfigSection(), tempStore, ptrString))
+			{
+			INFO_PRINTF2(_L("Group Name = %S"), &ptrString);
+
+			// Flag for adding contacts to group.
+			groupExists = ETrue;
+			}
+
+		const TContactItemId id = iDatabase->AddNewContactL(contact->ContactItem());
+
+		/********************************************************************
+		This is for adding the contact entry to the specified group.
+		********************************************************************/
+		if(groupExists)
+			{
+			INFO_PRINTF1(_L("Adding Item "));
+			CContactIdArray* groupList = NULL;
+
+			// Returns a copy of the database's group ID list
+			groupList = iDatabase->GetGroupIdListL();
+			CleanupStack::PushL(groupList);
+
+			// Returns the number of groups that currently exist in the database
+			TInt groupCount = iDatabase->GroupCount();
+
+
+			// Search for the group
+			for(TInt i = 0; i<groupCount;i++)
+				{
+				// Reads a contact item
+				CContactGroup* group = STATIC_CAST(CContactGroup*, iDatabase->ReadContactLC((*groupList)[i]));
+
+				// Gets the contact item's ID.
+				const TContactItemId groupId1 = group->Id();
+
+				// Gets the group label.
+				TPtrC	label = group->GetGroupLabelL();
+				// Compare the group label with group name read from ini file.
+				if(!(label.Compare(ptrString)))
+					{
+					/**
+					Sets a contact item which already exists in the database
+					to be a member of a contact group
+					 */
+					iDatabase->AddContactToGroupL(id, groupId1);
+					INFO_PRINTF1(_L("Item added successfully"));
+					groupExists = EFalse;
+					}
+				CleanupStack::PopAndDestroy(group);
+
+				}
+			CleanupStack::PopAndDestroy(groupList);
+			}
+
+		CleanupStack::PopAndDestroy(contact);
+		CleanupStack::PopAndDestroy(item);
+
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/src/TestContactsBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,176 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This CTestContactsBase
+// 
+//
+
+// User include
+#include "TestContactsBase.h"
+
+// EPOC includes
+#include <e32base.h>
+#include <Uri16.h>
+#include <UriUtils.h>
+#include <TestExecuteLog.h>
+
+/*@{*/
+/// Literal constants
+_LIT(KDef,			"default");
+_LIT(KFileName,		"filenameSecure");
+_LIT(KKey,			"key");
+/*@}*/
+
+
+// constructor
+CTestContactsBase::CTestContactsBase()
+:	iDatabase(NULL)
+,	iFieldDef(NULL)
+,	iSchedular(NULL)
+	{
+	}
+
+// destructor
+CTestContactsBase::~CTestContactsBase()
+	{
+	delete iFieldDef;
+	iFieldDef=NULL;
+
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+	}
+
+enum TVerdict CTestContactsBase::doTestStepPreambleL()
+	{
+	iSchedular=new (ELeave)CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+
+	iFieldDef=new(ELeave) CContactItemFieldDef;
+	iFieldDef->AppendL(KUidContactFieldFamilyName);
+	iFieldDef->AppendL(KUidContactFieldGivenName);
+	return CTestStep::doTestStepPreambleL();
+	}
+
+enum TVerdict CTestContactsBase::doTestStepPostambleL()
+	{
+	delete iFieldDef;
+	iFieldDef=NULL;
+
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+
+	return CTestStep::doTestStepPostambleL();
+	}
+
+// Create a new database
+void CTestContactsBase::CreateDatabase()
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName(), ptrFileName);
+	if (!returnValue)
+		returnValue=GetStringFromConfig(KDef(), KFileName(), ptrFileName);
+
+	//	Create database
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		TRAPD(r, iDatabase=CContactDatabase::ReplaceL(ptrFileName))
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Creating Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	else
+		{
+		INFO_PRINTF1(_L("No Contacts file specified. Open default file."));
+		TRAPD(r, iDatabase=CContactDatabase::ReplaceL())
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Creating Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	}
+
+void CTestContactsBase::OpenDatabase()
+	{
+	TPtrC	ptrFileName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KFileName(), ptrFileName);
+	if (!returnValue)
+		returnValue=GetStringFromConfig(KDef(), KFileName(), ptrFileName);
+
+	//	Open database
+	if (returnValue)
+		{
+		INFO_PRINTF2(_L("filename = %S"), &ptrFileName);
+		RaiseInstrumentationEventNotificationL(17);
+		TRAPD(r, iDatabase=CContactDatabase::OpenL(ptrFileName));
+		RaiseInstrumentationEventNotificationL(18);
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Opening Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	else
+		{
+		INFO_PRINTF1(_L("No Contacts file specified. Open default file."));
+		RaiseInstrumentationEventNotificationL(17);
+		TRAPD(r, iDatabase=CContactDatabase::OpenL(CContactDatabase::EMultiThread));
+		RaiseInstrumentationEventNotificationL(18);
+		if (r!=KErrNone)
+			{
+			ERR_PRINTF2(_L("Opening Contacts file failed. Error %d"), r);
+			SetTestStepResult(EFail);
+			}
+		}
+	}
+
+void CTestContactsBase::CleanupDatabase()
+	{
+	delete iDatabase;
+	iDatabase=NULL;
+	}
+
+void CTestContactsBase::RaiseInstrumentationEventNotificationL(TInt aEventTag)
+	{
+	INFO_PRINTF2(_L("RaiseEventNotification %d"), aEventTag);
+	}
+
+CContactIdArray* CTestContactsBase::SearchEntriesL()
+/**
+This function searches in the contacts database and populates an array
+with ids' of the contacts which satisfy the search criterion
+read from the ini file.
+@return - Pointer to the contact ID array
+@leave system wide error code
+ */
+	{
+	TPtrC	ptrKey;
+	if (!GetStringFromConfig(ConfigSection(), KKey, ptrKey))
+		{
+		ERR_PRINTF1(_L("No key value for entry"));
+		SetTestStepResult(EFail);
+		}
+	INFO_PRINTF2(_L("Key Value for Entry Search = %S"), &ptrKey);
+
+	// The function searches the fields contained in the field definition
+	INFO_PRINTF1(_L("Searching through the database for entry"));
+
+	CContactIdArray*	ret=iDatabase->FindLC(ptrKey, iFieldDef);
+	CleanupStack::Pop(ret);
+	return ret;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/src/TestContactsCreateDB.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,42 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestContactsCreateDB
+// 
+//
+
+#include <TestExecuteLog.h>
+
+#include "TestContactsCreateDB.h"
+
+CTestContactsCreateDB::CTestContactsCreateDB()
+	{
+	SetTestStepName(_L("CreateDB"));
+	}
+
+CTestContactsCreateDB::~CTestContactsCreateDB()
+	{
+	}
+
+// Each test step must supply a implementation for doTestStepL
+enum TVerdict CTestContactsCreateDB::doTestStepL()
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Contacts CreateDB Test"));
+
+	CreateDatabase();
+	CleanupDatabase();
+
+	// test steps return a result
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/contacts/src/sm_contacts.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,2 @@
+[Files MRU]
+0=m:\src\common\generic\smoketest\agenda\src\TestAgendaServerLaunchProgress.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Group/Smoketest_Mess.mmp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,82 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET			Smoketest_Mess_Server.exe
+TARGETTYPE		exe
+UID				0x1000007A 0x101F7774
+
+#if (!defined __NO_VENDORID__)
+VENDORID		0x70000001
+#endif
+
+CAPABILITY		ReadUserData WriteUserData WriteDeviceData NetworkServices
+
+#if (defined _PLATTEST_CDMA_)
+MACRO			CDMA_API_ENABLED
+MACRO			GSM_COMPATIBILITY_MODE
+#endif
+
+SOURCEPATH		..\Src
+
+SOURCE			TestMessServer.cpp
+SOURCE			TestMessSession.cpp
+SOURCE			TestMessSharedData.cpp
+SOURCE			TestMessWatcher.cpp
+SOURCE			TestMessProcessor.cpp
+SOURCE			TestMessTimer.cpp
+SOURCE			TestMessBase.cpp
+SOURCE			TestMessCleanMessageFolder.cpp
+SOURCE			TestMessCreateSmsAccount.cpp
+SOURCE			TestMessSetDefaultSc.cpp
+SOURCE			TestMessCreateSMS.cpp
+SOURCE			TestMessCreateGsmSmsUtil.cpp
+#ifdef _PLATTEST_CDMA_
+SOURCE			TestMessCreateCdmaSmsUtil.cpp
+#endif
+SOURCE			TestMessCreateSmsUtilBase.cpp
+SOURCE			TestMessProcessExistingMsg.cpp
+SOURCE			TestMessEditEntry.cpp
+SOURCE			TestMessStoreProcessUtil.cpp
+SOURCE			TestMessEditEntryUtil.cpp
+SOURCE			TestMessPrintEntryUtil.cpp
+
+USERINCLUDE		..\Inc 
+USERINCLUDE		..\..\Group
+
+SYSTEMINCLUDE	\Epoc32\include
+SYSTEMINCLUDE	\Epoc32\include\Test
+
+LIBRARY			etel.lib
+LIBRARY			schsend.lib
+LIBRARY			estor.lib
+LIBRARY			euser.lib
+LIBRARY			bafl.lib
+LIBRARY			msgs.lib
+LIBRARY			fbscli.lib
+LIBRARY			imcm.lib
+LIBRARY			efsrv.lib
+LIBRARY			sendas2.lib
+LIBRARY			etext.lib
+LIBRARY			smcm.lib
+
+LIBRARY			gsmu.lib
+LIBRARY			esock.lib
+LIBRARY			smsu.lib
+LIBRARY			TestExecuteUtils.lib 
+LIBRARY			TestExecuteLogClient.lib
+LIBRARY			SmokeTest_Utils.lib
+LIBRARY			etelmm.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Group/bld.inf	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Integration test system build description file for self test suite
+// 
+//
+
+PRJ_TESTEXPORTS
+
+../Scripts/Smoketest_CreateSmsAccount.script	z:/smoketest/smoketest_createsmsaccount.script
+../Scripts/setup_Smoketest_Mess.script			z:/smoketest/setup_smoketest_mess.script
+../Scripts/Smoketest_Mess.script				z:/smoketest/smoketest_mess.script
+../TestData/Sms/Message1.txt					z:/smoketest/sms/message1.txt
+../TestData/Smoketest_Mess.ini			   		z:/smoketest/smoketest_mess.ini
+
+PRJ_TESTMMPFILES
+Smoketest_Mess.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMess.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,26 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMess which contains common constants
+// 
+//
+
+#if (!defined __TEST_MESS_H__)
+#define __TEST_MESS_H__
+
+/*@{*/
+/// Literals defined for SMS account details
+_LIT(KSmsAccountName,	"Short Message");
+/*@}*/ 
+
+#endif /* __TEST_MESS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,126 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessBase which is the base class for all 
+// messaging test steps
+// 
+//
+
+
+#if (!defined __TEST_MESS_BASE_H__)
+#define __TEST_MESS_BASE_H__
+
+#include "Configuration.cfg"
+
+#include <msvapi.h>
+#include <SmutHdr.h>
+#include <TestExecuteStepBase.h>
+#include <EMSFormatIE.h>
+#include <EMSSoundIE.h>
+#include <EMSAnimationIE.h>
+#include <IAPPrefs.h>
+
+#include "TestMessProcessor.h"
+#include "TestMessTimer.h"
+
+#include <smut.h>
+#include <Smutset.h>
+#include <etelmm.h>
+#if (defined CDMA_API_ENABLED)
+#include <SmsMessageWrappers.h>
+#include <SmsMessageSettings.h>
+#endif
+#include <SmutHdr.h>
+
+#include <TestStepSmokeTest.h>
+//To check whether the reply quoted is set
+_LIT(KReplyQuoted,		"SmsReplyQuoted");
+
+const TUid KUidMsvSMSHeaderStream				= {0x10001834};
+const TUid KUidMsgFileInternetAccessPreferences	= {0x1000924B};
+const TUid KUidMsvDefaultServices				= {0x100017FD};
+
+const TInt	KOneSecond = 1000000;
+
+class	CParaFormatLayer;
+class 	CCharFormatLayer;
+class 	CRichText;
+
+class CTestMessBase : public CTestStepSmokeTest, private MMsvSessionObserver
+	{
+public:
+	CTestMessBase(TBool aSetDirectory);
+	virtual ~CTestMessBase();
+
+	virtual TVerdict	doTestStepPreambleL();
+	virtual TVerdict	doTestStepPostambleL();
+
+	void							SetEntryL(TMsvId	aId);
+	CMsvEntry&						EntryL();
+	TBool							HasEntry() const { return iEntry!=NULL; }
+	const TMsvSelectionOrdering&	SelectionOrdering() const { return iOrder; }
+	CMsvSession&					Session() const { return *iSession; }
+	void							PrintEntryL(CMsvEntry& aEntry);
+	CEmsPreDefSoundIE*				NewPreDefSoundL(const TDesC& aPreDefType);
+
+
+protected:
+	//	MMsvSessionObserver
+	void			HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*);
+
+	//	Utilities
+	static HBufC8*	CopyToBuf8LC(const TDesC& aPtrC);
+	static HBufC*	CopyToBufLC(const TDesC8& aPtr8);
+	void			PrintTreeL(TMsvId aRoot);
+	void			IssueTimerRequest();
+
+
+	void			PrepareSmsHeaderFromIniFileL(CSmsHeader& aSmsHeader);
+
+	//reads the schedule time from ini file
+	TTimeIntervalMinutes	ReadScheduleTime();
+
+private:
+	//	PrintEntry helper functions
+	void			PrintStoreL(CMsvEntry& aEntry);
+	void			PrintStoreSmtpL(CMsvEntry& aEntry);
+	void			PrintStorePop3L(CMsvEntry& aEntry);
+	void			PrintStoreImap4L(CMsvEntry& aEntry);
+	void			PrintStoreSmsL(CMsvEntry& aEntry);
+
+	//	PrepareSmsHeaderFromIniFileL helper functions
+	void			SetAlignmentFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aAlignment);
+	void			SetFontSizeFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aFontSize);
+
+	CEmsPreDefAnimationIE*	NewPreDefAnimationL(const TDesC& aPreDefType);
+	CFbsBitmap*				NewBitmapL(const TParse& aFileName, const TDesC& aObjectSize);
+
+protected:
+	CMsvSession*				iSession;
+	CTestMessProcessor*			iMessageProcessor;
+	CParaFormatLayer*			iParaFormatLayer;
+ 	CCharFormatLayer*			iCharFormatLayer;
+ 	CRichText*					iBodyText;
+    TBool						iBodyAvailable;
+
+
+private:
+    TBool						iCheckForSim;
+	TBool						iSetDirectory;
+	CTestMessTimer*				iMessageTimer;
+	CActiveScheduler*			iSchedular;
+	CMsvEntry*					iEntry;
+	TMsvSelectionOrdering		iOrder;
+	};
+
+#endif /* __TEST_MESS_BASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessCleanMessageFolder.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,38 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCleanMessageFolder which cleans out all the
+// message folders
+// 
+//
+
+#if (!defined __TEST_MESS_CLEAN_MESSAGE_FOLDER_H__)
+#define __TEST_MESS_CLEAN_MESSAGE_FOLDER_H__
+
+#include "TestMessBase.h"
+
+class CTestMessCleanMessageFolder : public CTestMessBase
+{
+public:
+	CTestMessCleanMessageFolder();
+
+	virtual	TVerdict	doTestStepL();
+
+private:
+	void	CleanFolders(const TMsvId aEntryId);
+
+private:
+	TInt	iNumberOfMessagesToDelete;
+};
+
+#endif /* __TEST_MESS_CLEAN_MESSAGE_FOLDER_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessCreateCdmaSmsUtil.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,56 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class creates a Cdma sms header and service settings. It sets the fields by reading
+// from the ini file
+// 
+//
+ 
+
+#if (!defined __TEST_MESS_CREATE_CDMA_SMS_UTIL_H__)
+#define __TEST_MESS_CREATE_CDMA_SMS_UTIL_H__
+
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ This class creates a Cdma sms header and service settings.It sets the fields by reading
+ from the ini file
+*/
+class CTestMessCreateCdmaSmsUtil : public CTestMessCreateSmsUtilBase
+{
+public:
+	//Constructor
+	CTestMessCreateCdmaSmsUtil(CTestMessBase &aTestStep);
+
+	//Creates a new header
+	CSmsHeader* NewHeaderL(CRichText &aBodyText);
+
+	//Sets the fields of the header
+	void PrepareHeaderL(CSmsHeader &aSmsHeader);
+
+	//Sets the account settings.
+	void SetSmsAccountSettings(CSmsSettings &aSmsSettings);
+
+private:
+	//Gets the message type of the SMS
+	TSmsMessageType GetMessageTypeId(TPtrC aMessageType);
+	
+	//Gets the tele service ID
+	tia637::TTeleserviceId GetTeleServiceId(TPtrC aTeleService);
+
+	//Gets the message conversion ID
+	TSmsPIDConversion GetMessageConversionId(TPtrC aMessageConversion);
+	
+};
+
+#endif /* __TEST_MESS_CREATE_CDMA_SMS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessCreateGsmSmsUtil.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,56 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class creates the Gsm sms header and service settings. It fills up the
+// fields using data read from the ini file
+// 
+//
+
+
+#if (!defined __TEST_MESS_CREATE_GSM_SMS_UTIL_H__)
+#define __TEST_MESS_CREATE_GSM_SMS_UTIL_H__
+
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ This class creates the Gsm sms header and the GSM SMS service settings. 
+ The data is read from the ini file.
+*/
+class CTestMessCreateGsmSmsUtil : public CTestMessCreateSmsUtilBase
+	{
+public:
+	//Constructor
+	CTestMessCreateGsmSmsUtil(CTestMessBase &aTestStep);
+
+	/**
+	 Prepare sms account details
+	*/
+	virtual void		PrepareAccountL(CMsvSession& aSession);
+
+	/**
+	 Creates the new header object
+	*/
+	virtual CSmsHeader*	NewHeaderL(CRichText &aBodyText);
+
+	/**
+	 Fills up the fields of the sms header object
+	*/
+	virtual void 		PrepareHeaderL(CSmsHeader &aSmsHeader);
+
+	/**
+	 Fills up the fields of the sms account settings 
+	*/
+	virtual void 		SetSmsAccountSettings(CSmsSettings &aSmsSettings);
+	};
+
+#endif /* __TEST_MESS_CREATE_GSM_SMS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessCreateSMS.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,64 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCreateSMS. This class creates the sms message 
+// for GSM or CDMA. For CDMA mtm, it uses utility classes to create 
+// the respective GSM or CDMA sms message
+// 
+//
+
+#if (!defined __TEST_MESS_CREATE_SMS_H__)
+#define __TEST_MESS_CREATE_SMS_H__
+
+//Epoc include
+#include <SmokeTestActive.h>
+#include <sendas2.h>
+#include <csendasaccounts.h>
+#include <csendasmessageTypes.h>
+
+#include "TestMessBase.h"
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ This class creates the sms message for GSM or CDMA. For CDMA mtm, it 
+ uses utility classes to create the respective GSM or CDMA sms message
+*/
+class CTestMessCreateSMS : public CTestMessBase
+,	private MTestActiveCallback
+	{
+public:
+	CTestMessCreateSMS();
+
+	virtual	TVerdict	doTestStepPreambleL();
+	virtual	TVerdict	doTestStepL();
+
+protected:
+	virtual void		AddMtmCapabilitiesL(RSendAs& aSendAs);
+	virtual void		PrepareSendAsL(RSendAsMessage& aSendAs);
+	virtual void		PrepareHeaderL(CTestMessCreateSmsUtilBase& aCreateUtil, CSmsHeader& aSmsHeader);
+	void				ConCatMessageTextL(CSmsHeader& aHeader);
+	void				CreateSmsL(const TMsvId aMsvId, TTimeIntervalMinutes aScheduledTime);
+
+private:
+	virtual void	RunL() { CActiveScheduler::Stop(); }
+	/**
+	* Method from which CTestActive informs the user DoCancel call
+	*/
+	virtual void	DoCancel() { }
+
+private:
+	TBool							iSimInDatabase;
+	RMobilePhone::TMobileAddress	iSimPhoneNumber;
+	};
+
+#endif /* __TEST_MESS_CREATE_SMS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessCreateSMSaccount.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,36 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessCreateSmsAccount.cpp
+// This contains CTestMessCreateSmsAccount which creates an SMS
+// account folder for GSM or CDMA
+// 
+//
+
+#if (!defined __TEST_MESS_CREATE_SMS_ACCOUNT_H__)
+#define __TEST_MESS_CREATE_SMS_ACCOUNT_H__
+
+#include "TestMessBase.h"
+
+/**
+ This class creates an SMS account folder for GSM or CDMA
+*/
+class CTestMessCreateSmsAccount : public CTestMessBase
+	{
+public:
+	CTestMessCreateSmsAccount();
+
+	virtual	TVerdict	doTestStepL();
+	};
+
+#endif /* __TEST_MESS_CREATE_SMS_ACCOUNT_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessCreateSmsUtilBase.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,81 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class is the base class for create CDMA or GSM SMS utility class
+// 
+//
+
+#if (!defined __TEST_MESS_CREATE_SMS_UTIL_BASE_H__)
+#define __TEST_MESS_CREATE_SMS_UTIL_BASE_H__
+
+#include "TestMessBase.h"
+
+// EPOC includes
+#include <mtmuids.h>
+#include <txtrich.h>
+
+#include <smut.h>
+
+/*@{*/
+_LIT(KBearer,				"bearer");
+_LIT(KEncoding,				"encoding");
+_LIT(KDef,					"default");
+_LIT(KDefBearer,			"smsbearer");
+_LIT(KDefEncoding,			"smsencoding");
+_LIT(KDefDeliveryReport,	"smsDeliveryReport");
+_LIT(KDeliveryReport,		"DeliveryReport");
+_LIT(KRejectDuplicate,		"SmsRejectDuplicate");
+_LIT(KReplyPath,			"SmsReplyPath");
+_LIT(KConCatenate,			"SmsConCatenate");
+
+_LIT(KBearerWap,			"wap");
+_LIT(KBearerWapSecure,		"wapsecure");
+/*@}*/
+
+/**
+ This class is the base class for create GSM or CDMA SMS utility classes
+*/
+class CTestMessCreateSmsUtilBase : public CBase
+	{
+public:
+	//Constructor
+	CTestMessCreateSmsUtilBase(CTestMessBase &aTestStep);
+
+	/**
+	 Prepare sms account details
+	*/
+	virtual void		PrepareAccountL(CMsvSession& aSession) = 0;
+
+	/**
+	 Creates the new header object
+	*/
+	virtual CSmsHeader*	NewHeaderL(CRichText &aBodyText) = 0;
+
+	/**
+	 Fills up the fields of the sms header object
+	*/
+	virtual void 		PrepareHeaderL(CSmsHeader &aSmsHeader) =0;
+
+	/**
+	 Fills up the fields of the sms account settings 
+	*/
+	virtual void 		SetSmsAccountSettings(CSmsSettings &aSmsSettings) =0;
+
+protected:
+	/**
+	 Reference to the test step which creates the utility class
+	*/
+	CTestMessBase&		iTestStep;
+	};
+
+#endif /* __TEST_MESS_CREATE_SMS_UTIL_BASE_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessEditEntry.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,64 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntry which edits the entry characterstics
+// 
+//
+
+
+#if (!defined __TEST_MESS_EDIT_ENTRY_H__)
+#define __TEST_MESS_EDIT_ENTRY_H__
+
+#include "TestMessProcessExistingMsg.h"
+
+/**
+ This class edits the entry characteristics
+*/
+class CTestMessEditEntry : public CTestMessProcessExistingMsg
+{
+public:
+	CTestMessEditEntry() { SetTestStepName(_L("EditEntry")); }
+
+	virtual	void ProcessMessageL(CBaseMtm& aBaseMtm, TMsvId aMsgId);
+
+	//Move the message to different folder
+	void MoveMessageL(TMsvId aMessageId,TMsvId aFolderId);
+
+	/**
+	 This class is used for asynchronous operation for move
+	 message operation
+	*/
+	class CMoveOperation: public CActive
+		{
+	public:
+		//Pure virtual implementation of CActive
+		void RunL();
+
+		//Pure virtual implementation of CActive
+		void DoCancel();
+		
+		//Set the operation as active
+		void SetOperation();
+
+		//Two phase construction
+		static CMoveOperation* NewL();
+	private:
+		//Second phase construction
+		void ConstructL();
+
+		//Constructor
+		CMoveOperation();
+		};
+};
+
+#endif /* __TEST_MESS_EDIT_ENTRY_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessEditEntryUtil.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,54 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntryUtil. A utility to edit an entry
+// 
+//
+
+#if (!defined __TEST_MESS_EDIT_ENTRY_UTIL_H__)
+#define __TEST_MESS_EDIT_ENTRY_UTIL_H__
+
+#include "TestMessStoreProcessUtil.h"
+
+/**
+ This class is a utility to edit an entry
+*/
+class CTestMessEditEntryUtil : public CTestMessStoreProcessUtil
+{
+public:
+	CTestMessEditEntryUtil(CTestMessBase& aTestStep, TBool aSimChecked, TBool aSimInDatabase, RMobilePhone::TMobileAddress aSimPhoneNumber);
+
+protected:
+	// Process the CImHeader information
+	virtual void	ProcessImHeaderL(CImHeader& aHeader);
+
+	// Process the CImMimeHeader information
+	virtual void	ProcessImMimeHeaderL(CImMimeHeader& aHeader);
+
+	// Process the CImIAPPreferences information
+	virtual void	ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences);
+
+	// Process the CSmsHeader information
+	virtual void	ProcessSmsHeaderStreamL(CSmsHeader& aHeader);
+
+
+	// Process the CRichText information
+	virtual void	ProcessRichTextBodyL(CRichText& aBodyText);
+
+private:
+	TBool							iSimChecked;
+	TBool							iSimInDatabase;
+	RMobilePhone::TMobileAddress	iSimPhoneNumber;
+};
+
+#endif /* __TEST_MESS_EDIT_ENTRY_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessPrintEntryUtil.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,56 @@
+/**
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains CTestMessEditEntryUtil. A utility to edit an entry
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file TestMessPrintEntryUtil.h
+*/
+
+#if (!defined __TEST_MESS_PRINT_ENTRY_UTIL_H__)
+#define __TEST_MESS_PRINT_ENTRY_UTIL_H__
+
+#include "TestMessStoreProcessUtil.h"
+
+class CTestMessPrintEntryUtil : public CTestMessStoreProcessUtil
+{
+public:
+	CTestMessPrintEntryUtil(CTestMessBase& aTestStep);
+
+protected:
+	// Process the CImHeader information
+	virtual void	ProcessImHeaderL(CImHeader& aHeader);
+
+	// Process the CImMimeHeader information
+	virtual void	ProcessImMimeHeaderL(CImMimeHeader& aHeader);
+
+	// Process the CImIAPPreferences information
+	virtual void	ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences);
+
+	// Process the CSmsHeader information
+	virtual void	ProcessSmsHeaderStreamL(CSmsHeader& aHeader);
+
+
+	// Process the CRichText information
+	virtual void	ProcessRichTextBodyL(CRichText& aBodyText);
+};
+
+#endif /* __TEST_MESS_PRINT_ENTRY_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessProcessExistingMsg.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,43 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessProcessExistingMsg.cpp
+// This contains CTestMessProcessExistingMsg
+// Base class for processing an existing message
+// 
+//
+
+#if (!defined __TEST_MESS_PROCESS_EXISTING_MSG__)
+#define __TEST_MESS_PROCESS_EXISTING_MSG__
+
+#include "TestMessBase.h"
+
+#include <mtclbase.h>
+
+class CTestMessProcessExistingMsg : public CTestMessBase
+{
+public:
+	CTestMessProcessExistingMsg();
+
+	virtual	TVerdict		doTestStepL();
+
+protected:
+	virtual	void			ProcessMessageL(CBaseMtm& aBaseMtm, TMsvId aMsgId) = 0;
+	virtual	void			PostProcessMessageL();
+	TUid					MtmID() const { return iMtmID; }
+
+private:
+	TUid			iMtmID;
+};
+
+#endif /* __TEST_MESS_PROCESS_EXISTING_MSG__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessProcessor.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,86 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessProcessor.cpp
+// This contains CTestMessProcessor which an active object utility
+// used for send/recieving or any time consuming 
+// 
+//
+
+#if (!defined __TEST_MESS_PROCESSOR_H__)
+#define __TEST_MESS_PROCESSOR_H__
+
+//Epoc Include
+#include <e32base.h>
+#include <msvapi.h>
+#include <miuthdr.h>
+
+class CTestStep;
+
+class MTestMessProcessorClient
+	{
+public:
+	virtual TBool			MoreOperations() const = 0;
+	virtual CMsvOperation*	CreateOperationL(TRequestStatus& aStatus) = 0;
+	virtual TInt			DisplayProgressL(TBool aFinalProgress, CMsvOperation* aMsvOperation) = 0;
+	};
+
+/**
+ This class is an active object utility used for send/recieving
+ or any time consuming
+*/
+class CTestMessProcessor : public CActive
+	{
+public:
+	virtual ~CTestMessProcessor();
+	static CTestMessProcessor*	NewL(CTestStep& aTestStep, CMsvSession& aSession);
+
+	void	RunL();
+
+	void	DisplayProgress();
+	void	SendEmailMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient);
+
+	//Sends the SMS message
+	void	SendSmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient, TBool aCancelSms);
+	void	SendMmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient);
+	void	MtmRequestL(TMsvId aAccountId, MTestMessProcessorClient* aClient);
+
+protected:
+	CTestMessProcessor(CTestStep& aTestStep, CMsvSession& aSession /*, MTestInstrumentation& aInstrumentation */);
+	void	ConstructL();
+	void	DoCancel();
+
+private:
+	enum EState
+		{
+		EStatePrepareToSendMsg,
+		EStateRequest,
+		};
+
+	EState						iState;
+	CTestStep&					iTestStep;
+	CMsvSession&				iSession;
+
+	//	Send message parameters saved for RunL
+	CMsvEntry*					iEntry;
+	TMsvId						iMsgId;
+	MTestMessProcessorClient*	iClient;
+	TMsvEntry					iMsgEntry;
+	CMsvOperation*				iMsvOperation;
+	/**
+	 Boolean value for the Cancel sms flag
+	*/
+	TBool						iCancelSms;
+};
+
+#endif /* __TEST_MESS_PROCESSOR_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessServer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,45 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessServer
+// 
+//
+
+#if (!defined __TEST_MESS_SERVER_H_)
+#define __TEST_MESS_SERVER_H_
+
+#include "TestMessWatcher.h"
+#include "TestMessSharedData.h"
+
+#include <TestExecuteServerBase.h>
+
+class CMsvSession;
+
+class  CTestMessServer : public CTestServer
+{
+public:
+	static CTestMessServer*	NewL();
+	virtual CTestStep*		CreateTestStep(const TDesC& aStepName);
+	~CTestMessServer();
+	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+protected:
+	CTestMessServer();
+	void	ConstructL(const TDesC& aName);
+
+private:
+
+private:
+	CTestMessSharedData*	iSharedData;
+};
+
+#endif /* __TEST_MESS_SERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessSession.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,35 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessSession
+// 
+//
+
+#if (!defined __TEST_MESS_SESSION_H__)
+#define __TEST_MESS_SESSION_H__
+
+#include <TestExecuteServerUtils.h>
+#include "TestMessSharedData.h"
+
+class CTestMessSession : public CTestSession
+{
+public:
+	CTestMessSession(CTestMessSharedData* aSharedData);
+	virtual void ServiceL(const RMessage2& aMessage);
+
+
+private:
+	CTestMessSharedData*	iSharedData;
+};
+
+#endif /* __TEST_MESS_SESSION_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessSetDefaultSc.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessSetDefaultSc.cpp
+// This contains TestMessSetDefaultSc which sets an SMS
+// SC as default SC.
+// 
+//
+
+#if (!defined __TEST_MESS_SET_DEFAULT_SC_H__)
+#define __TEST_MESS_SET_DEFAULT_SC_H__
+
+#include "TestMessBase.h"
+
+class CTestMessSetDefaultSc : public CTestMessBase
+{
+public:
+	CTestMessSetDefaultSc();
+
+	virtual	TVerdict	doTestStepL();
+};
+
+#endif /* __TEST_MESS_SET_DEFAULT_SC_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessSharedData.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,102 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessSharedData
+// 
+//
+
+#if (!defined __TEST_MESS_SHARED_DATA_H__)
+#define __TEST_MESS_SHARED_DATA_H__
+
+#include <msvapi.h>
+#include <mtclreg.h>
+#include <ImapConnectionObserver.h>
+#include <TestExecuteStepBase.h>
+
+class  CTestMessSharedData : public CBase, private MMsvSessionObserver
+{
+public:
+	static CTestMessSharedData*	NewL();
+	~CTestMessSharedData();
+
+	void	IMAP4ConnectAndSyncCompleteAfterDisconnectL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep);
+	TInt	DeleteEntryL(CTestStep& aStep);
+
+	void	DoProcessL();
+
+protected:
+	CTestMessSharedData();
+
+private:
+	void	ConstructL();
+
+	//	MMsvSessionObserver implementation
+	virtual void HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*) {}
+
+private:
+	class CMsgEntry : public CActive
+	{
+	public:
+		~CMsgEntry();
+
+		virtual void	DoCancel();
+		virtual void	RunL();
+		virtual void	DoProcessL(CClientMtmRegistry& aMtmRegistry) = 0;
+		virtual void	DoCancelProcessL() = 0;
+
+	protected:
+		CMsgEntry(CMsgEntry* aList);
+
+		void	ConstructL(CTestStep& aStep);
+
+	public:
+		TName		iName;
+		CMsgEntry*	iNext;
+		TBool		iReadyToBeDeleted;
+	};
+	class CMsgIMAP4ConnectAndSyncComplete : public CMsgEntry, public MMsvImapConnectionObserver
+	{
+	public:
+		static CMsgIMAP4ConnectAndSyncComplete* NewL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep, CMsgEntry* aList);
+		~CMsgIMAP4ConnectAndSyncComplete();
+
+		virtual void	RunL();
+		virtual void	DoProcessL(CClientMtmRegistry& aMtmRegistry);
+		virtual void	DoCancelProcessL();
+
+	protected:
+		CMsgIMAP4ConnectAndSyncComplete(TUid aMtmId, TMsvId aMsvId, CMsgEntry* aList);
+
+	private:		
+		//	MMsvImapConnectionObserver implementation
+		void	HandleImapConnectionEvent(TImapConnectionEvent aConnectionEvent);
+
+	private:
+		TUid			iMtmId;
+		TMsvId			iMsvId;
+		CBaseMtm*		iBaseMtm;
+		CMsvOperation*	iOperation;
+		
+	};
+
+public:
+	CMsvSession*		iSession;
+	CClientMtmRegistry*	iMtmRegistry;
+	CMsgEntry*			iList;
+
+private:
+	CMsgEntry*			iAnyPostStepToDo;
+	TBool				iDeleteTestStep;
+};
+
+#endif /* __TEST_MESS_SHARED_DATA_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessStoreProcessUtil.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,83 @@
+/**
+* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* This contains CTestMessStoreProcessUtil. Base class process what is in the message store
+* 
+*
+*/
+
+
+
+
+
+/**
+ @file TestMessStoreProcessUtil.h
+*/
+
+#if (!defined __TEST_MESS_STORE_PROCESS_UTIL_H__)
+#define __TEST_MESS_STORE_PROCESS_UTIL_H__
+
+#include "TestMessBase.h"
+
+class CTestMessStoreProcessUtil : public CBase
+{
+public:
+	CTestMessStoreProcessUtil(CTestMessBase& aTestStep, TBool aReadOnly);
+
+	//
+	TInt	ProcessEntryL(TMsvId aMsvId);
+
+protected:
+	// Process the CImHeader information
+	virtual void	ProcessImHeaderL(CImHeader& aHeader) = 0;
+
+	// Process the CImMimeHeader information
+	virtual void	ProcessImMimeHeaderL(CImMimeHeader& aHeader) = 0;
+
+	// Process the CImIAPPreferences information
+	virtual void	ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences) = 0;
+
+	// Process the CSmsHeader information
+	virtual void	ProcessSmsHeaderStreamL(CSmsHeader& aHeader) = 0;
+
+
+	// Process the CRichText information
+	virtual void	ProcessRichTextBodyL(CRichText& aBodyText) = 0;
+
+	// Convert Text to character set information
+	TBool			ValidCharacterSetInfo(const TPtrC& aCharacterSetType, TUint &aCharSetVal);
+
+private:
+	// Process the CImHeader information
+	void	ProcessImHeaderL(CMsvStore& aStore);
+
+	// Process the CImMimeHeader information
+	void	ProcessImMimeHeaderL(CMsvStore& aStore);
+
+
+	// Process the CSmsHeader information
+	void	ProcessSmsHeaderStreamL(CMsvStore& aStore);
+
+
+	// Process the CRichText information
+	void	ProcessRichTextBodyL(CMsvStore& aStore);
+
+protected:
+	CTestMessBase&	iTestStep;
+
+private:
+	TBool			iReadOnly;
+};
+
+#endif /* __TEST_MESS_STORE_PROCESS_UTIL_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessTimer.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,44 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessTimer
+// 
+//
+
+#if (!defined __TEST_MESS_TIMER_H_)
+#define __TEST_MESS_TIMER_H_
+
+#include <e32base.h>
+
+class CTestMessProcessor;
+
+class CTestMessTimer : public CTimer  
+{
+public:
+	virtual ~CTestMessTimer();
+	static CTestMessTimer*	NewL(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor);
+
+	void	RunL();
+
+	void	IssueRequest();
+
+protected:
+	CTestMessTimer(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor);
+	void	ConstructL();
+
+private:
+	TTimeIntervalMicroSeconds32	iInterval;
+	CTestMessProcessor&			iProcessor;
+};
+
+#endif /* __TEST_MESS_TIMER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Inc/TestMessWatcher.h	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,45 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessWatcher which starts the message watchers
+// 
+//
+
+#if (!defined __TEST_MESS_WATCHER_H__)
+#define __TEST_MESS_WATCHER_H__
+
+#include <e32base.h>
+#include <watcher.h>
+
+const TInt	KTestUtilsWatcherStarterMin = 5000000;
+
+class CTestMessWatcher : public CActive
+{
+public:
+	static CTestMessWatcher* NewL(TInt aPriority = EPriorityStandard);
+	~CTestMessWatcher();
+
+private:
+	CTestMessWatcher(TInt aPriority);
+	void	RunL();
+	void	DoCancel();
+	void	ConstructL();
+
+private:
+	RTimer						iTimer;
+	RProcess					iWatcher;
+	TBool						iConstructed;
+	TTimeIntervalMicroSeconds32	iTimeLeft;
+};
+
+#endif /* __TEST_MESS_WATCHER_H__ */
Binary file common/tools/ats/smoketest/messaging/ReadMe.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Scripts/Smoketest_CreateSmsAccount.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Create SMS account with vodaphone service centre
+//
+LOAD_SUITE Smoketest_Mess_Server
+//
+START_TESTCASE	SMOKE_MESS_SMS_0001
+RUN_TEST_STEP	10000	Smoketest_Mess_Server CreateSmsAccount		c:\smoketest\smoketest_mess.ini	27029_SmsVodafoneAccount
+END_TESTCASE	SMOKE_MESS_SMS_0001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Scripts/Smoketest_Mess.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run Mesaging smoketest
+//
+LOAD_SUITE Smoketest_Mess_Server
+// Wait for watchers to start
+DELAY 1000
+//
+START_TESTCASE SMOKE_MESS_SMS_0002
+RUN_TEST_STEP	10000	Smoketest_Mess_Server CleanMessageFolder		c:\smoketest\Smoketest_mess.ini	27595_SmsCount01
+END_TESTCASE	SMOKE_MESS_SMS_0002
+DELAY 500
+//
+RUN_SCRIPT	c:\smoketest\Smoketest_CreateSmsAccount.script
+//
+START_TESTCASE SMOKE_MESS_SMS_0003
+RUN_TEST_STEP	10000	Smoketest_Mess_Server SetSmsSc				c:\smoketest\Smoketest_mess.ini	27029_SmsVodafoneAccount
+END_TESTCASE	SMOKE_MESS_SMS_0003
+DELAY 500
+//
+START_TESTCASE SMOKE_MESS_SMS_0004
+RUN_TEST_STEP	10000	Smoketest_Mess_Server CreateSms				c:\smoketest\Smoketest_mess.ini	27584_SmsMessage01
+END_TESTCASE	SMOKE_MESS_SMS_0004
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Scripts/setup_Smoketest_Mess.script	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,27 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+RUN_UTILS MkDir c:\smoketest\
+RUN_UTILS MkDir c:\smoketest\sms\
+
+RUN_UTILS CopyFile z:\smoketest\smoketest_mess.ini	c:\smoketest\smoketest_mess.ini
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_mess.ini
+RUN_UTILS CopyFile z:\smoketest\sms\message1.txt	c:\smoketest\sms\message1.txt
+RUN_UTILS MakeReadWrite c:\smoketest\sms\message1.txt
+RUN_UTILS CopyFile z:\smoketest\smoketest_createsmsaccount.script	c:\smoketest\smoketest_createsmsaccount.script
+RUN_UTILS MakeReadWrite c:\smoketest\smoketest_createsmsaccount.script
+
+// RUN_SCRIPT c:\Smoketest\Smoketest_Mess.script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,1518 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestCase which is the base class for all the TestCase DLLs
+// 
+//
+
+#include "Configuration.cfg"
+
+#include "TestMessBase.h"
+#include "TestMessProcessor.h"
+#include "TestMessTimer.h"
+#include "TestMessPrintEntryUtil.h"
+
+// EPOC includes
+#include <SmtpSet.h>
+#include <Pop3Set.h>
+#include <ImapSet.h>
+#include <txtrich.h>
+#include <f32file.h>
+#include <msvids.h>
+#include <fbs.h>
+#include <EMSUserPromptIE.h>
+#ifdef __MESSAGING_API_V2__
+#include <smut.h>
+#include <miutset.h>
+#include <cemailaccounts.h>
+#include <csmsaccount.h>
+#endif
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+_LIT(KDepth,					"depth");
+_LIT(KFolder,					"folder%d");
+
+/// Default value for depth of the count
+#define KDefaultDepthCount		1
+
+/// Default value for depth of the count
+#define KDefaultDepthCount		1
+
+_LIT(KDefault,					"default");
+
+_LIT(KScheduled,				"scheduled");
+_LIT(KProgress,					"progress");
+
+//_LIT(KIap,						"iap");
+//_LIT(KIapName,					"iapname");
+
+_LIT(KElements,					"elements");
+_LIT(KStartPosition,			"StartPosition%d");
+_LIT(KFile,						"File%d");
+_LIT(KType,						"Type%d");
+_LIT(KTypeFormat,				"Format");
+_LIT(KTypeSound,				"Sound");
+_LIT(KTypePreDefSound,			"PreDefSound");
+_LIT(KTypeAnimation,			"Animation");
+_LIT(KTypePreDefAnimation,		"PreDefAnimation");
+_LIT(KTypePicture,				"Picture");
+_LIT(KTypeUserPrompt,			"UserPrompt");
+_LIT(KFormatLength,				"FormatLength%d");
+_LIT(KBold,						"Bold%d");
+_LIT(KItalic,					"Italic%d");
+_LIT(KUnderline,				"Underline%d");
+_LIT(KStrikethrough,			"Strikethrough%d");
+_LIT(KAlignment,				"Alignment%d");
+_LIT(KFontSize,					"FontSize%d");
+
+_LIT(KLeftAlign,				"LeftAlign");
+_LIT(KRightAlign,				"RightAlign");
+_LIT(KCenterAlign,				"CenterAlign");
+_LIT(KLangDepend,				"LangDepend");
+
+_LIT(KNormal,					"Normal");
+_LIT(KLarge,					"Large");
+_LIT(KSmall,					"Small");
+_LIT(KVariable,					"Variable");
+_LIT(KReserved,					"Reserved");
+
+_LIT(KEmsPreDef,				"emspredef%d");
+
+_LIT(KEmsAnimTypeFlirty,		"a0");
+_LIT(KEmsAnimTypeGlad,			"a1");
+_LIT(KEmsAnimTypeSceptic,		"a2");
+_LIT(KEmsAnimTypeSad,			"a3");
+_LIT(KEmsAnimTypeWow,			"a4");
+_LIT(KEmsAnimTypeCrying,		"a5");
+_LIT(KEmsAnimTypeWinking,		"a6");
+_LIT(KEmsAnimTypeLaughing,		"a7");
+_LIT(KEmsAnimTypeIndifferent,	"a8");
+_LIT(KEmsAnimTypeKissing,		"a9");
+_LIT(KEmsAnimTypeConfused,		"a10");
+_LIT(KEmsAnimTypeTongueOut,		"a11");
+_LIT(KEmsAnimTypeAngry,			"a12");
+_LIT(KEmsAnimTypeGlasses,		"a13");
+_LIT(KEmsAnimTypeDevil,			"a14");
+
+_LIT(KEmsSoundTypeChimesHigh,	"s0");
+_LIT(KEmsSoundTypeChimesLow,	"s1");
+_LIT(KEmsSoundTypeDing,			"s2");
+_LIT(KEmsSoundTypeTaDa,			"s3");
+_LIT(KEmsSoundTypeNotify,		"s4");
+_LIT(KEmsSoundTypeDrum,			"s5");
+_LIT(KEmsSoundTypeClaps,		"s6");
+_LIT(KEmsSoundTypeFanFar,		"s7");
+_LIT(KEmsSoundTypeChordHigh,	"s8");
+_LIT(KEmsSoundTypeChordLow,		"s9");
+
+/*
+_LIT(KBioIAP,					"IAP");
+_LIT(KBioEmailNotification,		"EmailNotification");
+_LIT(KBioBusinessCard,			"BusinessCard");
+_LIT(KBioWAPAccessPoint,		"WAPAccessPoint");
+_LIT(KBioVCalendar,				"VCalendar");
+_LIT(KBioVCard,					"VCard");
+_LIT(KBioRingingTones,			"RingingTones");
+_LIT(KBioOperatorLogo,			"OperatorLogo");
+_LIT(KBioWPRV,					"WPRV");
+_LIT(KBioCLILogo,				"CLILogo");
+*/
+_LIT(KObjectSize,				"ObjectSize%d");
+_LIT(KBody,						"body");
+/*@}*/
+
+const TInt KSmallObject		= 0;
+const TInt KLargeObject		= 1;
+const TInt KVariableObject	= 2;
+
+const TInt KDefaultStartPos	= 1;
+
+/**
+ * Constructor.
+ * @return - None
+ * 
+*/	
+CTestMessBase::CTestMessBase(TBool aSetDirectory)
+:	CTestStepSmokeTest()
+,	iSession(NULL)
+,	iMessageProcessor(NULL)
+,   iParaFormatLayer(NULL)
+,   iCharFormatLayer(NULL)
+,   iBodyText(NULL)
+,	iBodyAvailable(EFalse)
+,	iSetDirectory(aSetDirectory)
+,	iMessageTimer(NULL)
+,	iSchedular(NULL)
+,	iEntry(NULL)
+,	iOrder(KMsvGroupByType|KMsvGroupByStandardFolders, EMsvSortById, ETrue)
+	{
+	}
+
+CTestMessBase::~CTestMessBase()
+	{
+	delete iEntry;
+	iEntry=NULL;
+	delete iMessageTimer;
+	iMessageTimer=NULL;
+	delete iMessageProcessor;
+	iMessageProcessor=NULL;
+	delete iSession;
+	iSession=NULL;
+	delete iSchedular;
+	iSchedular=NULL;
+	delete iBodyText;
+	iBodyText=NULL;
+	delete iCharFormatLayer;
+	iCharFormatLayer=NULL;
+	delete iParaFormatLayer;
+	iParaFormatLayer=NULL;
+	}
+
+enum TVerdict CTestMessBase::doTestStepPreambleL()
+	{
+	TVerdict	ret=CTestStepSmokeTest::doTestStepPreambleL();
+
+	// Printing to the console and log file
+	const TDesC&	stepName=TestStepName();
+	INFO_PRINTF2(_L("%S"), &stepName);
+
+	iSchedular=new (ELeave) CActiveScheduler();
+	CActiveScheduler::Install(iSchedular);
+	iSession=CMsvSession::OpenSyncL(*this);
+
+	//	Get progress
+	TInt	progress=0;
+	TBool	hasProgress=GetIntFromConfig(ConfigSection(), KProgress, progress);
+	if ( !hasProgress )
+		{
+		hasProgress=GetIntFromConfig(KDefault, KProgress, progress);
+		}
+
+	iMessageProcessor=CTestMessProcessor::NewL(*this, *iSession);
+	if ( hasProgress )
+		{
+		iMessageTimer=CTestMessTimer::NewL(progress*KOneSecond, *iMessageProcessor);
+		}
+
+	if ( iSetDirectory )
+		{
+		TInt	depth=KDefaultDepthCount;
+		TBool	returnValue=GetIntFromConfig(ConfigSection(), KDepth, depth);
+		if ( !returnValue )
+			{
+			depth=KDefaultDepthCount;
+			}
+		INFO_PRINTF2(_L("Depth = %d"), depth);
+
+		//	Searce for the entry
+		TRAPD(error,SetEntryL(KMsvRootIndexEntryId));
+		if( error != KErrNone)
+			{
+			INFO_PRINTF2(_L("Set Entry failed, Error %D"),error);
+			SetTestStepError(error);
+			ret=EFail;
+			}
+		else
+			{
+
+			TBuf<KMaxTestExecuteCommandLength>	tempStore;
+			TBool								found=ETrue;
+			for (TInt entry=0; entry<depth && found;)
+				{
+				TPtrC	subject;
+				tempStore.Format(KFolder(), ++entry);
+				returnValue =GetStringFromConfig(ConfigSection(), tempStore, subject);
+				if ( !returnValue )
+					{
+					INFO_PRINTF1(_L("Null Folder"));
+					}
+				INFO_PRINTF2(_L("Folder = %S"), &subject);
+
+				CMsvEntrySelection*	selection=EntryL().ChildrenL();
+				CleanupStack::PushL(selection);
+				TInt				count=selection->Count();
+		
+				found=EFalse;
+				for (TInt i=count; i>0 && !found; )
+					{
+					TMsvId	childId=selection->At(--i);
+
+					SetEntryL(childId);
+					INFO_PRINTF2(_L("Entry Detail : %S"), &(EntryL().Entry().iDetails));
+					INFO_PRINTF2(_L("Entry Description: %S"), &(EntryL().Entry().iDescription));
+					if ( subject.Compare(EntryL().Entry().iDetails) == 0 ||
+						 subject.Compare(EntryL().Entry().iDescription) == 0 )
+						{
+						found=ETrue;
+						}
+					}
+				CleanupStack::PopAndDestroy(selection);
+				}
+
+			if ( !found )
+				{
+				ERR_PRINTF1(_L("Folder not found"));
+				ret=EFail;
+				}
+			}
+		}
+	if (TestStepResult() == EPass)
+		{
+		//Get body(file path) from ini file and read respective file. Store it into CRichText format.
+		iParaFormatLayer=CParaFormatLayer::NewL();
+		iCharFormatLayer=CCharFormatLayer::NewL(); 
+		iBodyText=CRichText::NewL(iParaFormatLayer, iCharFormatLayer);
+		iBodyAvailable=EFalse;
+	
+		TPtrC	body;
+		if(GetStringFromConfig(ConfigSection(), KBody, body))
+			{
+			INFO_PRINTF2(_L("Body = %S"), &body);
+			iBodyAvailable=ETrue;
+			}
+		else
+			{
+			INFO_PRINTF1(_L("No Body"));
+			}
+
+		if ( iBodyAvailable )
+			{
+			// open the file
+			RFile	file;
+	
+			TInt anError = file.Open(iSession->FileSession(), body, EFileShareAny);
+			if(anError == KErrNone)
+				{
+				TBool		reading=ETrue;
+				TInt		pos=0;
+				TBuf8<1>	charIn;
+				while (reading)
+					{
+					file.Read(charIn, 1);
+					if(charIn.Length())
+						{
+						switch ( charIn[0] )
+							{
+						case '\r':
+							iBodyText->InsertL(pos++, CEditableText::ELineBreak);
+						case '\n':
+							break;
+						default:
+							iBodyText->InsertL(pos++, TChar(charIn[0]));
+							}
+						}
+					else
+						{
+						reading = EFalse;	// stop at the end of the file
+						}
+					}
+				iBodyAvailable=ETrue;
+				file.Close();
+				}
+			else
+			{
+			INFO_PRINTF2(_L("Cannot open file = %S"), &body);
+			iBodyAvailable=EFalse;
+			}
+		}//End of read file.
+	}
+
+	SetTestStepResult(ret);
+	return ret;
+	}
+
+enum TVerdict CTestMessBase::doTestStepPostambleL()
+	{
+	delete iEntry;
+	iEntry=NULL;
+	delete iMessageTimer;
+	iMessageTimer=NULL;
+	delete iMessageProcessor;
+	iMessageProcessor=NULL;
+	delete iSession;
+	iSession=NULL;
+	delete iSchedular;
+	iSchedular=NULL;
+	CActiveScheduler::Install(NULL);
+	return CTestStepSmokeTest::doTestStepPostambleL();
+	}
+
+void CTestMessBase::SetEntryL(TMsvId aId)
+	{
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession->GetEntryL(aId);
+	}
+
+CMsvEntry& CTestMessBase::EntryL()
+	{
+	if ( iEntry == NULL )
+		{
+		User::Leave(KErrGeneral);
+		}
+
+	return *iEntry;
+	}
+
+
+HBufC8* CTestMessBase::CopyToBuf8LC(const TDesC& aDesC)
+//
+// @return - HBufC8*
+// Converts TDesC to HBufC8*.
+//
+	{
+	HBufC8*	itemBuff8 = HBufC8::NewLC(aDesC.Length());
+	itemBuff8->Des().Copy(aDesC);
+
+	return itemBuff8;
+	}
+
+HBufC* CTestMessBase::CopyToBufLC(const TDesC8& aDesC)
+//
+// @return - HBufC8*
+// Converts TDesC to HBufC8*.
+//
+	{
+	HBufC*	itemBuff = HBufC::NewLC(aDesC.Length());
+	itemBuff->Des().Copy(aDesC);
+
+	return itemBuff;
+	}
+
+
+#ifndef __MESSAGING_API_V2__
+void CTestMessBase::SetDefaultServiceL(TUid aMtm, TMsvId aService) const
+	{
+	// --- Now restore the default services from the root store ---
+	CMsvEntry*				rootEntry=iSession->GetEntryL(KMsvRootIndexEntryIdValue);
+	CleanupStack::PushL(rootEntry);
+	CMsvStore*				store = rootEntry->EditStoreL();
+	CleanupStack::PushL(store);
+	CMsvDefaultServices*	services = new(ELeave)CMsvDefaultServices;
+	CleanupStack::PushL(services);
+	services->RestoreL(*store);
+
+	// --- And now re-set the default service for the MTM to the one given ---
+	TMsvDefaultService	defaultService;
+	defaultService.iMtm=aMtm;
+	defaultService.iService=aService;
+	services->ChangeDefaultServiceL(defaultService);
+	services->StoreL(*store);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(3, rootEntry);
+	}
+
+TInt CTestMessBase::DefaultServiceL(TUid aMtm, TMsvId& aService) const
+	{
+	// --- Now restore the default services from the root store ---
+	CMsvEntry*				rootEntry=iSession->GetEntryL(KMsvRootIndexEntryIdValue);
+	CleanupStack::PushL(rootEntry);
+	CMsvStore*				store=rootEntry->ReadStoreL();
+	CleanupStack::PushL(store);
+	CMsvDefaultServices*	services=new(ELeave)CMsvDefaultServices;
+	CleanupStack::PushL(services);
+	services->RestoreL(*store);
+
+	TInt					ret=services->DefaultService(aMtm, aService);
+
+	CleanupStack::PopAndDestroy(3, rootEntry);
+
+	return ret;
+	}
+#endif
+
+void CTestMessBase::PrintTreeL(TMsvId aRoot)
+	{
+	INFO_PRINTF1(_L("PrintTreeL In"));
+	CMsvEntry*			entry=iSession->GetEntryL(aRoot);
+	CleanupStack::PushL(entry);
+	entry->SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=entry->ChildrenL();
+	CleanupStack::PushL(selection);
+
+	PrintEntryL(*entry);
+	for (TInt i=0; i<selection->Count(); )
+		{
+		PrintTreeL(selection->At(i++));
+		}
+
+	CleanupStack::PopAndDestroy(2, entry);
+	INFO_PRINTF1(_L("PrintTreeL Out"));
+	}
+
+void CTestMessBase::PrintEntryL(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+
+	INFO_PRINTF2(_L("Entry Detail : %S"), &(entry.iDetails));
+	INFO_PRINTF2(_L("  Description: %S"), &(entry.iDescription));
+	INFO_PRINTF2(_L("  Id         : %x"), entry.Id());
+	INFO_PRINTF2(_L("  Parent Id  : %x"), entry.Parent());
+	INFO_PRINTF2(_L("  Service Id : %x"), entry.iServiceId);
+	if ( entry.iRelatedId != 0 )
+		{
+		INFO_PRINTF2(_L("  Related Id : %x"), entry.iRelatedId);
+		}
+	INFO_PRINTF2(_L("  Type       : %x"), entry.iType);
+	INFO_PRINTF2(_L("  Mtm        : %x"), entry.iMtm);
+
+
+	if ( entry.iSize != 0 )
+		{
+		INFO_PRINTF2(_L("  Size       : %x"), entry.iSize);
+		}
+	if ( entry.iError != 0 )
+		{
+		INFO_PRINTF2(_L("  Error      : %d"), entry.iError);
+		}
+	if ( entry.iBioType != 0 )
+		{
+		INFO_PRINTF2(_L("  BioType    : %x"), entry.iBioType);
+		}
+	if ( entry.MtmData1() != 0 )
+		{
+		INFO_PRINTF2(_L("  MtmData1   : %x"), entry.MtmData1());
+		}
+	if ( entry.MtmData2() != 0 )
+		{
+		INFO_PRINTF2(_L("  MtmData2   : %x"), entry.MtmData2());
+		}
+	if ( entry.MtmData3() != 0 )
+		{
+		INFO_PRINTF2(_L("  MtmData3   : %x"), entry.MtmData3());
+		}
+	if ( entry.Attachment() != 0 )
+		{
+		INFO_PRINTF2(_L("  Attachment : %x"), entry.Attachment());
+		}
+	if ( entry.Complete() != 0 )
+		{
+		INFO_PRINTF2(_L("  Complete   : %x"), entry.Complete());
+		}
+	if ( entry.Connected() != 0 )
+		{
+		INFO_PRINTF2(_L("  Connected  : %x"), entry.Connected());
+		}
+	if ( entry.Deleted() != 0 )
+		{
+		INFO_PRINTF2(_L("  Deleted    : %x"), entry.Deleted());
+		}
+	if ( entry.Failed() != 0 )
+		{
+		INFO_PRINTF2(_L("  Failed     : %x"), entry.Failed());
+		}
+	if ( entry.InPreparation() != 0 )
+		{
+		INFO_PRINTF2(_L("  InPrep     : %x"), entry.InPreparation());
+		}
+	if ( entry.MultipleRecipients() != 0 )
+		{
+		INFO_PRINTF2(_L("  MultiRecip : %x"), entry.MultipleRecipients());
+		}
+	if ( entry.OffPeak() != 0 )
+		{
+		INFO_PRINTF2(_L("  OffPeak    : %x"), entry.OffPeak());
+		}
+	if ( entry.Operation() != 0 )
+		{
+		INFO_PRINTF2(_L("  Operation  : %x"), entry.Operation());
+		}
+	if ( entry.Owner() != 0 )
+		{
+		INFO_PRINTF2(_L("  Owner      : %x"), entry.Owner());
+		}
+	if ( entry.PcSyncCount() != 0 )
+		{
+		INFO_PRINTF2(_L("  PcSyncCount: %x"), entry.PcSyncCount());
+		}
+	if ( entry.Priority() != 0 )
+		{
+		INFO_PRINTF2(_L("  Priority   : %x"), entry.Priority());
+		}
+	if ( entry.ReadOnly() != 0 )
+		{
+		INFO_PRINTF2(_L("  ReadOnly   : %x"), entry.ReadOnly());
+		}
+	if ( entry.Scheduled() != 0 )
+		{
+		INFO_PRINTF2(_L("  Scheduled  : %x"), entry.Scheduled());
+		}
+	if ( entry.SendingState() != 0 )
+		{
+		INFO_PRINTF2(_L("  Send State : %x"), entry.SendingState());
+		}
+	if ( entry.StandardFolder() != 0 )
+		{
+		INFO_PRINTF2(_L("  StdFolder  : %x"), entry.StandardFolder());
+		}
+	if ( entry.Unread() != 0 )
+		{
+		INFO_PRINTF2(_L("  Unread     : %x"), entry.Unread());
+		}
+	if ( entry.Visible() != 0 )
+		{
+		INFO_PRINTF2(_L("  Visible    : %x"), entry.Visible());
+		}
+
+#if (!defined CDMA_API_ENABLED)
+	if ( aEntry.HasStoreL() )
+		{
+		PrintStoreL(aEntry);
+		}
+#endif
+	}
+
+void CTestMessBase::PrintStoreL(CMsvEntry& aEntry)
+	{
+	TMsvEntry					entry=aEntry.Entry();
+	CTestMessPrintEntryUtil*	printUtil=new (ELeave) CTestMessPrintEntryUtil(*this);
+	CleanupStack::PushL(printUtil);
+
+	printUtil->ProcessEntryL(entry.Id());
+	CleanupStack::PopAndDestroy(printUtil);
+
+	if ( entry.iMtm==KUidMsgTypeSMTP )
+		{
+		PrintStoreSmtpL(aEntry);
+		}
+	else if ( entry.iMtm == KUidMsgTypePOP3 )
+		{
+		PrintStorePop3L(aEntry);
+		}
+	else if ( entry.iMtm == KUidMsgTypeIMAP4 )
+		{
+		PrintStoreImap4L(aEntry);
+		}
+	else if ( entry.iMtm == KUidMsgTypeSMS )
+		{
+		PrintStoreSmsL(aEntry);
+		}
+	}
+
+void CTestMessBase::PrintStoreSmtpL(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CImSmtpSettings*	settings = new(ELeave) CImSmtpSettings();
+		CleanupStack::PushL(settings);
+#ifdef __MESSAGING_API_V2__
+		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
+		TSmtpAccount smtpAccountId;
+		accounts->GetSmtpAccountL(aEntry.EntryId(), smtpAccountId);
+		TRAPD(err, accounts->LoadSmtpSettingsL(smtpAccountId, *settings));
+		CleanupStack::PopAndDestroy(accounts);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			ptrTemp.Set(settings->ServerAddress());
+			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
+#ifndef __MESSAGING_API_V2__
+			ptrTemp.Set(settings->UserAddress());
+			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
+			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
+#endif
+			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
+			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
+			ptrTemp.Set(settings->EmailAlias());
+			INFO_PRINTF2(_L("  EmailAlias                   : %S"), &ptrTemp);
+			ptrTemp.Set(settings->EmailAddress());
+			INFO_PRINTF2(_L("  EmailAddress                 : %S"), &ptrTemp);
+			ptrTemp.Set(settings->ReplyToAddress());
+			INFO_PRINTF2(_L("  ReplyToAddress               : %S"), &ptrTemp);
+			ptrTemp.Set(settings->ReceiptAddress());
+			INFO_PRINTF2(_L("  ReceiptAddress               : %S"), &ptrTemp);
+			if ( settings->RequestReceipts() != 0 )
+				{
+				INFO_PRINTF2(_L("  RequestReceipts              : %x"), (TUint)settings->RequestReceipts());
+				}
+			if ( settings->SendCopyToSelf() != 0 )
+				{
+				INFO_PRINTF2(_L("  SendCopyToSelf               : %x"), (TUint)settings->SendCopyToSelf());
+				}
+			INFO_PRINTF2(_L("  SendMessageOption            : %x"), (TUint)settings->SendMessageOption());
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::PrintStorePop3L(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CImPop3Settings*	settings = new(ELeave) CImPop3Settings();
+		CleanupStack::PushL(settings);
+
+#ifdef __MESSAGING_API_V2__
+		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
+		TPopAccount popAccountId;
+		accounts->GetPopAccountL(aEntry.EntryId(), popAccountId);
+		TRAPD(err, accounts->LoadPopSettingsL(popAccountId, *settings));
+		CleanupStack::PopAndDestroy(accounts);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			ptrTemp.Set(settings->ServerAddress());
+			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
+#ifndef __MESSAGING_API_V2__
+			ptrTemp.Set(settings->UserAddress());
+			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
+			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
+#endif
+			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
+			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
+			HBufC*	loginName=CopyToBufLC(settings->LoginName());
+			INFO_PRINTF2(_L("  LoginName                    : %S"), loginName);
+			CleanupStack::PopAndDestroy(loginName);
+			if ( settings->AutoSendOnConnect() != 0 )
+				{
+				INFO_PRINTF2(_L("  AutoSendOnConnect            : %x"), (TUint)settings->AutoSendOnConnect());
+				}
+			if ( settings->Apop() != 0 )
+				{
+				INFO_PRINTF2(_L("  Apop                         : %x"), (TUint)settings->Apop());
+				}
+			if ( settings->DisconnectedUserMode() != 0 )
+				{
+				INFO_PRINTF2(_L("  DisconnectedUserMode         : %x"), (TUint)settings->DisconnectedUserMode());
+				}
+			if ( settings->DeleteEmailsWhenDisconnecting() != 0 )
+				{
+				INFO_PRINTF2(_L("  DeleteEmailsWhenDisconnecting: %x"), (TUint)settings->DeleteEmailsWhenDisconnecting());
+				}
+			if ( settings->AcknowledgeReceipts() != 0 )
+				{
+				INFO_PRINTF2(_L("  AcknowledgeReceipts          : %x"), (TUint)settings->AcknowledgeReceipts());
+				}
+			if ( settings->MaxEmailSize() != 0 )
+				{
+				INFO_PRINTF2(_L("  MaxEmailSize                 : %x"), (TUint)settings->MaxEmailSize());
+				}
+			if ( settings->GetMailOptions() != 0 )
+				{
+				INFO_PRINTF2(_L("  GetMailOptions               : %x"), (TUint)settings->GetMailOptions());
+				}
+			if ( settings->InboxSynchronisationLimit() != 0 )
+				{
+				INFO_PRINTF2(_L("  InboxSynchronisationLimit    : %x"), (TUint)settings->InboxSynchronisationLimit());
+				}
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::PrintStoreImap4L(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CImImap4Settings*	settings = new(ELeave) CImImap4Settings();
+		CleanupStack::PushL(settings);
+
+#ifdef __MESSAGING_API_V2__
+		CEmailAccounts*		accounts = CEmailAccounts::NewLC();
+		TImapAccount imapAccountId;
+		accounts->GetImapAccountL(aEntry.EntryId(), imapAccountId);
+		TRAPD(err, accounts->LoadImapSettingsL(imapAccountId, *settings));
+		CleanupStack::PopAndDestroy(accounts);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			ptrTemp.Set(settings->ServerAddress());
+			INFO_PRINTF2(_L("  ServerAddress                : %S"), &ptrTemp);
+#ifndef __MESSAGING_API_V2__
+			ptrTemp.Set(settings->UserAddress());
+			INFO_PRINTF2(_L("  UserAddress                  : %S"), &ptrTemp);
+			INFO_PRINTF2(_L("  Version                      : %x"), (TUint)settings->Version());
+#endif
+			INFO_PRINTF2(_L("  Port                         : %x"), settings->Port());
+			INFO_PRINTF2(_L("  SecureSockets                : %x"), (TUint)settings->SecureSockets());
+
+			HBufC*	loginName=CopyToBufLC(settings->LoginName());
+			INFO_PRINTF2(_L("  LoginName                    : %S"), loginName);
+			HBufC*	folderPath=CopyToBufLC(settings->FolderPath());
+			INFO_PRINTF2(_L("  FolderPath                   : %S"), folderPath);
+			CleanupStack::PopAndDestroy(2, loginName);
+			if ( settings->PathSeparator() != 0 )
+				{
+				INFO_PRINTF2(_L("  PathSeparator                : %c"), (TText)settings->PathSeparator());
+				}
+			if ( settings->DisconnectedUserMode() != 0 )
+				{
+				INFO_PRINTF2(_L("  DisconnectedUserMode         : %x"), (TUint)settings->DisconnectedUserMode());
+				}
+			if ( settings->Synchronise() != 0 )
+				{
+				INFO_PRINTF2(_L("  Synchronise                  : %x"), (TUint)settings->Synchronise());
+				}
+			if ( settings->Subscribe() != 0 )
+				{
+				INFO_PRINTF2(_L("  Subscribe                    : %x"), (TUint)settings->Subscribe());
+				}
+			if ( settings->AutoSendOnConnect() != 0 )
+				{
+				INFO_PRINTF2(_L("  AutoSendOnConnect            : %x"), (TUint)settings->AutoSendOnConnect());
+				}
+			if ( settings->MaxEmailSize() != 0 )
+				{
+				INFO_PRINTF2(_L("  MaxEmailSize                 : %x"), (TUint)settings->MaxEmailSize());
+				}
+			if ( settings->DeleteEmailsWhenDisconnecting() != 0 )
+				{
+				INFO_PRINTF2(_L("  DeleteEmailsWhenDisconnecting: %x"), (TUint)settings->DeleteEmailsWhenDisconnecting());
+				}
+			if ( settings->AcknowledgeReceipts() != 0 )
+				{
+				INFO_PRINTF2(_L("  AcknowledgeReceipts          : %x"), (TUint)settings->AcknowledgeReceipts());
+				}
+			if ( settings->GetMailOptions() != 0 )
+				{
+				INFO_PRINTF2(_L("  GetMailOptions               : %x"), (TUint)settings->GetMailOptions());
+				}
+			if ( settings->InboxSynchronisationLimit() != 0 )
+				{
+				INFO_PRINTF2(_L("  InboxSynchronisationLimit    : %x"), (TUint)settings->InboxSynchronisationLimit());
+				}
+			if ( settings->MailboxSynchronisationLimit() != 0 )
+				{
+				INFO_PRINTF2(_L("  MailboxSynchronisationLimit  : %x"), (TUint)settings->MailboxSynchronisationLimit());
+				}
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::PrintStoreSmsL(CMsvEntry& aEntry)
+	{
+	TMsvEntry	entry=aEntry.Entry();
+	CMsvStore*	store=aEntry.ReadStoreL();
+	CleanupStack::PushL(store);
+
+	TPtrC	ptrTemp;
+	if ( entry.iType == KUidMsvServiceEntry )
+		{
+		CSmsSettings*	settings = CSmsSettings::NewL();
+		CleanupStack::PushL(settings);
+
+#ifdef __MESSAGING_API_V2__
+		CSmsAccount*		smsAccount = CSmsAccount::NewLC();
+		TRAPD(err, smsAccount->LoadSettingsL(*settings));
+		CleanupStack::PopAndDestroy(smsAccount);
+#else
+		TRAPD(err, settings->RestoreL(*store));
+#endif
+		if ( err == KErrNone )
+			{
+			TSmsDelivery	delivery(settings->Delivery());
+			INFO_PRINTF2(_L("  Delivery                     : %d"), delivery);
+			CSmsSettings::TSmsReportHandling	reportHandling(settings->StatusReportHandling());
+			INFO_PRINTF2(_L("  StatusReportHandling         : %d"), reportHandling);
+			CSmsSettings::TSmsReportHandling	specialMsgHandling(settings->SpecialMessageHandling());
+			INFO_PRINTF2(_L("  SpecialMessageHandling       : %d"), specialMsgHandling);
+			INFO_PRINTF2(_L("  ReplyQuoted                  : %d"), settings->ReplyQuoted());
+#ifdef __MESSAGING_API_V2__
+			const TInt	numSCAddr = settings->ServiceCenterCount();
+#else
+			const TInt	numSCAddr = settings->NumSCAddresses();
+#endif
+			for( TInt index=0;index<numSCAddr;index++ )
+				{
+#ifdef __MESSAGING_API_V2__
+				CSmsServiceCenter&	scAddr = settings->GetServiceCenter(index);
+#else
+				CSmsNumber&			scAddr = settings->SCAddress(index);
+#endif
+				ptrTemp.Set(scAddr.Name());
+				INFO_PRINTF2(_L("  SC Name                      : %S"), &ptrTemp);
+				ptrTemp.Set(scAddr.Address());
+				INFO_PRINTF2(_L("  SC Address                   : %S"), &ptrTemp);
+				}
+			CSmsSettings::TSmsSettingsCommDbAction	commDbAction(settings->SmsBearerAction());
+			INFO_PRINTF2(_L("  SmsBearerAction              : %d"), commDbAction);
+
+			CSmsSettings::TMobileSmsBearer	smsBearer(settings->SmsBearer());
+			INFO_PRINTF2(_L("  SmsBearer                    : %d"), smsBearer);
+			}
+		CleanupStack::PopAndDestroy(settings);
+		}
+
+	CleanupStack::PopAndDestroy(store);
+	}
+
+void CTestMessBase::IssueTimerRequest()
+	{
+	if (iMessageTimer!= NULL)
+		{
+		iMessageTimer->IssueRequest();
+		}
+	}
+
+void CTestMessBase::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny*, TAny*)
+/**
+ Handler for the Session Event
+ @param aEvent - TMsvSessionEvent object
+ @param aArg1 - TAny object pointer, used to store the argument for the event
+ @leave - System wide error codes
+*/
+	{
+	TBool	printSelection=EFalse;
+
+	switch (aEvent)
+		{
+	case EMsvEntriesCreated:
+		INFO_PRINTF1(_L("EMsvEntriesCreated"));
+		printSelection=ETrue;
+		break;
+	case EMsvEntriesChanged:
+		INFO_PRINTF1(_L("EMsvEntriesChanged"));
+		printSelection=ETrue;
+		break;
+	case EMsvEntriesDeleted:
+		INFO_PRINTF1(_L("EMsvEntriesDeleted"));
+		break;
+	case EMsvEntriesMoved:
+		INFO_PRINTF1(_L("EMsvEntriesMoved"));
+		printSelection=ETrue;
+		break;
+	case EMsvMtmGroupInstalled:
+		INFO_PRINTF1(_L("EMsvMtmGroupInstalled"));
+		break;
+	case EMsvMtmGroupDeInstalled:
+		INFO_PRINTF1(_L("EMsvMtmGroupDeInstalled"));
+		break;
+	case EMsvGeneralError:
+		INFO_PRINTF1(_L("EMsvGeneralError"));
+		break;
+	case EMsvCloseSession:
+		INFO_PRINTF1(_L("EMsvCloseSession"));
+		break;
+	case EMsvServerReady:
+		INFO_PRINTF1(_L("EMsvServerReady"));
+		break;
+	case EMsvServerFailedToStart:
+		INFO_PRINTF1(_L("EMsvServerFailedToStart"));
+		break;
+	case EMsvCorruptedIndexRebuilt:
+		INFO_PRINTF1(_L("EMsvCorruptedIndexRebuilt"));
+		break;
+	case EMsvServerTerminated:
+		INFO_PRINTF1(_L("EMsvServerTerminated"));
+		break;
+	case EMsvMediaChanged:
+		INFO_PRINTF1(_L("EMsvMediaChanged"));
+		break;
+	case EMsvMediaUnavailable:
+		INFO_PRINTF1(_L("EMsvMediaUnavailable"));
+		break;
+	case EMsvMediaAvailable:
+		INFO_PRINTF1(_L("EMsvMediaAvailable"));
+		break;
+	case EMsvMediaIncorrect:
+		INFO_PRINTF1(_L("EMsvMediaIncorrect"));
+		break;
+	case EMsvCorruptedIndexRebuilding:
+		INFO_PRINTF1(_L("EMsvCorruptedIndexRebuilding"));
+		break;
+	default:
+		INFO_PRINTF2(_L("EMsv Unknown event:%d"), aEvent);
+		break;
+	}
+
+	if ( printSelection )
+		{
+		CMsvEntrySelection*	selection=STATIC_CAST(CMsvEntrySelection*, aArg1);
+		CMsvEntry*			entry=NULL;
+		for ( int i=0; i<selection->Count(); )
+			{
+			entry=iSession->GetEntryL(selection->At(i++));
+			CleanupStack::PushL(entry);
+			PrintEntryL(*entry);
+			CleanupStack::PopAndDestroy(entry);
+			}
+		}
+	}
+
+
+void CTestMessBase::PrepareSmsHeaderFromIniFileL(CSmsHeader& aSmsHeader)
+	{
+	// Starts the Bitmap server
+	FbsStartup();
+	// start the server
+	RFbsSession::Connect();
+
+	// Add the Fromating required for EMS if required
+	TInt	emsElements=0;
+	if ( !GetIntFromConfig(ConfigSection(), KElements, emsElements) )
+		{
+		ERR_PRINTF1(_L("Elements not set"));
+		SetTestStepResult(EFail);
+		}
+
+// Macro usage for CDMA mtm
+#if (defined CDMA_API_ENABLED)
+	TMsvMessageSms&	message=aSmsHeader.SmsMessage();
+#else
+	CSmsMessage&	message=aSmsHeader.Message(); 
+#endif
+
+	TBuf<KMaxTestExecuteCommandLength>	tempStore;
+	for ( TInt element=0; element<emsElements && TestStepResult()==EPass;)
+		{
+		++element;
+		INFO_PRINTF2(_L("==== PROCESSING ELEMENT %d ===="), element);
+		//	Start position
+		tempStore.Format(KStartPosition, element);
+		TInt	startPosition=KDefaultStartPos;
+		if ( GetIntFromConfig(ConfigSection(), tempStore, startPosition) )
+			{
+			INFO_PRINTF2(_L("Start position %d"), startPosition);
+			}
+
+		//	File
+		tempStore.Format(KFile, element);
+		TPtrC	file;
+		TParse	fileName;
+		TBool	hasFile=GetStringFromConfig(ConfigSection(), tempStore, file);
+		if ( hasFile )
+			{
+			INFO_PRINTF2(_L("File %S"), &file);
+			fileName.Set(file,NULL,NULL);
+			}
+
+		tempStore.Format(KType, element);
+		TPtrC	type;
+		if ( GetStringFromConfig(ConfigSection(), tempStore, type) )
+			{
+			if ( type.Compare(KTypeFormat) == 0 )
+				{
+				//	=== Process text formating Information Element ===
+				CEmsFormatIE*	newElement=CEmsFormatIE::NewL();
+				CleanupStack::PushL(newElement);
+				newElement->SetStartPosition(startPosition);
+
+				TInt			intTemp;
+				TBool			boolTemp;
+				TPtrC			alignment;
+				TPtrC			fontSize;
+
+				// Set the Format length and other information
+				tempStore.Format(KFormatLength, element);
+				if ( GetIntFromConfig(ConfigSection(), tempStore, intTemp) )
+					{
+					INFO_PRINTF2(_L("Format Length %d"), intTemp);
+					newElement->SetFormatLength(intTemp);
+					}
+				tempStore.Format(KBold, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Bold %d"), boolTemp);
+					newElement->SetBold(boolTemp);
+					}
+				tempStore.Format(KItalic, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Italic %d"), boolTemp);
+				    newElement->SetItalic(boolTemp);
+					}
+				tempStore.Format(KUnderline, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Underline %d"), boolTemp);
+					newElement->SetUnderline(boolTemp);
+					}
+				tempStore.Format(KStrikethrough, element);
+				if ( GetBoolFromConfig(ConfigSection(), tempStore, boolTemp) )
+					{
+					INFO_PRINTF2(_L("Strikethrough %d"), boolTemp);
+					newElement->SetStrikethrough(boolTemp);
+					}
+				tempStore.Format(KAlignment,element);
+				if(GetStringFromConfig(ConfigSection(),tempStore,alignment))
+					{
+					SetAlignmentFormat(*newElement, alignment);
+					}
+				
+				tempStore.Format(KFontSize,element);
+				if(GetStringFromConfig(ConfigSection(),tempStore,fontSize))
+					{
+					//
+					SetFontSizeFormat(*newElement, fontSize);
+					}
+			    message.AddEMSInformationElementL(*newElement); 
+				CleanupStack::PopAndDestroy(newElement);
+				}
+			else if ( type.Compare(KTypeSound) == 0 )
+				{
+				//	=== Process sound Information Element ===
+				if ( hasFile )
+					{
+					HBufC8*			buffFile=CopyToBuf8LC(fileName.FullName());
+					CEmsSoundIE*	newElement=CEmsSoundIE::NewL(buffFile->Des());
+					CleanupStack::PushL(newElement);
+					newElement->SetStartPosition(startPosition); 
+				    message.AddEMSInformationElementL(*newElement); 
+					CleanupStack::PopAndDestroy(2, buffFile);
+					}
+				else
+					{
+					ERR_PRINTF1(_L("No Sound file name"));
+					SetTestStepResult(EFail);
+					}
+				}
+			else if ( type.Compare(KTypePreDefSound) == 0 )
+				{
+				//	=== Process predefined sound Information Element ===
+				TPtrC	preDefSound;
+				tempStore.Format(KEmsPreDef, element);
+				if ( !GetStringFromConfig(ConfigSection(),tempStore, preDefSound))
+					{
+					ERR_PRINTF1(_L("Predefined sound not present"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("Predefined sound %S"), &preDefSound);
+					CEmsPreDefSoundIE*	newElement=NewPreDefSoundL(preDefSound);
+
+					if ( newElement != NULL )
+						{
+						//Assign the predef animation element to newElement
+						CleanupStack::PushL(newElement);
+						newElement->SetStartPosition(startPosition);
+					    message.AddEMSInformationElementL(*newElement); 
+						CleanupStack::PopAndDestroy(newElement);
+						}
+					else
+						{
+						ERR_PRINTF1(_L("Unable to create predefined sound"));
+						SetTestStepResult(EFail);
+						}
+					}
+				}
+			else if ( type.Compare(KTypeAnimation) == 0 )
+				{
+				//	=== Process animation Information Element ===
+				if ( hasFile )
+					{
+					TPtrC	objectSize;
+
+					tempStore.Format(KObjectSize, element);
+					if ( !GetStringFromConfig(ConfigSection(),tempStore,objectSize) )
+						{
+						ERR_PRINTF1(_L("No size provided"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						CFbsBitmap*	bmp=NewBitmapL(fileName, objectSize);
+						if ( bmp == NULL )
+							{
+							ERR_PRINTF1(_L("Failed to Load Animation File. Error %d"));
+							SetTestStepResult(EFail);
+							}
+						else
+							{
+							CleanupStack::PushL(bmp);
+							CEmsAnimationIE*	newElement=CEmsAnimationIE::NewL(*bmp);
+							CleanupStack::PushL(newElement);
+							newElement->SetStartPosition(startPosition);
+						    message.AddEMSInformationElementL(*newElement); 
+							CleanupStack::PopAndDestroy(2, bmp);
+							}
+						}
+					}
+				else
+					{
+					ERR_PRINTF1(_L("No Animation file name"));
+					SetTestStepResult(EFail);
+					}
+				}
+			else if ( type.Compare(KTypePreDefAnimation) == 0 )
+				{
+				//	=== Process predefined animation Information Element ===
+				TPtrC	preDefAnim;
+				tempStore.Format(KEmsPreDef, element);
+				if ( !GetStringFromConfig(ConfigSection(),tempStore, preDefAnim) )
+					{
+					ERR_PRINTF1(_L("Predefined animations not present"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("Predefined animation %S"), &preDefAnim);
+					CEmsPreDefAnimationIE*	newElement=NewPreDefAnimationL(preDefAnim);
+
+					if ( newElement != NULL )
+						{
+						//Assign the predef animation element to newElement
+						CleanupStack::PushL(newElement);
+						newElement->SetStartPosition(startPosition);
+					    message.AddEMSInformationElementL(*newElement); 
+						CleanupStack::PopAndDestroy(newElement);
+						}
+					else
+						{
+						ERR_PRINTF1(_L("Unable to create predefined animation"));
+						SetTestStepResult(EFail);
+						}
+					}
+				}
+			else if ( type.Compare(KTypePicture) == 0 )
+				{
+				//	=== Process picture Information Element ===
+				if ( hasFile )
+					{
+					TPtrC	objectSize;
+
+					tempStore.Format(KObjectSize, element);
+					if ( !GetStringFromConfig(ConfigSection(),tempStore,objectSize) )
+						{
+						ERR_PRINTF1(_L("No size provided"));
+						SetTestStepResult(EFail);
+						}
+					else
+						{
+						CFbsBitmap*	bmp=NewBitmapL(fileName, objectSize);
+						if ( bmp == NULL )
+							{
+							ERR_PRINTF1(_L("Failed to Load Animation File. Error %d"));
+							SetTestStepResult(EFail);
+							}
+						else
+							{
+							CleanupStack::PushL(bmp);
+							CEmsPictureIE*	newElement=CEmsPictureIE::NewL(*bmp);
+							CleanupStack::PushL(newElement);
+							newElement->SetStartPosition(startPosition);
+						    message.AddEMSInformationElementL(*newElement); 
+							CleanupStack::PopAndDestroy(2, bmp);
+							}
+						}
+					}
+				else
+					{
+					ERR_PRINTF1(_L("No Picture file name"));
+					SetTestStepResult(EFail);
+					}
+				}
+			else if ( type.Compare(KTypeUserPrompt) == 0 )
+				{
+				//	=== Process user prompt Information Element ===
+				CEmsUserPrompt*	newElement=CEmsUserPrompt::NewL(2);
+				CleanupStack::PushL(newElement);
+				newElement->SetStartPosition(startPosition);
+			    message.AddEMSInformationElementL(*newElement); 
+				CleanupStack::PopAndDestroy(newElement);
+				}
+			else
+				{
+				ERR_PRINTF2(_L("Unknown element type %S"), &type);
+				SetTestStepResult(EFail);
+				}
+			}
+		else
+			{
+			ERR_PRINTF1(_L("No type given"));
+			SetTestStepResult(EFail);
+			}
+		}
+
+	RFbsSession::Disconnect(); 
+	}
+
+/**
+ This function reads the schedule time from ini file
+ @return - returns the schedule time read from the ini file
+*/
+TTimeIntervalMinutes CTestMessBase::ReadScheduleTime()
+	{
+	// Read  the schedule time from ini file. Add this schedule time to current time.
+	// This time will be set as the scheduled time for sending the SMS message from task scheduler
+	// By default schedule time will be 1 min
+	TInt	scheduled=0;
+	GetIntFromConfig(ConfigSection(), KScheduled, scheduled);
+	INFO_PRINTF2(_L("Scheduled Time in minutes is %d"), scheduled);
+	return TTimeIntervalMinutes(scheduled);
+	}
+
+void CTestMessBase::SetAlignmentFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aAlignment)
+	{
+	//Sets the alignment to the text
+	INFO_PRINTF2(_L("Alignment %S"), &aAlignment);
+	if( aAlignment.Compare(KLeftAlign)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ELeft);
+		}
+	else if( aAlignment.Compare(KRightAlign)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ERight);
+		}
+	else if( aAlignment.Compare(KCenterAlign)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ECenter);
+		}
+	else if( aAlignment.Compare(KLangDepend)== 0 )
+		{
+		aEmsFormatIE.SetAlignment(CEmsFormatIE::ELangDepend);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Illegal alignment value"));
+		SetTestStepResult(EFail);
+		}
+	}
+
+void CTestMessBase::SetFontSizeFormat(CEmsFormatIE& aEmsFormatIE, const TDesC& aFontSize)
+	{
+	//Sets the specified font to the text 
+	INFO_PRINTF2(_L("FontSize %S"), &aFontSize);
+	if( aFontSize.Compare(KNormal)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::ENormal);
+		}
+	else if( aFontSize.Compare(KLarge)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::ELarge);
+		}
+	else if( aFontSize.Compare(KSmall)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::ESmall);
+		}
+	else if( aFontSize.Compare(KReserved)== 0 )
+		{
+		aEmsFormatIE.SetFontSize(CEmsFormatIE::EReserved);
+		}
+	else
+		{
+		ERR_PRINTF1(_L("Illegal fonst size value"));
+		SetTestStepResult(EFail);
+		}
+	}
+
+CEmsPreDefAnimationIE* CTestMessBase::NewPreDefAnimationL(const TDesC& aPreDefType) 
+//
+// Attaches the required predef animation. 
+// Arguments - aString - holds the TAnim type to be attached 
+// Return Value - Returns a Pointer of CEmsPreDefAnimationIE 
+//
+	{
+	//Initialize emsPreDef to NULL
+	CEmsPreDefAnimationIE::TAnimType	animType=CEmsPreDefAnimationIE::EFlirty;
+	TBool								validType=ETrue;
+
+	//Set a value for emsPreDef 
+	if ( aPreDefType.Compare(KEmsAnimTypeFlirty) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EFlirty;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeGlad) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EGlad;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeSceptic) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ESceptic;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeSad) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ESad;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeWow) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EWow;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeCrying) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ECrying;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeWinking) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EWinking;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeLaughing) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ELaughing;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeIndifferent) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EIndifferent;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeKissing) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EKissing;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeConfused) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EConfused;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeTongueOut) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::ETongueOut;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeAngry) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EAngry;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeGlasses) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EGlasses;
+		}
+	else if ( aPreDefType.Compare(KEmsAnimTypeDevil) == 0 )
+		{
+		animType = CEmsPreDefAnimationIE::EDevil;
+		}
+	else
+		{
+		validType=EFalse;
+		}
+
+	CEmsPreDefAnimationIE*	emsPreDef=NULL;
+	if ( validType )
+		{
+		emsPreDef=CEmsPreDefAnimationIE::NewL(animType);
+		}
+
+	return emsPreDef;
+	}
+
+CEmsPreDefSoundIE* CTestMessBase::NewPreDefSoundL(const TDesC& aPreDefType) 
+//
+// Attaches the required predef animation. 
+// Arguments - aString - holds the TAnim type to be attached 
+// Return Value - Returns a Pointer of CEmsPreDefAnimationIE 
+//
+	{
+	//Initialize emsPreDef to NULL
+	CEmsPreDefSoundIE::TPredefinedSound	soundType=CEmsPreDefSoundIE::EChimesHigh;
+	TBool								validType=ETrue;
+
+	//Set a value for emsPreDef 
+	if ( aPreDefType.Compare(KEmsSoundTypeChimesHigh) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChimesHigh;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeChimesLow) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChimesLow;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeDing) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EDing;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeTaDa) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::ETaDa;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeNotify) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::ENotify;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeDrum) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EDrum;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeClaps) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EClaps;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeFanFar) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EFanFar;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeChordHigh) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChordHigh;
+		}
+	else if ( aPreDefType.Compare(KEmsSoundTypeChordLow) == 0 )
+		{
+		soundType = CEmsPreDefSoundIE::EChordLow;
+		}
+	else
+		{
+		validType=EFalse;
+		}
+
+	CEmsPreDefSoundIE*	emsPreDef=NULL;
+	if ( validType )
+		{
+		emsPreDef=CEmsPreDefSoundIE::NewL(soundType);
+		}
+
+	return emsPreDef;
+	}
+
+CFbsBitmap* CTestMessBase::NewBitmapL(const TParse& aFileName, const TDesC& aObjectSize)
+	{
+	TInt	bitmapType=KSmallObject;
+	TBool	validType=ETrue;
+	if( aObjectSize.Compare(KSmall) == 0 )
+		{
+		bitmapType=KSmallObject;
+		}
+	else if ( aObjectSize.Compare(KLarge) == 0 )
+		{
+		bitmapType=KLargeObject;
+		}
+	else if ( aObjectSize.Compare(KVariable) == 0 )
+		{
+		bitmapType=KVariableObject;
+		}
+	else
+		{
+		ERR_PRINTF2(_L("Invalid bitmap type %S"), &aObjectSize);
+		validType=EFalse;
+		}
+
+	CFbsBitmap*	bmp = NULL;
+	if ( validType )
+		{
+		bmp = new (ELeave) CFbsBitmap();
+
+		TInt	error = bmp->Load(aFileName.FullName(), bitmapType, EFalse);
+		INFO_PRINTF2(_L("Bimap load %d"), error);
+		if ( error != KErrNone)
+			{
+			delete bmp;
+			bmp=NULL;
+			}
+		}
+
+	return bmp;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessCleanMessageFolder.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,171 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCleanMessageFolder which cleans out all the
+// message folders
+// 
+//
+
+#include "TestMessCleanMessageFolder.h"
+
+// EPOC includes
+#include <msvids.h>
+#include <TestExecuteClient.h>
+
+#ifdef __MESSAGING_API_V2__
+#include <cemailaccounts.h>
+#endif
+
+_LIT(KMessageCount, "messagecount");
+
+CTestMessCleanMessageFolder::CTestMessCleanMessageFolder()
+:	CTestMessBase(ETrue)
+,	iNumberOfMessagesToDelete(-1)		//	Negative value implies delete all
+	{
+	SetTestStepName(_L("CleanMessageFolder"));
+	}
+
+TVerdict CTestMessCleanMessageFolder::doTestStepL()
+	{
+	INFO_PRINTF1(_L("Clean message folder"));
+
+	if ( GetIntFromConfig(ConfigSection(), KMessageCount, iNumberOfMessagesToDelete) )
+		{
+		INFO_PRINTF2(_L("Message count read from the ini file is  %D"), iNumberOfMessagesToDelete);
+		}
+	else
+		{
+		WARN_PRINTF1(_L("No Count specified in the ini file"));
+		WARN_PRINTF1(_L("All the messages will be deleted"));
+		}
+
+	if ( TestStepResult() == EPass )
+		{
+		//delete the contents of the folder
+		CleanFolders(EntryL().EntryId());
+
+		if ( iNumberOfMessagesToDelete<=0 )
+			{
+			INFO_PRINTF1(_L("Messages deleted"));
+			}
+		else
+			{
+			ERR_PRINTF2(_L("%d Outstanding entries not deleted."), iNumberOfMessagesToDelete);
+			SetTestStepResult(EFail);
+			}
+		}
+
+	return TestStepResult();
+	}
+
+void CTestMessCleanMessageFolder::CleanFolders(const TMsvId aEntryId)
+	{
+#ifdef __MESSAGING_API_V2__
+	if ( aEntryId == KMsvRootIndexEntryId )
+		{
+		CEmailAccounts*	accounts = CEmailAccounts::NewLC();
+
+		RArray<TPopAccount>	pop3Accounts;
+		CleanupClosePushL(pop3Accounts);
+		accounts->GetPopAccountsL(pop3Accounts);
+		TInt	count = pop3Accounts.Count();
+		TInt	index=0;
+		for( index = 0; index < count; index++ )
+			{
+			TPopAccount	id = pop3Accounts[index];
+			accounts->DeletePopAccountL( id );
+			}
+
+		RArray<TImapAccount>	imap4Accounts;
+		CleanupClosePushL(imap4Accounts);
+		accounts->GetImapAccountsL(imap4Accounts);
+		count = imap4Accounts.Count();
+		for( TInt index = 0; index < count; index++ )
+			{
+			TImapAccount	id = imap4Accounts[index];
+			accounts->DeleteImapAccountL( id );
+			}
+
+		CleanupStack::PopAndDestroy(3, accounts);
+		}
+#endif
+
+	SetEntryL(aEntryId);
+	EntryL().SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=EntryL().ChildrenL();
+	CleanupStack::PushL(selection);
+	TInt				count=selection->Count();
+	TInt				i;
+	for (i=count; i>0; )
+		{
+		TMsvId	childId=selection->At(--i);
+
+		SetEntryL(aEntryId);
+		if( iNumberOfMessagesToDelete!=0 )
+			{
+			TRAPD(err, EntryL().DeleteL(childId));
+			switch ( err )
+				{
+			case KErrNone:
+				INFO_PRINTF2(_L("DeletedId      : %x"), childId);
+				if ( iNumberOfMessagesToDelete > 0 )
+					{
+					--iNumberOfMessagesToDelete;
+					}
+				break;
+			case KErrAccessDenied:
+				INFO_PRINTF2(_L("Access Denied  : %x"), childId);
+				break;
+			default:
+				ERR_PRINTF3(_L("Deletion Error : %d , Id : %x "), err, childId);
+				SetTestStepResult(EFail);
+				break;
+				}
+			}
+		}
+	CleanupStack::PopAndDestroy(selection);
+
+	EntryL().SetSortTypeL(SelectionOrdering());
+	selection=EntryL().ChildrenL();
+	CleanupStack::PushL(selection);
+	count=selection->Count();
+	for (i=count; i>0; )
+		{
+		TMsvId	childId=selection->At(--i);
+
+		//	Log child
+		CleanFolders(childId);
+
+		SetEntryL(aEntryId);
+
+		TRAPD(err, EntryL().DeleteL(childId));
+		switch ( err )
+			{
+		case KErrNone:
+			INFO_PRINTF2(_L("DeletedId      : %x"), childId);
+			if ( iNumberOfMessagesToDelete > 0 )
+				{
+				--iNumberOfMessagesToDelete;
+				}
+			break;
+		case KErrAccessDenied:
+			INFO_PRINTF2(_L("Access Denied  : %x"), childId);
+			break;
+		default:
+			ERR_PRINTF3(_L("Deletion Error : %d , Id : %x "), err, childId);
+			SetTestStepResult(EFail);
+			break;
+			}
+		}
+	CleanupStack::PopAndDestroy(selection);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessCreateCdmaSmsUtil.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,433 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessCreateCdmsSmsUtil.cpp
+// This class creates the Cdma sms header and the service settings
+// 
+//
+
+#include "TestMessCreateCdmaSmsUtil.h"
+#include "TestMessCreateSmsAccount.h"
+
+// EPOC includes
+#include <csmsaccount.h>
+
+/*@{*/
+_LIT(KPtDeliveryAck,			"DeliveryAck");
+_LIT(KPtUserAck,				"UserAck");
+_LIT(KPtReadAck,				"ReadAck");
+_LIT(KPtMessageConversion,		"MessageConversion");
+_LIT(KPtPriorityIndicator,		"PriorityIndicator");
+_LIT(KPtPrivacyIndicator,		"PrivacyIndicator");
+_LIT(KPtReplyOption,			"ReplyOption");
+_LIT(KPtAlertonDelivery,		"AlertonDelivery");
+_LIT(KPtLanguageIndicator,		"LanguageIndicator");
+
+//Constants used
+_LIT(KPtTeleService,			"TeleService");
+_LIT(KPtSubmit,					"Submit");
+_LIT(KPtCancel,					"Cancel");
+
+// Supported Teleservices
+_LIT(KPtTeleWmt,				"WMT");
+_LIT(KPtTeleWemt,				"WEMT");
+_LIT(KPtTeleWpt,				"WPT");
+_LIT(KPtTeleVmn,				"VMN");
+_LIT(KPtTeleScpt,				"SCPT");
+_LIT(KPtTeleCatpt,				"CATPT");
+_LIT(KPtTeleCmt91,				"CMT91");
+_LIT(KPtTeleWap,				"WAP");
+
+// Supported message conversion formats
+_LIT(KPtPidFax,					"Fax");
+_LIT(KPtPidX400,				"X400");
+_LIT(KPtPidPaging,				"Paging");
+_LIT(KPtPidMail,				"Mail");
+_LIT(KPtPidErmes,				"Ermes");
+_LIT(KPtPidSpeech,				"Speech");
+/*@}*/
+
+/**
+ Constructor
+*/
+CTestMessCreateCdmaSmsUtil ::CTestMessCreateCdmaSmsUtil(CTestMessBase& aTestStep)
+: 	CTestMessCreateSmsUtilBase(aTestStep)
+	{
+	aTestStep.INFO_PRINTF1(_L("The CDMA SMS util is created"));
+	}
+
+/**
+ Prepares the SMS account details for CSendAs/RSendAs
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+void CTestMessCreateCdmaSmsUtil::PrepareAccountL(CMsvSession& /*aSession*/)
+	{
+	// Reads the teleservice
+	tia637::TTeleserviceId	teleServiceId=tia637::KTeleserviceWMT;
+	TPtrC 					ptrTeleService;
+	if( !(iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KPtTeleService, ptrTeleService)))
+		{
+		iTestStep.INFO_PRINTF1(_L("Teleservice is not provided. Default teleservice (WMT) is used"));
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF2(_L("Teleservice to be set is : %S"), &ptrTeleService);
+
+		//Get the teleservice Id
+		teleServiceId = GetTeleServiceId(ptrTeleService);
+		}
+
+	if ( teleServiceId!=tia637::KTeleserviceWEMT )
+		{
+		teleServiceId=tia637::KTeleserviceWMT;
+		}
+
+	CSmsSettings*	smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+
+	CSmsAccount*	smsAccount=CSmsAccount::NewLC();
+	smsAccount->LoadSettingsL(*smsSettings);
+	smsSettings->SetDefaultTeleservice(teleServiceId);
+	smsAccount->SaveSettingsL(*smsSettings);
+	CleanupStack::PopAndDestroy(smsAccount);
+	CleanupStack::PopAndDestroy(smsSettings);
+	}
+
+/**
+ Creates a new CDMA sms header object
+ @param aBodyText - body text of the message
+ @return CSmsHeader - pointer of the CSmsHeader object
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+CSmsHeader* CTestMessCreateCdmaSmsUtil::NewHeaderL(CRichText& aBodyText)
+	{
+	return CSmsHeader::NewL(KSmsTypeSubmit, aBodyText);
+	}
+
+/**
+ Fill up the header object with data read from the ini file
+ @param aSmsHeader - reference for the sms header object
+ @leave - System wide error codes
+*/
+void CTestMessCreateCdmaSmsUtil::PrepareHeaderL(CSmsHeader& aSmsHeader)
+	{
+	//	Get bearer data
+	TPtrC	ptrBearer;
+	TBool	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KBearer, ptrBearer);
+	if ( !returnValue )
+		{
+		//If no bearer provided, the bearer is read from the default section ofthe
+		// ini file
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefBearer, ptrBearer);
+		}
+
+	if ( returnValue )
+		{
+		//default value for the bearer
+		TBioMsgIdType	bearer = EBioMsgIdNbs;
+
+		iTestStep.INFO_PRINTF2(_L("Bearer = %S"), &ptrBearer);
+		if (ptrBearer.CompareF(KBearerWap) == 0)
+			{
+			//Wap message ID
+			bearer = EBioMsgIdWap;
+			}
+		else if (ptrBearer.CompareF(KBearerWapSecure) == 0)
+			{
+			//WapSecure message ID
+			bearer = EBioMsgIdWapSecure;
+			}
+		else
+			{
+			iTestStep.ERR_PRINTF1(_L("No bearer provided. Default is used"));
+			}
+
+		//Set the BIO Message ID type
+		aSmsHeader.BioMessage().SetBioMsgIdType(bearer);
+		}
+
+	//	Get encoding data
+	TInt	encoding;
+	returnValue=iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KEncoding, encoding);
+	if ( !returnValue )
+		{
+		//If no encoding is provided, the encoding is read from the default section 
+		//of the ini file
+		returnValue=iTestStep.GetIntFromConfig(KDef, KDefEncoding, encoding);
+		}
+	if ( returnValue )
+		{
+		//Default encoding value.
+		TSmsCharacterEncoding charEncoding = KSmsEncodingUnicode;
+
+		iTestStep.INFO_PRINTF2(_L("Encoding = %d"), encoding);
+		switch (encoding)
+			{
+		case 7:
+			//7 bit encoding format
+			charEncoding = KSmsEncoding7BitASCII;
+			break;
+		case 8:
+			//8 bit encoding format
+			charEncoding = KSmsEncodingBinary;
+			break;
+		case 16:
+			//unicode encoding format
+			charEncoding = KSmsEncodingUnicode;
+			break;
+		default:
+			//default encoding format
+			charEncoding = KSmsEncodingUnicode;
+			break;
+			}
+		//Set the character encoding format
+		aSmsHeader.BioMessage().SetEncoding(charEncoding);
+		}
+
+	
+	TBool	deliveryAck = EFalse;
+	TBool	userAck = EFalse;
+	TBool	readAck = EFalse;
+
+	//	Get acknowledgements report request
+	TPtrC	ptrDeliveryReport;
+	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KDeliveryReport, ptrDeliveryReport);
+	if ( !returnValue )
+		{
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefDeliveryReport, ptrDeliveryReport);
+		}
+	if ( returnValue )
+		{
+		iTestStep.INFO_PRINTF2(_L("The acknowledgement request flag : %S"), &ptrDeliveryReport);
+		if(ptrDeliveryReport.Compare(_L("NO")) == 0)
+			{
+			deliveryAck = EFalse;
+			userAck = EFalse;
+			readAck = EFalse;
+			}
+		if(ptrDeliveryReport.Compare(_L("YES")) == 0)
+			{
+			// Read different type of acknowledgements
+			iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtDeliveryAck, deliveryAck);
+			iTestStep.INFO_PRINTF2(_L("The Delivery acknowledgement request flag : %d"), deliveryAck);
+			iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtUserAck, userAck);
+			iTestStep.INFO_PRINTF2(_L("The User acknowledgement request flag : %d"), userAck);
+			iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtReadAck, readAck);
+			iTestStep.INFO_PRINTF2(_L("The Read acknowledgement request flag : %d"), readAck);
+			}
+		}
+	
+	aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeDelivery, deliveryAck);
+	aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeUser, userAck);
+	aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeRead, readAck);
+	
+	//Get the message conversion type
+	TPtrC	ptrMessageConversion;
+	TSmsPIDConversion smsPidConversion = ESmsConvPIDNone;
+	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KPtMessageConversion, ptrMessageConversion);
+	if ( !returnValue )
+		{
+		iTestStep.INFO_PRINTF1(_L("The message conversion is not provided. Default (PIDNone) is taken"));
+		}
+	if ( returnValue )
+		{
+		iTestStep.INFO_PRINTF2(_L("The message conversion to be set is  : %S"), &ptrMessageConversion);
+		//Get the Message conversion id
+		smsPidConversion = GetMessageConversionId(ptrMessageConversion);
+		}
+	//Set the message conversion.
+	CSmsSettings *smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	aSmsHeader.GetDefaultMessageSettingsL(*smsSettings);
+	smsSettings->SetMessageConversion(smsPidConversion);
+	CleanupStack::Pop(smsSettings);
+
+	// Set the other message settings
+	aSmsHeader.CdmaMessage().SetPrivacyIndicatorL(tia637::KBdRestricted);
+	aSmsHeader.CdmaMessage().SetPriorityIndicatorL(tia637::KBdUrgent);
+	aSmsHeader.CdmaMessage().SetAlertOnDeliveryL(tia637::KBdUseMediumPriorityAlert);
+	aSmsHeader.CdmaMessage().SetLanguageIndicatorL(tia637::KLanguageEnglish);
+	}
+
+/**
+ Sets the cdma sms service settings fields using data read from the
+ ini file. If no data is provided/read from ini file, the default 
+ account settings is used.
+ @param aSmsSettings - reference of the CSmsSettings
+*/
+void CTestMessCreateCdmaSmsUtil::SetSmsAccountSettings(CSmsSettings& aSmsSettings)
+	{
+	iTestStep.INFO_PRINTF1(_L("Set SMS account Settings...."));
+	TBool	boolTemp;
+	
+	//	Set the Reply quoted setting.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyQuoted, boolTemp) )
+		{
+		aSmsSettings.SetReplyQuoted(boolTemp);
+		}
+
+	// Set the priority indicator
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtPriorityIndicator, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTPriorityIndicator, boolTemp);
+		}
+
+	//Set the Privacy Indicator	
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtPrivacyIndicator, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTPrivacyIndicator, boolTemp);
+		}
+
+	//Set the Reply option
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtReplyOption, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTReplyOption, boolTemp);
+		}
+
+	//Set the alert on Message deliver
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtAlertonDelivery, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTAlertOnMessageDelivery, boolTemp);
+		}
+
+	//Set the Language Indicator
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KPtLanguageIndicator, boolTemp) )
+		{
+		aSmsSettings.MessageSettings().Cdma().ActivateMessageSetting(tia637::KTLanguageIndicator, boolTemp);
+		}
+
+	aSmsSettings.SetValidityPeriod(ESmsVPWeek);	// week 
+	aSmsSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger); //relative
+	aSmsSettings.SetDelivery(ESmsDeliveryImmediately);
+	}
+
+/**
+ Get the message type id
+ @param aMessageType - TPtrC object holding the message type
+ @return TSmsMessageType - message type id
+*/
+TSmsMessageType CTestMessCreateCdmaSmsUtil::GetMessageTypeId(const TDesC& aMessageType)
+	{
+	//Default message type is assigned
+	TSmsMessageType smsMessageType = KSmsTypeSubmit;
+
+	if( aMessageType.Compare(KPtSubmit) ==0)
+		{
+		smsMessageType = KSmsTypeSubmit;
+		}
+	else if( aMessageType.Compare(KPtCancel) ==0)
+		{
+		smsMessageType = KSmsTypeCdmaCancellation;
+		}
+	else
+		{
+		iTestStep.WARN_PRINTF1(_L("Invalid message type provided. Default is used"));
+		}
+	return smsMessageType;
+	}
+	
+/**
+ Gets the Teleservice Id
+ @param aTeleService - TPtrC holding the tele service name
+ @return tia637::TTeleserviceId - teleservice id
+*/
+tia637::TTeleserviceId CTestMessCreateCdmaSmsUtil::GetTeleServiceId(const TDesC& aTeleService)
+	{
+	//default teleservice ID assigned
+	tia637::TTeleserviceId	teleServiceId = tia637::KTeleserviceWMT;
+
+	iTestStep.INFO_PRINTF2(_L("Teleservice set is : %S"), &aTeleService);
+	if( aTeleService.Compare(KPtTeleScpt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceSCPT;
+		}
+	else if( aTeleService.Compare(KPtTeleCatpt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceCATPT;
+		}
+	else if( aTeleService.Compare(KPtTeleCmt91) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceCMT91;
+		}
+	else if( aTeleService.Compare(KPtTeleVmn) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceVMN;
+		}
+	else if( aTeleService.Compare(KPtTeleWap) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWAP;
+		}
+	else if( aTeleService.Compare(KPtTeleWemt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWEMT;
+		}
+	else if( aTeleService.Compare(KPtTeleWmt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWMT;
+		}
+	else if( aTeleService.Compare(KPtTeleWpt) ==0)
+		{
+		teleServiceId = tia637::KTeleserviceWPT;
+		}
+	else
+		{
+		iTestStep.WARN_PRINTF1(_L("Invalid Teleservice provided. Default WMT used"));
+		}
+
+	return teleServiceId;
+	}
+
+/**
+ Gets the Message Conversion Id
+ @param aTeleService - TPtrC holding the tele service name
+ @return tia637::TTeleserviceId - teleservice id
+*/
+TSmsPIDConversion CTestMessCreateCdmaSmsUtil::GetMessageConversionId(const TDesC& aMessageConversion)
+	{
+	TSmsPIDConversion	smsPidConv = ESmsConvPIDNone;
+
+	iTestStep.INFO_PRINTF2(_L("The message conversion set is  : %S"), &aMessageConversion);
+	if( aMessageConversion.Compare(KPtPidFax) ==0)
+		{
+		smsPidConv = ESmsConvFax;
+		}
+	else if( aMessageConversion.Compare(KPtPidX400) ==0)
+		{
+		smsPidConv = ESmsConvX400;
+		}
+	else if( aMessageConversion.Compare(KPtPidPaging) ==0)
+		{
+		smsPidConv = ESmsConvPaging;
+		}
+	else if( aMessageConversion.Compare(KPtPidMail) ==0)
+		{
+		smsPidConv = ESmsConvMail;
+		}
+	else if( aMessageConversion.Compare(KPtPidErmes) ==0)
+		{
+		smsPidConv = ESmsConvErmes;
+		}
+	else if( aMessageConversion.Compare(KPtPidSpeech) ==0)
+		{
+		smsPidConv = ESmsConvSpeech;
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF1(_L("The message conversion provided is invalid"));
+		iTestStep.INFO_PRINTF1(_L("The default NONE message conversion is set"));
+		}
+	
+	return smsPidConv;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessCreateGsmSmsUtil.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,262 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class creates the Gsm sms header and service settings. It fills up the
+// fields using data read from the ini file
+// 
+//
+ 
+#include "Configuration.cfg"
+
+#include "TestMessCreateGsmSmsUtil.h"
+
+/** 
+ Constructor
+*/
+CTestMessCreateGsmSmsUtil::CTestMessCreateGsmSmsUtil(CTestMessBase &aTestStep)
+: 	CTestMessCreateSmsUtilBase(aTestStep)
+	{
+	aTestStep.INFO_PRINTF1(_L("The GSM SMS util is created"));
+	}
+
+/**
+ Prepares the SMS account details for CSendAs/RSendAs
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+void CTestMessCreateGsmSmsUtil::PrepareAccountL(CMsvSession& /*aSession*/)
+	{
+	}
+
+/**
+ Creates the header object for the GSM sms message
+ @param aBodyText - body text of the message
+ @return CSmsHeader* - pointer to CSmsHeader
+ @leave - KErrNoMemory
+ @leave - system wide error codes
+*/
+CSmsHeader* CTestMessCreateGsmSmsUtil::NewHeaderL(CRichText &aBodyText)
+	{
+	return CSmsHeader::NewL(CSmsPDU::ESmsSubmit, aBodyText);
+	}
+
+/**
+ Fills up the header object with the data read from the ini file.
+ @param aSmsHeader - sms header object ofthe sms message
+ @leave - system wide error codes
+*/
+void CTestMessCreateGsmSmsUtil::PrepareHeaderL(CSmsHeader &aSmsHeader)
+	{
+	//	Get bearer data
+	TPtrC	ptrBearer;
+	TBool	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KBearer, ptrBearer);
+	if ( !returnValue )
+		{
+		//If bearer is not provided, read from the default section of the ini file
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefBearer, ptrBearer);
+		}
+
+	if ( returnValue )
+		{
+		//default value for Bio message ID type
+		TBioMsgIdType	bearer = EBioMsgIdNbs;
+
+		iTestStep.INFO_PRINTF2(_L("Bearer = %S"), &ptrBearer);
+		if (ptrBearer.CompareF(KBearerWap) == 0)
+			{
+			//Set Wap message ID
+			bearer = EBioMsgIdWap;
+			}
+		else if (ptrBearer.CompareF(KBearerWapSecure) == 0)
+			{
+			//Set WapSecure message ID
+			bearer = EBioMsgIdWapSecure;
+			}
+		else
+			{
+			iTestStep.INFO_PRINTF1(_L("No supported bearer is provided. Default is used"));
+			}
+
+		//Set the Bio message ID type.
+#if (defined CDMA_API_ENABLED)
+		aSmsHeader.BioMessage().SetBioMsgIdType(bearer);
+#else
+		aSmsHeader.SetBioMsgIdType(bearer);
+#endif
+		}
+
+	//	Get encoding data
+	TInt	encoding;
+	returnValue=iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KEncoding, encoding);
+	if ( !returnValue )
+		{
+		//If encoding is not provied, read it from the default section of the ini file
+		returnValue=iTestStep.GetIntFromConfig(KDef, KDefEncoding, encoding);
+		}
+	if ( returnValue )
+		{
+		iTestStep.INFO_PRINTF2(_L("Encoding = %d"), encoding);
+#if (defined CDMA_API_ENABLED)
+		TSmsCharacterEncoding	charEncoding;
+
+		switch (encoding)
+			{
+		case 7:
+			//7 bit encoding format
+			charEncoding = KSmsEncoding7BitGsm;
+			break;
+		case 8:
+			//8 bit encoding format
+			charEncoding = KSmsEncodingBinary;
+			break;
+		case 16:
+			//Unicode encoding format
+			charEncoding = KSmsEncodingUnicode;
+			break;
+		default:
+			//default encoding format
+			charEncoding = KSmsEncoding7BitGsm;
+			break;
+			}
+
+		//Set the character encoding
+		aSmsHeader.BioMessage().SetEncoding(charEncoding);
+#else
+		TSmsDataCodingScheme::TSmsAlphabet	alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
+
+		switch (encoding)
+			{
+		case 7:
+			alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
+			break;
+		case 8:
+			alpha = TSmsDataCodingScheme::ESmsAlphabet8Bit;
+			break;
+		case 16:
+			alpha = TSmsDataCodingScheme::ESmsAlphabetUCS2;
+			break;
+		default:
+			alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
+			break;
+			}
+
+		CSmsPDU&	pdu=aSmsHeader.Message().SmsPDU();
+		if ( pdu.DataCodingSchemePresent() )
+			{
+			pdu.SetAlphabet(alpha);
+			}
+#endif
+		}
+
+	//	Get delivery report data
+	TPtrC	ptrDeliveryReport;
+	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KDeliveryReport, ptrDeliveryReport);
+	if ( !returnValue )
+		{
+		returnValue=iTestStep.GetStringFromConfig(KDef, KDefDeliveryReport, ptrDeliveryReport);
+		}
+	if ( returnValue )
+		{
+		TBool	changeDR = EFalse;
+		TBool	deliveryReport = EFalse;
+
+		iTestStep.INFO_PRINTF2(_L("Delivery Report = %S"), &ptrDeliveryReport);
+		if (ptrDeliveryReport.CompareF(_L("NO")) == 0)
+			{
+			changeDR = ETrue;
+			deliveryReport = EFalse;
+			}
+		else if (ptrDeliveryReport.CompareF(_L("YES")) == 0)
+			{
+			changeDR = ETrue;
+			deliveryReport = ETrue;
+			}
+
+		if ( changeDR )
+			{
+#if (defined CDMA_API_ENABLED)
+			aSmsHeader.SetAcknowledgementRequest(ESmsAckTypeDelivery, deliveryReport);
+#else
+			switch ( aSmsHeader.Type() )
+				{
+			case CSmsPDU::ESmsSubmit:
+				aSmsHeader.Submit().SetStatusReportRequest(deliveryReport);
+				break;
+			case CSmsPDU::ESmsCommand:
+				aSmsHeader.Command().SetStatusReportRequest(deliveryReport);
+				break;
+			default:
+				User::Leave(KErrNotSupported);
+				}
+#endif
+			}
+		}
+	}
+/**
+ Sets the fields for the sms account settings using data read from the ini file
+ If no data is given in ini file, the default settings in the account is used.
+ @param aSmsSettings - CSmsSettings reference
+*/
+void CTestMessCreateGsmSmsUtil::SetSmsAccountSettings(CSmsSettings &aSmsSettings)
+	{
+	iTestStep.INFO_PRINTF1(_L("Set SMS account Settings...."));
+	TBool	boolTemp;
+
+	//	Set the Reply quoted setting.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyQuoted, boolTemp) )
+		{
+		aSmsSettings.SetReplyQuoted(boolTemp);
+		}
+
+	//	Set the Reject duplicate settings.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KRejectDuplicate, boolTemp) )
+		{
+#if (defined CDMA_API_ENABLED)
+		aSmsSettings.MessageSettings().Gsm().SetRejectDuplicate(boolTemp);
+#else
+		aSmsSettings.SetRejectDuplicate(boolTemp);
+#endif
+		}
+
+	//	Set the option for delivery report.
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KDeliveryReport, boolTemp) )
+		{
+		aSmsSettings.SetDeliveryReport(boolTemp);
+		}
+
+	//	Set the concatenate feature
+	if ( iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KConCatenate, boolTemp) )
+		{
+#if (defined CDMA_API_ENABLED)
+		aSmsSettings.MessageSettings().Gsm().SetCanConcatenate(boolTemp);
+#else
+		aSmsSettings.SetCanConcatenate(boolTemp);
+#endif
+		}
+
+	//	Set whether to use the same path while replying.
+	if(iTestStep.GetBoolFromConfig(iTestStep.ConfigSection(), KReplyPath, boolTemp))
+		{
+#if (defined CDMA_API_ENABLED)
+		aSmsSettings.MessageSettings().Gsm().SetReplyPath(boolTemp);
+#else
+		aSmsSettings.SetReplyPath(boolTemp);
+#endif
+		}
+
+	//can implement these features later...
+	aSmsSettings.SetValidityPeriod(ESmsVPWeek);	// week 
+	aSmsSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger); //relative
+	aSmsSettings.SetDelivery(ESmsDeliveryImmediately);
+	aSmsSettings.SetMessageConversion(ESmsConvPIDNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessCreateSMS.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,417 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCreateSMS. This class creates the sms message
+// for GSM or CDMA. For CDMA mtm, it uses utility classes to create
+// the respective GSM or CDMA sms message
+// 
+//
+
+#include "Configuration.cfg"
+
+#include "TestMessCreateSMS.h"
+#include "TestMessEditEntryUtil.h"
+
+//Usage of macros of Cdma mtm
+#include "TestMessCreateGsmSmsUtil.h"
+#if (defined CDMA_API_ENABLED)
+#include "TestMessCreateCdmaSmsUtil.h"
+#endif
+
+// EPOC includes
+#include <mtmuids.h>
+#include <txtrich.h>
+#include <smut.h>
+#include <etelmm.h>
+#include <SMUTSET.h> //For CSmsMessageSettings
+
+/*@{*/
+/// Literal constants read from the ini file
+_LIT(KRecipients,			"recipients");
+_LIT(KTo,					"to%d");
+_LIT(KPtSaveDraft,			"SaveInDraft");
+_LIT(KDefTo,				"smsto");
+
+_LIT(KPtMsgBearerGsm,		"GSM");
+//Usage of macros for Cdma mtm
+#if (defined CDMA_API_ENABLED)
+_LIT(KPtMsgBearerType,		"MessageBearerType");
+_LIT(KPtMsgBearerCdma,		"CDMA");
+#endif
+/*@}*/
+
+#if (defined CDMA_API_ENABLED)
+#define KPtDefaultCount		1
+#endif
+
+CTestMessCreateSMS::CTestMessCreateSMS()
+:	CTestMessBase(EFalse)
+,	iSimInDatabase(EFalse)
+	{
+	SetTestStepName(_L("CreateSms"));
+	}
+
+/**
+ Creates the SMS message for GSM or CDMA.
+ @return TVerdict
+*/
+
+TVerdict CTestMessCreateSMS::doTestStepPreambleL()
+	{
+	TVerdict	ret=CTestMessBase::doTestStepPreambleL();
+	// IMK iSimInDatabase=(GetPhoneSmsNumberL(iSimPhoneNumber)==KErrNone);
+	iSimInDatabase=false; //IMK (GetPhoneSmsNumberL(iSimPhoneNumber)==KErrNone);
+	return ret;
+	}
+
+/**
+ Creates the SMS message for GSM or CDMA.
+ @return TVerdict
+*/
+TVerdict CTestMessCreateSMS::doTestStepL()
+	{
+	//	Get scheduling data
+	TTimeIntervalMinutes	scheduledTime=ReadScheduleTime();
+
+	//create the message
+	TBool					saveDraft = EFalse;
+	GetBoolFromConfig(ConfigSection(), KPtSaveDraft, saveDraft);
+
+	if ( saveDraft )
+		{
+		//Create the message in Draft
+		CreateSmsL(KMsvDraftEntryId, scheduledTime);
+		}
+	else
+		{
+		//Creates the message in Outbox
+		CreateSmsL(KMsvGlobalOutBoxIndexEntryId, scheduledTime);
+		}
+
+	return TestStepResult();
+	}
+
+void CTestMessCreateSMS::CreateSmsL(const TMsvId aMsvId, TTimeIntervalMinutes aScheduledTime)
+	{
+	//	Get the bearertype (CDMA/GSM)
+	TPtrC	messageBearerType;
+	messageBearerType.Set(KPtMsgBearerGsm);
+#if (defined CDMA_API_ENABLED)
+	GetStringFromConfig(ConfigSection(), KPtMsgBearerType, messageBearerType);
+	INFO_PRINTF2(_L("The message bearertype is : %S"), &messageBearerType);
+#endif
+
+	CTestMessCreateSmsUtilBase*	createSmsUtil = NULL;
+	//	Create the repective util class
+	if ( messageBearerType.Compare(KPtMsgBearerGsm)==0 )
+		{
+		createSmsUtil=new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+		}
+#if (defined CDMA_API_ENABLED)
+	else if ( messageBearerType.Compare(KPtMsgBearerCdma)==0 )
+		{
+		createSmsUtil=new (ELeave) CTestMessCreateCdmaSmsUtil(*this);
+		}
+#endif
+	else
+		{
+		WARN_PRINTF1(_L("Unknown bearer type using Gsm"));
+		createSmsUtil=new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+		}
+	CleanupStack::PushL(createSmsUtil);
+
+//	All references to PrepareAccountL can be removed when DEF054045 is fixed
+//	createSmsUtil->PrepareAccountL(*iSession);
+
+	if(!iBodyAvailable)
+       {
+		ERR_PRINTF1(_L("No Body"));
+		SetTestStepResult(EFail);
+	   }
+
+	if ( TestStepResult()==EPass )
+		{
+		TInt	err=KErrNone;
+		RSendAs			sendAsServer;
+		User::LeaveIfError(sendAsServer.Connect());
+		CleanupClosePushL(sendAsServer);
+		AddMtmCapabilitiesL(sendAsServer);
+
+		RSendAsMessage	sendAs;
+		TRAP(err, sendAs.CreateL(sendAsServer, KUidMsgTypeSMS));
+		PrepareSendAsL(sendAs);
+
+		if ( err!=KErrNone )
+			{
+			SetTestStepError(err);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("sendAs.SetBodyTextL"));
+			sendAs.SetBodyTextL(*iBodyText);
+
+#if (!defined CDMA_API_ENABLED)
+			TInt	recipients=1;
+			GetIntFromConfig(ConfigSection(), KRecipients, recipients);
+
+			TPtrC	to(iSimPhoneNumber.iTelNumber);
+			TBool	returnValue=ETrue;
+			for ( TInt recipient=0; (recipient<recipients) && (TestStepResult()==EPass); )
+				{
+				++recipient;
+
+				if ( iSimInDatabase )
+					{
+					returnValue=ETrue;
+					}
+				else
+					{
+					TBuf<KMaxTestExecuteCommandLength>	tempStore;
+					tempStore.Format(KTo(), recipient);
+					returnValue=GetStringFromConfig(ConfigSection(), tempStore, to);
+					if ( !returnValue )
+						{
+						returnValue=GetStringFromConfig(KDef, KDefTo, to);
+						}
+					}
+				if ( !returnValue )
+					{
+					ERR_PRINTF1(_L("No To"));
+					SetTestStepResult(EFail);
+					}
+				else
+					{
+					INFO_PRINTF2(_L("To = %S"), &to);
+					sendAs.AddRecipientL(to, RSendAsMessage::ESendAsRecipientTo);
+					}
+				}
+#endif
+
+			TRAP(err, sendAs.SaveMessageAndCloseL());
+			if ( err!=KErrNone )
+				{
+				ERR_PRINTF1(_L("Save Message Failiure"));
+				SetTestStepResult(EFail);
+				sendAs.Close();
+				}
+			else
+				{
+				TMsvId				messageId=KMsvNullIndexEntryId;
+				CMsvEntry*			parent=iSession->GetEntryL(KMsvDraftEntryIdValue);
+				CleanupStack::PushL(parent);
+				parent->SetSortTypeL(SelectionOrdering());
+				CMsvEntrySelection*	selection=parent->ChildrenL();
+				CleanupStack::PushL(selection);
+
+				if ( selection->Count()>0 )
+					{
+					messageId=selection->At(0);
+					}
+				if ( messageId!=KMsvNullIndexEntryId )
+					{
+					SetEntryL(messageId);
+					TMsvEntry	child=EntryL().Entry();
+
+					//Get the message header
+					CSmsHeader*	smsHeader = createSmsUtil->NewHeaderL(*iBodyText);
+					CleanupStack::PushL(smsHeader);
+
+					//If message is too big lets concatenate.....
+					ConCatMessageTextL(*smsHeader);
+
+					CMsvStore*	store =NULL;
+					TRAPD(error, store = EntryL().EditStoreL());
+					if(error != KErrNone)
+						{
+						ERR_PRINTF2(_L("Edit Store Failed. Error %d"), error);
+						SetTestStepError(error);
+						}
+					else
+						{
+						CleanupStack::PushL(store);
+						smsHeader->RestoreL(*store);
+#if (defined CDMA_API_ENABLED)
+						//Adding the recipients...
+						CArrayPtrFlat<CSmsNumber>& recips = smsHeader->Recipients();
+
+						TInt	recipients=KPtDefaultCount;
+						GetIntFromConfig(ConfigSection(), KRecipients, recipients);
+
+						TBool	returnValue;
+						for ( TInt recipient=1; recipient<=recipients; recipient++)
+							{
+							TBuf<KMaxTestExecuteCommandLength>	tempStore;	
+
+							tempStore.Format(KTo(), recipient);	
+
+							TPtrC	to;
+							returnValue=GetStringFromConfig(ConfigSection(), tempStore, to);
+							if ( !returnValue )
+								{
+								returnValue=GetStringFromConfig(KDef, KDefTo, to);
+								}
+							if ( !returnValue )
+								{
+								ERR_PRINTF1(_L("No To"));
+								SetTestStepResult(EFail);
+								}
+							else
+								{
+								INFO_PRINTF2(_L("To = %S"), &to);
+
+								//Get the recipient array
+								CSmsNumber* newRecip = CSmsNumber::NewL();
+								CleanupStack::PushL(newRecip);
+
+								// Check for the email address in recipient
+								// This is for email over sms feature
+								if(to.Locate('@') != KErrNotFound)
+									{
+									newRecip->SetAddressL(to, EMsvAddressTypeEMail);
+									}
+								else
+									{
+									newRecip->SetAddressL(to, EMsvAddressTypeISDN);
+									}
+
+								//Append the recipients
+								recips.AppendL(newRecip);
+								CleanupStack::Pop(newRecip);
+								}
+							}
+#endif
+						child.SetSendingState(KMsvSendStateSuspended);
+						child.SetInPreparation(EFalse);
+						child.SetVisible(ETrue);
+
+						//Get the details
+						TBuf<KSmsDetailsLength>	details;
+
+//Usage of macros of Cdma mtm
+#if (!defined CDMA_API_ENABLED)
+						if ( TSmsUtilities::GetDetails(EntryL().Session().FileSession(), smsHeader->Message(), details) == KErrNone )
+							{
+							child.iDetails.Set(details);
+							}
+#else
+						//if ( TSmsUtilities::GetDetails(EntryL().Session().FileSession(), smsHeader->Message(), details) == KErrNone )
+						CArrayPtrFlat<CSmsNumber>& smsNumberArray = smsHeader->Recipients();
+						if ( smsNumberArray.Count() )
+							{
+							details.Copy(smsNumberArray[0]->Address());
+							}
+						if ( details.Length() )
+							{
+							child.iDetails.Set(details);
+							}
+#endif
+
+						//Get the description
+						TBuf<KSmsDescriptionLength>	desc;
+						if ( TSmsUtilities::GetDescription(smsHeader->Message(), desc) == KErrNone )
+							{
+							child.iDescription.Set(desc);
+							}
+
+						//fill up the fields of the message header
+						PrepareHeaderL(*createSmsUtil, *smsHeader);
+
+						//set the scheduled time if any
+						if ( aScheduledTime!=TTimeIntervalMinutes(0) )
+							{
+							child.SetSendingState(KMsvSendStateScheduled);
+							child.SetScheduled(ETrue);
+							child.iDate.UniversalTime();
+							child.iDate+=aScheduledTime;
+							}
+
+						//	Update entry with data set from .ini file
+						EntryL().ChangeL(child);
+						smsHeader->StoreL(*store);
+						store->CommitL();
+						CleanupStack::PopAndDestroy(store);
+
+						CTestMessEditEntryUtil*	editUtil=new (ELeave) CTestMessEditEntryUtil(*this, ETrue, iSimInDatabase, iSimPhoneNumber);
+						CleanupStack::PushL(editUtil);
+						editUtil->ProcessEntryL(EntryL().EntryId());
+						CleanupStack::PopAndDestroy(editUtil);
+
+						if ( aMsvId==KMsvGlobalOutBoxIndexEntryId )
+							{
+							// Move the selected message to out box
+							CTestActive*	active=CTestActive::NewLC(*this);
+							CMsvOperation*	op=parent->MoveL(child.Id(), KMsvGlobalOutBoxIndexEntryIdValue, active->iStatus);
+							CleanupStack::PushL(op);
+							active->Activate();
+							CActiveScheduler::Start();
+							CleanupStack::PopAndDestroy(2, active);
+							}
+						}
+					CleanupStack::PopAndDestroy(smsHeader);
+					}
+				CleanupStack::PopAndDestroy(2, parent);
+				}
+			}
+
+		CleanupStack::PopAndDestroy(&sendAsServer);
+		}
+	CleanupStack::PopAndDestroy(createSmsUtil);
+	}
+
+void CTestMessCreateSMS::AddMtmCapabilitiesL(RSendAs& aSendAs)
+	{
+	aSendAs.ResetMessageFilter();
+	}
+
+void CTestMessCreateSMS::PrepareSendAsL(RSendAsMessage& /*aSendAs*/)
+	{
+	}
+
+void CTestMessCreateSMS::PrepareHeaderL(CTestMessCreateSmsUtilBase& aCreateUtil, CSmsHeader& aSmsHeader)
+	{
+	aCreateUtil.PrepareHeaderL(aSmsHeader);
+	}
+
+//Usage of macro for CDMA mtm
+#if (defined CDMA_API_ENABLED)
+void CTestMessCreateSMS::ConCatMessageTextL(CSmsHeader& /*aHeader*/)
+	{
+	}
+#else
+void CTestMessCreateSMS::ConCatMessageTextL(CSmsHeader& aHeader)
+	//Doxygen compatible comments
+	/**
+		This method Concatenates the long message. Checks for the length of 
+		body, if it is greater than 160 characters sets the concatenation 
+		option on for the Sms.
+
+		@param aHeader
+		Header for which the concatenation option is set on... 
+
+	*/
+	{
+	CSmsSettings*	smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	//if the length of the iBodyText is greater than the sms maximum length
+	//i.e 160 chars...Set the Concatenation On....
+	if( aHeader.Message().MessageLengthL() > aHeader.Message().MaxMessageLength() )
+		{
+		INFO_PRINTF1(_L("Concatenate Message..."));
+		INFO_PRINTF1(_L("Message Exceeds max length setting Concatenate On..."));
+		aHeader.GetSmsSettingsL(*smsSettings);
+		smsSettings->SetCanConcatenate(ETrue);
+		aHeader.SetSmsSettingsL(*smsSettings);
+		}
+	CleanupStack::PopAndDestroy(smsSettings);
+	}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessCreateSMSaccount.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,154 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessCreateSmsAccount which creates an SMS
+// account folder for GSM or CDMA
+// 
+//
+
+#include "TestMessCreateSmsAccount.h"
+#include "TestMess.h"
+#include "Configuration.cfg"
+
+// EPOC includes
+#include <msvids.h>
+#include <miutset.h>
+#include <msvstore.h>
+
+#include "TestMessCreateGsmSmsUtil.h"
+//Usage of Macro for CDMA mtm
+#if (defined CDMA_API_ENABLED)
+#include "TestMessCreateCdmaSmsUtil.h"
+#endif
+
+#include <csmsaccount.h>
+#include <MsvScheduleSettings.h>
+#include <MsvOffPeakTime.h>
+#include <MsvSendErrorAction.h>
+#include <MsvSysAgentAction.h>
+
+/*@{*/
+_LIT(KSCName,				"scname");
+_LIT(KSCNumber,				"scnumber");
+
+_LIT(KPtGSM,				"GSM");
+#if (defined CDMA_API_ENABLED)
+_LIT(KPtMessageBearerType,	"MessageBearerType");
+_LIT(KPtCDMA,				"CDMA");		
+#endif
+/*@}*/
+
+CTestMessCreateSmsAccount::CTestMessCreateSmsAccount()
+:	CTestMessBase(EFalse)
+	{
+	SetTestStepName(_L("CreateSmsAccount"));
+	}
+
+/**
+ Creates the SMS account folder for GSM or CDMA. For CDMA mtm,
+ it creates the respective utility class for creating the account
+ @return TVerdict
+*/
+TVerdict CTestMessCreateSmsAccount::doTestStepL()
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Create SMS account"));
+
+	TPtrC	ptrSCName;
+	TBool	returnValue =GetStringFromConfig(ConfigSection(), KSCName, ptrSCName);
+	INFO_PRINTF2(_L("SC Name = %S"), &ptrSCName);
+
+	TPtrC	ptrSCNumber;
+	returnValue =GetStringFromConfig(ConfigSection(), KSCNumber, ptrSCNumber);
+	INFO_PRINTF2(_L("SC Number = %S"), &ptrSCNumber);
+
+	CSmsAccount*			smsAccount = CSmsAccount::NewLC();
+	CMsvScheduleSettings*	scheduleSetting = CMsvScheduleSettings::NewLC();
+	CMsvOffPeakTimes*		offPeakTimes=new (ELeave) CMsvOffPeakTimes();
+	CleanupStack::PushL(offPeakTimes);
+	CMsvSendErrorActions*	errorActions=CMsvSendErrorActions::NewLC();
+	CMsvSysAgentActions*	sysAgentActions=new (ELeave) CMsvSysAgentActions();
+	CleanupStack::PushL(sysAgentActions);
+	CSmsSettings*		smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	SetEntryL(KMsvRootIndexEntryId);
+
+	EntryL().SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=EntryL().ChildrenWithTypeL(KUidMsvServiceEntry);
+	CleanupStack::PushL(selection);
+	TInt				count=selection->Count();
+	TBool				found=EFalse;
+	for (TInt i=count; i>0 && !found; )
+		{
+		SetEntryL(selection->At(--i));
+
+		// Only one Sms Service allowed
+		if	(	EntryL().Entry().iMtm == KUidMsgTypeSMS &&
+				EntryL().Entry().iType == KUidMsvServiceEntry
+			)
+			{
+			found=ETrue;
+			}
+		}
+
+	if ( !found )
+		{
+		smsAccount->InitialiseDefaultSettingsL(*smsSettings);
+		smsAccount->InitialiseDefaultSettingsL(*scheduleSetting, *offPeakTimes, *errorActions, *sysAgentActions);
+
+		TPtrC	messageBearerType;
+		messageBearerType.Set(KPtGSM);
+#if (defined CDMA_API_ENABLED)
+		GetStringFromConfig(ConfigSection(), KPtMessageBearerType, messageBearerType);
+		INFO_PRINTF2(_L("The message bearer type is : %S"), &messageBearerType);
+#endif
+
+		CTestMessCreateSmsUtilBase*	createSmsUtil = NULL;
+		//Creates the util class for GSM or CDMA
+		if ( messageBearerType.Compare(KPtGSM)==0 )
+			{
+			createSmsUtil = new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+			}
+#if (defined CDMA_API_ENABLED)
+		else if( messageBearerType.Compare(KPtCDMA)==0 )
+			{
+			createSmsUtil = new (ELeave) CTestMessCreateCdmaSmsUtil(*this);
+			}
+#endif
+		else
+			{
+			WARN_PRINTF1(_L("Unknown bearer type using Gsm"));
+			createSmsUtil= new (ELeave) CTestMessCreateGsmSmsUtil(*this);
+			}
+		CleanupStack::PushL(createSmsUtil);
+
+		//Changes the new account settings
+		createSmsUtil->SetSmsAccountSettings(*smsSettings);
+		CleanupStack::PopAndDestroy(createSmsUtil);
+
+		smsAccount->SaveSettingsL(*smsSettings);
+		smsAccount->SaveSettingsL(*scheduleSetting, *offPeakTimes, *errorActions, *sysAgentActions);
+		}
+
+	if ( TestStepResult()==EPass )
+		{
+		smsAccount->LoadSettingsL(*smsSettings);
+		smsSettings->AddServiceCenterL(ptrSCName, ptrSCNumber);
+		smsAccount->SaveSettingsL(*smsSettings);
+		}
+
+	CleanupStack::PopAndDestroy(2, smsSettings);
+	CleanupStack::PopAndDestroy(5, smsAccount);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessCreateSmsUtilBase.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This class is the base class for create CDMA or GSM SMS utility class
+// 
+//
+
+
+#include "TestMessCreateSmsUtilBase.h"
+
+/**
+ Constructor
+*/
+CTestMessCreateSmsUtilBase::CTestMessCreateSmsUtilBase(CTestMessBase &aTestStep)
+: iTestStep(aTestStep)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessEditEntry.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,170 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntry which edits the entry characterstics
+// 
+//
+ 
+#include "TestMessEditEntry.h"
+#include "TestMessEditEntryUtil.h"
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+_LIT(KPtSaveToOutbox,			"SaveToOutbox");
+/*@}*/
+
+/// Default value for depth of the count
+#define KDefaultDepthCount	1
+
+/**
+ * Override of base class pure virtual
+ * @param  None
+ * @return TVerdict - return TVerdict codes
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntry::ProcessMessageL(CBaseMtm& /*aBaseMtm*/, TMsvId /*aMsgId*/)
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Edit Entry"));
+
+	if ( TestStepResult() == EPass )
+		{
+		CTestMessEditEntryUtil*	editUtil=new (ELeave) CTestMessEditEntryUtil(*this, EFalse, EFalse, RMobilePhone::TMobileAddress());
+		CleanupStack::PushL(editUtil);
+
+		editUtil->ProcessEntryL(EntryL().EntryId());
+
+		//Read whether the message is saved in outbox
+		TBool saveOutbox;
+		if( ! GetBoolFromConfig(ConfigSection(), KPtSaveToOutbox, saveOutbox))
+			{
+			saveOutbox = EFalse;
+			}
+
+		INFO_PRINTF2(_L("The message saved in outbox flag is : %S"), &saveOutbox);
+		if(saveOutbox)
+			{
+			//Move the message to outbox
+			MoveMessageL(EntryL().EntryId(), KMsvGlobalOutBoxIndexEntryId);
+			}
+		else
+			{
+			INFO_PRINTF1(_L("Entry is not moved"));
+			}
+
+		CleanupStack::PopAndDestroy(editUtil);
+		}
+	}
+
+/**
+ Move the message the destination folder
+ @param aMessageId - TMsvId of the message
+ @param aFolderId - TMsvId of the destination folder
+ @leave KErrNoMemory
+ @leave KErrNotFound
+*/
+void CTestMessEditEntry::MoveMessageL(TMsvId aMessageId,TMsvId aFolderId)
+	{
+	// Get CMsvEntry object and the TMsvEntry of the message
+	CMsvEntry*		msgvEntry = iSession->GetEntryL(aMessageId);
+	CleanupStack::PushL(msgvEntry);
+	TMsvEntry entry= msgvEntry->Entry();
+
+	// Get the parent folder Id of the messaage and create the CMsvEntry
+	TMsvId			parentId = entry.Parent();
+	CMsvEntry*		msvEntry = iSession->GetEntryL(parentId);
+	CleanupStack::PushL(msvEntry);
+
+	// Create the active object for handling asynchronous request
+	CMoveOperation*	activeOperation = CMoveOperation::NewL();
+	CleanupStack::PushL(activeOperation);
+
+	// Move the selected message to given target folder
+	CMsvOperation*	op = msvEntry->MoveL(aMessageId, aFolderId, activeOperation->iStatus);
+	CleanupStack::PushL(op);
+
+	// Start the Active scheduler 
+	activeOperation->SetOperation();
+	CActiveScheduler::Start();
+	TInt	error = activeOperation->iStatus.Int();
+	if(error == KErrNone)
+		{
+		INFO_PRINTF1(_L("message moved successfully"));
+		}
+	else
+		{
+		INFO_PRINTF2(_L("message failed to be moved. Error : %d"),error);
+		SetTestStepResult(EFail);
+		}
+		//Destroy the object
+	CleanupStack::PopAndDestroy(4, msgvEntry);
+	}
+
+/**
+ Constructor for CMoveOperation 
+*/
+CTestMessEditEntry::CMoveOperation::CMoveOperation()
+: CActive(CActive::EPriorityStandard)
+	{
+	}
+
+/**
+ Two phase constructor
+ @return CTestMessEditEntry::CMoveOperation* - pointer of CTestMessEditEntry::CMoveOperation
+ @leave - KErrNoMemory
+ @leave - System wide error codes
+*/
+CTestMessEditEntry::CMoveOperation* CTestMessEditEntry::CMoveOperation::NewL()
+	{
+	CMoveOperation* self = new (ELeave) CMoveOperation();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+/**
+ Second phase construction
+ @leave - sytem wide error codes
+*/
+void CTestMessEditEntry::CMoveOperation::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
+
+/**
+ Sets the operation as active
+*/
+void CTestMessEditEntry::CMoveOperation::SetOperation()
+	{
+	SetActive();
+	}
+
+/**
+ Operation completed event handler.
+*/
+void CTestMessEditEntry::CMoveOperation::RunL()
+	{
+	CActiveScheduler::Stop();
+	}
+
+/**
+ Cancels the active operation
+*/
+void CTestMessEditEntry::CMoveOperation::DoCancel()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessEditEntryUtil.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,249 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntryUtil. A utility to edit an entry
+// 
+//
+
+
+#include "TestMessEditEntryUtil.h"
+
+// EPOC includes
+
+#include <smut.h>
+#include <miutmsg.h>
+#include <mtclreg.h>
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+_LIT(KToRecipients,			"toRecipients");
+_LIT(KTo,					"to%d");
+_LIT(KDef,					"default");
+_LIT(KDefTo,				"emailto");
+
+/// Literal constants used
+_LIT(KCharacterSetType,		"characterSetType");
+_LIT(KPtEditBody,			"EditBody");
+_LIT(KPtEditRecipients,		"EditRecipients");
+_LIT(KPtRecipient,			"recipient%d");
+/*@}*/
+
+CTestMessEditEntryUtil::CTestMessEditEntryUtil(CTestMessBase& aTestStep, TBool aSimChecked, TBool aSimInDatabase, RMobilePhone::TMobileAddress aSimPhoneNumber)
+:	CTestMessStoreProcessUtil(aTestStep, EFalse)
+,	iSimChecked(aSimChecked)
+,	iSimInDatabase(aSimInDatabase)
+,	iSimPhoneNumber(aSimPhoneNumber)
+	{
+	}
+
+/**
+ * Edits the ImHeaders of the Entry
+ * @param  CImHeader& aHeader - Im Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntryUtil::ProcessImHeaderL(CImHeader& aHeader)
+	{
+	// Edit the CImHeader information
+	TInt	recipients;
+	if ( !iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KToRecipients, recipients) )
+		{
+		recipients=0;
+		}
+
+	for ( TInt recipient=1; recipient<=recipients; recipient++)
+		{
+		TBuf<KMaxTestExecuteCommandLength>	tempStore;
+		tempStore.Format(KTo(), recipient);
+
+		TPtrC	to;
+		TInt	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), tempStore, to);
+		if ( !returnValue )
+			{
+			returnValue=iTestStep.GetStringFromConfig(KDef, KDefTo, to);
+			}
+		if ( !returnValue )
+			{
+			iTestStep.ERR_PRINTF1(_L("No To"));
+			iTestStep.SetTestStepResult(EFail);
+			}
+		else
+			{
+			iTestStep.INFO_PRINTF2(_L("To = %S"), &to);
+			aHeader.ToRecipients().AppendL(to);
+			}
+		}
+	}
+
+/**
+ * Edits the ImMimeHeaders of the message entry
+ * @param  CImMimeHeader& aHeader - Mime Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntryUtil::ProcessImMimeHeaderL(CImMimeHeader& aHeader)
+	{
+	// Update the character set info
+	TPtrC	charSetType;
+	if ( iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KCharacterSetType, charSetType) )
+		{
+		TUint	charSetVal;
+		if ( ValidCharacterSetInfo(charSetType, charSetVal) )
+			{
+			aHeader.SetMimeCharset(charSetVal);
+			}
+		}
+	}
+
+/**
+ * Edits the ImIAPPreferences of the entry
+ * @param  CImIAPPreferences& aPreferences - IAP Preferences to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessEditEntryUtil::ProcessInternetAccessPreferencesL(CImIAPPreferences& /*aPreferences*/)
+	{
+	}
+
+/**
+ Edits the CSmsHeader of the entry
+ @param  CSmsHeader& aHeader - Sms Header to edit
+ @return None
+ @panic None
+ @leave KErrNoMemory
+*/
+void CTestMessEditEntryUtil::ProcessSmsHeaderStreamL(CSmsHeader& aSmsHeader)
+	{
+	// Get the number of recipients 
+	TInt	recipients = 0;
+	if ( !iTestStep.GetIntFromConfig(iTestStep.ConfigSection(), KPtEditRecipients, recipients) )
+		{
+		recipients=0;
+		iTestStep.INFO_PRINTF1(_L("No Recipients edited/added"));
+		}
+	iTestStep.INFO_PRINTF2(_L("The number of recipients : %d"), recipients);
+
+	if ( !iSimChecked )
+		{
+		//IMK iSimInDatabase=(iTestStep.GetPhoneSmsNumberL(iSimPhoneNumber)==KErrNone);
+		iSimInDatabase=0;
+		}
+	TPtrC	to(iSimPhoneNumber.iTelNumber);
+	TInt	returnValue=ETrue;
+	for ( TInt recipient=0; (recipient<recipients) && (iTestStep.TestStepResult()==EPass); )
+		{
+		++recipient;
+		if ( iSimInDatabase )
+			{
+			returnValue=ETrue;
+			}
+		else
+			{
+			TBuf<KMaxTestExecuteCommandLength>	tempStore;
+			tempStore.Format(KPtRecipient(), recipient);
+
+			//Get the recipient address
+			returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), tempStore, to);
+			if ( !returnValue )
+				{
+				returnValue=iTestStep.GetStringFromConfig(KDef, KDefTo, to);
+				}
+			}
+		if ( !returnValue )
+			{
+			iTestStep.ERR_PRINTF1(_L("Recipient number is not Provided"));
+			iTestStep.SetTestStepResult(EFail);
+			}
+		else
+			{
+			//Append the recipient address in recipient list
+			CSmsNumber*	smsNumber = CSmsNumber::NewL();
+			CleanupStack::PushL(smsNumber);
+			iTestStep.INFO_PRINTF2(_L("To = %S"), &to);
+			smsNumber->SetAddressL(to);
+			aSmsHeader.Recipients().AppendL(smsNumber);
+			//No need to destory CSmsNumber. CSmsHeader destroys it
+			CleanupStack::Pop(smsNumber);
+			}
+		}
+	}
+
+
+/**
+ Edits the CRichText of the entry
+ @param  CRichText& aBodyText - Text to edit
+ @return None
+ @panic None
+ @leave KErrNoMemory
+*/
+void CTestMessEditEntryUtil::ProcessRichTextBodyL(CRichText& aBodyText)
+	{
+	TPtrC	ptrBody;
+	//Get the body text file
+	TBool	returnValue=iTestStep.GetStringFromConfig(iTestStep.ConfigSection(), KPtEditBody, ptrBody);
+	if ( !returnValue )
+		{
+		iTestStep.INFO_PRINTF1(_L("Body is not edited"));
+		}
+	else
+		{
+		iTestStep.INFO_PRINTF2(_L("Body = %S"), &ptrBody);
+
+		// open the file
+		RFs rfs;
+		rfs.Connect();
+		RFile	file;
+
+		//Append the body text of the entry
+		TInt anError = file.Open(rfs, ptrBody, EFileShareAny);
+		if(anError == KErrNone)
+			{
+			TBool		reading=ETrue;
+			TInt		pos = aBodyText.LdDocumentLength();
+			TBuf8<1>	charIn;
+			while (reading)
+				{
+				file.Read(charIn, 1);
+				if(charIn.Length())
+					switch ( charIn[0] )
+						{
+					case '\r':
+						aBodyText.InsertL(pos++, CEditableText::ELineBreak);
+					case '\n':
+						break;
+					default:
+						aBodyText.InsertL(pos++, TChar(charIn[0]));
+						}
+				else
+					{
+					reading = FALSE;	// stop at the end of the file
+					}
+				}
+			file.Close();
+			rfs.Close();
+			}
+		else
+			{
+			iTestStep.ERR_PRINTF2(_L("Cannot open file = %S"), &ptrBody);
+			iTestStep.SetTestStepResult(EFail);
+			}
+		}	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessPrintEntryUtil.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,117 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessEditEntryUtil. A utility to edit an entry
+// 
+//
+
+#include "Configuration.cfg"
+
+#include "TestMessPrintEntryUtil.h"
+
+CTestMessPrintEntryUtil::CTestMessPrintEntryUtil(CTestMessBase& aTestStep)
+:	CTestMessStoreProcessUtil(aTestStep, ETrue)
+	{
+	}
+
+/**
+ * Prints the ImHeaders of the Entry
+ * @param  CImHeader& aHeader - Im Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessImHeaderL(CImHeader& aHeader)
+	{
+	TPtrC	ptrTemp;
+
+	ptrTemp.Set(aHeader.From());
+	iTestStep.INFO_PRINTF2(_L("  From                         : %S"), &ptrTemp);
+	ptrTemp.Set(aHeader.ReceiptAddress());
+	iTestStep.INFO_PRINTF2(_L("  ReceiptAddress               : %S"), &ptrTemp);
+	ptrTemp.Set(aHeader.ReplyTo());
+	iTestStep.INFO_PRINTF2(_L("  ReplyTo                      : %S"), &ptrTemp);
+	ptrTemp.Set(aHeader.Subject());
+	iTestStep.INFO_PRINTF2(_L("  Subject                      : %S"), &ptrTemp);
+	}
+
+/**
+ * Prints the ImMimeHeaders of the message entry
+ * @param  CImMimeHeader& aHeader - Mime Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessImMimeHeaderL(CImMimeHeader& /*aHeader*/)
+	{
+	}
+
+/**
+ * Prints the ImIAPPreferences of the entry
+ * @param  CImIAPPreferences& aPreferences - IAP Preferences to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessInternetAccessPreferencesL(CImIAPPreferences& aPreferences)
+	{
+	TInt	prefs=aPreferences.NumberOfIAPs();
+	for ( TInt pref=0; pref<prefs; )
+		{
+		TImIAPChoice	choice=aPreferences.IAPPreference(pref++);
+		iTestStep.INFO_PRINTF2(_L("  IAP Preference               : %d"), pref);
+		iTestStep.INFO_PRINTF2(_L("  iIAP                         : %d"), choice.iIAP);
+		iTestStep.INFO_PRINTF2(_L("  iDialogPref                  : %d"), choice.iDialogPref);
+		}
+	}
+
+/**
+ * Prints the CSmsHeader of the entry
+ * @param  CSmsHeader& aHeader - Sms Header to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessSmsHeaderStreamL(CSmsHeader& aHeader)
+	{
+#if (defined CDMA_API_ENABLED)
+	CSmsSettings*	smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	aHeader.GetDefaultMessageSettingsL(*smsSettings);
+	TSmsMessageType	pduType = aHeader.MessageType();
+	TBool			replyPath = smsSettings->ReplyPath();
+	CleanupStack::PopAndDestroy(smsSettings);
+#else
+	CSmsPDU::TSmsPDUType	pduType=aHeader.Type();
+	TBool					replyPath = aHeader.ReplyPathProvided();
+#endif
+	iTestStep.INFO_PRINTF2(_L("  pduType                      : %d"), pduType);
+	iTestStep.INFO_PRINTF2(_L("  replyPathProvided            : %d"), replyPath);
+	}
+
+
+/**
+ * Prints the CRichText of the entry
+ * @param  CRichText& aBodyText - Text to edit
+ * @return None
+ * @panic None
+ * @leave KErrNoMemory
+ *  
+*/
+void CTestMessPrintEntryUtil::ProcessRichTextBodyL(CRichText& /*aBodyText*/)
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessProcessExistingMsg.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,91 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessProcessExistingMsg
+// Base class for processing an existing message
+// 
+//
+
+
+
+/**
+ @file TestMessProcessExistingMsg.cpp
+*/
+
+#include "TestMessProcessExistingMsg.h"
+
+// EPOC includes
+#include <mtclreg.h>
+#include <miuthdr.h>
+#include <txtfmlyr.h>
+#include <txtrich.h>
+#include <miutmsg.h>
+
+/**
+ * Constructor.
+ * @return - None
+ * 
+*/	
+CTestMessProcessExistingMsg::CTestMessProcessExistingMsg()
+:	CTestMessBase(ETrue)
+	{
+	}
+
+/**
+ * Override of base class pure virtual function
+ * @return - TVerdict code
+ * @leave - KErrNoMemory - memory allocatior failure
+ * @leave - KErrBadLibraryEntryPoint  - Malformed MTM
+ * @leave - KErrNotFound - Not found the mtmUid and StepStepResult set to Fail
+ * 
+*/	
+TVerdict CTestMessProcessExistingMsg::doTestStepL()
+	{
+	if ( TestStepResult() == EPass )
+		{
+		CClientMtmRegistry*	clientMtmRegistry=CClientMtmRegistry::NewL(*iSession);
+		CleanupStack::PushL(clientMtmRegistry);
+
+		iMtmID=EntryL().Entry().iMtm;
+
+		CBaseMtm*	baseMtm=clientMtmRegistry->NewMtmL(iMtmID);
+		CleanupStack::PushL(baseMtm);
+
+		// switch the context
+		TMsvId		msgId=EntryL().EntryId();
+		PrintEntryL(EntryL());
+		baseMtm->SwitchCurrentEntryL(msgId);
+		baseMtm->LoadMessageL();
+
+		ProcessMessageL(*baseMtm, msgId);
+
+		if ( TestStepResult() == EPass )
+			{
+			PostProcessMessageL();
+			}
+
+		CleanupStack::PopAndDestroy(2, clientMtmRegistry);
+		}
+	
+	return TestStepResult();
+	}
+
+/**
+ * Nothing done for open
+ * @return None
+ * @leave KErrNone and TestStepResult set to EFail
+ * 
+*/
+void CTestMessProcessExistingMsg::PostProcessMessageL()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessProcessor.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,288 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessProcessor which an active object utility
+// used for send/recieving or any time consuming 
+// 
+//
+
+#include "TestMessProcessor.h"
+#include "TestMessBase.h"
+
+CTestMessProcessor* CTestMessProcessor::NewL(CTestStep& aTestStep, CMsvSession& aSession)
+	{
+	CTestMessProcessor*	self=new(ELeave) CTestMessProcessor(aTestStep, aSession);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestMessProcessor::CTestMessProcessor(CTestStep& aTestStep, CMsvSession& aSession)
+:	CActive(EPriorityStandard)
+,	iState(EStatePrepareToSendMsg)
+,	iTestStep(aTestStep)
+,	iSession(aSession)
+,	iEntry(NULL)
+,	iMsgId(KMsvRootIndexEntryId)
+,	iClient(NULL)
+,	iMsvOperation(NULL)
+,	iCancelSms(EFalse)
+	{
+	}
+
+CTestMessProcessor::~CTestMessProcessor()
+	{
+	delete iEntry;
+	iEntry=NULL;
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	}
+
+void CTestMessProcessor::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CTestMessProcessor::DoCancel()
+	{
+	iTestStep.INFO_PRINTF1(_L("Cancel operation"));
+	iMsvOperation->Cancel();
+	}
+
+void CTestMessProcessor::DisplayProgress()
+	{
+	// display the current progress
+	switch(iState)
+		{
+	case EStatePrepareToSendMsg:
+		{
+		TMsvLocalOperationProgress			temp;
+		TPckgC<TMsvLocalOperationProgress>	progress(temp);
+
+		progress.Set(iMsvOperation->ProgressL());
+		iTestStep.INFO_PRINTF1(_L("   Progress"));
+		iTestStep.INFO_PRINTF2(_L("       Operation              :%d"), progress().iType);
+		iTestStep.INFO_PRINTF2(_L("       Total Number Of Entries:%d"), progress().iTotalNumberOfEntries);
+		iTestStep.INFO_PRINTF2(_L("       Number Completed       :%d"), progress().iNumberCompleted);
+		iTestStep.INFO_PRINTF2(_L("       Number Failed          :%d"), progress().iNumberFailed);
+		iTestStep.INFO_PRINTF2(_L("       Number Remaining       :%d"), progress().iNumberRemaining);
+		iTestStep.INFO_PRINTF2(_L("       Error                  :%d"), progress().iError);
+		iTestStep.INFO_PRINTF2(_L("       Id                     :%x"), progress().iId);
+		}
+		break;
+	case EStateRequest:
+		iClient->DisplayProgressL(EFalse, iMsvOperation);
+		break;
+	default:
+		break;
+		}
+	}
+
+void CTestMessProcessor::SendEmailMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient)
+	{
+	iMsgId=aMsgId;
+	iClient=aClient;
+	iState=EStatePrepareToSendMsg;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iMsgEntry=iEntry->Entry();
+	iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	iMsvOperation=iEntry->ChangeL(iMsgEntry, iStatus);
+	SetActive();
+	}
+
+/**
+ Sends the sms message. It sets the fields of the enty.
+ @param aMsgId - TMsvId of the message
+ @param aClient - Pointer to the MTestMessProcessClient
+ @param aCancelSms - Bool value for the Cancel sms flag
+*/
+void CTestMessProcessor::SendSmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient, TBool aCancelSms)
+	{
+	iMsgId=aMsgId;
+	iClient=aClient;
+	iState=EStatePrepareToSendMsg;
+	iCancelSms = aCancelSms;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iMsgEntry=iEntry->Entry();
+	iMsgEntry.SetConnected(ETrue);
+	iMsgEntry.SetFailed(EFalse);
+	iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+	iMsgEntry.iError = KErrNone;
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	iMsvOperation=iEntry->ChangeL(iMsgEntry, iStatus);
+	SetActive();
+	}
+
+void CTestMessProcessor::SendMmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient)
+	{
+	iMsgId=aMsgId;
+	iClient=aClient;
+	iState=EStatePrepareToSendMsg;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iMsgEntry=iEntry->Entry();
+	iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	iMsvOperation=iEntry->ChangeL(iMsgEntry, iStatus);
+	SetActive();
+	}
+
+void CTestMessProcessor::MtmRequestL(TMsvId aAccountId, MTestMessProcessorClient* aClient)
+	{
+	iMsgId=aAccountId;
+	iClient=aClient;
+	iState=EStateRequest;
+
+	delete iEntry;
+	iEntry=NULL;
+	iEntry=iSession.GetEntryL(iMsgId);
+	iStatus = KRequestPending;
+	delete iMsvOperation;
+	iMsvOperation=NULL;
+	TRAPD(err, iMsvOperation=iClient->CreateOperationL(iStatus));
+	if ( iTestStep.TestStepResult() == EPass && err==KErrNone )
+		{
+		SetActive();
+		}
+	}
+
+void CTestMessProcessor::RunL()
+	{
+	switch(iState)
+		{
+	case EStatePrepareToSendMsg:
+		switch (iStatus.Int())
+			{
+		case KErrNone:
+			{
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			delete iEntry;
+			iEntry=NULL;
+			iEntry=iSession.GetEntryL(iMsgId);
+			iMsgEntry=iEntry->Entry();
+			iMsgEntry.SetSendingState(KMsvSendStateWaiting);
+			iEntry->ChangeL(iMsgEntry);
+			if ( iMsgEntry.SendingState() == KMsvSendStateWaiting )
+				{
+				iState=EStateRequest;
+				iStatus = KRequestPending;
+				TRAPD(err, iMsvOperation=iClient->CreateOperationL(iStatus));
+				if ( iTestStep.TestStepResult() == EPass && err==KErrNone )
+					{
+					SetActive();
+					}
+				else
+					{
+					CActiveScheduler::Stop();
+					}
+				}
+			else
+				{
+				iTestStep.ERR_PRINTF2(_L("Sending State not Waiting :%d"), iMsgEntry.SendingState());
+				iTestStep.SetTestStepResult(EFail);
+				CActiveScheduler::Stop();
+				}
+			}
+			break;
+		case KErrCancel:
+			{
+			if(iCancelSms)
+				{
+				iTestStep.INFO_PRINTF1(_L("Sending of the mesage Cancelled successfully"));
+				}
+			else
+				{
+				iTestStep.ERR_PRINTF2(_L("Message failed to Send, Error = %d"), iStatus.Int());
+				iTestStep.SetTestStepResult(EFail);
+				}
+			CActiveScheduler::Stop();
+			break;
+			}
+		default:
+			iTestStep.ERR_PRINTF2(_L("Unknown Event :%d"), iStatus.Int());
+			iTestStep.SetTestStepResult(EFail);
+			CActiveScheduler::Stop();
+			}
+		break;
+	case EStateRequest:
+		switch (iStatus.Int())
+			{
+		case KErrNone:
+			{
+			TInt	error=iClient->DisplayProgressL(ETrue, iMsvOperation);
+			if ( error != KErrNone )
+				{
+				iTestStep.ERR_PRINTF2(_L("Progress Error:%d"), error);
+				iTestStep.SetTestStepResult(EFail);
+				}
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+
+			//	Is there another operation
+			if ( iClient->MoreOperations() )
+				{
+				iStatus = KRequestPending;
+				TRAPD(err, iMsvOperation=iClient->CreateOperationL(iStatus));
+				if ( iTestStep.TestStepResult() == EPass && err==KErrNone )
+					{
+					SetActive();
+					}
+				else
+					{
+					CActiveScheduler::Stop();
+					}
+				}
+			else
+				{
+				CActiveScheduler::Stop();
+				}
+			}
+			break;
+		case KErrServerTerminated:
+			{
+			TInt	error=iClient->DisplayProgressL(ETrue, iMsvOperation);
+			if ( error != KErrServerTerminated )
+				{
+				iTestStep.ERR_PRINTF2(_L("Progress Error:%d"), error);
+				iTestStep.SetTestStepResult(EFail);
+				}
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			CActiveScheduler::Stop();
+			}
+		default:
+			iTestStep.ERR_PRINTF2(_L("Unknown Event :%d"), iStatus.Int());
+			iTestStep.SetTestStepResult(EFail);
+			CActiveScheduler::Stop();
+			}
+		break;
+	default:
+		iTestStep.ERR_PRINTF1(_L("No handler found in CTestMessProcessor class"));
+		iTestStep.SetTestStepResult(EFail);
+		CActiveScheduler::Stop();
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessServer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,191 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestMessServer.h"
+#include "TestMessSession.h"
+#include "TestMessCleanMessageFolder.h"
+#include "TestMessCreateSmsAccount.h"
+//IMK #include "TestMessCreatePopAccount.h"
+//IMK #include "TestMessCreateImapAccount.h"
+#include "TestMessSetDefaultSc.h"
+//IMK #include "TestMessCreateBIO.h"
+//IMK #include "TestMessCreateEmail.h"
+//IMK #include "TestMessCreateBulkEmail.h"
+//IMK #include "TestMessCreateEMS.h"
+#include "TestMessCreateSMS.h"
+//IMK #include "TestMessCreateBulkSMS.h"
+//IMK #include "TestMessEntryCount.h"
+//IMK #include "TestMessSendEmail.h"
+//IMK #include "TestMessSendBulkEmail.h"
+//IMK #include "TestMessSendSms.h"
+//IMK #include "TestMessDeleteEmailImap.h"
+//IMK #include "TestMessDeleteEmailPop.h"
+//IMK #include "TestMessFullSyncImap.h"
+//IMK #include "TestMessReceiveEmailImap.h"
+//IMK #include "TestMessReceiveEmailPop.h"
+//IMK #include "TestMessOpen.h"
+//IMK #include "TestMessVerifyEntry.h"
+//IMK #include "TestMessReply.h"
+//IMK #include "TestMessForward.h"
+//IMK #include "TestMessCompareMessages.h"
+//IMK #include "TestMessSetSyncRateImap.h"
+//IMK #include "TestMessDeleteSharedData.h"
+#include "TestMessEditEntry.h"
+//IMK #include "TestMessSaveEmailAttachments.h"
+//IMK #include "TestMessDeleteFolder.h"
+//IMK #include "TestMessCreateFolder.h"
+//IMK #include "TestMessRenameFolder.h"
+//IMK #include "TestMessMoveMessages.h"
+//IMK #include "TestMessSearchMessage.h"
+//IMK #include "TestMessDeleteMessages.h"
+//IMK #include "TestMessScheduleSendSMS.h"
+//IMK #include "TestMessCancelScheduledSMS.h"
+//IMK #include "TestMessVerifyScheduleSMS.h"
+//IMK #include "TestMessBackupStore.h"
+//IMK #include "TestMessRestoreStore.h"
+//IMK #include "TestMessReceiveHeadersEmailPop.h"
+//IMK #if (defined _PLATTEST_CDMA_)
+//IMK #include "TestMessCreateCancelSms.h"
+//IMK #endif
+
+
+// EPOC includes
+#include <e32base.h>
+#include <es_sock.h>
+#include <smsuaddr.h>
+#include <TestExecuteServerUtils.h>
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+/*@}*/
+
+
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler*	sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CTestMessServer*	server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CTestMessServer::NewL());
+	if ( err==KErrNone )
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+#if (defined TRAP_IGNORE)
+	TRAP_IGNORE(MainL());
+#else
+	TRAPD(err,MainL());
+#endif
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return KErrNone;
+    }
+
+
+CTestMessServer* CTestMessServer::NewL()
+	{
+	CTestMessServer*	server=new(ELeave) CTestMessServer();
+	CleanupStack::PushL(server);
+	RProcess	handle = RProcess();
+	TParsePtrC	serverName(handle.FileName());
+	server->ConstructL(serverName.Name());
+	CleanupStack::Pop();
+	return server;
+	}
+
+CTestMessServer::CTestMessServer()
+:	CTestServer()
+,	iSharedData(NULL)
+	{
+	}
+
+void CTestMessServer::ConstructL(const TDesC& aName)
+	{
+	CTestServer::ConstructL(aName);
+	iSharedData=CTestMessSharedData::NewL();
+	}
+
+CTestMessServer::~CTestMessServer()
+	{
+	delete iSharedData;
+	iSharedData=NULL;
+	}
+
+CSession2* CTestMessServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& /*aMessage*/) const
+/**
+ * @param RMessage - RMessage for the session open
+ * Secure version
+ */
+	{
+	CTestSession*	session = new (ELeave) CTestMessSession(iSharedData);
+	CONST_CAST(CTestMessServer*,this)->IncSessionCount();
+	return session;
+	}
+
+// constructor for ESOCK test suite
+// this creates all the ESOCK test steps and
+// stores them inside CTestSuiteEsock
+CTestStep* CTestMessServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestMessBase*	testStep = NULL;
+
+	if(aStepName == _L("CleanMessageFolder"))
+		{
+		testStep = new CTestMessCleanMessageFolder();
+		}
+	else if(aStepName == _L("CreateSms"))
+		{
+		testStep = new CTestMessCreateSMS();
+		}
+	else if(aStepName == _L("CreateSmsAccount"))
+		{
+		testStep = new CTestMessCreateSmsAccount();
+		}
+	else if(aStepName == _L("SetSmsSc"))
+		{
+		testStep = new CTestMessSetDefaultSc();
+		}
+	return testStep;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessSession.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,50 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "TestMessSession.h"
+
+CTestMessSession::CTestMessSession(CTestMessSharedData* aSharedData)
+:	CTestSession()
+,	iSharedData(aSharedData)
+	{
+	}
+
+
+void CTestMessSession::ServiceL(const RMessage2& aMessage)
+	{
+	CTestSession::ServiceL(aMessage);
+	switch(aMessage.Function())
+		{
+		case EOpenTestStep :
+			{
+			}
+			break;
+		case ERunTestStep :
+			{
+			iSharedData->DoProcessL();
+			}
+			break;
+		case EAbortTestStep :
+			{
+			}
+			break;
+		case ECloseTestStep :
+			{
+			}
+			break;
+		default:
+			break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessSetDefaultSC.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,122 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains TestMessSetDefaultSc which sets an SMS
+// SC as default SC.
+// 
+//
+
+#include "TestMessSetDefaultSC.h"
+
+// EPOC includes
+#include <msvids.h>
+#include <miutset.h>
+#include <smutset.h>
+#include <etelmm.h>
+#include <msvstore.h>
+#include <csmsaccount.h>
+
+_LIT(KSCName,		"scname");
+
+CTestMessSetDefaultSc::CTestMessSetDefaultSc()
+:	CTestMessBase(EFalse)
+	{
+	SetTestStepName(_L("SetSmsSc"));
+	}
+
+TVerdict CTestMessSetDefaultSc::doTestStepL()
+	{
+	// Printing to the console and log file
+	INFO_PRINTF1(_L("Set Default Service Center"));
+
+	CSmsSettings*		smsSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(smsSettings);
+	SetEntryL(KMsvRootIndexEntryId);
+
+	EntryL().SetSortTypeL(SelectionOrdering());
+	CMsvEntrySelection*	selection=EntryL().ChildrenWithTypeL(KUidMsvServiceEntry);
+	CleanupStack::PushL(selection);
+	TInt				count=selection->Count();
+	TBool				found=EFalse;
+	for (TInt i=count; i>0 && !found; )
+		{
+		SetEntryL(selection->At(--i));
+
+		//	Log child
+		if	(	EntryL().Entry().iMtm == KUidMsgTypeSMS &&
+				EntryL().Entry().iType == KUidMsvServiceEntry
+			)
+			{
+			found=ETrue;
+			}
+		}
+
+	if ( !found )
+		{
+		ERR_PRINTF1(_L("No SMS Account found"));
+		SetTestStepResult(EFail);
+		}
+
+	TName	network;
+//IMK	TBool	returnValue=(GetPhoneSmsNetworkL(network)==KErrNone);
+TBool	returnValue=false; //IMK
+	TPtrC	ptrSCName(network);
+
+	if ( !returnValue )
+		{
+		returnValue=GetStringFromConfig(ConfigSection(), KSCName, ptrSCName);
+		}
+	if ( !returnValue )
+		{
+		ERR_PRINTF1(_L("No SC specified in script/ini file"));
+		SetTestStepResult(EFail);
+		}
+
+	INFO_PRINTF2(_L("SC Name = %S"), &ptrSCName);
+
+	if ( TestStepResult()==EPass )
+		{
+		CSmsAccount*	smsAccount = CSmsAccount::NewLC();
+		smsAccount->LoadSettingsL(*smsSettings);
+		const TInt	numSCAddr = smsSettings->ServiceCenterCount();
+
+		if( !numSCAddr )
+			{
+			ERR_PRINTF1(_L("No SC found"));
+			SetTestStepResult(EFail);
+			}
+
+		TBool	scFound	= EFalse;
+		for( TInt index=0; (index<numSCAddr) && (!scFound);index++ )
+			{
+			CSmsServiceCenter&	scAddr = smsSettings->GetServiceCenter(index);
+			if( (scAddr.Name()).CompareF(ptrSCName) == 0)
+				{
+				smsSettings->SetDefaultServiceCenter(index);
+				smsAccount->SaveSettingsL(*smsSettings);
+				scFound = ETrue;
+				}
+			}
+
+		if ( !scFound )
+			{
+			ERR_PRINTF2(_L("%S NOT Found"), &ptrSCName);
+			SetTestStepResult(EFail);
+			}
+
+		CleanupStack::PopAndDestroy(smsAccount);
+		}
+	CleanupStack::PopAndDestroy(2, smsSettings);
+
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessSharedData.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,276 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessSharedData
+// 
+//
+
+#include "TestMessSharedData.h"
+
+#include <mtclbase.h>
+#include <msvids.h>
+#include <e32std.h>
+#include <imapcmds.h>
+
+_LIT(KName,			"name");
+
+CTestMessSharedData* CTestMessSharedData::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CTestMessSharedData*	sharedData = new (ELeave) CTestMessSharedData();
+	CleanupStack::PushL(sharedData);
+	sharedData->ConstructL();
+	CleanupStack::Pop(sharedData);
+	return sharedData;
+	}
+
+CTestMessSharedData::CTestMessSharedData()
+:	CBase()
+,	iSession(NULL)
+,	iMtmRegistry(NULL)
+,	iList(NULL)
+,	iAnyPostStepToDo(NULL)
+,	iDeleteTestStep(EFalse)
+	{
+	}
+
+void CTestMessSharedData::ConstructL()
+	{
+	iSession=CMsvSession::OpenSyncL(*this);
+	iMtmRegistry=CClientMtmRegistry::NewL(*iSession);
+	}
+
+CTestMessSharedData::~CTestMessSharedData()
+	{
+	while ( iList != NULL )
+		{
+		CMsgEntry*	entry=iList;
+		iList=iList->iNext;
+		delete entry;
+		}
+	delete iMtmRegistry;
+	iMtmRegistry=NULL;
+	delete iSession;
+	iSession=NULL;
+	}
+
+void CTestMessSharedData::DoProcessL()
+	{
+	if ( iAnyPostStepToDo != NULL )
+		{
+		if (iDeleteTestStep)
+			{
+			iAnyPostStepToDo->DoCancelProcessL();
+			iDeleteTestStep=EFalse;
+			}
+		else
+			{
+			iAnyPostStepToDo->DoProcessL(*iMtmRegistry);
+			}
+		iAnyPostStepToDo=NULL;
+		}
+	}
+
+void CTestMessSharedData::IMAP4ConnectAndSyncCompleteAfterDisconnectL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep)
+	{
+	iList=CMsgIMAP4ConnectAndSyncComplete::NewL(aMtmId, aMsvId, aStep, iList);
+	iAnyPostStepToDo=iList;
+	}
+
+TInt CTestMessSharedData::DeleteEntryL(CTestStep& aStep)
+	{
+	TInt	ret=KErrNone;
+	TPtrC	name;
+
+	if ( !aStep.GetStringFromConfig(aStep.ConfigSection(), KName, name) )
+		{
+		aStep.ERR_PRINTF1(_L("Name not found"));
+		aStep.SetTestStepResult(EFail);
+		ret=KErrArgument;
+		}
+	else
+		{
+		aStep.INFO_PRINTF2(_L("Name : %S"), &name);
+
+		CMsgEntry*	msgParent=NULL;
+		CMsgEntry*	msgEntry=iList;
+		TBool		found=EFalse;
+
+		while ( (msgEntry!=NULL) && !found )
+			{
+			if ( msgEntry->iName.Compare(name) == 0 )
+				{
+				if ( msgParent!=NULL )
+					{
+					msgParent->iNext=msgEntry->iNext;
+					}
+				else
+					{
+					iList=msgEntry->iNext;
+					}
+				iDeleteTestStep=ETrue;
+				iAnyPostStepToDo=msgEntry;
+				found=ETrue;
+				}
+			else
+				{
+				msgParent=msgEntry;
+				msgEntry=msgEntry->iNext;
+				}
+			}
+
+		if ( !found )
+			{
+			aStep.ERR_PRINTF1(_L("Message Entry not found"));
+			aStep.SetTestStepResult(EFail);
+			ret=KErrNotFound;
+			}
+		}
+
+	return ret;
+	}
+
+CTestMessSharedData::CMsgEntry::CMsgEntry(CMsgEntry* aList)
+:	CActive(EPriorityStandard)
+,	iNext(aList)
+,	iReadyToBeDeleted(EFalse)
+	{
+	}
+
+void CTestMessSharedData::CMsgEntry::ConstructL(CTestStep& aStep)
+	{
+	TPtrC	name;
+
+	//	Read in name tag
+	if ( !aStep.GetStringFromConfig(aStep.ConfigSection(), KName, name) )
+		{
+		aStep.ERR_PRINTF1(_L("Name not found"));
+		aStep.SetTestStepResult(EFail);
+		}
+	else
+		{
+		aStep.INFO_PRINTF2(_L("Name : %S"), &name);
+		iName.Copy(name);
+		}
+	}
+
+CTestMessSharedData::CMsgEntry::~CMsgEntry()
+	{
+	}
+
+void CTestMessSharedData::CMsgEntry::DoCancel()
+	{
+	}
+
+void CTestMessSharedData::CMsgEntry::RunL()
+	{
+	iReadyToBeDeleted=ETrue;
+	}
+
+CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete* CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::NewL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep, CMsgEntry* aList)
+	{
+	CMsgIMAP4ConnectAndSyncComplete*	self= new (ELeave) CMsgIMAP4ConnectAndSyncComplete(aMtmId, aMsvId, aList);
+	CleanupStack::PushL(self);
+	self->ConstructL(aStep);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::CMsgIMAP4ConnectAndSyncComplete(TUid aMtmId, TMsvId aMsvId, CMsgEntry* aList)
+:	CMsgEntry(aList)
+,	iMtmId(aMtmId)
+,	iMsvId(aMsvId)
+,	iBaseMtm(NULL)
+,	iOperation(NULL)
+	{
+	}
+
+CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::~CMsgIMAP4ConnectAndSyncComplete()
+	{
+	if ( iOperation != NULL )
+		{
+		delete iOperation;
+		iOperation=NULL;
+		}
+	delete iBaseMtm;
+	iBaseMtm=NULL;
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::RunL()
+	{
+	CMsgEntry::RunL();
+	delete iOperation;
+	iOperation=NULL;
+	delete iBaseMtm;
+	iBaseMtm=NULL;
+
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::DoProcessL(CClientMtmRegistry& aMtmRegistry)
+	{
+	iBaseMtm=aMtmRegistry.NewMtmL(iMtmId);
+	CActiveScheduler::Add(this);
+
+	iBaseMtm->SwitchCurrentEntryL(iMsvId);
+	CMsvEntrySelection*	selection=new (ELeave) CMsvEntrySelection();
+	CleanupStack::PushL(selection);
+	selection->Reset();
+	selection->AppendL(iMsvId);
+	selection->AppendL(iMsvId);	// remote inbox
+
+	TPckg<MMsvImapConnectionObserver*>	parameter(this);
+	iOperation=iBaseMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterDisconnect, *selection, parameter, iStatus);
+	CleanupStack::PopAndDestroy(selection);
+	SetActive();
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::DoCancelProcessL()
+	{
+	if ( iOperation != NULL )
+		{
+		iOperation->Cancel();
+		}
+	}
+
+void CTestMessSharedData::CMsgIMAP4ConnectAndSyncComplete::HandleImapConnectionEvent(TImapConnectionEvent aConnectionEvent)
+	{
+	switch (aConnectionEvent)
+		{
+	/** Connecting to server. */
+	case EConnectingToServer:
+		break;
+	/** Synchronising folder list. */
+	case ESynchronisingFolderList:
+		break;
+	/** Synchronising inbox. */
+	case ESynchronisingInbox:
+		break;
+	/** Synchronising folders. */
+	case ESynchronisingFolders:
+		break;
+	/** Synchronisation complete. */
+	case ESynchronisationComplete:
+		break;
+	/** Disconnecting. */
+	case EDisconnecting:
+		break;
+	/** Connection completed. */
+	case EConnectionCompleted:
+		break;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessStoreProcessUtil.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,258 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessStoreProcessUtil. Base class process what is in the message store
+// 
+//
+
+
+
+/**
+ @file TestMessStoreProcessUtil.cpp
+*/
+
+#include "TestMessStoreProcessUtil.h"
+
+//	EPOC include
+#include <txtrich.h>
+
+/**
+ * @name Constant Literals used.
+ */
+/*@{*/
+/// Literal constants used for the character set
+_LIT(KChineseGB2312,		"ChineseGB2312");
+_LIT(KChineseHz,			"ChineseHz");
+_LIT(KChineseBig5,			"ChineseBig5");
+/*@}*/
+
+CTestMessStoreProcessUtil::CTestMessStoreProcessUtil(CTestMessBase& aTestStep, TBool aReadOnly)
+:	CBase()
+,	iTestStep(aTestStep)
+,	iReadOnly(aReadOnly)
+	{
+	}
+
+/**
+ * Process the message entry
+ * @param  TMsvId aMsvId - Id of message to edit
+ * @return TInt - return TErrNone if all worked
+ *  
+*/
+TInt CTestMessStoreProcessUtil::ProcessEntryL(TMsvId aMsvId)
+	{
+	TInt		ret=KErrNone;
+	CMsvEntry*	msvEntry=iTestStep.Session().GetEntryL(aMsvId);
+	CleanupStack::PushL(msvEntry);
+
+	if ( msvEntry->HasStoreL() )
+		{
+		CMsvStore*	store=NULL;
+		if ( iReadOnly )
+			{
+			store=msvEntry->ReadStoreL();
+			}
+		else
+			{
+			store=msvEntry->EditStoreL();
+			}
+		CleanupStack::PushL(store);
+
+		RArray<TUid>	ids;
+		ids.Append(KUidMsgFileIMailHeader);
+		ids.Append(KUidMsgFileMimeHeader);
+		ids.Append(KUidMsgFileInternetAccessPreferences);
+		ids.Append(KUidMsvSMSHeaderStream);
+		ids.Append(KUidMsvDefaultServices);
+		ids.Append(KMsvEntryRichTextBody);
+		for ( TUint uidIndex=ids.Count(); uidIndex>0; )
+			{
+			TUid	uid=ids[--uidIndex];
+
+			if ( store->IsPresentL(uid) )
+				{
+				if ( uid==KUidMsgFileIMailHeader )
+					{
+					// Process the CImHeader info
+					ProcessImHeaderL(*store);
+					}
+				else if ( uid==KUidMsgFileMimeHeader )
+					{
+					// Process the CImMimeHeader info
+					ProcessImMimeHeaderL(*store);
+					}
+				else if ( uid==KUidMsgFileInternetAccessPreferences )
+					{
+					}
+				else if ( uid==KUidMsvSMSHeaderStream )
+					{
+					// Process the CSmsHeader info
+					ProcessSmsHeaderStreamL(*store);
+					}
+				else if ( uid==KUidMsvDefaultServices )
+					{
+					}
+				else if ( uid==KMsvEntryRichTextBody )
+					{
+					// Process the CRichText info
+					ProcessRichTextBodyL(*store);
+					}
+				else
+					{
+					iTestStep.INFO_PRINTF2(_L("Cannot process %x"), uid.iUid);
+					}
+				}
+			}
+
+		// Commit to the store
+		if ( !iReadOnly )
+			{
+			store->CommitL();
+			}
+		CleanupStack::PopAndDestroy(store);
+		}
+
+	CleanupStack::PopAndDestroy(msvEntry);
+
+	return ret;
+	}
+
+// Process the CImHeader information
+void CTestMessStoreProcessUtil::ProcessImHeaderL(CMsvStore& aStore)
+	{
+	CImHeader*	header=CImHeader::NewLC();
+	TRAPD(err, header->RestoreL(aStore));
+
+	if ( err==KErrNone )
+		{
+		ProcessImHeaderL(*header);
+		if ( !iReadOnly )
+			{
+			header->StoreL(aStore);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(header);
+	}
+
+// Process the CImMimeHeader information
+void CTestMessStoreProcessUtil::ProcessImMimeHeaderL(CMsvStore& aStore)
+	{
+	CImMimeHeader*	header=CImMimeHeader::NewLC();
+	TRAPD(err, header->RestoreL(aStore));
+
+	if ( err==KErrNone )
+		{
+		ProcessImMimeHeaderL(*header);
+		if ( !iReadOnly )
+			{
+			header->StoreL(aStore);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(header);
+	}
+
+
+// Process the CSmsHeader information
+void CTestMessStoreProcessUtil::ProcessSmsHeaderStreamL(CMsvStore& aStore)
+	{
+	CParaFormatLayer*	paraFormatLayer=CParaFormatLayer::NewL();
+	CleanupStack::PushL(paraFormatLayer);
+
+	CCharFormatLayer*	charFormatLayer=CCharFormatLayer::NewL(); 
+	CleanupStack::PushL(charFormatLayer);
+
+	CRichText*			bodyText=CRichText::NewL(paraFormatLayer, charFormatLayer);
+	CleanupStack::PushL(bodyText);
+
+	CSmsHeader*			header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *bodyText);
+	CleanupStack::PushL(header);
+
+	TRAPD(err, header->RestoreL(aStore));
+	if ( err == KErrNone )
+		{
+		ProcessSmsHeaderStreamL(*header);
+		if ( !iReadOnly )
+			{
+			header->StoreL(aStore);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(4, paraFormatLayer);
+	}
+
+
+// Process the CRichText information
+void CTestMessStoreProcessUtil::ProcessRichTextBodyL(CMsvStore& aStore)
+	{
+	CParaFormatLayer*	paraFormatLayer=CParaFormatLayer::NewL();
+	CleanupStack::PushL(paraFormatLayer);
+
+	CCharFormatLayer*	charFormatLayer=CCharFormatLayer::NewL(); 
+	CleanupStack::PushL(charFormatLayer);
+
+	CRichText*			bodyText=CRichText::NewL(paraFormatLayer, charFormatLayer);
+	CleanupStack::PushL(bodyText);
+
+	TRAPD(err, aStore.RestoreBodyTextL(*bodyText));
+	if ( err == KErrNone )
+		{
+		ProcessRichTextBodyL(*bodyText);
+		if ( !iReadOnly )
+			{
+			aStore.StoreBodyTextL(*bodyText);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(3, paraFormatLayer);
+	}
+
+/**
+ * Saves the new character set to the message 
+ * @param  TPtrC aCharacterSetType - New Character set type to be stored for the received message
+ * @param  TUint &aCharSetVal - character set value
+ * @return TBool 
+ * @panic None
+ * @leave None
+ *
+*/
+TBool CTestMessStoreProcessUtil::ValidCharacterSetInfo(const TPtrC& aCharacterSetType, TUint &aCharSetVal)
+	{
+	TBool	hasSet = ETrue;
+
+	if ( aCharacterSetType.Compare(KChineseGB2312) == 0 )
+		{
+		iTestStep.INFO_PRINTF1(_L("Character set set to Chinese GB2312"));
+		aCharSetVal =  KCharacterSetIdentifierGb2312;
+		}
+	else if (aCharacterSetType.Compare(KChineseHz) == 0)
+		{
+		iTestStep.INFO_PRINTF1(_L("Character set set to Chinese Hz"));
+		aCharSetVal = KCharacterSetIdentifierHz;
+		}
+	else if ( aCharacterSetType.Compare(KChineseBig5) == 0 )
+		{
+		iTestStep.INFO_PRINTF1(_L("Character set set to Chinese Big5"));
+		aCharSetVal = KCharacterSetIdentifierBig5;
+		}
+	else
+		{
+		// To be updated later
+		hasSet= EFalse;
+		iTestStep.ERR_PRINTF2(_L("Character not supported in test code: %S"), &aCharacterSetType);
+		iTestStep.SetTestStepResult(EFail);
+		}
+
+	return hasSet;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessTimer.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,63 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// TestMessTimer.h
+// This contains CTestMessTimer
+// EPOC includes
+// 
+//
+
+#include "TestMessTimer.h"
+#include "TestMessProcessor.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CTestMessTimer* CTestMessTimer::NewL(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor)
+	{
+	CTestMessTimer*	self=new(ELeave) CTestMessTimer(aInterval, aProcessor);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CTestMessTimer::CTestMessTimer(TTimeIntervalMicroSeconds32 aInterval, CTestMessProcessor& aProcessor)
+: CTimer(EPriorityStandard)
+, iInterval(aInterval)
+, iProcessor(aProcessor)
+	{
+	}
+
+void CTestMessTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+	CActiveScheduler::Add(this);
+	}
+
+
+CTestMessTimer::~CTestMessTimer()
+	{
+	}
+
+void CTestMessTimer::RunL()
+	{
+	iProcessor.DisplayProgress();
+	IssueRequest();
+	};
+
+void CTestMessTimer::IssueRequest()
+	{
+	After(iInterval);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/Src/TestMessWatcher.cpp	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,73 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This contains CTestMessWatcher which starts the message watchers
+// 
+//
+
+#include "TestMessWatcher.h"
+
+_LIT(KWatcherExe, "z:\\system\\libs\\watcher.exe");
+
+CTestMessWatcher* CTestMessWatcher::NewL(TInt aPriority)
+	{
+	CTestMessWatcher* self = new (ELeave) CTestMessWatcher(aPriority);
+	CleanupStack::PushL(self);
+
+	self->ConstructL();
+
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CTestMessWatcher::~CTestMessWatcher()
+	{
+	Cancel();
+	iTimer.Close();
+	if (iConstructed)
+		iWatcher.Kill(KErrNone);
+
+	iWatcher.Close();
+	}
+
+CTestMessWatcher::CTestMessWatcher(TInt aPriority)
+:	CActive(aPriority)
+,	iConstructed(EFalse)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CTestMessWatcher::ConstructL()
+	{
+	TInt	ret=iWatcher.Create(KWatcherExe, KNullDesC);
+	switch ( ret )
+		{
+	case KErrNone:
+		iWatcher.Resume();
+		iConstructed = ETrue;
+	case KErrAlreadyExists:
+		break;
+	default:
+		User::Leave(ret);
+		}
+	}
+
+void CTestMessWatcher::RunL()
+	{
+	}
+
+void CTestMessWatcher::DoCancel()
+	{
+	iTimer.Cancel();
+	iStatus=KErrCancel;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/TestData/Smoketest_Mess.ini	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,751 @@
+[default]
+smsto=07769588944
+smsbearer=NBS
+smsencoding=7
+smsDeliveryReport=NO
+mmsto=07769588944
+mmsDeliveryReport=NO
+progress=120
+
+[19101_RootFolder]
+depth=0
+
+[27030_SmsO2Account]
+scname=O2
+scnumber=+447802000332
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[27031_SmsOrangeAccount]
+scname=Orange
+scnumber=+447973100973
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[27032_SmsTMobileAccount]
+scname=TMobile
+scnumber=+447958879879
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[27029_SmsVodafoneAccount]
+scname=Vodafone
+scnumber=+447785016005
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[21770_SmsAirtelAccount]
+MessageBearerType=CDMA
+scname=Airtel
+scnumber=919845087001
+SmsRejectDuplicate=TRUE
+SmsReplyPath=TRUE
+SmsConCatenate=TRUE
+SmsDeliveryReport=TRUE
+SmsReplyQuoted=TRUE
+
+[SmsHutchAccount]
+scname=Hutch
+scnumber=919886005444
+SmsReplyQuoted=TRUE
+SmsRejectDuplicate=TRUE
+SmsReplyPath=FALSE
+SmsConCatenate=TRUE
+SmsDeliveryReport=FALSE
+
+[28206_MmsAccount]
+accountname=Multimedia Messaging
+serveraddr=http://10.22.64.20
+fromaddr=07769588944
+automaticfetch=TRUE
+iap=14
+
+[27028_ImapAccount]
+accountname=smoketest Imap Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.dial.pipex.com
+inserver=imap.dial.pipex.com
+SyncRate=120
+iap=6
+
+[27027_PopAccount]
+accountname=smoketest Pop Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.dial.pipex.com
+inserver=pop.dial.pipex.com
+iap=6
+
+[21558_ImapAccountAuth]
+accountname=smoketest ImapAuth Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[27035_PopAccountAuth]
+accountname=smoketest PopAuth Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[28381_ImapAccountSSL]
+accountname=smoketest ImapSSL Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+sslwrapper=yes
+sslport=993
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[28382_PopAccountSSL]
+accountname=smoketest PopSSL Account
+myname=Symbian smoketest
+username=mailtst1
+password=mailtest1
+auth=TRUE
+sslwrapper=yes
+sslport=995
+authUserName=mailtst1
+authPassword=mailtest1
+emailaddress=mailtst1@trmai01.it.cellulardata.com
+outserver=trmai01.it.cellulardata.com
+inserver=cyrus.cellulardata.com
+iap=7
+
+[27027_VodafoneGprsAccount]
+accountname=Vodafone Gprs Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.vizzavi.co.uk
+inserver=pop.dial.pipex.com
+iap=13
+
+[o2GprsAccount]
+accountname=O2 Gprs Account
+myname=Symbian smoketest
+username=mdgi15
+password=vethihiz
+emailaddress=mdgi15@dial.pipex.com
+outserver=smtp.o2.co.uk
+inserver=pop.dial.pipex.com
+iap=17
+
+[MmsCount01]
+count=7
+depth=2
+folder1=Local
+folder2=Inbox
+
+[MmsMessage01]
+from=Multimedia Messaging
+subject=mms test1
+priority=high
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message1.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+[MmsMessage02]
+from=Multimedia Messaging
+subject=mms test2
+priority=high
+   
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message2.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype1=image/gif
+imgfile1=c:\smoketest\Mms\Image2.gif
+imgmimeheaders1=1
+imgmimeheader1name1=content-type
+imgmimeheader1type1=image/gif
+
+[MmsMessage03]
+from=Multimedia Messaging
+subject=mms test3
+priority=high
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message3.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype1=image/gif
+imgfile1=c:\smoketest\Mms\Image3.gif
+imgmimeheaders1=1
+imgmimeheader1name1=content-type
+imgmimeheader1type1=image/gif
+
+audiomimetype1=audio/basic
+audiofile1=c:\smoketest\Mms\Audio3.wav
+audiomimeheaders1=1
+audiomimeheader1name1=content-type
+audiomimeheader1type1=audio/basic
+
+[MmsMessage04]
+from=Multimedia Messaging
+subject=mms test4
+priority=high
+slides=2
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message4.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype2=image/gif
+imgfile2=c:\smoketest\Mms\Image4.gif
+imgmimeheaders2=1
+imgmimeheader2name1=content-type
+imgmimeheader2type1=image/gif
+
+[MmsMessage05]
+from=Multimedia Messaging
+subject=mms test5
+priority=high
+slides=2
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message5.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+imgmimetype2=image/gif
+imgfile2=c:\smoketest\Mms\Image5.gif
+imgmimeheaders2=1
+imgmimeheader2name1=content-type
+imgmimeheader2type1=image/gif
+
+audiomimetype2=audio/basic
+audiofile2=c:\smoketest\Mms\Audio5.wav
+audiomimeheaders2=1
+audiomimeheader2name1=content-type
+audiomimeheader2type1=audio/basic
+
+[MmsMessage06]
+from=Multimedia Messaging
+subject=mms test6
+priority=high
+slides=3
+
+textmimetype1=text/plain
+textfile1=c:\smoketest\Mms\Message6.txt
+textmimeheaders1=1
+textmimeheader1name1=content-type
+textmimeheader1type1=text/plain
+
+audiomimetype2=audio/basic
+audiofile2=c:\smoketest\Mms\Audio6.wav
+audiomimeheaders2=1
+audiomimeheader2name1=content-type
+audiomimeheader2type1=audio/basic
+
+imgmimetype3=image/gif
+imgfile3=c:\smoketest\Mms\Image6.gif
+imgmimeheaders3=1
+imgmimeheader3name1=content-type
+imgmimeheader3type1=image/gif
+
+[27584_SmsMessage01]
+recipients=2
+body=c:\smoketest\Sms\Message1.txt
+
+[27596_SmsMessage02]
+body=c:\smoketest\Sms\Message2.txt
+
+[27587_SmsMessage03]
+body=c:\smoketest\Sms\Message3.txt
+encoding=8
+
+[27589_SmsMessage04]
+body=c:\smoketest\Sms\Message4.txt
+DeliveryReport=NO
+
+[27591_SmsMessage05]
+body=c:\smoketest\Sms\Message5.txt
+
+[27593_SmsMessage06]
+body=c:\smoketest\Sms\Message6.txt
+encoding=8
+scheduled=120
+
+[27577_SmsSend01]
+text=This message is going
+
+[20388_SmsSend02]
+text=Hello, this is a plain
+
+[20389_SmsSend03]
+text=Hello, this is a 8-bit
+
+[20390_SmsSend04]
+text=No status report requested
+
+[20392_SmsSend05]
+text=A big message to ya!
+
+[20391_SmsSend06]
+text=This is a big 8-bit
+
+[27595_SmsCount01]
+count=7
+depth=2
+folder1=Local
+folder2=Inbox
+
+[27033_PopMessage01]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage01
+body=c:\smoketest\EMail\PopTestMsg01.txt
+priority=high
+count=1
+depth=2
+folder1=smoketest Pop Account
+folder2=PopMessage01
+
+[27044_PopMessage02]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage02
+body=c:\smoketest\EMail\PopTestMsg02.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=2
+depth=3
+folder1=smoketest Pop Account
+folder2=PopMessage02
+
+[27040_PopMessage03]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage03
+body=c:\smoketest\EMail\PopTestMsg03.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=4
+depth=3
+folder1=smoketest Pop Account
+folder2=PopMessage03
+
+[19103_PopMessage04]
+from=smoketest Pop Account
+to=mdgi15@dial.pipex.com
+subject=PopMessage04
+body=c:\smoketest\EMail\PopTestMsg04.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=3
+depth=3
+folder1=smoketest Pop Account
+folder2=PopMessage04
+
+[27041_PopBox01]
+from=smoketest Pop Account
+
+[28111_PopSend01]
+subject=PopMessage01
+
+[28112_PopSend02]
+subject=PopMessage02
+
+[28114_PopSend03]
+subject=PopMessage03
+
+[28113_PopSend04]
+subject=PopMessage04
+
+[19102_PopCount01]
+count=4
+depth=1
+folder1=smoketest Pop Account
+
+[19102_PopCount01_MadcowSanity]
+count=3
+depth=1
+folder1=smoketest Pop Account
+
+[28360_ImapMessage01]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage01
+body=c:\smoketest\EMail\PopTestMsg01.txt
+priority=high
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage01
+
+[28361_ImapMessage02]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage02
+body=c:\smoketest\EMail\PopTestMsg02.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage02
+
+[28362_ImapMessage03]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage03
+body=c:\smoketest\EMail\PopTestMsg03.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage03
+
+[28363_ImapMessage04]
+from=smoketest Imap Account
+to=mdgi15@dial.pipex.com
+subject=ImapMessage04
+body=c:\smoketest\EMail\PopTestMsg04.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=0
+depth=3
+folder1=smoketest Imap Account
+folder2=Inbox
+folder3=ImapMessage04
+
+[19104_ImapBox01]
+name=imapsync
+from=smoketest Imap Account
+depth=1
+folder1=Inbox
+
+[28118_ImapSend01]
+subject=ImapMessage01
+
+[28117_ImapSend02]
+subject=ImapMessage02
+
+[28115_ImapSend03]
+subject=ImapMessage03
+
+[28116_ImapSend04]
+subject=ImapMessage04
+
+[28359_ImapCount01]
+count=4
+depth=2
+folder1=smoketest Imap Account
+folder2=Inbox
+
+[28359_ImapCount01MadcowSanity]
+count=3
+depth=2
+folder1=smoketest Imap Account
+folder2=Inbox
+
+[27048_PopMessage06]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage06
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=1
+depth=2
+folder1=smoketest PopAuth Account
+folder2=PopMessage06
+
+[28364_PopMessage07]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage07
+body=c:\smoketest\EMail\PopTestMsg07.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=2
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage07
+
+[28365_PopMessage08]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage08
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=4
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage08
+
+[28366_PopMessage09]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage09
+body=c:\smoketest\EMail\PopTestMsg09.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=3
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage09
+
+[28394_PopMessage10]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage10
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=1
+depth=2
+folder1=smoketest PopAuth Account
+folder2=PopMessage10
+
+[28395_PopMessage11]
+from=smoketest PopAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=PopMessage11
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=4
+depth=3
+folder1=smoketest PopAuth Account
+folder2=PopMessage11
+
+[27043_PopBox02]
+from=smoketest PopAuth Account
+
+[21560_PopSend06]
+subject=PopMessage06
+
+[27042_PopSend07]
+subject=PopMessage07
+
+[27039_PopSend08]
+subject=PopMessage08
+
+[28367_PopSend09]
+subject=PopMessage09
+
+[28396_PopSend10]
+subject=PopMessage10
+
+[28397_PopSend11]
+subject=PopMessage11
+
+[28368_PopCount02]
+count=4
+depth=1
+folder1=smoketest PopAuth Account
+
+[28373_ImapMessage06]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage06
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage06
+
+[28374_ImapMessage07]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage07
+body=c:\smoketest\EMail\PopTestMsg07.txt
+priority=low
+attachments=1
+attachment1=c:\smoketest\EMail\Attachment01.txt
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage07
+
+[28375_ImapMessage08]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage08
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage08
+
+[28376_ImapMessage09]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage09
+body=c:\smoketest\EMail\PopTestMsg09.txt
+priority=low
+attachments=2
+attachment1=c:\smoketest\EMail\Attachment01.txt
+attachment2=c:\smoketest\EMail\Typhoon.zip
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage09
+
+[28387_ImapMessage10]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage10
+body=c:\smoketest\EMail\PopTestMsg06.txt
+priority=high
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage10
+
+[28388_ImapMessage11]
+from=smoketest ImapAuth Account
+to=mailtst1@trmai01.it.cellulardata.com
+subject=ImapMessage11
+body=c:\smoketest\EMail\PopTestMsg08.txt
+priority=low
+attachments=3
+attachment1=c:\smoketest\EMail\Attachment02.txt
+attachment2=c:\smoketest\EMail\Attachment02.txt
+attachment3=c:\smoketest\EMail\Attachment02.txt
+count=0
+depth=3
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+folder3=ImapMessage11
+
+[27037_ImapBox02]
+from=smoketest ImapAuth Account
+depth=1
+folder1=Inbox
+
+[27036_ImapSend06]
+subject=ImapMessage06
+
+[28377_ImapSend07]
+subject=ImapMessage07
+
+[28378_ImapSend08]
+subject=ImapMessage08
+
+[28379_ImapSend09]
+subject=ImapMessage09
+
+[28389_ImapSend10]
+subject=ImapMessage10
+
+[28390_ImapSend11]
+subject=ImapMessage11
+
+[28380_ImapCount02]
+count=4
+depth=2
+folder1=smoketest ImapAuth Account
+folder2=Inbox
+
+[28398_PopBox03]
+from=smoketest PopSSL Account
+
+[28399_PopCount03]
+count=2
+depth=1
+folder1=smoketest PopSSL Account
+
+[28391_ImapBox03]
+from=smoketest ImapSSL Account
+depth=1
+folder1=Inbox
+
+[28392_ImapCount03]
+count=2
+depth=2
+folder1=smoketest ImapSSL Account
+folder2=Inbox
+
+[28383_HangUpPipex]
+iap=6
+
+[28384_HangUpNokia]
+iap=7
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/TestData/Sms/Message1.txt	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,1 @@
+This message is going to my two buddies
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/messaging/bwins/SMOKETEST_MESS_SERVERU.DEF	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/smoketest_commdb.xml	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,2023 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Symbian Foundation License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+ CommDB Settings File
+ All Rights Reserved
+
+-->
+
+
+
+
+
+<CommDB:Config xmlns="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:CommDB="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:xlink="http://www.w3.org/1999/xlink"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="SymbianOS.Generic.Comms-Infras.CommDB CommDB.xsd">
+
+<InformationTable>
+</InformationTable>
+
+<NetworkTable>
+    <Network operation="add">
+        <Name>Intranet</Name>
+    </Network>
+    <Network operation="add">
+        <Name>mRouter</Name>
+    </Network>
+</NetworkTable>
+
+<IAPTable>
+ 	 	<IAP operation="add">
+ 		<Name>Ethernet WinTAP</Name>
+ 		<IAPService>LANService.Ethernet WinTAP</IAPService>
+ 		<IAPBearer>LANBearer.Ethernet WinTAP</IAPBearer>
+ 		<IAPNetwork>Network.Intranet</IAPNetwork>
+ 		<IAPNetworkWeighting>0</IAPNetworkWeighting>
+ 		<LocationRef>Location.Office</LocationRef>
+ 	</IAP>
+    <IAP operation="add">
+        <Name>NT RAS with Null Modem</Name>
+        <IAPService>DialOutISP.NT RAS</IAPService>
+        <IAPBearer>ModemBearer.Null Modem 115200bps</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office</LocationRef>
+    </IAP>
+    <IAP operation="add">
+        <Name>Ethernet with DHCP</Name>
+        <IAPService>LANService.Ethernet Dynamic IP</IAPService>
+        <IAPBearer>LANBearer.EKA1 Emulator Ethernet</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office</LocationRef>
+    </IAP>
+</IAPTable>
+
+<ModemBearerTable>
+    <ModemBearer operation="template">
+        <Name>Default Modem</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>0</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>Null Modem 115200bps</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>TRUE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>US Robotics Sportster</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>244</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>AFTERDIALUNTILANSWER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT&amp;F1</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT&amp;d2</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>Dacom Surfer</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>244</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>AFTERDIALUNTILANSWER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT&amp;F</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT&amp;d2</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Infrared</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Serial</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>19200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Ericsson R520m via IR</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Ericsson R520m/T68i via Serial</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>19200</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <IspInitString>*99***1#</IspInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GPRS Motorola Mobile Phone via Serial</Name>
+        <Agent>PSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>57600</Rate>
+        <Handshaking>4</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>WinTunnel Modem</Name>
+        <Agent>null.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::6</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>180</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>30</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>60</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterWinsBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>WINS::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>WINSCSY</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterRs232Bearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterIrBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>IRCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>IRCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterBtBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>BTCOMM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>BTCOMM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>mRouterUsbBearer</Name>
+        <Agent>mRouterAgent.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>ACM::0</PortName>
+        <TSYName>MM</TSYName>
+        <CSYName>ECACM</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>52</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>9999</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+        <SIRSettings>0</SIRSettings>
+        <CommRole>0</CommRole>
+    </ModemBearer>
+</ModemBearerTable>
+
+<LANBearerTable>
+	<LANBearer operation="add">
+		<Name>Ethernet WinTAP</Name>
+		<Agent>nullagt.agt</Agent>
+		<IfName>ethint</IfName>
+		<LDDFilename>enet</LDDFilename>
+		<LDDName>=Ethernet</LDDName>
+		<PDDFilename>ethertap</PDDFilename>
+		<PDDName>Ethertap.Wins</PDDName>
+		<PacketDriverName>EtherPkt.drv</PacketDriverName>
+		<LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+		<LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+		<LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 Target Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>EtherCard</LDDName>
+        <PDDFilename>EtherSmc</PDDFilename>
+        <PDDName>EtherCard.Smc</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 Emulator Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>Ethercard</LDDName>
+        <PDDFilename>etherwins</PDDFilename>
+        <PDDName>Ethercard.wins</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+    <LANBearer operation="add">
+        <Name>EKA1 WINTAP Ethernet</Name>
+        <Agent>nullagt.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDFilename>ethercard</LDDFilename>
+        <LDDName>Ethercard</LDDName>
+        <PDDFilename>ethertap</PDDFilename>
+        <PDDName>Ethertap.wins</PDDName>
+        <PacketDriverName>EtherPkt.drv</PacketDriverName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+</LANBearerTable>
+
+<LANServiceTable>
+	<LANService operation="add">
+        <Name>Ethernet WinTAP</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>192.168.0.1</IpGateway>
+        <IpAddrFromServer>FALSE</IpAddrFromServer>
+        <IpAddr>192.168.0.3</IpAddr>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <IpNameServer1>10.16.59.15</IpNameServer1>
+        <IpNameServer2>10.23.58.12</IpNameServer2>
+        <Ip6DNSAddrFromServer>FALSE</Ip6DNSAddrFromServer>
+    </LANService>
+    <LANService operation="add">
+        <Name>Ethernet Dynamic IP</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>10.32.194.254</IpGateway>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>10.32.194.251</IpAddr>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>194.72.6.51</IpNameServer1>
+        <IpNameServer2>194.72.6.52</IpNameServer2>
+        <ConfigDaemonManagerName>ConfigDaemonManager</ConfigDaemonManagerName>
+        <ConfigDaemonName>DhcpServ</ConfigDaemonName>
+    </LANService>
+    <LANService operation="add">
+        <Name>Ethernet Static 1</Name>
+        <IfNetworks>ip</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>192.168.0.1</IpGateway>
+        <IpAddrFromServer>FALSE</IpAddrFromServer>
+        <IpAddr>192.168.0.2</IpAddr>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <IpNameServer1>10.16.59.15</IpNameServer1>
+        <IpNameServer2>10.23.58.12</IpNameServer2>
+        <Ip6DNSAddrFromServer>FALSE</Ip6DNSAddrFromServer>
+    </LANService>
+</LANServiceTable>
+
+<DialInISPTable>
+    <DialInISP operation="template">
+        <Name>Default Dial In ISP</Name>
+        <Description>Default Dial In ISP</Description>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+    <DialInISP operation="add">
+        <Name>Dial In ISP01</Name>
+        <Description>Dial In ISP01</Description>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+</DialInISPTable>
+
+<DialOutISPTable>
+    <DialOutISP operation="template">
+        <Name>Default Dial Out ISP</Name>
+        <Description>Default Dial Out ISP</Description>
+        <DefaultTelNum>Default Dial Out ISP</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>TRUE</PromptForLogin>
+        <LoginName>1</LoginName>
+        <LoginPass>1</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>0</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>1</IfAuthName>
+        <IfAuthPass>1</IfAuthPass>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>NT RAS</Name>
+        <Description>Test</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>TRUE</UseLoginScript>
+        <LoginScript>CHARMAP \[windows-1252\]\nLOOP 10\n{\nSEND &quot;CLIENT&quot;+&lt;0x0d&gt;\nWAIT 3\n{\n&quot;SERVER&quot; OK\n}\n}\nEXIT KErrNoAnswer$\n\nOK:\nEXIT\n</LoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP01</Name>
+        <Description>PlaceHolder for ISP01</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP02</Name>
+        <Description>PlaceHolder for ISP02</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP03</Name>
+        <Description>PlaceHolder for ISP03</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP04</Name>
+        <Description>PlaceHolder for ISP04</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>ISP05</Name>
+        <Description>PlaceHolder for ISP05</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IfAuthName>xxx</IfAuthName>
+        <IfAuthPass>yyy</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>mRouterDialOutIsp</Name>
+        <Description>mRouterDialOutIsp</Description>
+        <Type>INTERNETONLY</Type>
+        <DefaultTelNum>INTERNETONLY</DefaultTelNum>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <LoginName>0</LoginName>
+        <LoginPass>0</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfParams>0</IfParams>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>IfAuthPass=</IfAuthName>
+        <IfAuthPass>AuthRetries=0</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpAddr>1</IpAddr>
+        <IpNetMask>1</IpNetMask>
+        <IpGateway>1</IpGateway>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>1</IpNameServer1>
+        <IpNameServer2>1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>UNSPECIFIED</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+</DialOutISPTable>
+
+<AgentLookupTable>
+</AgentLookupTable>
+
+<CDMA2000PacketServiceTable>
+</CDMA2000PacketServiceTable>
+
+<DefaultCDMA2000Table>
+</DefaultCDMA2000Table>
+
+<ChargecardTable>
+    <Chargecard operation="add">
+        <Name>Dummy BT Chargecard</Name>
+        <AccountNumber>144,12345678</AccountNumber>
+        <Pin>0000</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>HFG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+    <Chargecard operation="add">
+        <Name>Dummy Mercury Chargecard</Name>
+        <AccountNumber>0500800800,,12345678</AccountNumber>
+        <Pin>****</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>J,K,0FG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+</ChargecardTable>
+
+<ConnectionPreferencesTable>
+    <ConnectionPreferences operation="add">
+        <Name>ConnectionPreferencesTable1</Name>
+        <Ranking>1</Ranking>
+        <Direction>OUTGOING</Direction>
+        <BearerSet>LAN</BearerSet>
+        <DialogPref>DONOTPROMPT</DialogPref>
+        <IAPRef>IAP.Ethernet WinTAP</IAPRef>
+    </ConnectionPreferences>
+</ConnectionPreferencesTable>
+
+<GlobalSettingsTable>
+    <GlobalSettings operation="add">
+        <Name>GlobalSettingsTable1</Name>
+        <WAPAccess>WAPAccessPoint.Default Dial In ISP</WAPAccess>
+        <RedialAttempts>3</RedialAttempts>
+        <SmsBearer>1</SmsBearer>
+        <SmsReceiveMode>2</SmsReceiveMode>
+        <GPRSAttachMode>1</GPRSAttachMode>
+        <AcceptIncomingGprs>1</AcceptIncomingGprs>
+        <GPRSClassCBearer>GSM</GPRSClassCBearer>
+        <ConnectionAttempts>2</ConnectionAttempts>
+        <ModemForDataAndFax>2</ModemForDataAndFax>
+        <ModemForPhoneServicesAndSMS>2</ModemForPhoneServicesAndSMS>
+        <LocationForDataAndFax>Location.Office</LocationForDataAndFax>
+        <LocationForPhoneServicesAndSMS>Location.Office</LocationForPhoneServicesAndSMS>
+        <DefaultNetwork>Network.Intranet</DefaultNetwork>
+        <BearerAvailabilityCheckTSY>mm</BearerAvailabilityCheckTSY>
+    </GlobalSettings>
+</GlobalSettingsTable>
+
+<IncomingGPRSTable>
+    <IncomingGPRS operation="add">
+        <Name>Incoming GPRS Settings PlaceHolder</Name>
+        <APN>Test</APN>
+        <PDPType>IPV4</PDPType>
+        <PDPAddress>0.0.0.0</PDPAddress>
+        <ReqPrecedence>1</ReqPrecedence>
+        <ReqDelay>1</ReqDelay>
+        <ReqReliability>1</ReqReliability>
+        <ReqPeakThroughput>1</ReqPeakThroughput>
+        <ReqMeanThroughput>1</ReqMeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <IpNameServer1>0.0.0.0</IpNameServer1>
+        <IpNameServer2>0.0.0.0</IpNameServer2>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+    </IncomingGPRS>
+</IncomingGPRSTable>
+
+<OutgoingGPRSTable>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS01</Name>
+        <APN>gprs01APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS02</Name>
+        <APN>gprs02APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS03</Name>
+        <APN>gprs03APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+</OutgoingGPRSTable>
+
+<DefaultGPRSTable>
+    <DefaultGPRS operation="add">
+        <Name>Dummy Default GPRS Settings</Name>
+        <Usage>1</Usage>
+        <APN>Access point name</APN>
+        <PDPType>IPV6</PDPType>
+        <PDPAddress>www.wid.com</PDPAddress>
+        <Precedence>1</Precedence>
+        <Delay>1</Delay>
+        <Reliability>1</Reliability>
+        <PeakThroughput>1</PeakThroughput>
+        <MeanThroughput>1</MeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>TRUE</DataCompression>
+        <HeaderCompression>TRUE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>TRUE</AnonymousAccess>
+    </DefaultGPRS>
+</DefaultGPRSTable>
+
+<ProxyTable>
+    <Proxy operation="add">
+        <Name>ProxyTable1</Name>
+        <ISPRef>DialOutISP.NT RAS</ISPRef>
+        <UseProxyServer>TRUE</UseProxyServer>
+        <ProxyServerName>www.dummyproxy.com</ProxyServerName>
+        <ProtocolName>http</ProtocolName>
+        <PortNumber>80</PortNumber>
+        <Exceptions>www.dummyproxy.com/exception</Exceptions>
+    </Proxy>
+</ProxyTable>
+
+<LocationTable>
+    <Location operation="template">
+        <Name>Default Location</Name>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>44</AreaCode>
+        <DialOutCode>44</DialOutCode>
+        <DisableCallWaitingCode>44</DisableCallWaitingCode>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Office</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>9,</DialOutCode>
+        <DisableCallWaitingCode>9,</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Office Direct Dial</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>171</DialOutCode>
+        <DisableCallWaitingCode>171</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Mobile</Name>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>44</AreaCode>
+        <DialOutCode>44</DialOutCode>
+        <DisableCallWaitingCode>44</DisableCallWaitingCode>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+    <Location operation="add">
+        <Name>Home</Name>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>181</AreaCode>
+        <DialOutCode>181</DialOutCode>
+        <DisableCallWaitingCode>181</DisableCallWaitingCode>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>TRUE</UsePulseDial>
+        <WaitForDialTone>TRUE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+    </Location>
+</LocationTable>
+
+<SecureSocketTable>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable1</Name>
+        <ProtocolName>ssl3.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable2</Name>
+        <ProtocolName>tls1.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+</SecureSocketTable>
+
+<BTDeviceTable>
+</BTDeviceTable>
+
+<BTPersistTable>
+</BTPersistTable>
+
+<BTSecurityTable>
+</BTSecurityTable>
+
+<BTDefaultTable>
+</BTDefaultTable>
+
+<WAPAccessPointTable>
+    <WAPAccessPoint operation="template">
+        <Name>Default Dial In ISP</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+    </WAPAccessPoint>
+    <WAPAccessPoint operation="add">
+        <Name>Dummy WAP Settings</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+        <StartPage>www.wapstart.com</StartPage>
+    </WAPAccessPoint>
+</WAPAccessPointTable>
+
+<WAPIPBearerTable>
+    <WAPIPBearer operation="template">
+        <Name>WAPIPBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <GatewayAddress>0</GatewayAddress>
+        <IAPRef>IAP.-1</IAPRef>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+        <ProxyPortNumber>0</ProxyPortNumber>
+        <ProxyLogin>0</ProxyLogin>
+        <ProxyPassword>0</ProxyPassword>
+    </WAPIPBearer>
+    <WAPIPBearer operation="add">
+        <Name>WAPIPBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>www.wapgateway.com</GatewayAddress>
+        <IAPRef>IAP.Ethernet WinTAP</IAPRef>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+        <ProxyPortNumber>1</ProxyPortNumber>
+        <ProxyLogin>1</ProxyLogin>
+        <ProxyPassword>1</ProxyPassword>
+    </WAPIPBearer>
+</WAPIPBearerTable>
+
+<WAPSMSBearerTable>
+    <WAPSMSBearer operation="template">
+        <Name>WAPSMSBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <GatewayAddress>0</GatewayAddress>
+        <ServiceCentreAddress>0</ServiceCentreAddress>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+    <WAPSMSBearer operation="add">
+        <Name>WAPSMSBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>+4412345678901</GatewayAddress>
+        <ServiceCentreAddress>+442071234567</ServiceCentreAddress>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+</WAPSMSBearerTable>
+
+<VirtualBearerTable>
+</VirtualBearerTable>
+
+<VpnServiceTable>
+</VpnServiceTable>
+
+<WLANServiceExtensionTable>
+</WLANServiceExtensionTable>
+
+<PANServiceExtensionsTable>
+</PANServiceExtensionsTable>
+
+<EAPSecuritySettingsTable>
+</EAPSecuritySettingsTable>
+
+<TunnelledEAPSettingsTable>
+</TunnelledEAPSettingsTable>
+
+<EAPTLSSettingsTable>
+</EAPTLSSettingsTable>
+
+<LEAPSettingsTable>
+</LEAPSettingsTable>
+
+
+</CommDB:Config>
--- a/common/tools/difflist.pl	Wed May 20 14:26:55 2009 +0100
+++ b/common/tools/difflist.pl	Fri May 29 17:20:47 2009 +0100
@@ -1,4 +1,18 @@
 #! perl -w
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Compares two files
+
 use strict;
 
 my $element;
@@ -7,9 +21,9 @@
 my @difference = ();
 my %count = ();
 
-my $file1 = shift or die "Usage: $0 file1 file2\n";
-my $file2 = shift or die "Usage: $0 file1 file2\n";
-
+my $file1 = shift or die "Usage: $0 file1 file2 | optional -I[ntersection]\n";
+my $file2 = shift or die "Usage: $0 file1 file2 | optional -I[ntersection]\n";
+my $mode  = shift;
 open FILE1, "<$file1" or die "ERROR: Can't read $file1";
 open FILE2, "<$file2" or die "ERROR: Can't read $file2";
 
@@ -26,10 +40,20 @@
     push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element;
 }
 
-if (@difference > 0) {
-    foreach (@difference){
-        print $_;
-    }
+if (!defined $mode) {
+	if (@difference > 0) {
+		foreach (@difference){
+			print $_;
+		}
+	} else {
+		print "* Files are identical\n";
+	}
+} elsif ($mode eq "-I") {
+	if (@intersection > 0) {
+		foreach (@intersection){
+			print $_;
+		}
+	}
 } else {
-    print "* Files are identical\n";
+	print "Usage: $0 file1 file2 | optional -I[ntersection]\n";
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/Text/CSV.pm	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,488 @@
+package Text::CSV;
+
+# Copyright (c) 1997 Alan Citterman. All rights reserved.
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+
+################################################################################
+# HISTORY
+#
+# Written by:
+#    Alan Citterman <alan@mfgrtl.com>
+#
+# Version 0.01  06/05/1997
+#    original version
+################################################################################
+
+require 5.002;
+
+use strict;
+
+BEGIN {
+  use Exporter   ();
+  use AutoLoader qw(AUTOLOAD);
+  use vars       qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+  $VERSION =     '0.01';
+  @ISA =         qw(Exporter AutoLoader);
+  @EXPORT =      qw();
+  @EXPORT_OK =   qw();
+  %EXPORT_TAGS = qw();
+}
+
+1;
+
+__END__
+
+################################################################################
+# version
+#
+#    class/object method expecting no arguments and returning the version number
+#    of Text::CSV.  there are no side-effects.
+################################################################################
+sub version {
+  return $VERSION;
+}
+
+################################################################################
+# new
+#
+#    class/object method expecting no arguments and returning a reference to a
+#    newly created Text::CSV object.
+################################################################################
+sub new {
+  my $proto = shift;
+  my $class = ref($proto) || $proto;
+  my $self = {};
+  $self->{'_STATUS'} = undef;
+  $self->{'_ERROR_INPUT'} = undef;
+  $self->{'_STRING'} = undef;
+  $self->{'_FIELDS'} = undef;
+  bless $self, $class;
+  return $self;
+}
+
+################################################################################
+# status
+#
+#    object method returning the success or failure of the most recent combine()
+#    or parse().  there are no side-effects.
+################################################################################
+sub status {
+  my $self = shift;
+  return $self->{'_STATUS'};
+}
+
+################################################################################
+# error_input
+#
+#    object method returning the first invalid argument to the most recent
+#    combine() or parse().  there are no side-effects.
+################################################################################
+sub error_input {
+  my $self = shift;
+  return $self->{'_ERROR_INPUT'};
+}
+
+################################################################################
+# string
+#
+#    object method returning the result of the most recent combine() or the
+#    input to the most recent parse(), whichever is more recent.  there are no
+#    side-effects.
+################################################################################
+sub string {
+  my $self = shift;
+  return $self->{'_STRING'};
+}
+
+################################################################################
+# fields
+#
+#    object method returning the result of the most recent parse() or the input
+#    to the most recent combine(), whichever is more recent.  there are no
+#    side-effects.
+################################################################################
+sub fields {
+  my $self = shift;
+  if (ref($self->{'_FIELDS'})) {
+    return @{$self->{'_FIELDS'}};
+  }
+  return undef;
+}
+
+################################################################################
+# combine
+#
+#    object method returning success or failure.  the given arguments are
+#    combined into a single comma-separated value.  failure can be the result of
+#    no arguments or an argument containing an invalid character.   side-effects
+#    include:
+#      setting status()
+#      setting fields()
+#      setting string()
+#      setting error_input()
+################################################################################
+sub combine {
+  my $self = shift;
+  my @part = @_;
+  $self->{'_FIELDS'} = \@part;
+  $self->{'_ERROR_INPUT'} = undef;
+  $self->{'_STATUS'} = 0;
+  $self->{'_STRING'} = '';
+  my $column = '';
+  my $combination = '';
+  my $skip_comma = 1;
+  if ($#part >= 0) {
+
+    # at least one argument was given for "combining"...
+    for $column (@part) {
+      if ($column =~ /[^\t\040-\176]/) {
+
+	# an argument contained an invalid character...
+	$self->{'_ERROR_INPUT'} = $column;
+	return $self->{'_STATUS'};
+      }
+      if ($skip_comma) {
+
+	# do not put a comma before the first argument...
+	$skip_comma = 0;
+      } else {
+
+	# do put a comma before all arguments except the first argument...
+	$combination .= ',';
+      }
+      $column =~ s/\042/\042\042/go;
+      $combination .= "\042";
+      $combination .= $column;
+      $combination .= "\042";
+    }
+    $self->{'_STRING'} = $combination;
+    $self->{'_STATUS'} = 1;
+  }
+  return $self->{'_STATUS'};
+}
+
+################################################################################
+# parse
+#
+#    object method returning success or failure.  the given argument is expected
+#    to be a valid comma-separated value.  failure can be the result of
+#    no arguments or an argument containing an invalid sequence of characters.
+#    side-effects include:
+#      setting status()
+#      setting fields()
+#      setting string()
+#      setting error_input()
+################################################################################
+sub parse {
+  my $self = shift;
+  $self->{'_STRING'} = shift;
+  $self->{'_FIELDS'} = undef;
+  $self->{'_ERROR_INPUT'} = $self->{'_STRING'};
+  $self->{'_STATUS'} = 0;
+  if (!defined($self->{'_STRING'})) {
+    return $self->{'_STATUS'};
+  }
+  my $keep_biting = 1;
+  my $palatable = 0;
+  my $line = $self->{'_STRING'};
+  if ($line =~ /\n$/) {
+    chop($line);
+    if ($line =~ /\r$/) {
+      chop($line);
+    }
+  }
+  my $mouthful = '';
+  my @part = ();
+  while ($keep_biting and ($palatable = $self->_bite(\$line, \$mouthful, \$keep_biting))) {
+    push(@part, $mouthful);
+  }
+  if ($palatable) {
+    $self->{'_ERROR_INPUT'} = undef;
+    $self->{'_FIELDS'} = \@part;
+  }
+  return $self->{'_STATUS'} = $palatable;
+}
+
+################################################################################
+# _bite
+#
+#    *private* class/object method returning success or failure.  the arguments
+#    are:
+#      - a reference to a comma-separated value string
+#      - a reference to a return string
+#      - a reference to a return boolean
+#    upon success the first comma-separated value of the csv string is
+#    transferred to the return string and the boolean is set to true if a comma
+#    followed that value.  in other words, "bite" one value off of csv
+#    returning the remaining string, the "piece" bitten, and if there's any
+#    more.  failure can be the result of the csv string containing an invalid
+#    sequence of characters.
+#   
+#    from the csv string and 
+#    to be a valid comma-separated value.  failure can be the result of
+#    no arguments or an argument containing an invalid sequence of characters.
+#    side-effects include:
+#      setting status()
+#      setting fields()
+#      setting string()
+#      setting error_input()
+################################################################################
+sub _bite {
+  my ($self, $line_ref, $piece_ref, $bite_again_ref) = @_;
+  my $in_quotes = 0;
+  my $ok = 0;
+  $$piece_ref = '';
+  $$bite_again_ref = 0;
+  while (1) {
+    if (length($$line_ref) < 1) {
+
+      # end of string...
+      if ($in_quotes) {
+
+	# end of string, missing closing double-quote...
+	last;
+      } else {
+
+	# proper end of string...
+	$ok = 1;
+	last;
+      }
+    } elsif ($$line_ref =~ /^\042/) {
+
+      # double-quote...
+      if ($in_quotes) {
+	if (length($$line_ref) == 1) {
+
+	  # closing double-quote at end of string...
+	  substr($$line_ref, 0, 1) = '';
+	  $ok = 1;
+	  last;
+	} elsif ($$line_ref =~ /^\042\042/) {
+
+	  # an embedded double-quote...
+	  $$piece_ref .= "\042";
+	  substr($$line_ref, 0, 2) = '';
+	} elsif ($$line_ref =~ /^\042,/) {
+
+	  # closing double-quote followed by a comma...
+	  substr($$line_ref, 0, 2) = '';
+	  $$bite_again_ref = 1;
+	  $ok = 1;
+	  last;
+	} else {
+
+	  # double-quote, followed by undesirable character (bad character sequence)...
+	  last;
+	}
+      } else {
+	if (length($$piece_ref) < 1) {
+
+	  # starting double-quote at beginning of string
+	  $in_quotes = 1;
+	  substr($$line_ref, 0, 1) = '';
+	} else {
+
+	  # double-quote, outside of double-quotes (bad character sequence)...
+	  last;
+	}
+      }
+    } elsif ($$line_ref =~ /^,/) {
+
+      # comma...
+      if ($in_quotes) {
+
+	# a comma, inside double-quotes...
+	$$piece_ref .= substr($$line_ref, 0 ,1);
+	substr($$line_ref, 0, 1) = '';
+      } else {
+
+	# a comma, which separates values...
+	substr($$line_ref, 0, 1) = '';
+	$$bite_again_ref = 1;
+	$ok = 1;
+	last;
+      }
+    } elsif ($$line_ref =~ /^[\t\040-\176]/) {
+
+      # a tab, space, or printable...
+      $$piece_ref .= substr($$line_ref, 0 ,1);
+      substr($$line_ref, 0, 1) = '';
+    } else {
+
+      # an undesirable character...
+      last;
+    }
+  }
+  return $ok;
+}
+
+=head1 NAME
+
+Text::CSV - comma-separated values manipulation routines
+
+=head1 SYNOPSIS
+
+ use Text::CSV;
+
+ $version = Text::CSV->version();      # get the module version
+
+ $csv = Text::CSV->new();              # create a new object
+
+ $status = $csv->combine(@columns);    # combine columns into a string
+ $line = $csv->string();               # get the combined string
+
+ $status = $csv->parse($line);         # parse a CSV string into fields
+ @columns = $csv->fields();            # get the parsed fields
+
+ $status = $csv->status();             # get the most recent status
+ $bad_argument = $csv->error_input();  # get the most recent bad argument
+
+=head1 DESCRIPTION
+
+Text::CSV provides facilities for the composition and decomposition of
+comma-separated values.  An instance of the Text::CSV class can combine
+fields into a CSV string and parse a CSV string into fields.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item version
+
+ $version = Text::CSV->version();
+
+This function may be called as a class or an object method.  It returns the current
+module version.
+
+=item new
+
+ $csv = Text::CSV->new();
+
+This function may be called as a class or an object method.  It returns a reference to a
+newly created Text::CSV object.
+
+=item combine
+
+ $status = $csv->combine(@columns);
+
+This object function constructs a CSV string from the arguments, returning
+success or failure.  Failure can result from lack of arguments or an argument
+containing an invalid character.  Upon success, C<string()> can be called to
+retrieve the resultant CSV string.  Upon failure, the value returned by
+C<string()> is undefined and C<error_input()> can be called to retrieve an
+invalid argument.
+
+=item string
+
+ $line = $csv->string();
+
+This object function returns the input to C<parse()> or the resultant CSV string of
+C<combine()>, whichever was called more recently.
+
+=item parse
+
+ $status = $csv->parse($line);
+
+This object function decomposes a CSV string into fields, returning
+success or failure.  Failure can result from a lack of argument or the given CSV
+string is improperly formatted.  Upon success, C<fields()> can be called to
+retrieve the decomposed fields .  Upon failure, the value returned by
+C<fields()> is undefined and C<error_input()> can be called to retrieve the
+invalid argument.
+
+=item fields
+
+ @columns = $csv->fields();
+
+This object function returns the input to C<combine()> or the resultant decomposed
+fields of C<parse()>, whichever was called more recently.
+
+=item status
+
+ $status = $csv->status();
+
+This object function returns success (or failure) of C<combine()> or C<parse()>,
+whichever was called more recently.
+
+=item error_input
+
+ $bad_argument = $csv->error_input();
+
+This object function returns the erroneous argument (if it exists) of C<combine()>
+or C<parse()>, whichever was called more recently.
+
+=back
+
+=head1 EXAMPLE
+
+  require Text::CSV;
+
+  my $csv = Text::CSV->new;
+
+  my $column = '';
+  my $sample_input_string = '"I said, ""Hi!""",Yes,"",2.34,,"1.09"';
+  if ($csv->parse($sample_input_string)) {
+    my @field = $csv->fields;
+    my $count = 0;
+    for $column (@field) {
+      print ++$count, " => ", $column, "\n";
+    }
+    print "\n";
+  } else {
+    my $err = $csv->error_input;
+    print "parse() failed on argument: ", $err, "\n";
+  }
+
+  my @sample_input_fields = ('You said, "Hello!"',
+			     5.67,
+			     'Surely',
+			     '',
+			     '3.14159');
+  if ($csv->combine(@sample_input_fields)) {
+    my $string = $csv->string;
+    print $string, "\n";
+  } else {
+    my $err = $csv->error_input;
+    print "combine() failed on argument: ", $err, "\n";
+  }
+
+=head1 CAVEATS
+
+This module is based upon a working definition of CSV format which may not be
+the most general.
+
+=over 4
+
+=item 1 
+
+Allowable characters within a CSV field include 0x09 (tab) and the inclusive
+range of 0x20 (space) through 0x7E (tilde).
+
+=item 2
+
+A field within CSV may be surrounded by double-quotes.
+
+=item 3
+
+A field within CSV must be surrounded by double-quotes to contain a comma.
+
+=item 4
+
+A field within CSV must be surrounded by double-quotes to contain an embedded
+double-quote, represented by a pair of consecutive double-quotes.
+
+=item 5
+
+A CSV string may be terminated by 0x0A (line feed) or by 0x0D,0x0A
+(carriage return, line feed).
+
+=head1 AUTHOR
+
+Alan Citterman F<E<lt>alan@mfgrtl.comE<gt>>
+
+=head1 SEE ALSO
+
+perl(1)
+
+=cut
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/.packlist	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,12 @@
+C:\Apps\Perl\html\site\lib\Text\CSV.html
+C:\Apps\Perl\site\lib\Text\CSV.pm
+C:\Apps\Perl\site\lib\auto\Text\CSV\_bite.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\autosplit.ix
+C:\Apps\Perl\site\lib\auto\Text\CSV\combine.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\error_input.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\fields.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\new.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\parse.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\status.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\string.al
+C:\Apps\Perl\site\lib\auto\Text\CSV\version.al
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/_bite.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,121 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 231 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/_bite.al)"
+################################################################################
+# _bite
+#
+#    *private* class/object method returning success or failure.  the arguments
+#    are:
+#      - a reference to a comma-separated value string
+#      - a reference to a return string
+#      - a reference to a return boolean
+#    upon success the first comma-separated value of the csv string is
+#    transferred to the return string and the boolean is set to true if a comma
+#    followed that value.  in other words, "bite" one value off of csv
+#    returning the remaining string, the "piece" bitten, and if there's any
+#    more.  failure can be the result of the csv string containing an invalid
+#    sequence of characters.
+#   
+#    from the csv string and 
+#    to be a valid comma-separated value.  failure can be the result of
+#    no arguments or an argument containing an invalid sequence of characters.
+#    side-effects include:
+#      setting status()
+#      setting fields()
+#      setting string()
+#      setting error_input()
+################################################################################
+sub _bite {
+  my ($self, $line_ref, $piece_ref, $bite_again_ref) = @_;
+  my $in_quotes = 0;
+  my $ok = 0;
+  $$piece_ref = '';
+  $$bite_again_ref = 0;
+  while (1) {
+    if (length($$line_ref) < 1) {
+
+      # end of string...
+      if ($in_quotes) {
+
+	# end of string, missing closing double-quote...
+	last;
+      } else {
+
+	# proper end of string...
+	$ok = 1;
+	last;
+      }
+    } elsif ($$line_ref =~ /^\042/) {
+
+      # double-quote...
+      if ($in_quotes) {
+	if (length($$line_ref) == 1) {
+
+	  # closing double-quote at end of string...
+	  substr($$line_ref, 0, 1) = '';
+	  $ok = 1;
+	  last;
+	} elsif ($$line_ref =~ /^\042\042/) {
+
+	  # an embedded double-quote...
+	  $$piece_ref .= "\042";
+	  substr($$line_ref, 0, 2) = '';
+	} elsif ($$line_ref =~ /^\042,/) {
+
+	  # closing double-quote followed by a comma...
+	  substr($$line_ref, 0, 2) = '';
+	  $$bite_again_ref = 1;
+	  $ok = 1;
+	  last;
+	} else {
+
+	  # double-quote, followed by undesirable character (bad character sequence)...
+	  last;
+	}
+      } else {
+	if (length($$piece_ref) < 1) {
+
+	  # starting double-quote at beginning of string
+	  $in_quotes = 1;
+	  substr($$line_ref, 0, 1) = '';
+	} else {
+
+	  # double-quote, outside of double-quotes (bad character sequence)...
+	  last;
+	}
+      }
+    } elsif ($$line_ref =~ /^,/) {
+
+      # comma...
+      if ($in_quotes) {
+
+	# a comma, inside double-quotes...
+	$$piece_ref .= substr($$line_ref, 0 ,1);
+	substr($$line_ref, 0, 1) = '';
+      } else {
+
+	# a comma, which separates values...
+	substr($$line_ref, 0, 1) = '';
+	$$bite_again_ref = 1;
+	$ok = 1;
+	last;
+      }
+    } elsif ($$line_ref =~ /^[\t\040-\176]/) {
+
+      # a tab, space, or printable...
+      $$piece_ref .= substr($$line_ref, 0 ,1);
+      substr($$line_ref, 0, 1) = '';
+    } else {
+
+      # an undesirable character...
+      last;
+    }
+  }
+  return $ok;
+}
+
+1;
+# end of Text::CSV::_bite
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/autosplit.ix	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,13 @@
+# Index created by AutoSplit for blib\lib\Text\CSV.pm
+#    (file acts as timestamp)
+package Text::CSV;
+sub version  ;
+sub new  ;
+sub status  ;
+sub error_input  ;
+sub string  ;
+sub fields  ;
+sub combine  ;
+sub parse  ;
+sub _bite  ;
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/combine.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,60 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 125 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/combine.al)"
+################################################################################
+# combine
+#
+#    object method returning success or failure.  the given arguments are
+#    combined into a single comma-separated value.  failure can be the result of
+#    no arguments or an argument containing an invalid character.   side-effects
+#    include:
+#      setting status()
+#      setting fields()
+#      setting string()
+#      setting error_input()
+################################################################################
+sub combine {
+  my $self = shift;
+  my @part = @_;
+  $self->{'_FIELDS'} = \@part;
+  $self->{'_ERROR_INPUT'} = undef;
+  $self->{'_STATUS'} = 0;
+  $self->{'_STRING'} = '';
+  my $column = '';
+  my $combination = '';
+  my $skip_comma = 1;
+  if ($#part >= 0) {
+
+    # at least one argument was given for "combining"...
+    for $column (@part) {
+      if ($column =~ /[^\t\040-\176]/) {
+
+	# an argument contained an invalid character...
+	$self->{'_ERROR_INPUT'} = $column;
+	return $self->{'_STATUS'};
+      }
+      if ($skip_comma) {
+
+	# do not put a comma before the first argument...
+	$skip_comma = 0;
+      } else {
+
+	# do put a comma before all arguments except the first argument...
+	$combination .= ',';
+      }
+      $column =~ s/\042/\042\042/go;
+      $combination .= "\042";
+      $combination .= $column;
+      $combination .= "\042";
+    }
+    $self->{'_STRING'} = $combination;
+    $self->{'_STATUS'} = 1;
+  }
+  return $self->{'_STATUS'};
+}
+
+# end of Text::CSV::combine
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/error_input.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,19 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 81 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/error_input.al)"
+################################################################################
+# error_input
+#
+#    object method returning the first invalid argument to the most recent
+#    combine() or parse().  there are no side-effects.
+################################################################################
+sub error_input {
+  my $self = shift;
+  return $self->{'_ERROR_INPUT'};
+}
+
+# end of Text::CSV::error_input
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/fields.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,23 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 105 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/fields.al)"
+################################################################################
+# fields
+#
+#    object method returning the result of the most recent parse() or the input
+#    to the most recent combine(), whichever is more recent.  there are no
+#    side-effects.
+################################################################################
+sub fields {
+  my $self = shift;
+  if (ref($self->{'_FIELDS'})) {
+    return @{$self->{'_FIELDS'}};
+  }
+  return undef;
+}
+
+# end of Text::CSV::fields
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/new.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,26 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 52 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/new.al)"
+################################################################################
+# new
+#
+#    class/object method expecting no arguments and returning a reference to a
+#    newly created Text::CSV object.
+################################################################################
+sub new {
+  my $proto = shift;
+  my $class = ref($proto) || $proto;
+  my $self = {};
+  $self->{'_STATUS'} = undef;
+  $self->{'_ERROR_INPUT'} = undef;
+  $self->{'_STRING'} = undef;
+  $self->{'_FIELDS'} = undef;
+  bless $self, $class;
+  return $self;
+}
+
+# end of Text::CSV::new
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/parse.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,50 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 177 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/parse.al)"
+################################################################################
+# parse
+#
+#    object method returning success or failure.  the given argument is expected
+#    to be a valid comma-separated value.  failure can be the result of
+#    no arguments or an argument containing an invalid sequence of characters.
+#    side-effects include:
+#      setting status()
+#      setting fields()
+#      setting string()
+#      setting error_input()
+################################################################################
+sub parse {
+  my $self = shift;
+  $self->{'_STRING'} = shift;
+  $self->{'_FIELDS'} = undef;
+  $self->{'_ERROR_INPUT'} = $self->{'_STRING'};
+  $self->{'_STATUS'} = 0;
+  if (!defined($self->{'_STRING'})) {
+    return $self->{'_STATUS'};
+  }
+  my $keep_biting = 1;
+  my $palatable = 0;
+  my $line = $self->{'_STRING'};
+  if ($line =~ /\n$/) {
+    chop($line);
+    if ($line =~ /\r$/) {
+      chop($line);
+    }
+  }
+  my $mouthful = '';
+  my @part = ();
+  while ($keep_biting and ($palatable = $self->_bite(\$line, \$mouthful, \$keep_biting))) {
+    push(@part, $mouthful);
+  }
+  if ($palatable) {
+    $self->{'_ERROR_INPUT'} = undef;
+    $self->{'_FIELDS'} = \@part;
+  }
+  return $self->{'_STATUS'} = $palatable;
+}
+
+# end of Text::CSV::parse
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/status.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,19 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 70 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/status.al)"
+################################################################################
+# status
+#
+#    object method returning the success or failure of the most recent combine()
+#    or parse().  there are no side-effects.
+################################################################################
+sub status {
+  my $self = shift;
+  return $self->{'_STATUS'};
+}
+
+# end of Text::CSV::status
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/string.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,20 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 93 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/string.al)"
+################################################################################
+# string
+#
+#    object method returning the result of the most recent combine() or the
+#    input to the most recent parse(), whichever is more recent.  there are no
+#    side-effects.
+################################################################################
+sub string {
+  my $self = shift;
+  return $self->{'_STRING'};
+}
+
+# end of Text::CSV::string
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/lib/auto/Text/CSV/version.al	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,18 @@
+# NOTE: Derived from blib\lib\Text\CSV.pm.
+# Changes made here will be lost when autosplit again.
+# See AutoSplit.pm.
+package Text::CSV;
+
+#line 42 "blib\lib\Text\CSV.pm (autosplit into blib\lib\auto/Text\CSV/version.al)"
+################################################################################
+# version
+#
+#    class/object method expecting no arguments and returning the version number
+#    of Text::CSV.  there are no side-effects.
+################################################################################
+sub version {
+  return $VERSION;
+}
+
+# end of Text::CSV::version
+1;
--- a/common/tools/listdir.pl	Wed May 20 14:26:55 2009 +0100
+++ b/common/tools/listdir.pl	Fri May 29 17:20:47 2009 +0100
@@ -1,14 +1,31 @@
 #!perl -w
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Recursive listing of a directory, outputting lower-cased relative paths with unix dir separators
+
 use strict;
 
 my $dir      = shift or die "Usage: $0 <dir> \n";   #  provided dir to traverse
 my $filelist = [];
+my $init = $dir = lc($dir);
+$init =~ s{\\}{\\\\};
 
 # fwd declaration to prevent warning
 sub recursedir($$);
 
 # run recurse and print
 recursedir ($dir, $filelist);
+
 print $_, "\n" for(@$filelist);
 
 sub recursedir($$) {
@@ -19,15 +36,14 @@
   if(opendir(DIR, "$dir")) {
     #  list dir
     for my $file(grep { !/^\./ } readdir DIR) {
-      if(-d "$dir\\$file") {
+      if(-d "$dir/$file") {
         #  traverse subdirs
-        recursedir("$dir\\$file", $list);
+        recursedir("$dir/$file", $list);
       }
-      elsif(-f "$dir\\$file") {
-        #  if file then swap (any present) fwd to bkslash and add to list        
-        $dir   =~s/\//\\/;
-        $file  =~s/\//\\/;
-        push @$list, "$dir\\$file";
+      elsif(-f "$dir/$file") {
+        my $formatted = lc($dir)."/".lc($file);
+        $formatted =~ s!$init/!!;
+        push @$list, $formatted;
       }
     }
     closedir DIR;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/mergeepoc32.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,26 @@
+#!perl -w
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Merges binaries from RnD repositories into the epoc32 tree used for the build
+
+use strict;
+
+# Assume that all rnd repositories are delivered onto the build machine in \rnd\category\name\epoc32\...
+
+my @rndRepositories = glob "/rnd/*/*";
+foreach (@rndRepositories)
+{
+	s{/}{\\}g;
+	system("xcopy /Q/C/I/Y/E $_\\epoc32 \\epoc32 > nul:");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/populateziptemplate.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,146 @@
+#!perl -w
+# Copyright (c) 2009 Symbian Foundation Ltd
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation Ltd - initial contribution.
+# 
+# Contributors:
+#
+# Description:
+# Populates the template for packaging src and binaries in the build
+
+use strict;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+use Text::CSV;
+require XML::Simple;
+
+# Raw inputs come in as parameters to the script
+# TODO: Use a proper option parsing module
+my $sourcesCSV = shift or die "First arg must be source csv file";
+my $template = shift or die "Second arg must be template file";
+my $ftl = shift or die "Third arg must be output file";
+shift and die "No more than three arguments please";
+
+# Load CSV
+open my $csvText, "<", $sourcesCSV or die;
+my $csv = Text::CSV->new();
+my @keys;
+my @packages;
+while (my $line = <$csvText>)
+{
+	chomp $line;
+	next unless $line;
+	unless ($csv->parse($line))
+	{
+		my $err = $csv->error_input();
+		die "Failed to parse line '$line': $err";
+	}
+
+	if (! @keys)
+	{
+		# First line - note the column names
+		@keys =  $csv->fields();
+	}
+	else
+	{
+		# Already got the keys, so get the data
+		my %package;
+		# Read into a hash slice
+		@package{@keys} = $csv->fields();
+		push @packages, \%package;
+	}
+}
+close $csvText;
+
+# This controls how the XML parsing decides what should be tags and what should be attributes
+# It's been worked out mostly by trial and error :-(
+my $keyAttr = { config => "name", name => "set"};
+# Load template
+my $xml = XML::Simple->new();
+my $zipConfig = $xml->XMLin($template, KeyAttr => $keyAttr);
+my @allRndFiles;
+
+# For each package in CSV...
+foreach my $package (@packages)
+{
+	warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst};
+	$package->{dst} =~ s{^/}{}g;
+	if ($package->{source} =~ m{/(sfl|oss)/(MCL|FCL)/sf/([^/]+)/([^/]+)})
+	{	    
+		push @{$zipConfig->{config}->{config}->{src}->{config}->{$1}->{config}},
+		{
+			set =>
+			[
+				{
+					name => "name",
+					value=> "src_$1_$3_$4",
+				},
+				{
+					name => "include",
+					value => "$package->{dst}/**",
+				},
+			]
+		};
+	}
+	elsif ($package->{source} =~ m{/rnd/([^/]+)/([^/]+)})
+	{
+		# RnD repository
+		my $name = "bin_rnd_$1_$2";
+		# Create a zip object
+		push @{$zipConfig->{config}->{config}->{src}->{config}->{rnd}->{config}},
+		{
+			set =>
+			[
+				{
+					name => "root.dir",
+					value=> "\${build.drive}/$package->{dst}",
+				},
+				{
+					name => "name",
+					value=> "$name",
+				},
+				{
+					name => "include",
+					value=> "/**",
+				},
+			]
+		};
+		# Enumerate all the files on the local disk that are in this repository
+		(my $dosCompatibleDst = $package->{dst}) =~ s{/}{\\}g;
+		my @files = `dir /b/s/a-d $dosCompatibleDst 2> nul:`;
+		#print "@files\n";
+		next unless @files;
+		# Add the files to this zip object
+		@files = grep {
+			s{\\}{/}g;
+			s!^[A-Z]:/$package->{dst}/!!i;
+			m{^epoc32/}i;
+		} @files;
+		push @allRndFiles, @files;
+		
+		open FILE, ">", $name ."_includefile.txt" or die "Cannot write includefile!";
+		print FILE @files;
+		close FILE;
+	}
+	else
+	{
+		die "Cannot determine license for '$package->{source}'";
+	}
+}
+
+# Turn the RnD source inclusion lists into a binary exclusion list
+my @excludes = map { {name => "exclude", value => "$_"} } @allRndFiles;
+push @{$zipConfig->{config}->{config}->{bin}->{config}->{set}}, @excludes;
+
+$xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', KeyAttr => $keyAttr);
+
+# Output all rnd files into exclude list for later
+open FILE, "> rnd_excludefile.txt" or die "Cannot write exludefile!";
+print FILE @allRndFiles;
+close FILE;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/zip_includefiles.pl	Fri May 29 17:20:47 2009 +0100
@@ -0,0 +1,13 @@
+#!perl -w
+
+use strict;
+
+my @includefiles = glob "*_includefile.txt";
+foreach (@includefiles)
+{
+    my $includefilename=$_;
+	if (m/(.*)(_includefile.txt)/) {
+		my $zipfilename = $1.".zip";
+		system("7za a -tzip -i@".$includefilename . " " .$zipfilename);
+	}
+}
\ No newline at end of file
--- a/sf-package/package_props.ant.xml	Wed May 20 14:26:55 2009 +0100
+++ b/sf-package/package_props.ant.xml	Fri May 29 17:20:47 2009 +0100
@@ -7,7 +7,16 @@
   <property name="sf.spec.baseline.location" value="\\lon-engbuild87\d$\PDK\PDK_candidate_1"/>
   <property name="sf.spec.baseline.getenv_options" value="-i emu -i rnd"/>
   
+  <property name="sf.spec.systemdefinition.assemble" value="false"/>
   <property name="sf.spec.sysdef.configurations.list" value="SF"/>
+  
+  <property name="sf.spec.sbs.config" value="winscw"/>
+  
+  <!-- property name="sf.spec.publish.networkdrive" value="\\sym-build01\f$\SF_builds"/ -->
+  <!-- property name="sf.spec.publish.rootdir" value="\\sym-build01\f$\SF_builds"/ -->
+  
+  <property name="sf.spec.publish.networkdrive" value="D:\SF_builds"/>
+  <property name="sf.spec.publish.rootdir" value="D:\SF_builds"/>
 
 </project>
 
--- a/sf-platform/build.xml	Wed May 20 14:26:55 2009 +0100
+++ b/sf-platform/build.xml	Fri May 29 17:20:47 2009 +0100
@@ -17,21 +17,37 @@
   <!-- workaround until GenXML can merge v2.0.0 fragments -->
   <target name="create-canonical-sysdef-file">
 
-       <if>
-          <!-- TODO use scripting to match this -->
-          <equals arg1="${sf.spec.sysdef.version}" arg2="1.4.0" />
-          <then>
-            <echo message="Using System Definition v1.4.0 "/>
-            <runtarget target="compile.create-canonical-sysdef-file"/>
-          </then>
-          <else>
-            <runtarget target="preprocess-sysdef-files"/>
-            <echo message="Exporting preprocessed System Definition"/>
+    <runtarget target="preprocess-sysdef-files"/>
+    <echo message="Exporting preprocessed System Definition"/>
+    <if><istrue value="${sf.spec.splitbuild}"/>
+       <then>
+       <if><istrue value="${sf.spec.os.skipbuild}" />
+            <then><echo message="Skipping OS sysdef creation"/></then>
+       <else>
+            <!-- TODO use better method to export or wait for GenXML fix?-->
+            <copy file="${build.output.dir}\build\input\0000000000000001_system_model_os.xml"
+            tofile="${canonical.sysdef.file}" failonerror="false" verbose="true"/>
+       </else>
+       </if>
 
+       <if><istrue value="${sf.spec.s60.skipbuild}" />
+            <then><echo message="Skipping S60 sysdef creation"/></then>
+       <else>
             <!-- TODO use better method to export or wait for GenXML fix?-->
-            <copy file="${build.output.dir}\build\input\0000000000000001_system_definition.xml"
-                  tofile="${canonical.sysdef.file}" failonerror="true" verbose="true"/>
-          </else>
+            <copy file="${build.output.dir}\build\input\0000000000000001_system_model_s60.xml"
+            tofile="${canonical.sysdef.file}" failonerror="false" verbose="true"/>
+	   </else>
+	   </if>
+	   </then>
+	
+	<else>
+	    <!-- TODO use better method to export or wait for GenXML fix?-->
+        <copy file="${build.output.dir}\build\input\*_system_model_os.xml"
+        tofile="${canonical.sysdef.file}" failonerror="false" verbose="true"/>
+
+	    <!-- TODO targets for single sysdef build -->
+	    <runtarget target="sf-os-compile"/>
+	</else>
         </if>
 
   </target>
@@ -72,32 +88,6 @@
         </for>
     </target>
 
-    <target name="generate-layers">
-       <echo message="canno-file:${canonical.sysdef.file}"/>
-       <echo message="raptor-filters:raptor_${sysdef.configuration}"/>
-
-	   <!-- split builds currently generate layer sysdef from original -->
-	   <if><istrue value="${sf.spec.splitbuild}"/>
-       <then>
-           <hlm:compileGenxmlFilterMacro xmlns:hlm="http://www.nokia.com/helium" input="${canonical.sysdef.file}" filter="raptor_${sysdef.configuration}" output="${build.output.dir}/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
-	   </then>
-	   <else>
-	       <!-- but all we want is a sysdef with the config name appended, so just copy it -->
-           <echo message="INFO: skip genxml and copy sysdef to sysdef+config name"/>
-           <copy file="${canonical.sysdef.file}" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
-       </else>
-    </if>
-
-	<copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml" tofile="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml">
-		<filterchain>
-			<linecontainsregexp negate="true">
-			  <regexp pattern="^\s*$"/>
-			</linecontainsregexp>
-		</filterchain>
-	</copy>
-	<delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
-	</target>
-
   <!--
     == Name: SF-COMPILE
     ==
@@ -140,29 +130,29 @@
   <target name="sf-os-compile">
 
         <hlm:argSet id="sbs.tools2.var">
-                <hlm:arg name="config" value="tools2_rel" />
+                <hlm:arg name="config" value="tools2_rel.whatlog" />
                 <hlm:arg name="singlejob" value="false" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
         </hlm:argSet>
 
 		<hlm:argSet id="sbs.tools2.clean.var">
-                <hlm:arg name="config" value="tools2_rel" />
+                <hlm:arg name="config" value="tools2_rel.whatlog" />
                 <hlm:arg name="singlejob" value="false" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
-				<hlm:arg name="command" value="CLEAN" />
+		<hlm:arg name="command" value="CLEAN --check" />
         </hlm:argSet>
 
         <hlm:argSet id="sbs.tools.var">
-                <hlm:arg name="config" value="tools_rel" />
+                <hlm:arg name="config" value="tools_rel.whatlog" />
                 <hlm:arg name="singlejob" value="true" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
         </hlm:argSet>
 
 		<hlm:argSet id="sbs.tools.clean.var">
-                <hlm:arg name="config" value="tools_rel" />
+                <hlm:arg name="config" value="tools_rel.whatlog" />
                 <hlm:arg name="singlejob" value="true" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
-				<hlm:arg name="command" value="CLEAN" />
+		<hlm:arg name="command" value="CLEAN --check" />
         </hlm:argSet>
 
         <hlm:argSet id="sbs.main.sbs.var">
@@ -173,13 +163,13 @@
 		<hlm:argSet id="sbs.main.clean.sbs.var">
                 <hlm:arg name="config" value="${sf.spec.sbs.config}" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
-				<hlm:arg name="command" value="CLEAN" />
+		<hlm:arg name="command" value="CLEAN --check" />
         </hlm:argSet>
 		
 		<hlm:argSet id="sbs.main.what.sbs.var">
                 <hlm:arg name="config" value="${sf.spec.sbs.config}" />
                 <hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
-				<hlm:arg name="command" value="WHAT" />
+		<hlm:arg name="command" value="WHAT" />
         </hlm:argSet>
 
         <hlm:sbsMakeOptions engine="gmake" id="sbs.toolsbuild.options" />
@@ -202,15 +192,19 @@
         </antcall>
 		
 		<!-- OS clean main build -->
-        <antcall target="compile-main" inheritAll="false" inheritRefs="true">
-                <param name="build.system" value="${sf.spec.build.system}" />
-                <param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
-                <param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
-                <param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
-                <reference refid="sbs.main.clean.sbs.var" torefid="sbs.var" />
-                <reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
-                <reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
-        </antcall>
+		<if><istrue value="${sf.spec.baseline.clean}"/>
+			<then>
+				<antcall target="compile-main" inheritAll="false" inheritRefs="true">
+						<param name="build.system" value="${sf.spec.build.system}" />
+						<param name="compile.sysdef.dtd.stub" value="${sf.spec.os.sysdef.dtd}" />
+						<param name="sysdef.configurations.list" value="${sf.spec.os.sysdef.clean.configurations.list}" />
+						<param name="sf.spec.sysdef.version" value ="${sf.spec.os.sysdef.version}"/>
+						<reference refid="sbs.main.clean.sbs.var" torefid="sbs.var" />
+						<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
+						<reference refid="sf.spec.os.system.definition.files" torefid="system.definition.files" />
+				</antcall>
+			</then>
+		</if>
 		
 		<antcall target="sf-list-dir" inheritAll="false">
 			<param name="sf.list.name" value="post-clean"/>
@@ -273,6 +267,15 @@
 			<param name="sf.list_a.name" value="post-clean"/>
 			<param name="sf.list_b.name" value="post-build-main"/>
 		</antcall>
+		
+		<!-- what has been cleaned and rebuilt -->
+		<antcall target="sf-intersect-dir" inheritAll="false">
+			<param name="sf.list_a.name" value="post-clean_delta"/>       <!-- clean list -->
+			<param name="sf.list_b.name" value="post-build-main_delta"/>  <!-- built list -->
+		</antcall>
+		
+		<!-- what has been cleaned and not rebuilt -->
+		
   </target>
 
   <!--
@@ -306,13 +309,13 @@
 			<hlm:argSet id="sbs.main.clean.sbs.var">
           			<hlm:arg name="config" value="${sf.spec.sbs.config}" />
           			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
-					<hlm:arg name="command" value="CLEAN" />
+				<hlm:arg name="command" value="CLEAN --check" />
     		</hlm:argSet>
 			
 			<hlm:argSet id="sbs.main.what.sbs.var">
           			<hlm:arg name="config" value="${sf.spec.sbs.config}" />
           			<hlm:arg name="enable-filter" value="${sf.spec.logs.raptorfilter.enable}" />
-					<hlm:arg name="command" value="WHAT" />
+				<hlm:arg name="command" value="WHAT" />
     		</hlm:argSet>
 
     		<hlm:sbsMakeOptions engine="gmake" id="sbs.toolsbuild.options" />
@@ -333,14 +336,18 @@
     		</antcall>
 			
 			<!-- s60 clean main build -->
-    		<antcall target="compile-main" inheritAll="false" inheritRefs="true">
-          			<param name="build.system" value="${sf.spec.build.system}" />
-          			<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
-                    <param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
-          			<reference refid="sbs.main.clean.sbs.var" torefid="sbs.var" />
-          			<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
-          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
-    		</antcall>
+			<if><istrue value="${sf.spec.baseline.clean}"/>
+				<then>
+					<antcall target="compile-main" inheritAll="false" inheritRefs="true">
+							<param name="build.system" value="${sf.spec.build.system}" />
+							<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
+							<param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
+							<reference refid="sbs.main.clean.sbs.var" torefid="sbs.var" />
+							<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
+							<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
+					</antcall>
+				</then>
+			</if>
 
 			<antcall target="sf-list-dir" inheritAll="false">
 				<param name="sf.list.name" value="post-s60-clean"/>
@@ -371,32 +378,51 @@
     		<antcall target="compile-main" inheritAll="false" inheritRefs="true">
           			<param name="build.system" value="${sf.spec.build.system}" />
           			<param name="sysdef.configurations.list" value="${sf.spec.s60.sysdef.clean.configurations.list}" />
-                    <param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
+                                <param name="sf.spec.sysdef.version" value="${sf.spec.s60.sysdef.version}"/>
           			<reference refid="sbs.main.sbs.var" torefid="sbs.var" />
           			<reference refid="sbs.fullbuild.options" torefid="sbs.make.options" />
           			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
     		</antcall>
 			
+			<runtarget target="sf-s60-create-cenrep"/>
+			
 			<antcall target="sf-list-dir" inheritAll="false">
 				<param name="sf.list.name" value="post-s60-build-main"/>
 			</antcall>
 
-    		<!-- s60 postbuild bldmelast using ebs -->
-    		<antcall target="compile-main" inheritAll="false">
-          			<param name="build.system" value="ebs" />
-          			<param name="sysdef.configurations.list" value="S60_bldmelast" />
-          			<reference refid="sf.spec.s60.system.definition.files" torefid="system.definition.files" />
-    		</antcall>
-
-			<antcall target="sf-list-dir" inheritAll="false">
-				<param name="sf.list.name" value="post-s60-bldmelast"/>
-			</antcall>
-
-			<!-- what has been built by tools+2+main+bldmelast -->
+			<!-- what has been built by tools+2+main -->
 			<antcall target="sf-delta-dir" inheritAll="false">
 				<param name="sf.list_a.name" value="s60-baseline"/>
-				<param name="sf.list_b.name" value="post-s60-bldmelast"/>
+				<param name="sf.list_b.name" value="post-s60-build-main"/>
 			</antcall>		
+			
+			<!-- what has been cleaned and rebuilt -->
+			<antcall target="sf-intersect-dir" inheritAll="false">
+				<param name="sf.list_a.name" value="post-s60-clean_delta"/>       <!-- clean list -->
+				<param name="sf.list_b.name" value="post-s60-build-main_delta"/>  <!-- built list -->
+			</antcall>
+		
+	</target>
+
+	<target name="sf-s60-create-cenrep">
+        <echo message="INFO Generating CenRep"/>
+        <exec executable="${helium.dir}/../ConfigurationTool/cli_build.cmd" dir="${build.drive}" failonerror="false" output="${build.log.dir}/${build.id}_create_cenrep.log">
+		  <arg value="-master_conf"/>
+		  <arg value="s60"/>
+		  <arg value="-impl"/>
+		  <arg value="/epoc32/rom/config/confml_data/s60"/>
+		  <arg value="-confml"/>
+		  <arg value="/epoc32/rom/config/confml_data/s60"/>
+		  <arg value="-ignore_errors"/>
+        </exec>
+		
+		<if><available  file="${build.drive}/cli_build_error.log" />
+		<then>
+            <echo message="INFO CenRep error log found, moving to ${build.log.dir}" />
+    		<move file="${build.drive}/cli_build_error.log" todir="${build.log.dir}" failonerror="false"/>
+		</then>
+		</if>
+		
 	</target>
 
   <!-- import sf-common-config -->