From fb83e885f908bb4e87a21ac7db032ca968e3add2 Mon Sep 17 00:00:00 2001
From: ugaston <ugaston@localhost>
Date: Fri, 29 Feb 2008 16:55:57 +0000
Subject: [PATCH] Code clean-up

---
 opendj-sdk/opends/tests/functional-tests/testcases/replication/encryption/encryption.xml |   85 +++------------------------
 opendj-sdk/opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml |   93 ++++++++++++++++++++----------
 2 files changed, 73 insertions(+), 105 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml b/opendj-sdk/opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
index 9204884..9d5b774 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/replication/binarycopy/binarycopy.xml
@@ -39,7 +39,9 @@
           <call function="'testSuite_Preamble'"/>
           <!--- Test Suite information
           #@TestSuiteName       Replication Binary Copy Tests
-          #@TestSuitePurpose    Verify that the servers in a replicated topology can be initialised by the means of a binary copy (backup-restore).
+          #@TestSuitePurpose    Verify that the servers in a replicated topology
+                                can be initialised by the means of a binary copy
+                                (backup-restore).
           #@TestSuiteID         Binary Copy Tests
           #@TestSuiteGroup      Binary Copy
           #@TestGroup           Replication
@@ -48,7 +50,8 @@
           -->
           
           <import machine="STAF_LOCAL_HOSTNAME"
-                  file="'%s/testcases/replication/replication_setup.xml' % (TESTS_DIR)"/>
+                  file="'%s/testcases/replication/replication_setup.xml' 
+                        % (TESTS_DIR)"/>
           <call function="'replication_setup'" />
           
           <script>
@@ -57,9 +60,11 @@
           
           <!--- Test Case information
           #@TestMarker          Replication Binary Copy Tests
-          #@TestName            Replication: Binary Copy: Off-line initialisation
-          #@TestID                  Off-line initialisation
-          #@TestPurpose         Initialise replicated servers using off-line backup/restore
+          #@TestName            Replication: Binary Copy: Off-line
+                                initialisation
+          #@TestID              Off-line initialisation
+          #@TestPurpose         Initialise replicated servers using off-line 
+                                backup/restore
           #@TestPreamble
           #@TestSteps
           #@TestPostamble
@@ -69,7 +74,8 @@
             <sequence>
               <call function="'testCase_Preamble'"/>
               <message>
-                 'Replication: Binary Copy: Off-line initialisation. Initialise replicated servers using off-line backup/restore'
+                 'Replication: Binary Copy: Off-line initialisation. \
+                 Initialise replicated servers using off-line backup/restore'
               </message>
               <!-- Stop the servers in the topology -->
               <call function="'stopServers'">
@@ -110,10 +116,14 @@
               <!-- Copy backup to "consumer" servers and restore it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
-                  <if expr="os.path.exists('%s/config/schematokens.dat' % dsPath)" >
+                  <if expr="os.path.exists('%s/config/schematokens.dat' 
+                                           % masterPath)" >
                     <call function="'copyFile'">
-                      { 'srcfile'    : '%s/config/schematokens.dat' % dsPath,
-                        'destfile'   : '%s/%s/config/schematokens.dat' % (consumer.getDir(),OPENDSNAME),
+                      { 'location'   : masterHost,
+                        'srcfile'    : '%s/config/schematokens.dat' \
+                                       % masterPath,
+                        'destfile'   : '%s/%s/config/schematokens.dat' \
+                                       % (consumer.getDir(),OPENDSNAME),
                         'remotehost' : consumer.getHostname()
                       }
                     </call>
@@ -121,15 +131,18 @@
                   <call function="'CopyFolderByExtension'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
-                      'srcfolder'  : '%s/replication/master_backup' % masterDataDir,
-                      'destfolder' : '%s/%s/replication/master_backup' % (consumer.getDir(),relativeDataDir),
+                      'srcfolder'  : '%s/replication/master_backup' \
+                                     % masterDataDir,
+                      'destfolder' : '%s/%s/replication/master_backup' \
+                                     % (consumer.getDir(),relativeDataDir),
                       'extension'  : '*'
                     }
                   </call>
                   <call function="'restore'">
                     { 'location'  : consumer.getHostname(),
                       'dsPath'    : '%s/%s' % (consumer.getDir(), OPENDSNAME),
-                      'backupDir' : '%s/%s/replication/master_backup' % (consumer.getDir(),relativeDataDir)
+                      'backupDir' : '%s/%s/replication/master_backup' \
+                                    % (consumer.getDir(),relativeDataDir)
                     }
                   </call>
                 </sequence>
