From f5f9f6de857a54886775c80d7bbca07d08143841 Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Thu, 30 Aug 2007 20:28:22 +0000
Subject: [PATCH] 1. fix for knownIssue bug (cast a list to a string) 2. fix testcase_Postamble issue- forgot to close file handlers

---
 opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml |   45 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
index 856bc93..319c863 100755
--- a/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/functional-tests/shared/functions/utils.xml
@@ -613,7 +613,7 @@
           if len(issuesList)==0:
             _status='FAIL'
           else:
-            _status='KNOWN ISSUES (%s)' % ','.join(issuesList)
+            _status='KNOWN ISSUES %s' % str(issuesList)
       </script>
       <message level="'status'">'## Test Verdict: %s ##' % _status</message>
       <call function="'testCase_EndBanner'" />
@@ -633,9 +633,10 @@
             self.log='%s/test.log'      % TMPDIR
             self.errors='%s/error.log'   % TMPDIR
             self.access='%s/access.log' % TMPDIR
-            open(self.log,'w').write('')
-            open(self.errors,'w').write('')
-            open(self.access,'w').write('')
+            for f in [self.log,self.errors,self.access]:
+              fh=open(f,'w')
+              fh.write('')
+              fh.close()
             self.group=group
             self.suite=suite
             self.fullname=fullname
@@ -674,15 +675,33 @@
             for issue in self.issues:
               xml += '          &lt;issue&gt;%s&lt;/issue&gt;%s'   % (issue,newLine)
             xml += '        &lt;/issues&gt;%s'                     % newLine
-            xml += '        &lt;log&gt;\n&lt;![CDATA[%s'           % newLine
-            xml += open(self.log).read()
-            xml += '        ]]&gt;&lt;/log&gt;%s'                  % newLine
-            xml += '        &lt;error&gt;\n&lt;![CDATA[%s'         % newLine
-            xml += open(self.errors).read()
-            xml += '        ]]&gt;&lt;/error&gt;%s'                % newLine
-            xml += '        &lt;access&gt;\n&lt;![CDATA[%s'        % newLine
-            xml += open(self.access).read()
-            xml += '        ]]&gt;&lt;/access&gt;%s'               % newLine
+            xml += '        &lt;log&gt;%s'                         % newLine
+            xml += '          &lt;![CDATA[%s'                      % newLine
+            if self.result!='pass':
+              # TODO: wrap with try catch to get IOError without stopping the tests
+              fh=open(self.log)
+              xml += fh.read()
+              fh.close()
+            xml += '          ]]&gt;%s'                            % newLine
+            xml += '        &lt;/log&gt;%s'                        % newLine
+            xml += '        &lt;error&gt;%s'                       % newLine
+            xml += '          &lt;![CDATA[%s'                      % newLine
+            if self.result!='pass':
+              # TODO: wrap with try catch to get IOError without stopping the tests
+              fh=open(self.errors)
+              xml += fh.read()
+              fh.close()
+            xml += '          ]]&gt;%s'                            % newLine
+            xml += '        &lt;/error&gt;%s'                      % newLine
+            xml += '        &lt;access&gt;%s'                      % newLine
+            xml += '          &lt;![CDATA[%s'                      % newLine
+            if self.result!='pass':
+              # TODO: wrap with try catch to get IOError without stopping the tests
+              fh=open(self.access)
+              xml += fh.read()
+              fh.close()
+            xml += '          ]]&gt;%s'                            % newLine
+            xml += '        &lt;/access&gt;%s'                     % newLine
             xml += '      &lt;/test&gt;%s'                         % newLine
             return xml
           

--
Gitblit v1.10.0