From b0a465e7bacfe61b72dd746680c3fe33b8d614ce Mon Sep 17 00:00:00 2001
From: andrug <andrug@localhost>
Date: Sun, 29 Jun 2008 17:30:03 +0000
Subject: [PATCH] QA: System Test: Review: Add new dedicated jython object to manage external tools

---
 opendj-sdk/opends/tests/system-tests/phases/parser/parser.xml |   96 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 82 insertions(+), 14 deletions(-)

diff --git a/opendj-sdk/opends/tests/system-tests/phases/parser/parser.xml b/opendj-sdk/opends/tests/system-tests/phases/parser/parser.xml
index ec70e7f..2530438 100755
--- a/opendj-sdk/opends/tests/system-tests/phases/parser/parser.xml
+++ b/opendj-sdk/opends/tests/system-tests/phases/parser/parser.xml
@@ -56,17 +56,17 @@
         
         sys.path.append("%s/phases/parser" % TESTS_DIR )
         from parser import *
-        parserResult = main(STAXResult)
-        msg          = parserResult[0]
-        instances    = parserResult[1]
-        suffix       = parserResult[2]
-        scheduler    = parserResult[3]
-        scenario     = parserResult[4]
-        if (parserResult[5] != NOT_DEFINED):
-          DOMAIN[0]  = '.%s' % parserResult[5]
+        parserResult  = main(STAXResult)
+        msg           = parserResult[0]
+        instances     = parserResult[1]
+        suffix        = parserResult[2]
+        scheduler     = parserResult[3]
+        scenario      = parserResult[4]
+        externalTools = parserResult[5]
+        if (parserResult[6] != NOT_DEFINED):
+          DOMAIN[0]  = '.%s' % parserResult[6]
       </script>
       
-      
       <!--=================================================================-->
       <!--========  Set some attributes to add in instance objects   ======-->
       <paralleliterate in="instances" var="instance">
@@ -140,7 +140,7 @@
           </script>
           <!-- Check jdmk dependcy if snmp is enabled -->
           <if expr="instance.getSNMPPort() != NOT_DEFINED 
-                    and scenario.getJdmkrtPath() == NOT_DEFINED">
+                    and externalTools.getJdmkrtPath() == NOT_DEFINED">
             <sequence>
               <message>
                 'ERROR, jdmkrt path not defined, needed for instance %s' % \
@@ -174,15 +174,15 @@
             <script>
               merr = ''
               if client.getName() == 'monitoring':
-                if scenario.getJdmkrtPath() == NOT_DEFINED:
+                if externalTools.getJdmkrtPath() == NOT_DEFINED:
                   merr = '%s\nERROR, jdmkrt path not defined,' % merr
                   merr = '%s needed for monitoring client' % merr
                   ERR_NUM[0] += 1
-                if scenario.getJcommonPath() == NOT_DEFINED:
+                if externalTools.getJcommonPath() == NOT_DEFINED:
                   merr = '%s\nERROR, jcommon path not defined,' % merr
                   merr = '%s needed for monitoring client' % merr
                   ERR_NUM[0] += 1
-                if scenario.getJfreechartPath() == NOT_DEFINED:
+                if externalTools.getJfreechartPath() == NOT_DEFINED:
                   merr = '%s\nERROR, jfreechart path not defined,' % merr
                   merr = '%s needed for monitoring client' % merr
                   ERR_NUM[0] += 1
@@ -202,7 +202,75 @@
       
       
       <!--=================================================================-->
-      <!--========  Basic configuration checks       ======-->
+      <!--========  Basic checks for extTools object                 ======-->
+      
+      <!-- check jdmk jar file exists -->
+      <if expr="externalTools.getJdmkrtPath() != NOT_DEFINED">
+        <sequence>
+          <call function="'isFile'">
+          {
+            'location' : STAXServiceMachine,
+            'fileName' : externalTools.getJdmkrtPath()
+          }
+          </call>
+          <script>
+            fileExist = STAXResult
+          </script>
+          <if expr="fileExist == FALSE">
+            <script>
+              msg = '%s\nERROR : canf find file %s' % \
+                    (msg,externalTools.getJdmkrtPath())
+            </script>
+          </if>
+        </sequence>
+      </if>
+      <!-- check jcommon jar file exists -->
+      <if expr="externalTools.getJcommonPath() != NOT_DEFINED">
+        <sequence>
+          <call function="'isFile'">
+          {
+            'location' : STAXServiceMachine,
+            'fileName' : externalTools.getJcommonPath()
+          }
+          </call>
+          <script>
+            fileExist = STAXResult
+          </script>
+          <if expr="fileExist == FALSE">
+            <script>
+              msg = '%s\nERROR : canf find file %s' % \
+                    (msg,externalTools.getJcommonPath())
+            </script>
+          </if>
+        </sequence>
+      </if>
+      <!-- check jfreechart jar file exists -->
+      <if expr="externalTools.getJfreechartPath() != NOT_DEFINED">
+        <sequence>
+          <call function="'isFile'">
+          {
+            'location' : STAXServiceMachine,
+            'fileName' : externalTools.getJfreechartPath()
+          }
+          </call>
+          <script>
+            fileExist = STAXResult
+          </script>
+          <if expr="fileExist == FALSE">
+            <script>
+              msg = '%s\nERROR : canf find file %s' % \
+                    (msg,externalTools.getJfreechartPath())
+            </script>
+          </if>
+        </sequence>
+      </if>
+      
+      
+      
+      
+      
+      <!--=================================================================-->
+      <!--========  Basic configuration checks                       ======-->
       
       <!-- replace localhost by real host name -->
       <script>

--
Gitblit v1.10.0