From d822ce82fa596adae7f75c0576be63890658700b Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Fri, 27 Apr 2007 15:53:48 +0000
Subject: [PATCH] 1.fix for functional tests pre-run (Re-enabled cleanup) 2.added get-dtd target 3.ability to see in the email report subject pass/fail status

---
 opendj-sdk/opends/tests/functional-tests/staf-installer.xml          |   43 ++++++++++++++++++++++++++++++++++++++-----
 opendj-sdk/opends/tests/functional-tests/staf-installer/failure.html |    7 +++++++
 2 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer.xml b/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
index b88a6bd..8b804fc 100644
--- a/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer.xml
@@ -282,7 +282,9 @@
   <target name="gui"
           depends="status-do"
           description="brings up the stax gui" >
-    
+    <!--
+    <echo>${java.home}/bin/java -classpath ${staf.install.dir}/services/stax/STAXMon.jar${path.separator}${staf.lib.dir}/JSTAF.jar</echo>
+    -->
     <exec
       dir="${staf.install.dir}"
       executable="${java.home}/bin/java"
@@ -509,6 +511,9 @@
       <tstamp>
         <format property="tests.run.time" pattern="yyyy.MM.dd-HH.mm.ss"/>
       </tstamp>
+      <!-- clean up some -->
+      <delete dir="${staf.logs.dir}"/>
+      <delete dir="${staf.tmp.dir}"/>
       <!-- make all the necessary directories for this test run -->
       <mkdir dir="${staf.tmp.dir}"/>
       <mkdir dir="${tests.run.dir}/${tests.run.time}"/>
@@ -605,9 +610,7 @@
     <copy todir="${tests.run.dir}/${tests.run.time}/staf-logs">
       <fileset dir="${staf.home}/logs"/>
     </copy>
-    <!--
     <delete dir="${staf.home}/logs" />
-    -->
     <echo>Saving report</echo>
     <copy todir="${tests.run.dir}/${tests.run.time}/report">
       <fileset dir="${staf.tmp.dir}">
@@ -635,13 +638,23 @@
         </not>
       </or>
     </condition>
+    <condition property="email.file" 
+               value="${staf.tmp.dir}/results.html" 
+               else="staf-installer/failure.html">
+      <available file="${staf.tmp.dir}/results.html"/>
+    </condition>
+    <condition property="email.subject"
+               value="FT - Run - ${daily.date} - ${os.name} - ${os.arch}"
+               else="FT - Failed -${daily.date} - ${os.name} - ${os.arch}">
+      <available file="${staf.tmp.dir}/results.html"/>
+    </condition>
     <antcall target="send-mail-noauth"/>
     <antcall target="send-mail-withauth"/>
   </target>
   <target name="send-mail-noauth" if="email.send.noauth">
     <mail from="${email.from}" 
           tolist="${email.to}" 
-          subject="FT - ${daily.date} - ${os.name} - ${os.arch}"
+          subject="${email.subject}"
           files="${staf.tmp.dir}/results.html"
           mailhost="${email.server.host}"
           mailport="${email.server.port}"
@@ -651,7 +664,7 @@
   <target name="send-mail-withauth" unless="email.send.noauth">
     <mail from="${email.from}" 
           tolist="${email.to}" 
-          subject="FT - ${daily.date} - ${os.name} - ${os.arch}"
+          subject="${email.subject}"
           files="${staf.tmp.dir}/results.html"
           mailhost="${email.server.host}"
           mailport="${email.server.port}"
@@ -964,4 +977,24 @@
     <echoproperties/>
   </target>
   
+  <target name="get-dtd" depends="status-do">
+    <property name="stax.dtd" value="${staf.home}/stax.dtd"/>
+    <exec
+      dir="${staf.bin.dir}"
+      executable="${staf.executable}"
+      output="${stax.dtd}"
+      >
+      <arg line="LOCAL STAX get dtd"/>
+      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
+      <env key="LD_LIBRARY_PATH" value="${staf.lib.dir}"/>
+      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+      <env key="STAFCODEPAGE" value="LATIN_1"/>
+    </exec>
+    <replace file="${stax.dtd}">
+      <replacetoken>Response
+--------
+</replacetoken>
+      <replacevalue></replacevalue>
+    </replace>
+  </target>
 </project>
diff --git a/opendj-sdk/opends/tests/functional-tests/staf-installer/failure.html b/opendj-sdk/opends/tests/functional-tests/staf-installer/failure.html
new file mode 100644
index 0000000..f30fbbc
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/staf-installer/failure.html
@@ -0,0 +1,7 @@
+<html>
+  <body>
+    <center>
+      <img src="http://pangea.stanford.edu/courses/GES41L/motivation/failure.gif">
+    </center>
+  </body>
+</html>

--
Gitblit v1.10.0