From fbe0698ab2dd016a87cb547d9021a027e3e7d4fb Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Mon, 10 Nov 2008 16:02:48 +0000
Subject: [PATCH] Issue 851: log archiving, reporting and results collection fix test names

---
 opendj-sdk/opends/tests/staf-tests/shared/python/common.py     |   14 +++++++++++++-
 opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml  |    2 +-
 opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml |    4 +---
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml b/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml
index 83f445b..a276cde 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/functions/utils.xml
@@ -1199,7 +1199,7 @@
             line.setAttribute("level", "%s" % level)
             line.setAttribute("message", "%s" % message)
             if level == 'Start':
-              tag=message.split(":")[3].strip()
+              tag=get_test_name(message.replace('testcase: ',''))
               line.setAttribute("tag", "%s" % tag.lower())
             log.appendChild(line)
           </script>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
index d4f65c5..afa72c0 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
+++ b/opendj-sdk/opends/tests/staf-tests/shared/python/common.py
@@ -40,7 +40,8 @@
             "exception_thrown",
             "directory_server",
             "test_env",
-            "staf_service" ]
+            "staf_service",
+            "get_test_name" ]
 
 class format_testcase:
   'Format the Test name objects'
@@ -537,3 +538,14 @@
     def get_reljavadir(self):
       return self.directory
 
+def get_test_name(name):
+  i=2
+  __name=''
+  __tn=name.split(':')
+  while i < len(__tn):
+    __name += '%s:' % __tn[i]
+    i=i+1
+  return __name[0:-1].strip()
+
+
+
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml b/opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml
index 8be924a..a6ff613 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml
@@ -597,12 +597,9 @@
                   tcsuiteshort=tcsuite
               else:
                 tcsuite=tcgroup
-              if tcnamesplit[2]:
-                tcshortname=tcnamesplit[2].strip()
             else:
               tcgroup=tcname
               tcsuite=tcname
-              tcshortname=tcname
               tcsuiteshort=tcname
 
             if testDict[tcname].has_key('pass'):
@@ -640,6 +637,7 @@
           else:
             tcresult='fail'
 
+          tcshortname=get_test_name(tcname)
           tcdurationsecs=test_time().timeToSeconds(tcduration)
 
           # Create the testgroup element

--
Gitblit v1.10.0