@@ -149,11 +162,13 @@
                   'dsInstancePort' : master.getPort(), 
                   'dsInstanceDn'   : master.getRootDn(),
                   'dsInstancePswd' : master.getRootPwd(),
-                  'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir
+                  'entryToBeAdded' : '%s/replication/tfitter.ldif' \
+                                     % clientDataDir
                 }
               </call>
               
-              <!-- Verify the synchronization of the trees among the servers in the topology -->
+              <!-- Verify the synchronization of the trees among the servers in
+                the topology -->
               <call function="'verifyTrees'">
                 [ clientHost, clientPath, master, consumerList, synchroSuffix ]
               </call>
@@ -164,8 +179,9 @@
           <!--- Test Case information
           #@TestMarker          Replication Binary Copy Tests
           #@TestName            Replication: Binary Copy: On-line initialisation
-          #@TestID                  On-line initialisation
-          #@TestPurpose         Initialise replicated servers using on-line backup/restore
+          #@TestID              On-line initialisation
+          #@TestPurpose         Initialise replicated servers using on-line
+                                backup/restore
           #@TestPreamble
           #@TestSteps
           #@TestPostamble
@@ -175,7 +191,8 @@
             <sequence>
               <call function="'testCase_Preamble'"/>
               <message>
-                 'Replication: Binary Copy: On-line initialisation. Initialise replicated servers using on-line backup/restore'
+                 'Replication: Binary Copy: On-line initialisation. Initialise \
+                 replicated servers using on-line backup/restore'
               </message>
               
               <!-- Clean the servers in the topology
@@ -183,15 +200,17 @@
                 [_topologyServerList, synchroSuffix, False]
               </call> -->
               
-              <!-- Delete manually added entry so that replication server won't add it automatically later on -->
+              <!-- Delete manually added entry so that replication server won't
+                add it automatically later on -->
               <call function="'ldapDeleteWithScript'">
                 { 'location'       :  clientHost,
                   'dsPath'         :  clientPath,
                   'dsInstanceHost' :  master.getHostname(),
                   'dsInstancePort' :  master.getPort(),
-                  'dsInstanceDn'   : master.getRootDn(),
+                  'dsInstanceDn'   :  master.getRootDn(),
                   'dsInstancePswd' :  master.getRootPwd(),
-                  'dsDn'           :  ['uid=tfitter, ou=People,%s' % synchroSuffix]
+                  'dsDn'           :  ['uid=tfitter, ou=People,%s' \
+                                       % synchroSuffix]
                 }
               </call>
               
@@ -204,7 +223,8 @@
                   'dsInstanceDn'   : master.getRootDn(),
                   'dsInstancePswd' : master.getRootPwd(),
                   'taskID'         : 'import task',
-                  'ldifFile'       : '%s/replication/Example.ldif' % masterDataDir
+                  'ldifFile'       : '%s/replication/Example.ldif' \
+                                     % masterDataDir
                 }
               </call>
               
@@ -232,17 +252,22 @@
                   'dsInstanceDn'   : master.getRootDn(),
                   'dsInstancePswd' : master.getRootPwd(),
                   'taskID'         : 'backup task',
