From 4e7101fd2097719f302d0948d855f23fff6059f8 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Mon, 26 Oct 2009 15:18:37 +0000
Subject: [PATCH] Frontport of 2.2 tests to the trunk

---
 opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml |  123 ++++++++++++++++++++++++++--------------
 1 files changed, 80 insertions(+), 43 deletions(-)

diff --git a/opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml b/opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml
index 1e75ac9..56671cf 100644
--- a/opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml
+++ b/opends/tests/staf-tests/functional-tests/testcases/replication/replication.xml
@@ -32,53 +32,90 @@
       <function-required-arg name="STAXParentID"/>
     </function-list-args>
     <sequence>
-      <block name="'replication'">
-        <sequence>
-          <!--- Load the job environment for the test group execution -->
-          <import machine="STAF_LOCAL_HOSTNAME"
-                  file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
-          <call function="'loadJobEnvironment'">
-               { 'parent' : STAXParentID }
-          </call>
-          <script>
-            CurrentTestPath['group']='replication'
-          </script>
-          <call function="'testGroup_Preamble'"/>            
-
-          <!-- List of replication test suites to run -->
-          <script>
-            testList = []
-            testList.append('totalupdate')
-            testList.append('binarycopy')
-            testList.append('ldifimport')
-            testList.append('resynchronization')
-            testList.append('basic')
-            testList.append('schema')
-            testList.append('failover')
-            testList.append('encryption')
-            testList.append('changelog')
-            testList.append('conflict')
-            testList.append('externalchangelog')
+      
+      <try>
+        
+        <block name="'replication'">
+          <sequence>
+            <!--- Load the job environment for the test group execution -->
+            <import machine="STAF_LOCAL_HOSTNAME"
+                    file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
+            <call function="'loadJobEnvironment'">
+                 { 'parent' : STAXParentID }
+            </call>
+            <script>
+              CurrentTestPath['group']='replication'
+            </script>
+            <call function="'testGroup_Preamble'"/>            
+  
+            <!-- List of replication test suites to run -->
+            <script>
+              suiteList = []
+              suiteList.append('totalupdate')
+              suiteList.append('binarycopy')
+              suiteList.append('ldifimport')
+              suiteList.append('resynchronization')
+              suiteList.append('basic')
+              suiteList.append('schema')
+              suiteList.append('failover')
+              suiteList.append('encryption')
+              suiteList.append('changelog')
+              suiteList.append('conflict')
+              suiteList.append('externalchangelog')
+              
+              globalAssuredReplication = None
+              
+              if (REPLICATION_SPLIT_SERVERS == 'true'):
+                globalSplitServers = True
+              else:
+                globalSplitServers = None
+            </script>
             
-            globalAssuredReplication = None
+            <iterate var="_suite" in="suiteList" >
+              <try>
+                <sequence>
+                  <import machine="STAF_LOCAL_HOSTNAME"
+                          file="'%s/testcases/replication/%s/%s.xml' % 
+                            (TESTS_DIR,_suite,_suite)"/>
+                  <call function="'replication_%s'% _suite" />
+                </sequence>
+                
+                <catch exception="'STAFException.TestSuite.SetupException'">
+                  <message log="1" level="'fatal'">
+                    'Setup of test suite %s failed.' % _suite
+                  </message>
+                </catch>
+                
+                <catch exception="'STAFException.TestSuite.MainException'">
+                  <message log="1" level="'fatal'">
+                    'Main part of test suite %s failed.' % _suite
+                  </message>
+                </catch>
+                
+                <catch exception="'STAFException.TestSuite.CleanupException'">
+                  <message log="1" level="'fatal'">
+                    'Cleanup of test suite %s failed.' % _suite
+                  </message>
+                </catch>
+              </try>
+            </iterate>
             
-            if (REPLICATION_SPLIT_SERVERS == 'true'):
-              globalSplitServers = True
-            else:
-              globalSplitServers = None
-          </script>
+          </sequence>
+        </block>
           
-          <iterate var="_test" in="testList" >
-            <sequence>
-              <import machine="STAF_LOCAL_HOSTNAME"
-                      file="'%s/testcases/replication/%s/%s.xml' % 
-                        (TESTS_DIR,_test,_test)"/>
-              <call function="'replication_%s'% _test" />
-            </sequence>
-          </iterate>
+        <catch exception="'STAXException.TestGroupException'">
+          <message log="1" level="'fatal'">
+            'Execution of Test Group Failed'
+          </message>
+        </catch>
+        
+        <finally>
+          <!-- Test Group postamble -->
           <call function="'testGroup_Postamble'"/>
-        </sequence>
-      </block>
+        </finally>
+        
+      </try>
+      
     </sequence>
   </function>
 </stax>

--
Gitblit v1.10.0