mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

andrug
06.30.2008 ba62d7868f5fceb574f3631804af1c61e7f21f8b
allow report to display links + add a new xsl to parse client details log
1 files added
8 files modified
162 ■■■■■ changed files
opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml 1 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/searchLoad/searchLoad.xml 1 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/log/log.xml 24 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/main_run.xml 3 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/main_run_lib.xml 10 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/phases/scheduler/scheduler.xml 14 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/report/clientDetails.xsl 88 ●●●●● patch | view | raw | blame | history
opends/tests/system-tests/report/result.xsl 20 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoad.xml 1 ●●●● patch | view | raw | blame | history
opends/tests/system-tests/clients/modifyLoad/modifyLoad.xml
@@ -260,6 +260,7 @@
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'xlink'   : outFile,
           'fileFd'  : fileFd}
          </call>
          
opends/tests/system-tests/clients/searchLoad/searchLoad.xml
@@ -258,6 +258,7 @@
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'xlink'   : outFile,
           'fileFd'  : fileFd}
          </call>
          
opends/tests/system-tests/phases/log/log.xml
@@ -379,6 +379,11 @@
          string to write in a file
        </function-arg-description>
      </function-arg-def>
      <function-arg-def name="xlink" type="optional" default="NOT_DEFINED">
        <function-arg-description>
          if you want the content to be a href of xlink
        </function-arg-description>
      </function-arg-def>
      <function-arg-def name="fileFd" type="required">
        <function-arg-description>
          file descriptor
@@ -392,7 +397,13 @@
          sys.path.append("%s/phases/log" % TESTS_DIR )
          from log import htmlTransformation
          content = htmlTransformation(content)
          fileFd.write('&lt;message&gt;%s&lt;/message&gt;\n' % content)
          if xlink == NOT_DEFINED:
            str = '&lt;message&gt;'
          else:
            str = '&lt;message xlink:href="%s" xlink:type="simple"&gt;' % xlink
          str = '%s %s&lt;/message&gt;\n' % (str,content)
          fileFd.write(str)
        </script>
      <else>
        <message>content</message>
@@ -543,6 +554,12 @@
    <function-map-args>
      <function-arg-def name="client" type="required">
      </function-arg-def>
      <function-arg-def name="extraParameters" type="optional"
                                               default="NOT_DEFINED">
        <function-arg-description>
          extra parameters to add in the node
        </function-arg-description>
      </function-arg-def>
      <function-arg-def name="fileFd" type="required">
        <function-arg-description>
          file descriptor
@@ -557,7 +574,10 @@
          str = '%s host=\"%s\"'           % (str,client.getHost())
          str = '%s start=\"%s\"'          % (str,client.getStart())
          str = '%s stop=\"%s\"'           % (str,client.getStop())
          str = '%s dependency=\"%s\"&gt;\n' % (str,client.getDependency())
          str = '%s dependency=\"%s\"'     % (str,client.getDependency())
          if extraParameters != NOT_DEFINED:
            str = '%s %s' % (str,extraParameters)
          str = '%s &gt;\n' % str
          fileFd.write(str)
        </script>
      </if>
opends/tests/system-tests/phases/main_run.xml
@@ -176,7 +176,8 @@
        str = '%s standalone=\"no\"?&gt;\n' % str
        str = '%s &lt;?xml-stylesheet type="text/xsl" href="result.xsl"?>\n' \
               % str
        str = '%s &lt;systemTestRoot&gt;\n' % str
        str = '%s &lt;systemTestRoot' % str
        str = '%s xmlns:xlink="http://www.w3.org/1999/xlink"&gt;\n' % str
        LOG_MAIN_FD.write(str)
      </script>
      
opends/tests/system-tests/phases/main_run_lib.xml
@@ -457,6 +457,16 @@
      }
      </call>
      
      <!--== Copy xsl file needed to read the client details ==-->
      <call function="'copyFile'">
      {
        'srcFile'    : '%s/report/clientDetails.xsl' % (TESTS_DIR),
        'destFile'   : '%s/tmp/clientDetails.xsl' % LOG_DIR,
        'remoteHost' : STAXServiceMachine,
        'fileFd'     : NO_FILE
      }
      </call>
      <!--== Close main output file ==-->
      <script>
        LOG_MAIN_FD.write('&lt;/systemTestRoot&gt;\n')
opends/tests/system-tests/phases/scheduler/scheduler.xml
@@ -404,12 +404,14 @@
      <call function="'writeMessage'">
      { 
        'content' : 'Details of the client : %s' % logFileDetails,
        'xlink'   : logFileDetails,
        'fileFd'  : fileFd
      }
      </call>
      <call function="'writeMessage'">
      { 
        'content' : 'Client outPuts : %s' % outFile,
        'xlink'   : outFile,
        'fileFd'  : fileFd
      }
      </call>