-                  'backupDir'      : '%s/replication/master_backup_online' % masterDataDir 
+                  'backupDir'      : '%s/replication/master_backup_online' \
+                                     % masterDataDir 
                 }
               </call>
               
               <!-- Copy backup to "consumer" servers and restore it -->
               <paralleliterate var="consumer" in="consumerList">
                 <sequence>
-                  <if expr="os.path.exists('%s/config/schematokens.dat' % dsPath)">
+                  <if expr="os.path.exists
+                            ('%s/config/schematokens.dat' % masterPath)">
                     <call function="'copyFile'">
-                      { 'srcfile'    : '%s/config/schematokens.dat' % dsPath,
-                        'destfile'   : '%s/%s/config/schematokens.dat' % (consumer.getDir(),OPENDSNAME),
+                      { 'location'   : masterHost,
+                        'srcfile'    : '%s/config/schematokens.dat' \
+                                       % masterPath,
+                        'destfile'   : '%s/%s/config/schematokens.dat' \
+                                       % (consumer.getDir(),OPENDSNAME),
                         'remotehost' : consumer.getHostname()
                       }
                     </call>
@@ -250,8 +275,10 @@
                   <call function="'CopyFolderByExtension'">
                     { 'location'   : masterHost,
                       'remotehost' : consumer.getHostname(),
-                      'srcfolder'  : '%s/replication/master_backup_online' % masterDataDir,
-                      'destfolder' : '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir),
+                      'srcfolder'  : '%s/replication/master_backup_online' \
+                                     % masterDataDir,
+                      'destfolder' : '%s/%s/replication/master_backup_online' \
+                                     % (consumer.getDir(),relativeDataDir),
                       'extension'  : '*'
                     }
                   </call>
@@ -264,7 +291,8 @@
                       'dsInstanceDn'   : consumer.getRootDn(),
                       'dsInstancePswd' : consumer.getRootPwd(),
                       'taskID'         : 'restore task',
-                      'backupDir'      :  '%s/%s/replication/master_backup_online' % (consumer.getDir(),relativeDataDir)
+                      'backupDir'   : '%s/%s/replication/master_backup_online' \
+                                      % (consumer.getDir(),relativeDataDir)
                     }
                   </call>
                 </sequence>
@@ -278,11 +306,13 @@
                   'dsInstancePort' : master.getPort(), 
                   'dsInstanceDn'   : master.getRootDn(),
                   'dsInstancePswd' : master.getRootPwd(),
-                  'entryToBeAdded' : '%s/replication/tfitter.ldif' % clientDataDir
+                  'entryToBeAdded' : '%s/replication/tfitter.ldif' \
+                                     % clientDataDir
                 }
               </call>
               
-              <!-- Verify the synchronization of the trees among the servers in the topology -->
+              <!-- Verify the synchronization of the trees among the servers in
+                the topology -->
               <call function="'verifyTrees'">
                 [ clientHost, clientPath, master, consumerList, synchroSuffix ]
               </call>
@@ -291,7 +321,8 @@
           </testcase>
           
           <import machine="STAF_LOCAL_HOSTNAME"
-                  file="'%s/testcases/replication/replication_cleanup.xml' % (TESTS_DIR)"/>
+                  file="'%s/testcases/replication/replication_cleanup.xml' 
+                        % (TESTS_DIR)"/>
           <call function="'replication_cleanup'" />
           <call function="'testSuite_Postamble'"/>
         </sequence>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/replication/encryption/encryption.xml b/opendj-sdk/opends/tests/functional-tests/testcases/replication/encryption/encryption.xml
index 2d945c8..c8e3dca 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/replication/encryption/encryption.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/replication/encryption/encryption.xml
@@ -61,80 +61,17 @@
             file="'%s/testcases/replication/replication_setup.xml'
                   % (TESTS_DIR)"/>
           <call function="'replication_setup'">