@@ -457,10 +459,18 @@
      
      <!-- ==== Log info ====================================-->
      <!--== Write root tag for xml details file -->
      <script>
        str = '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"'
        str = '%s standalone=\"no\"?&gt;\n' % str
        str = '%s &lt;?xml-stylesheet type="text/xsl"' % str
        str = '%s href="clientDetails.xsl"?>\n' % str
        fileFd.write(str)
      </script>
      <call function="'writeStartTagClient'">
      {
        'client' : client,
        'fileFd' : fileFd
        'client'          : client,
        'extraParameters' : 'xmlns:xlink="http://www.w3.org/1999/xlink"',
        'fileFd'          : fileFd
      }
      </call>
      
opends/tests/system-tests/report/clientDetails.xsl
New file
@@ -0,0 +1,88 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                exclude-result-prefixes="xlink"
                version="1.0">
  <xsl:output method="html"/>
  <!-- ================= root node ================ -->
  <xsl:template match="client">
    <html><body>
    <head>
      <link href="../result.css" rel="stylesheet" type="text/css"></link>
    </head>
    <h1>
      Details for client
      <xsl:value-of select="@name" />
      ( id <xsl:value-of select="@id" /> )
    </h1>
    <p>
      <ul>
      <xsl:apply-templates select="operation"/>
      </ul>
      <xsl:apply-templates select="message"/>
    </p>
    </body>
    </html>
  </xsl:template>
  <!-- ============= operation node =============== -->
  <xsl:template match="operation">
    <xsl:variable name="opName" select="normalize-space(@name)"/>
    <xsl:variable name="opDate" select="normalize-space(@date)"/>
    <li>
      <b><xsl:value-of select="$opName"/></b>
         <i>@ <xsl:value-of select="$opDate"/></i><br/>
      <xsl:apply-templates select="message"/>
      <xsl:apply-templates select="operationResult"/>
    </li>
  </xsl:template>
  <!-- ============= message node =============== -->
  <xsl:template match="message">
    <xsl:choose>
      <xsl:when test="@xlink:href">
        <a href="{@xlink:href}"><xsl:value-of select="." /></a>
      </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="." />
        </xsl:otherwise>
      </xsl:choose>
     <br/>
  </xsl:template>
  <!-- ============= operationResult node =============== -->
  <xsl:template match="operationResult">
    <xsl:variable name="rc" select="normalize-space(@returncode)"/>
    <xsl:variable name="exprc" select="normalize-space(@expected)"/>
    <xsl:variable name="result" select="normalize-space(.)"/>
    <xsl:variable name="status" select="normalize-space(@status)"/>
    <b>
      <xsl:choose>
        <xsl:when test="$status='SUCCESS'">
          <span class="pass"><xsl:value-of select="$status"/></span>
          [
           return code <xsl:value-of select="$rc" />,
           expected <xsl:value-of select="$exprc" />
          ] <br/>
        </xsl:when>
        <xsl:when test="$status='ERROR'">
          <span class="fail"><xsl:value-of select="$status"/></span>
          [
           return code <xsl:value-of select="$rc" />,
           expected <xsl:value-of select="$exprc" />,
           <xsl:value-of select="$result" />
          ] <br/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$status"/>
        </xsl:otherwise>
      </xsl:choose>
    </b>
  </xsl:template>
  </xsl:stylesheet>
opends/tests/system-tests/report/result.xsl
@@ -24,8 +24,10 @@
 !
 !      Copyright 2008 Sun Microsystems, Inc.
 ! -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                exclude-result-prefixes="xlink"
                version="1.0">
<xsl:output 
  method="html"
  encoding="ISO-8859-1"
@@ -456,7 +458,7 @@
  * <a href="#summary"> Move up to Summary</a>
  <br/>
  * <a onclick="ShowHideListElement('{$phaseName}')">
    <span class="showLink"> Clic me to show/hide details</span>
    <span class="showLink"> Click me to show/hide details</span>
  </a>
  <p id="{$phaseName}" style="display: none">
    <ul>
@@ -517,7 +519,7 @@
    </ul>
    
  * <a onclick="ShowHideListElement('{$phaseName}')">
    <span class="showLink">Clic me to show/hide details</span>
    <span class="showLink">Click me to show/hide details</span>
  </a><br/>
  * <a href="#summary">Move up to Summary</a>
  </p>
@@ -707,7 +709,15 @@
<!-- ================= Manage message node     ================ -->
<xsl:template name="displayMessage">
  <xsl:value-of select="." /> <br/>
  <xsl:choose>
    <xsl:when test="@xlink:href">
      <a href="{@xlink:href}"><xsl:value-of select="." /></a>
    </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="." />
      </xsl:otherwise>
    </xsl:choose>
   <br/>
  <xsl:call-template name="parseChildPhase" />
</xsl:template>
opends/tests/system-tests/scenario/sample2/clients/sampleSearchLoad/sampleSearchLoad.xml
@@ -259,6 +259,7 @@
          <!-- ========== Postamble ========== -->
          <call function="'writeMessage'">
          {'content' : 'Output file %s' % outFile,
           'xlink'   : outFile,
           'fileFd'  : fileFd}
          </call>