-            {  'topologyFile'    : '%s/config/replication/3server_topology.txt'\
-                                     % TESTS_DIR,
-              'secureReplication': True  }
+            { 'topologyFile'     : '%s/config/replication/3server_topology.txt'\
+                                   % TESTS_DIR,
+              'secureReplication': True,
+              'dataFile'         : 'Example.ldif'
+            }
           </call>
                                     
           <script>
-            consumer = consumerList[0]              
-            synchroSuffix = master.getSynchronizedSuffixList()[0].getSuffixDn()
+            consumer = consumerList[0]
           </script>        
-            
-          <!-- Load entries into "master" server -->                                
-          <!-- Stop "master" Directory Server -->
-          <call function="'StopDsWithScript'">
-            { 'location'  : masterHost,
-              'dsPath'    : masterPath,
-              'dsHost'    : masterHost,
-              'dsPort'    : master.getPort(),
-              'dsBindDN'  : master.getRootDn(),
-              'dsBindPwd' : master.getRootPwd()
-            }
-          </call>
-              
-          <!-- Import data into "master" Directory Server -->
-          <call function="'ImportLdifWithScript'">
-            { 'location'     : masterHost,
-              'dsPath'       : masterPath,
-              'dsBackEnd'    : 'userRoot',          
-              'dsLdifFile'   : '%s/replication/Example.ldif' % masterDataDir
-            }
-          </call>
-            
-          <!-- Start the Directory Server -->
-          <call function="'StartDsWithScript'">
-            { 'location'  : masterHost,
-              'dsPath'    : masterPath
-            }
-          </call>
-              
-          <!-- Wait for DS to start -->
-          <call function="'isAlive'">
-            { 'location'         : masterHost,
-              'dsPath'           : masterPath,
-              'dsInstanceHost'   : masterHost,
-              'dsInstancePort'   : master.getPort() ,
-              'dsInstanceDn'     : master.getRootDn() ,
-              'dsInstancePswd'   : master.getRootPwd() ,
-              'noOfLoops'        : 10 ,
-              'noOfMilliSeconds' : 2000
-            }
-          </call>                                                                                
-            
-          <!-- Initialise the servers in the topology -->
-<!--            
-          <call function="'initializeReplication'">
-            { 'location'  :  clientHost,
-              'dsPath'  :  clientPath,
-              'sourceInstanceHost'  :  masterHost,
-              'sourceInstancePort'  :  master.getPort(),
-              'replicationDnList'  :  [synchroSuffix]
-            }
-          </call>            
--->    
-          <iterate var="server" in="consumerList">     
-            <call function="'initializeReplication'">
-              { 'location'           : clientHost,
-                'dsPath'             : clientPath,
-                'dsInstanceHost'     : server.getHostname(),
-                'dsInstancePort'     : server.getPort(),
-                'sourceInstanceHost' : masterHost,
-                'sourceInstancePort' : master.getPort(),
-                'replicationDnList'  : [synchroSuffix]
-              }
-            </call>
-          </iterate>            
+
             
                         
           <!--- Test Case information
@@ -260,8 +197,8 @@
           <!--- Test Case information
           #@TestMarker          Replication Encryption Tests
           #@TestName            Replication: Encryption: Delete entry
-          #@TestID                  Delete entry
-          #@TestPurpose        Check entry delete over secured replication
+          #@TestID              Delete entry
+          #@TestPurpose         Check entry delete over secured replication
           #@TestPreamble
           #@TestSteps
           #@TestPostamble
@@ -313,9 +250,9 @@
           #@TestMarker          Replication Encryption Tests
           #@TestName            Replication: Encryption: Modify Entry - add 
                                 binary attribute
-          #@TestID                  Modify Entry - add binary attribute
+          #@TestID              Modify Entry - add binary attribute
           #@TestPurpose         Check that an entry modify is well propagated 
-              by secured replication.
+                                by secured replication.
           #@TestPreamble
           #@TestSteps
           #@TestPostamble

--
Gitblit v1.10.0