From b33a5dc684687d5cea55cb2c47ebe51e1aec274a Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Mon, 22 Sep 2008 10:17:30 +0000
Subject: [PATCH] Issue 3030: refactoring ant build (part II)

---
 opendj-sdk/opends/tests/staf-tests/shared/ant/staf.xml            |  250 +++++++
 opendj-sdk/opends/tests/staf-tests/shared/ant/dependencies.xml    |  149 ++++
 opendj-sdk/opends/tests/staf-tests/shared/ant/usage.xml           |   66 ++
 opendj-sdk/opends/tests/staf-tests/build.bat                      |    3 
 opendj-sdk/opends/tests/staf-tests/shared/ant/opends.xml          |  107 +++
 opendj-sdk/opends/tests/staf-tests/shared/staf/staf-controler.cfg |   18 
 opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml    |  236 +++---
 opendj-sdk/opends/tests/staf-tests/shared/tests/runTests.xml      |   12 
 opendj-sdk/opends/tests/staf-tests/shared/ant/proxy.xml           |   71 ++
 opendj-sdk/opends/tests/staf-tests/shared/staf/staf-slave.cfg     |   15 
 /dev/null                                                         |   30 
 opendj-sdk/opends/tests/staf-tests/build                          |    3 
 opendj-sdk/opends/tests/staf-tests/shared/ant/build.properties    |  110 +++
 opendj-sdk/opends/tests/staf-tests/shared/ant/tests.xml           |  301 +++++++++
 opendj-sdk/opends/tests/staf-tests/shared/ant/user.xml            |  184 +++++
 opendj-sdk/opends/tests/staf-tests/shared/ant/build.xml           |  377 +++++++++++
 opendj-sdk/opends/tests/staf-tests/shared/tests/config.py.stubs   |    6 
 17 files changed, 1,769 insertions(+), 169 deletions(-)

diff --git a/opendj-sdk/opends/tests/staf-tests/build b/opendj-sdk/opends/tests/staf-tests/build
index 96c5a76..6c6dc2e 100755
--- a/opendj-sdk/opends/tests/staf-tests/build
+++ b/opendj-sdk/opends/tests/staf-tests/build
@@ -45,7 +45,8 @@
 fi
 
 OPENDS_LIB=`cd ../../lib;pwd`
+ANT_LIB=$OPENDS_LIB/mail.jar:$OPENDS_LIB/activation.jar
 ANT_HOME=`cd ../..;pwd`/ext/ant
 export ANT_HOME
 # Execute the ant script and pass it any additional command-line arguments.
-$ANT_HOME/bin/ant -lib $OPENDS_LIB/mail.jar:$OPENDS_LIB/activation.jar -f shared/ant/staf-installer.xml ${*}
+$ANT_HOME/bin/ant -lib ${ANT_LIB} -f shared/ant/build.xml ${*}
diff --git a/opendj-sdk/opends/tests/staf-tests/build.bat b/opendj-sdk/opends/tests/staf-tests/build.bat
index 7f9efd3..0316abd 100644
--- a/opendj-sdk/opends/tests/staf-tests/build.bat
+++ b/opendj-sdk/opends/tests/staf-tests/build.bat
@@ -47,6 +47,7 @@
 if not "%*" == "" echo   your parameters=%*
 echo Now running ant ...
 set OPENDS_LIB=%FT_HOME%\..\..\lib
-"%ANT_HOME%\bin\ant" -lib "%OPENDS_LIB%\mail.jar;%OPENDS_LIB%\activation.jar" -f shared\ant\staf-installer.xml %*
+set ANT_LIB="%OPENDS_LIB%\mail.jar;%OPENDS_LIB%\activation.jar"
+"%ANT_HOME%\bin\ant" -lib "%ANT_LIB%" -f shared\ant\staf-installer.xml %*
 
 :end
diff --git a/opendj-sdk/opends/tests/staf-tests/functional-tests/config/config.py b/opendj-sdk/opends/tests/staf-tests/functional-tests/config/config.py
deleted file mode 100644
index 6158864..0000000
--- a/opendj-sdk/opends/tests/staf-tests/functional-tests/config/config.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2006-2008 Sun Microsystems, Inc.
-
-TEST_OS_STRING              = ''
-TEST_JVM_STRING             = ''
-STAF_LOCAL_HOSTNAME         = 'localhost'
-STAF_REMOTE_HOSTNAME        = 'localhost'
-TMPDIR                      = '/tmp'
-PSWDFILE                    = '%s/password' % TMPDIR
-OPENDSDIR                   = '/path/to/opends'
-OPENDSNAME                  = 'OpenDS-1.0.0'
-ZIPNAME                     = '%s.zip' % OPENDSNAME
-ZIPPATH                     = '%s/build/package' % OPENDSDIR
-TESTS_ROOT                  = '%s/tests' % OPENDSDIR
-TESTS_DIR                   = '%s/functional-tests' % TESTS_ROOT
-TESTS_SHARED_DIR            = '%s/shared' % TESTS_DIR
-TESTS_FUNCTIONS_DIR         = '%s/shared/functions' % TESTS_ROOT
-TESTS_DATA_DIR              = '%s/data' % TESTS_SHARED_DIR
-TESTS_JAVA_DIR              = '%s/shared/java' % TESTS_ROOT
-DIRECTORY_INSTANCE_DN       = 'cn=Directory Manager'
-DIRECTORY_INSTANCE_PSWD     = 'password'
-DIRECTORY_INSTANCE_DIR      = '%s' % TMPDIR
-DIRECTORY_INSTANCE_HOST     = 'localhost'
-DIRECTORY_INSTANCE_PORT     = '1389'
-DIRECTORY_INSTANCE_SSL_PORT = '1636'
-DIRECTORY_INSTANCE_SFX      = 'dc=com'
-DIRECTORY_INSTANCE_BE       = 'userRoot'
-JAVA_HOME                   = '/path/to/jdk'
-LOCAL_JAVA_HOME             = JAVA_HOME
-LOGS_ROOT                   = '%s' % TMPDIR
-LOGS_URI                    = ''
-SEND_MAIL_AFTER_TEST_RUN    = 'false'
-SEND_MAIL_TO                = ''
-WC_TYPE                     = 'apache-tomcat'
-WC_VERSION                  = '6.0.14'
-WC_ZIPPATH                  = '%s/tests/ext' % OPENDSDIR
-WC_ZIPNAME                  = '%s-%s.zip' % (WC_TYPE, WC_VERSION)
-WC_DIRECTORY                = '%s' % TMPDIR
-WC_PORT                     = '9000'
-WC_SSL_PORT                 = '9001'
-WC_HOST                     = 'localhost'
-DSML_WARNAME                = 'OpenDS-1.0.0-DSML.war'
-DSML_WARPATH                = '%s/build/package/%s' % (OPENDSDIR, DSML_WARNAME)
-SNMP_OPENDS_JARFILE         = '%s/lib/extensions/snmp-mib2605.jar' % OPENDSNAME
-SNMP_OPENDMK_LIBDIR         = '/path/to/opendmk/lib'
-SNMP_OPENDMK_JARFILE        = '%s/jdmkrt.jar' % SNMP_OPENDMK_LIBDIR
-SNMP_PORT                   = '8085'
-SNMP_TRAP_PORT              = '8086'
-VERBOSE_MODE                = 'False'
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/Linux.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/Linux.properties
deleted file mode 100644
index 57aaf9f..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/Linux.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-bits.staf.archive=STAF323-setup-linux.jar
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS-sparc.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS-sparc.properties
deleted file mode 100644
index 2c6f265..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS-sparc.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-bits.staf.archive=STAF322-setup-solaris-sparc.jar
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS-x86.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS-x86.properties
deleted file mode 100644
index 95a6fc1..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS-x86.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-bits.staf.archive=STAF323-setup-solaris-x86.jar
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/build.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/build.properties
new file mode 100644
index 0000000..8957f75
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/build.properties
@@ -0,0 +1,110 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at
+# trunk/opends/resource/legal-notices/OpenDS.LICENSE
+# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at
+# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+# add the following below this CDDL HEADER, with the fields enclosed
+# information:
+#      Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+#      Copyright 2007-2008 Sun Microsystems, Inc.
+
+## These values can be overrided using the user.properties file
+
+# Log directory section
+logs.dir=${basedir}${file.separator}temp${file.separator}logs
+
+# Repository section
+repository.dir=${basedir}${file.separator}temp${file.separator}repository
+
+# OpenDS section
+default.opends.dir=${project.home}${file.separator}build${file.separator}package
+default.opends.zip=${product.name}.zip
+opends.dir=${default.opends.dir}
+opends.zip=${default.opends.zip}
+
+# Java section
+java.path=${java.home}
+
+# Shared folder
+shared.dir=${basedir}${file.separator}shared
+
+# Proxy section
+proxy.enabled=n
+proxy.host=webcache.central.sun.com
+proxy.port=8080
+proxy.user=
+proxy.pass=
+
+# Archives section
+archives.dir=${repository.dir}${file.separator}archives
+staf.url=http://superb-east.dl.sourceforge.net/sourceforge/staf
+staf.version=330
+## staf.archive value depends on os
+stax.version=333
+stax.archive=STAXV${stax.version}.zip
+email.version=331
+email.archive=EmailV${email.version}.zip
+event.version=311
+event.archive=EventV${event.version}.zip
+eventmanager.version=332
+eventmanager.archive=EventManagerV${eventmanager.version}.zip
+http.version=300
+http.archive=HTTPV${http.version}.zip
+tomcat.version=6.0.14
+tomcat.url=http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcat.version}/bin
+tomcat.archive=apache-tomcat-${tomcat.version}.zip
+
+# STAF section
+staf.install.dir=${repository.dir}${file.separator}install${file.separator}staf-${os.myname}
+staf.port=6500
+staf.config.dir=${repository.dir}${file.separator}configs
+staf.shared.dir=${shared.dir}${file.separator}staf
+staf.config.stubs=${staf.shared.dir}${file.separator}staf-${staf.type}.cfg
+staf.config.file=${staf.config.dir}${file.separator}staf-${staf.type}-${host.name}.cfg
+staf.bin.dir=${staf.install.dir}${file.separator}bin
+staf.daemon=${staf.bin.dir}${file.separator}STAFProc${extension.binary}
+staf.executable=${staf.bin.dir}${file.separator}STAF${extension.binary}
+staf.email.send=false
+staf.email.to=
+
+# Tests section
+tests.dir=${basedir}${file.separator}${tests.type}
+tests.shared.dir=${shared.dir}${file.separator}tests
+tests.config.stubs=${tests.shared.dir}${file.separator}config.py.stubs
+tests.config.file=config-${host.name}.py
+tests.run.dir=${logs.dir}${file.separator}${tests.type}${file.separator}run
+tests.tmp.dir=${logs.dir}${file.separator}${tests.type}${file.separator}tmp
+tests.xml=${tests.shared.dir}${file.separator}runTestJob.xml
+opends.port.ldap=1389
+opends.port.ldaps=1636
+opends.port.jmx=1689
+opends.admin.dn=cn=myself
+opends.admin.pwd=password
+snmp.opendmk.lib.dir=
+test.plan.custom=${basedir}${file.separator}${tests.type}${file.separator}testcases${file.separator}run-custom-suites.dat
+test.plan.default=${basedir}${file.separator}${tests.type}${file.separator}testcases${file.separator}run-default-suites.dat
+test.plan.list=aci,backends,clu,core,dsconfig,dsml,groups,i18n,indexes,logging,monitoring,plugins,privileges,quickstart,replication,schema,security,setup,snmp,tasks,virtualAttributes
+
+# Email section
+email.enabled=n
+email.to=${user.name}@${host.name}
+email.from=${user.name}@${host.name}
+email.server.host=${host.name}
+email.server.port=25
+email.server.user=
+email.server.pwd=
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/build.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/build.xml
new file mode 100644
index 0000000..0d2aead
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/build.xml
@@ -0,0 +1,377 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+<project name="opends-staf-tests" basedir="../.." default="usage">
+
+  <description>
+    Installer ant file for the staf platform
+    This allows tests that need a running instance of staf to easily
+    get one and hides all the complexity under the hood
+  </description>
+
+
+  <!-- ################## -->
+  <!-- # ANT PROPERTIES # -->
+  <!-- ################## -->
+
+  <!-- Display ant properties -->
+  <target name="properties">
+    <echoproperties/>
+  </target>
+
+
+  <!-- ######## -->
+  <!-- # INIT # -->
+  <!-- ######## -->
+
+  <!-- Initialise variables -->
+  <target name="global-init">
+    <!-- Define project.home variable -->
+    <dirname file="${basedir}/.." property="project.home"/>
+
+    <!-- Default value for product.name variable -->
+    <property file="${project.home}/PRODUCT"/>
+    <property name="product.name"
+      value="${SHORT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}"/>
+
+    <!-- Define antfile.dir variable -->
+    <property name="antfile.dir" value="${basedir}/shared/ant"/>
+
+    <!-- Define antfile.dir variable -->
+    <property name="tmp.dir" value="${java.io.tmpdir}/temp_files"/>
+
+    <!-- Load ant-contrib -->
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath>
+        <fileset dir="${project.home}/ext/ant/lib">
+          <include name="**/*.jar"/>
+        </fileset>
+      </classpath>
+    </taskdef>
+
+    <!-- Check if the current platform is supported -->
+    <switch value="${os.name}">
+      <case value="SunOS">
+        <!-- Solaris system -->
+        <switch value="${os.arch}">
+          <case value="sparc">
+            <!-- Solaris sparc -->
+            <exec executable="isainfo" output="os.bits">
+              <arg value="-b"/>
+            </exec>
+            <switch value="${os.bits}">
+              <case value="32">
+                <!-- Solaris sparc 32 bit -->
+                <property name="os.myname" value="solaris-sparc"/>
+              </case>
+              <case value="64">
+                <!-- Solaris sparc 64 bit -->
+                <property name="os.myname" value="solaris-sparc64"/>
+              </case>
+            </switch>
+          </case>
+          <case value="x86">
+            <!-- Solaris x86 -->
+            <property name="os.myname" value="solaris-x86"/>
+          </case>
+          <case value="amd64">
+            <!-- Solaris amd64 -->
+            <property name="os.myname" value="solaris-x64-64"/>
+          </case>
+        </switch>
+
+        <exec executable="uname" outputproperty="host.name">
+            <arg line="-n"/>
+        </exec>
+        <property name="extension.binary" value=""/>
+        <property name="extension.shell" value=""/>
+        <property name="var.path" value="PATH"/>
+      </case>
+      <case value="Linux">
+        <!-- Linux system -->
+        <switch value="${os.arch}">
+          <case value="i386">
+            <!-- Linux i386 -->
+            <property name="os.myname" value="linux"/>
+          </case>
+          <case value="amd64">
+            <!-- Linux amd64 -->
+            <property name="os.myname" value="linux-amd64"/>
+          </case>
+        </switch>
+
+        <exec executable="uname" outputproperty="host.name">
+            <arg line="-n"/>
+        </exec>
+        <property name="extension.binary" value=""/>
+        <property name="extension.shell" value=""/>
+        <property name="var.path" value="PATH"/>
+      </case>
+      <default>
+        <if>
+          <equals arg1="${os.family}" arg2="windows"/>
+          <then>
+            <!-- Windows system -->
+            <property name="os.myname" value="win32"/>
+
+            <property name="host.name" value="${env.COMPUTERNAME}"/>
+            <property name="extension.binary" value=".exe"/>
+            <property name="extension.shell" value=".bat"/>
+            <property name="var.path" value="Path"/>
+          </then>
+          <else>
+            <fail>"Unsupported platform."</fail>
+          </else>
+        </if>
+      </default>
+    </switch>
+
+    <!-- Default value for staf.type -->
+    <if>
+      <not>
+        <isset property="staf.type"/>
+      </not>
+      <then>
+        <property name="staf.type" value="controler"/>
+      </then>
+    </if>
+
+    <!-- Default value for tests.type -->
+    <if>
+      <not>
+        <isset property="tests.type"/>
+      </not>
+      <then>
+        <property name="tests.type" value="functional-tests"/>
+      </then>
+    </if>
+
+    <!-- User-defined values -->
+    <property file="${basedir}/user.properties"/>
+
+    <!-- Default values for build environment -->
+    <property file="${antfile.dir}/build.properties"/>
+
+    <!-- Set value for staf.archive and staf.lib.dir variables -->
+    <if>
+      <equals arg1="${os.family}" arg2="windows"/>
+      <then>
+        <!-- Windows system -->
+        <property name="staf.archive"
+                  value="STAF${staf.version}-setup-${os.myname}.exe"/>
+        <property name="staf.lib.dir" value="${staf.install.dir}${file.separator}bin"/>
+      </then>
+      <else>
+        <!-- Other systems -->
+        <property name="staf.archive"
+                  value="STAF${staf.version}-${os.myname}.tar.gz"/>
+        <property name="staf.lib.dir" value="${staf.install.dir}${file.separator}lib"/>
+      </else>
+    </if>
+  </target>
+
+  <!-- ######### -->
+  <!-- # USAGE # -->
+  <!-- ######### -->
+
+  <!-- Display usage -->
+  <target name="usage"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/usage.xml" target="usage"/>
+  </target>
+
+
+  <!-- ############# -->
+  <!-- # CONFIGURE # -->
+  <!-- ############# -->
+
+  <!-- Configure user variables -->
+  <target name="user-configure"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/user.xml" target="configure"/>
+  </target>
+
+  <!-- Unconfigure user variables -->
+  <target name="user-unconfigure"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/user.xml" target="unconfigure"/>
+  </target>
+
+
+  <!-- ######### -->
+  <!-- # PROXY # -->
+  <!-- ######### -->
+
+  <!-- Check proxy -->
+  <target name="proxy-check"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/proxy.xml" target="check"/>
+  </target>
+
+  <!-- Set proxy -->
+  <target name="proxy-set"
+          depends="global-init,proxy-check">
+    <ant antfile="${antfile.dir}/proxy.xml" target="set"/>
+  </target>
+
+
+  <!-- ############ -->
+  <!-- # DOWNLOAD # -->
+  <!-- ############ -->
+
+  <!-- Download dependencies -->
+  <target name="dependencies-download"
+          depends="global-init,proxy-set">
+    <ant antfile="${antfile.dir}/dependencies.xml" target="download"/>
+  </target>
+
+  <!-- Remove current dependencies -->
+  <target name="dependencies-remove"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/dependencies.xml" target="remove"/>
+  </target>
+
+  <!-- Remove old dependencies -->
+  <target name="dependencies-removeold"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/dependencies.xml" target="removeold"/>
+  </target>
+
+  <!-- Remove all dependencies -->
+  <target name="dependencies-removeall"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/dependencies.xml" target="removeall"/>
+  </target>
+
+
+  <!-- ######## -->
+  <!-- # STAF # -->
+  <!-- ######## -->
+
+  <!-- Install STAF and STAF services -->
+  <target name="staf-install"
+          depends="global-init,dependencies-download">
+    <ant antfile="${antfile.dir}/staf.xml" target="install"/>
+  </target>
+
+  <!-- Uninstall STAF and STAF services -->
+  <target name="staf-uninstall"
+          depends="global-init,staf-stop">
+    <ant antfile="${antfile.dir}/staf.xml" target="uninstall"/>
+  </target>
+
+  <!-- Start STAF -->
+  <target name="staf-start"
+          depends="global-init,staf-install">
+    <ant antfile="${antfile.dir}/staf.xml" target="start"/>
+  </target>
+
+  <target name="staf-start-slave">
+    <property name="staf.type" value="slave"/>
+    <antcall target="staf-start"/>
+  </target>
+
+  <target name="staf-start-controler">
+    <property name="tests.type" value="controler"/>
+    <antcall target="staf-start"/>
+  </target>
+
+  <!-- Stop STAF -->
+  <target name="staf-stop"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/staf.xml" target="stop"/>
+  </target>
+
+  <!-- Status STAF -->
+  <target name="staf-status"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/staf.xml" target="status"/>
+  </target>
+
+   <!-- Start STAF GUI -->
+  <target name="staf-gui"
+          depends="global-init,staf-start">
+    <ant antfile="${antfile.dir}/staf.xml" target="gui"/>
+  </target>
+
+  <!-- Display STAF JVM logs -->
+  <target name="staf-jvmlogs"
+          depends="global-init,staf-start">
+    <ant antfile="${antfile.dir}/staf.xml" target="jvmlogs"/>
+  </target>
+
+
+  <!-- ######### -->
+  <!-- # TESTS # -->
+  <!-- ######### -->
+
+  <!-- Configure tests to run -->
+  <target name="tests-configure"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/tests.xml" target="configure"/>
+  </target>
+
+  <!-- Configure functional tests to run -->
+  <target name="tests-func-configure">
+    <property name="tests.type" value="functional-tests"/>
+    <antcall target="tests-configure"/>
+  </target>
+
+  <!-- Configure stress tests to run -->
+  <target name="tests-stress-configure">
+    <property name="tests.type" value="stress-tests"/>
+    <antcall target="tests-configure"/>
+  </target>
+
+  <!-- Run tests -->
+  <target name="tests-run"
+          depends="global-init,opends-build,staf-start">
+    <ant antfile="${antfile.dir}/tests.xml" target="run"/>
+  </target>
+
+  <!-- Run functional tests -->
+  <target name="tests-func-run">
+    <property name="tests.type" value="functional-tests"/>
+    <antcall target="tests-run"/>
+  </target>
+
+  <!-- Run stress tests -->
+  <target name="tests-stress-run">
+    <property name="tests.type" value="stress-tests"/>
+    <antcall target="tests-run"/>
+  </target>
+
+
+  <!-- ########## -->
+  <!-- # OPENDS # -->
+  <!-- ########## -->
+
+  <!-- Build OpenDS zip -->
+  <target name="opends-build"
+          depends="global-init">
+    <ant antfile="${antfile.dir}/opends.xml" target="build"/>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/dependencies.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/dependencies.xml
new file mode 100644
index 0000000..591f2ca
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/dependencies.xml
@@ -0,0 +1,149 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+<project name="dependencies">
+  <description>
+    Manage dependencies.
+  </description>
+
+  <!-- Download all the dependencies -->
+  <target name="download">
+    <mkdir dir="${archives.dir}"/>
+
+    <!-- STAF and other services -->
+    <var name="list" value="${staf.archive},${stax.archive},${email.archive}"/>
+    <var name="list" value="${list},${event.archive},${eventmanager.archive}"/>
+    <var name="list" value="${list},${http.archive},${tomcat.archive}"/>
+    <mkdir dir="${tmp.dir}"/>
+    <for list="${list}" param="archive">
+      <sequential>
+        <var name="rc" unset="true"/>
+        <var name="ext" unset="true"/>
+        <var name="url" unset="true"/>
+
+        <if>
+          <not>
+            <available file="${staf.install.dir}/bin/STAF.cfg"/>
+          </not>
+          <then>
+            <trycatch property="error" reference="referror">
+              <try>
+                <propertyregex property="ext"
+                               input="@{archive}"
+                               regexp=".*\.(.*)"
+                               select="\1"
+                               casesensitive="false"/>
+
+                <switch value="${ext}">
+                  <case value="gz">
+                    <!-- gz files -->
+                    <gunzip src="${archives.dir}/@{archive}"
+                            dest="${tmp.dir}"/>
+                  </case>
+                  <case value="zip">
+                    <!-- zip files -->
+                    <unzip src="${archives.dir}/@{archive}"
+                           dest="${tmp.dir}"/>
+                  </case>
+                  <default>
+                  </default>
+                </switch>
+
+                <var name="rc" value="0"/>
+              </try>
+
+              <catch>
+                <echo>ERROR: ${error}</echo>
+                <var name="rc" value="-1"/>
+              </catch>
+            </trycatch>
+          </then>
+        </if>
+
+        <var name="rc" value="0"/>
+        <if>
+          <or>
+            <not>
+              <equals arg1="${rc}" arg2="0"/>
+            </not>
+            <not>
+              <available file="${archives.dir}/@{archive}"/>
+            </not>
+          </or>
+          <then>
+            <if>
+              <equals arg1="@{archive}" arg2="${tomcat.archive}"/>
+              <then>
+                <!-- Tomcat url -->
+                <var name="url" value="${tomcat.url}"/>
+              </then>
+              <else>
+                <!-- Other url -->
+                <var name="url" value="${staf.url}"/>
+              </else>
+            </if>
+            <get src="${url}/@{archive}"
+                 dest="${archives.dir}/@{archive}"/>
+          </then>
+        </if>
+      </sequential>
+    </for>
+    <delete includeemptydirs="true">
+       <fileset dir="${tmp.dir}" includes="**/*"/>
+    </delete>
+  </target>
+
+  <!-- Remove current dependencies -->
+  <target name="remove">
+    <delete dir="${archives.dir}">
+      <include name="STAF${staf.version}*"/>
+      <include name="${stax.archive}"/>
+      <include name="${email.archive}"/>
+      <include name="${event.archive}"/>
+      <include name="${eventmanager.archive}"/>
+      <include name="${http.archive}"/>
+      <include name="${tomcat.archive}"/>
+    </delete>
+  </target>
+
+  <!-- Remove old dependencies -->
+  <target name="removeold">
+    <delete dir="${archives.dir}">
+      <exclude name="STAF${staf.version}*"/>
+      <exclude name="${stax.archive}"/>
+      <exclude name="${email.archive}"/>
+      <exclude name="${event.archive}"/>
+      <exclude name="${eventmanager.archive}"/>
+      <exclude name="${http.archive}"/>
+      <exclude name="${tomcat.archive}"/>
+    </delete>
+  </target>
+
+  <!-- Remove all the dependencies -->
+  <target name="removeall">
+    <delete dir="${archives.dir}"/>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/opends.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/opends.xml
new file mode 100644
index 0000000..6e88f3b
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/opends.xml
@@ -0,0 +1,107 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+<project name="opends">
+
+  <description>
+    Build OpenDS archive.
+  </description>
+
+  <!-- Build OpenDS archive -->
+  <target name="build">
+    <if>
+      <and>
+       <equals arg1="${opends.dir}" arg2="${default.opends.dir}"/>
+       <equals arg1="${opends.zip}" arg2="${default.opends.zip}"/>
+      </and>
+      <then>
+        <loadproperties srcFile="${project.home}/build.properties">
+          <filterchain>
+            <linecontains>
+              <contains value="opendmk."/>
+            </linecontains>
+          </filterchain>
+        </loadproperties>
+
+        <if>
+          <not>
+            <available file="${opends.dir}/${opends.zip}"/>
+          </not>
+          <then>
+            <if>
+              <and>
+                <not>
+                  <equals arg1="${snmp.opendmk.lib.dir}" arg2=""/>
+                </not>
+                <available file="${snmp.opendmk.lib.dir}"/>
+              </and>
+              <then>
+                <echo>Build ${opends.zip} with SNMP</echo>
+                <replace file="${project.home}/build.properties"
+                         value="opendmk.lib.dir=${snmp.opendmk.lib.dir}">
+                  <replacefilter token="opendmk.lib.dir="/>
+                </replace>
+                <property name="package.rebuild" value="true"/>
+              </then>
+              <else>
+                <echo>Build ${opends.zip} without SNMP</echo>
+                <property name="package.rebuild" value="true"/>
+              </else>
+            </if>
+          </then>
+          <else>
+            <if>
+              <and>
+                <not>
+                  <equals arg1="${snmp.opendmk.lib.dir}" arg2=""/>
+                </not>
+                <available file="${snmp.opendmk.lib.dir}"/>
+                <equals arg1="${opendmk.lib.dir}" arg2=""/>
+              </and>
+              <then>
+                <echo>Rebuild ${opends.zip} with SNMP</echo>
+                <replace file="${project.home}/build.properties"
+                         value="opendmk.lib.dir=${snmp.opendmk.lib.dir}">
+                  <replacefilter token="opendmk.lib.dir="/>
+                </replace>
+                <property name="package.rebuild" value="true"/>
+              </then>
+            </if>
+          </else>
+        </if>
+
+        <if>
+          <isset property="package.rebuild"/>
+          <then>
+            <ant antfile="${project.home}/build.xml"
+                 target="package"
+                 inheritAll="false"/>
+          </then>
+        </if>
+      </then>
+    </if>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/proxy.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/proxy.xml
new file mode 100644
index 0000000..5c92cd1
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/proxy.xml
@@ -0,0 +1,71 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+
+<project name="proxy">
+
+  <description>
+    Proxy configuration.
+  </description>
+
+  <!-- Check proxy configuration -->
+  <target name="check">
+    <if>
+      <equals arg1="${proxy.enabled}" arg2="y"/>
+      <then>
+        <echo>Checking for proxy [${proxy.host}:${proxy.port}]</echo>
+        <echo>as user [${proxy.user}].</echo>
+        <fail message="Proxy [${proxy.host}] is unreachable.">
+          <condition>
+            <and>
+              <not>
+                <http url="${staf.url}"/>
+              </not>
+              <not>
+                <isreachable host="${proxy.host}" timeout="5"/>
+              </not>
+            </and>
+          </condition>
+        </fail>
+        <echo>Proxy detected.</echo>
+      </then>
+    </if>
+  </target>
+
+  <!-- Set proxy configuration -->
+  <target name="set">
+    <if>
+      <equals arg1="${proxy.enabled}" arg2="y"/>
+      <then>
+        <echo>Configuring proxy...</echo>
+        <setproxy proxyhost="${proxy.host}"
+                  proxyport="${proxy.port}"
+                  proxyuser="${proxy.user}"
+                  proxypassword="${proxy.pass}"/>
+      </then>
+    </if>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/staf-installer.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/staf-installer.properties
deleted file mode 100644
index c17b1f7..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/staf-installer.properties
+++ /dev/null
@@ -1,114 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-temp.dir=${project.home}${file.separator}tests${file.separator}staf-tests${file.separator}temp
-
-# Global section - top
-host.name=localhost
-# Global section - bottom
-
-# Staf section - top
-staf.home=${temp.dir}${file.separator}functional-run
-staf.installer.dir=${basedir}${file.separator}shared${file.separator}staf
-staf.install.dir=${staf.home}${file.separator}staf
-staf.bin.dir=${staf.install.dir}${file.separator}bin
-staf.config.dir=${staf.home}${file.separator}config
-staf.config.file=functional-tests.cfg
-staf.config=${staf.config.dir}${file.separator}${staf.config.file}
-staf.config.stubs=${staf.installer.dir}${file.separator}${staf.config.file}
-staf.tmp.dir=${staf.home}${file.separator}tmp
-staf.logs.dir=${staf.home}${file.separator}logs
-#
-staf.email.send=false
-staf.email.to=
-
-daily.build.time=213000
-daily.build.url=http://www.opends.org/daily-builds/
-
-## TCP port on which to configure staf to listen
-## leave as is unless this port is already in use on your test machine
-staf.port.default=6500
-staf.port=${staf.port.default}
-# Staf section - bottom
-
-#opends section - top
-opends.port.ldap=1389
-opends.port.ldaps=1636
-opends.port.jmx=1689
-opends.admin.dn=cn=myself
-opends.admin.pwd=password
-# opends section - bottom
-
-# email section - top
-email.enabled=n
-email.to=${user.name}@${host.name}
-email.from=${user.name}@${host.name}
-email.server.host=${host.name}
-email.server.port=25
-email.server.user=
-email.server.pwd=
-# email section - bottom
-
-# Downloader section - top
-## where to download the staf bits before install
-bits.download.dir=${staf.home}${file.separator}staf-bits
-bits.download.url=http://superb-east.dl.sourceforge.net/sourceforge/staf
-bits.email.archive=EmailV320.zip
-bits.event.archive=EventV310.zip
-bits.eventmanager.archive=EventManagerV322.zip
-bits.stax.archive=STAXV321.zip
-bits.http.archive=HTTPV300Beta13.zip
-## where to download tomcat bits before install
-bits.webcontainer.download.dir=${staf.home}${file.separator}staf-bits
-bits.tomcat.download.url=http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin
-bits.tomcat.archive=apache-tomcat-6.0.14.zip
-# Downloader section - bottom
-
-
-# Proxy section - top
-## set to match your own proxy if any
-proxy.host=webcache.central.sun.com
-proxy.port=8080
-proxy.user=
-proxy.pass=
-# Proxy section - bottom
-
-# Tests section - top
-tests.dir=${basedir}${file.separator}functional-tests
-tests.run.dir=${staf.home}${file.separator}run
-tests.config.dir=${tests.dir}${file.separator}config
-tests.config.file=config.py
-tests.config.stubs=${basedir}${file.separator}shared${file.separator}tests${file.separator}${tests.config.file}.stubs
-tests.config=${tests.config.dir}${file.separator}${tests.config.file}
-tests.config.backup=${tests.config}.orig
-tests.xml=${basedir}${file.separator}shared${file.separator}tests${file.separator}runTestJob.xml
-# Tests section - bottom
-
-# test plan customization - top  <property name="test.plan.file" value="${basedir}/testcases/run-custom-suites.dat" />
-test.plan.list=sample,security,aci,clu,privileges,dsconfig,backends,core,schema,replication,indexes,groups,logging,plugins,tasks,virtualAttributes,monitoring,dsml,setup,snmp,i18n
-test.plan.dir=functional-tests${file.separator}testcases
-test.plan.custom=${test.plan.dir}/run-custom-suites.dat
-test.plan.default=${test.plan.dir}/run-default-suites.dat
-# test plan customization - bottom
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/staf-installer.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/staf-installer.xml
deleted file mode 100644
index 88df407..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/staf-installer.xml
+++ /dev/null
@@ -1,1365 +0,0 @@
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License").  You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- !      Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- !
- !      Copyright 2008 Sun Microsystems, Inc.
- ! -->
-
-<project name="opends-staf-installer" basedir="../.." default="usage">
-  <description>
-    Installer ant file for the staf platform
-    This allows tests that need a running instance of staf to easily
-    get one and hides all the complexity under the hood
-  </description>
-  <dirname file="${basedir}/.." property="project.home"/>
-  
-  <!-- installer wide settings - top -->
-    <property file="${project.home}/PRODUCT"/>
-    <property name="product.name"
-              value="${SHORT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}" />
-    <!-- load user properties first if they have been set -->
-    <property file="user.properties"/>
-    <!-- this is the file where the default values are defined                -->
-    <property file="shared/ant/staf-installer.properties"                  />
-    
-    <!-- Define the os name in case we're on windows
-         why do this ?
-         the jvm returns different strings for os.name on different flavors
-         of windows ('Windows 2000', 'Windows 2003', 'Windows XP', ...) 
-    -->
-    <condition property="os.myname" value="windows" else="${os.name}">
-      <os family="windows"/>
-    </condition>
-    
-    <!-- Check if the current platform is supported                           -->
-    <condition property="platform.supported">
-      <available file="shared/ant/${os.myname}.properties"/>
-    </condition>
-    
-    <!-- Load architecture specific properties
-        loading this one first allows to override common properties with platform
-        specific properties
-    -->
-    <property file="shared/ant/${os.myname}-${os.arch}-${sun.arch.data.model}.properties" />
-    <property file="shared/ant/${os.myname}-${os.arch}.properties"         />
-    <!-- Load properties common to the OS regardless of architecture          -->
-    <property file="shared/ant/${os.myname}.properties"                    />
-
-    <!-- Daily build properties -->
-    <tstamp>
-      <format property="todays.date" pattern="yyyyMMdd"/>
-    </tstamp>
-    <tstamp>
-      <format property="yesterdays.date" pattern="yyyyMMdd" offset="-24" unit="hour"/>
-    </tstamp>
-    <condition property="daily.date" value="${todays.date}" else="${yesterdays.date}">
-      <http url="${daily.build.url}/${todays.date}${daily.build.time}/${SHORT_NAME}/build.jdk5/package/${product.name}.zip"/>
-    </condition>
-    <property name="daily.package.dir" 
-              value="${staf.home}/daily-builds/${daily.date}"/>
-    <property name="daily.package" 
-              value="${daily.package.dir}/${product.name}.zip"/>
-    <property name="daily.package.url" 
-              value="${daily.build.url}/${daily.date}${daily.build.time}/${SHORT_NAME}/build.jdk5/package/${product.name}.zip"/>
-     
-  <!-- installer wide settings - bottom  -->
-  
-<!-- Usage section - top     -->
-  <!-- Default target => how to use this file -->
-  <target name="usage"
-          description="Gives a message that helps using this file">
-    <echo>Installer usage:
- main targets=
-   usage      : print this message
-   status     : report if the staf is installed and running
-   bootstrap  : install and start the framework
-   run-tests  : run the functional tests (requires staf installed and started)
-   run-daily  : run the functional tests on today's build
-   wipeout    : stop and uninstall the framework
- gui tools:
-   gui        : start the STAX gui
-   jvm-log    : start the STAF jvm log viewer
- subtargets=
-   download   : download the archives necessary to install the staf
-   install    : install the staf
-   start      : start the staf unless it is already running
-   stop       : stop the staf if it is already running
-   uninstall  : uninstall the staf if it is installed</echo>
-  </target>
-<!-- Usage section - bottom  -->
-  
-<!-- Downloader section - top    -->
-  <target name="download-do-prepare-check-proxy" unless="proxy.disabled">
-    <echo>Checking for proxy [${proxy.host}:${proxy.port}] as user [${proxy.user}].</echo>
-    <echo>Note: If these values do not match your environment, </echo>
-    <echo>      please use the 'configure' target</echo>
-    <condition property="proxy.enabled">
-      <and>
-        <not>
-          <http url="${bits.download.url}"/>
-        </not>
-        <isreachable host="${proxy.host}" timeout="5"/>
-      </and>
-    </condition>
-  </target>
-  <target name="download-do-prepare-set-proxy" if="proxy.enabled" >
-    <echo>Proxy detected. Configuring.</echo>
-    <setproxy 
-      proxyhost="${proxy.host}" 
-      proxyport="${proxy.port}"
-      proxyuser="${proxy.user}" 
-      proxypassword="${proxy.pass}"/>
-  </target>
-  <target 
-    name="download-do-prepare" 
-    depends="download-do-prepare-check-proxy,download-do-prepare-set-proxy">
-    <mkdir dir="${bits.download.dir}" />
-  </target>  
-  <target name="download-do-failed" unless="bits.all.downloaded" >
-    <echo>Couldn't get the bits, sorry.</echo>
-  </target>
-  <target name="download-do-succeeded" if="bits.all.downloaded" >
-    <echo>Successfully downloaded all the archives needed for installation.</echo>
-  </target>
-  
-  <target name="download-do-get-staf"  unless="bits.staf.downloaded.before">
-    <get src="${bits.download.url}/${bits.staf.archive}" 
-         dest="${bits.download.dir}/${bits.staf.archive}" />
-    <property name="bits.staf.downloaded" value="true"/>
-  </target>
-  
-  <target name="download-do-get-tomcat" unless="bits.tomcat.downloaded.before">
-    <get src="${bits.tomcat.download.url}/${bits.tomcat.archive}"
-         dest="${bits.webcontainer.download.dir}/${bits.tomcat.archive}" />
-    <property name="bits.tomcat.downloaded" value="true"/>
-  </target>
-
-  <target name="download-do-get-services"  unless="bits.services.downloaded.before">
-    <if>
-      <not>
-        <available file="${bits.download.dir}/${bits.email.archive}" />
-      </not>
-      <then>
-        <get src="${bits.download.url}/${bits.email.archive}" 
-             dest="${bits.download.dir}/${bits.email.archive}" />
-      </then>
-    </if>
-    <if>
-      <not>
-        <available file="${bits.download.dir}/${bits.event.archive}" />
-      </not>
-      <then>
-        <get src="${bits.download.url}/${bits.event.archive}" 
-             dest="${bits.download.dir}/${bits.event.archive}" />
-      </then>
-    </if>
-    <if>
-      <not>
-        <available file="${bits.download.dir}/${bits.eventmanager.archive}" />
-      </not>
-      <then>
-        <get src="${bits.download.url}/${bits.eventmanager.archive}" 
-             dest="${bits.download.dir}/${bits.eventmanager.archive}" />
-      </then>
-    </if>
-    <if>
-      <not>
-        <available file="${bits.download.dir}/${bits.stax.archive}" />
-      </not>
-      <then>
-        <get src="${bits.download.url}/${bits.stax.archive}" 
-             dest="${bits.download.dir}/${bits.stax.archive}" />
-      </then>
-    </if>
-    <if>
-      <not>
-        <available file="${bits.download.dir}/${bits.http.archive}" />
-      </not>
-      <then>
-        <get src="${bits.download.url}/${bits.http.archive}" 
-             dest="${bits.download.dir}/${bits.http.archive}" />
-      </then>
-    </if>
-    <property name="bits.services.downloaded" value="true" />
-  </target>
-  
-  <target name="download-do" 
-          if="platform.supported" 
-          depends="status-do,download-do-prepare,download-do-get-staf,download-do-get-services,download-do-get-tomcat">
-    <condition property="bits.all.downloaded" >
-      <and>
-        <or>
-          <isset property="bits.staf.downloaded"/>
-          <isset property="bits.staf.downloaded.before" />
-        </or>
-        <or>
-          <isset property="bits.tomcat.downloaded"/>
-          <isset property="bits.tomcat.downloaded.before" />
-        </or>
-        <or>
-          <isset property="bits.services.downloaded"/>
-          <isset property="bits.services.downloaded.before" />
-        </or>
-      </and>
-    </condition>
-    <antcall target="download-do-succeeded" />
-    <antcall target="download-do-failed"    />
-  </target>
-  
-  <target name="download-dont" unless="platform.supported">
-    <echo>${os.myname}-${os.arch} is not a supported platform</echo>
-  </target>
-  
-  <target name="download" 
-          depends="status-do,download-do,download-dont"
-          description="Download the bits necessary to install staf"/>
-
-  <target name="download-daily" depends="status-do,download-do-prepare" unless="daily.package.downloaded">
-    <mkdir dir="${daily.package.dir}"/>
-    <get src="${daily.package.url}"
-         dest="${daily.package}"/>
-  </target>
-  
-  <target name="remove-bits">
-    <delete dir="${bits.download.dir}"/>
-  </target>
-  
-  <target name="re-download" depends="remove-bits,download"/>
-<!-- Downloader section - bottom -->
-
-<!-- Installation section - top    -->
-  <target name="install-config" if="staf.install.successful">
-    <copy file="${staf.config.stubs}" tofile="${staf.config}">
-      <filterchain>
-        <expandproperties/>
-      </filterchain>
-    </copy>
-  </target>
-
-  <target name="install-services" if="staf.install.successful">
-    <unzip 
-        src="${bits.download.dir}/${bits.email.archive}" 
-        dest="${staf.install.dir}/services"/>
-    <unzip 
-        src="${bits.download.dir}/${bits.event.archive}" 
-        dest="${staf.install.dir}/services"/>
-    <unzip 
-        src="${bits.download.dir}/${bits.eventmanager.archive}" 
-        dest="${staf.install.dir}/services"/>
-    <unzip 
-        src="${bits.download.dir}/${bits.stax.archive}" 
-        dest="${staf.install.dir}/services"/>
-    <unzip 
-        src="${bits.download.dir}/${bits.http.archive}" 
-        dest="${staf.install.dir}/services"/>
-    <!-- adding dsml service extension -->
-    <mkdir dir="${staf.install.dir}/services/dsml"/>
-    <copy todir="${staf.install.dir}/services/dsml">
-      <fileset dir="${basedir}/shared/dsml" includes="dsmlService.jar"/>
-    </copy>
-
-  </target>
-
-  <target name="install-staf-jar" 
-          description="deploy the staf bits"
-          if="staf.archive.is.jar">
-    <echo message="Installing staf, please wait, it'll take some time..."    />
-    <java jar="${bits.download.dir}/${bits.staf.archive}" fork="true">
-      <arg value="-silent" />
-      <arg line="-W license.selection=&quot;Accept&quot;" />
-      <arg line="-W stafinstalldirectory.defaultInstallLocation=&quot;${staf.install.dir}&quot;"/>
-    </java>
-    <condition property="staf.install.successful">
-      <available file="${staf.install.dir}/bin/STAF.cfg"/>
-    </condition>
-  </target>
-  
-  <target name="install-staf-tar" if="staf.archive.is.tar">
-    <delete dir="${bits.download.dir}/staf"/>
-    <gunzip
-      src="${bits.download.dir}/${bits.staf.archive}"
-      dest="${bits.download.dir}"/>
-    <untar dest="${bits.download.dir}">
-      <fileset dir="${bits.download.dir}">
-        <include name="*.tar"/>
-      </fileset>
-    </untar>
-    <chmod file="${bits.download.dir}/staf/STAFInst" perm="755"/>
-    <exec executable="${bits.download.dir}/staf/STAFInst">
-      <arg value="-source"/>
-      <arg value="${bits.download.dir}/staf"/>
-      <arg value="-target"/>
-      <arg value="${staf.install.dir}"/>
-      <arg value="-acceptlicense"/>
-    </exec>
-    <condition property="staf.install.successful">
-      <available file="${staf.install.dir}/bin/STAF.cfg"/>
-    </condition>
-  </target>
-  
-  <target name="install-staf" 
-          depends="install-staf-jar,install-staf-tar">
-    <fail unless="staf.install.successful" />
-  </target>
-  
-  <target name="install-prepare" >
-    <mkdir dir="${staf.install.dir}"/>
-    <mkdir dir="${staf.install.dir}/services"/>
-    <mkdir dir="${staf.config.dir}"/>
-  </target>
-
-  <target name="install" 
-          description="Perform framework installation" 
-          depends="status-do,install-prepare,install-staf,install-services,install-config"
-          if="bits.all.downloaded"/>
-<!-- Installation section - bottom -->
-
-<!-- Gui section - top    -->
-  <target name="gui"
-          depends="status-do"
-          description="brings up the stax gui" >
-    <condition property="gui.spawn" value="false" else="true">
-      <isset property="DEBUG"/>
-    </condition>
-    <exec
-      dir="${staf.install.dir}"
-      executable="${java.home}/bin/java"
-      spawn="${gui.spawn}">
-      <env key="${path.var}" path="${java.home}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin${path.separator}${path.current}"/>
-      <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
-      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
-      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
-      <env key="STAFCODEPAGE" value="LATIN_1"/>
-      <arg value="-classpath"/>
-      <arg value="${staf.install.dir}/services/stax/STAXMon.jar${path.separator}${staf.lib.dir}/JSTAF.jar"/>
-      <arg value="com.ibm.staf.service.stax.STAXMonitor"/>
-    </exec>
-  </target>
-<!-- Gui section - bottom -->
-<!-- Jvmlog section - top    -->
-  <target name="jvm-log"
-          depends="status-do"
-          description="brings up the jvmlog gui" >
-    
-    <exec
-      dir="${staf.install.dir}"
-      executable="${java.home}/bin/java"
-      spawn="true">
-      <env key="${path.var}" path="${java.home}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin${path.separator}${path.current}"/>
-      <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
-      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
-      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
-      <env key="STAFCODEPAGE" value="LATIN_1"/>
-      <arg value="-classpath"/>
-      <arg value="${staf.lib.dir}${path.separator}${staf.lib.dir}/JSTAF.jar"/>
-      <arg value="com.ibm.staf.STAFJVMLogViewer"/>
-    </exec>
-  </target>
-<!-- Jvmlog section - bottom -->
-
-<!-- Configure section - top    -->
-  <target name="configure">
-    <echo>I. STAF configuration</echo>
-    <input
-      message="I [1/1] STAF port"
-      defaultvalue="${staf.port}"
-      addproperty="staf.port.input"
-    />
-    <input
-      message="I [2/2] Host name"
-      defaultvalue="${host.name}"
-      addproperty="host.name.input"
-    />
-    <echo>II. HTTP proxy (to download the framework and/or daily builds)</echo>
-    <input
-      message="II [1/4] Proxy host"
-      defaultvalue="${proxy.host}"
-      addproperty="proxy.host.input"
-    />
-    <input
-      message="II [2/4] Proxy port"
-      defaultvalue="${proxy.port}"
-      addproperty="proxy.port.input"
-    />
-    <input
-      message="II [3/4] Proxy user"
-      defaultvalue="${proxy.user}"
-      addproperty="proxy.user.input"
-    />
-    <input
-      message="II [4/4] Proxy password"
-      defaultvalue="${proxy.pass}"
-      addproperty="proxy.pass.input"
-    />
-    <echo>III. OpenDS configuration</echo>
-    <input
-      message="III [1/5] OpenDS ldap port"
-      defaultvalue="${opends.port.ldap}"
-      addproperty="opends.port.ldap.input"
-    />
-    <input
-      message="III [2/5] OpenDS secure ldap port"
-      defaultvalue="${opends.port.ldaps}"
-      addproperty="opends.port.ldaps.input"
-    />
-    <input
-      message="III [3/5] OpenDS jmx port"
-      defaultvalue="${opends.port.jmx}"
-      addproperty="opends.port.jmx.input"
-    />
-    <input
-      message="III [4/5] OpenDS admin DN (also called root DN)"
-      defaultvalue="${opends.admin.dn}"
-      addproperty="opends.admin.dn.input"
-    />
-    <input
-      message="III [5/5] OpenDS admin password"
-      defaultvalue="${opends.admin.pwd}"
-      addproperty="opends.admin.pwd.input"
-    />
-    <echo>IV. Email configuration</echo>
-    <input
-      message="IV [1/7] Send report email?"
-      defaultvalue="${email.enabled}"
-      validargs="y,n"
-      addproperty="email.enabled.input"
-    />
-    <input
-      message="IV [2/7] Email will appear to be from"
-      defaultvalue="${email.from}"
-      addproperty="email.from.input"
-    />
-    <input
-      message="IV [3/7] Send email to"
-      defaultvalue="${email.to}"
-      addproperty="email.to.input"
-    />
-    <input
-      message="IV [4/7] SMTP server host"
-      defaultvalue="${email.server.host}"
-      addproperty="email.server.host.input"
-    />
-    <input
-      message="IV [5/7] SMTP server port"
-      defaultvalue="${email.server.port}"
-      addproperty="email.server.port.input"
-    />
-    <input
-      message="IV [6/7] SMTP server user"
-      defaultvalue="${email.server.user}"
-      addproperty="email.server.user.input"
-    />
-    <input
-      message="IV [7/7] SMTP server password"
-      defaultvalue="${email.server.pwd}"
-      addproperty="email.server.pwd.input"
-    />
-
-    <echo>Saving ...</echo>
-    <echo
-      file="user.properties">staf.port=${staf.port.input}
-host.name=${host.name.input}
-proxy.host=${proxy.host.input}
-proxy.port=${proxy.port.input}
-proxy.user=${proxy.user.input}
-proxy.pass=${proxy.pass.input}
-opends.port.ldap=${opends.port.ldap.input}
-opends.port.ldaps=${opends.port.ldaps.input}
-opends.port.jmx=${opends.port.jmx.input}
-opends.admin.dn=${opends.admin.dn.input}
-opends.admin.pwd=${opends.admin.pwd.input}
-email.enabled=${email.enabled.input}
-email.from=${email.from.input}
-email.to=${email.to.input}
-email.server.host=${email.server.host.input}
-email.server.port=${email.server.port.input}
-email.server.user=${email.server.user.input}
-email.server.pwd=${email.server.pwd.input}
-</echo>
-  </target>
-  <target name="unconfigure">
-    <delete file="user.properties"/>
-  </target>
-<!-- Configure section - bottom -->
-
-<!-- Run tests section - top    -->
-  <target name="run-tests-build-pkg" 
-    if="product.package.build" 
-    depends="run-tests-get-pkg">
-      <ant antfile="${project.home}/build.xml" 
-           target="package"
-           inheritAll="false"/>
-  </target>
-  
-  <target name="run-tests-get-pkg">
-    <condition property="product.package.dir" 
-               value="${daily.package.dir}"
-               else="${project.home}/build/package">
-       <isset property="tests.run.daily"/>
-     </condition>
-     
-     <loadproperties srcFile="${project.home}/build.properties">
-       <filterchain>
-         <linecontains>
-           <contains value="opendmk."/>
-         </linecontains>
-       </filterchain>
-     </loadproperties>
-     <loadproperties srcFile="${tests.config.stubs}">
-       <filterchain>
-         <linecontains>
-           <contains value="SNMP_"/>
-         </linecontains>
-         <tokenfilter>
-           <replacestring from="'" to=""/>
-         </tokenfilter>
-       </filterchain>
-     </loadproperties>
-     <!-- <echo>opendm.lib.dir=${opendmk.lib.dir}</echo> -->
-     <!-- <echo>SNMP_OPENDMK_LIBDIR=${SNMP_OPENDMK_LIBDIR}</echo> -->
-  
-     <property name="product.package" 
-               value="${product.package.dir}/${product.name}.zip"/>
-     <if>
-       <and> 
-         <not>
-           <isset property="tests.run.daily"/>
-         </not>
-         <not>
-           <available file="${product.package}"/>
-         </not>
-       </and>    
-       <then>
-         <echo>Daily run not set and ${product.name}.zip not found.</echo>
-         <if>
-           <available file="${SNMP_OPENDMK_LIBDIR}" />
-           <then>
-             <if>
-               <length string="${opendmk.lib.dir}" when="equal" length="0" />
-               <then>
-                 <echo>SNMP_OPENDMK_LIBDIR is set in ${tests.config.stubs}.</echo>
-                 <echo>opendmk.lib.dir is not set in ${project.home}/build.properties.</echo>
-                 <echo>Update opendmk.lib.dir and build ${product.name}.zip with SNMP.</echo>
-                 <replace file="${project.home}/build.properties"
-                          value="opendmk.lib.dir=${SNMP_OPENDMK_LIBDIR}">
-                   <replacefilter token="opendmk.lib.dir="/>
-                 </replace>                 
-                 <property name="product.package.build" value="true"/>
-               </then>
-               <else>
-                 <echo>SNMP_OPENDMK_LIBDIR is set in ${tests.config.stubs}.</echo>
-                 <echo>opendmk.lib.dir is set in ${project.home}/build.properties.</echo>
-                 <echo>Build ${product.name}.zip with SNMP.</echo>
-                 <property name="product.package.build" value="true"/>
-               </else>
-             </if>
-           </then>
-           <else>
-             <echo>SNMP_OPENDMK_LIBDIR is not set or is wrong in ${tests.config.stubs}.</echo>
-             <echo>Build ${product.name}.zip without SNMP.</echo>
-             <property name="product.package.build" value="true"/>
-           </else>         
-         </if>
-       </then>
-       <else>
-         <if>
-           <isset property="tests.run.daily"/>
-           <then>
-             <echo>Daily run is set.</echo>
-             <echo>Nothing to do.</echo>
-           </then>
-           <else>
-             <echo>Daily run not set and ${product.name}.zip found.</echo>
-             <if>
-               <available file="${SNMP_OPENDMK_LIBDIR}" />
-               <then>
-                 <if>
-                   <not>
-                     <length string="${opendmk.lib.dir}" when="equal" length="0" />
-                   </not>
-                   <then>
-                     <echo>opendmk.lib.dir is set in ${project.home}/build.properties.</echo>
-                     <echo>Nothing to do.</echo>
-                   </then>
-                   <else>
-                     <echo>SNMP_OPENDMK_LIBDIR is set in ${tests.config.stubs}.</echo>
-                     <echo>opendmk.lib.dir is not set in ${project.home}/build.properties.</echo>
-                     <echo>Update opendmk.lib.dir and build again ${product.name}.zip with SNMP.</echo>
-                     <replace file="${project.home}/build.properties"
-                              value="opendmk.lib.dir=${SNMP_OPENDMK_LIBDIR}">
-                       <replacefilter token="opendmk.lib.dir="/>
-                     </replace>
-                     <property name="product.package.build" value="true"/>
-                   </else>
-                 </if>
-               </then>
-               <else>
-                 <echo>SNMP_OPENDMK_LIBDIR is not set or is wrong in ${tests.config.stubs}.</echo>
-                 <echo>Nothing to do.</echo>
-               </else>
-             </if>
-           </else>
-         </if>
-       </else>
-     </if>
-  </target>
-
-  <target name="run-tests-check" depends="run-tests-build-pkg">
-    <condition property="opends.port.ldap.taken">
-      <socket port="${opends.port.ldap}" server="${host.name}"/>
-    </condition>
-    <condition property="opends.port.ldaps.taken">
-      <socket port="${opends.port.ldaps}" server="${host.name}"/>
-    </condition>
-    <condition property="opends.port.jmx.taken">
-      <socket port="${opends.port.jmx}" server="${host.name}"/>
-    </condition>
-    <condition property="product.package.available">
-      <available file="${product.package}"/>
-    </condition>
-    <condition property="run-tests.proceed">
-      <and>
-        <not>
-          <or>
-            <isset property="opends.port.ldap.taken"/>
-            <isset property="opends.port.ldaps.taken"/>
-            <isset property="opends.port.jmx.taken"/>
-          </or>
-        </not>
-        <isset property="staf.running"/>
-        <isset property="product.package.available"/>
-      </and>
-    </condition>
-  </target>
-
-  <target name="run-tests-prepare"
-          depends="status-do,run-tests-build-pkg" 
-          if="run-tests.proceed">
-    <!-- python config - top -->
-      <!-- 1. get a timestamp for step 3 -->
-      <tstamp>
-        <format property="tests.run.time" pattern="yyyy.MM.dd-HH.mm.ss"/>
-      </tstamp>
-      <!-- clean up some -->
-      <delete dir="${staf.logs.dir}"/>
-      <delete dir="${staf.tmp.dir}"/>
-      <!-- make all the necessary directories for this test run -->
-      <mkdir dir="${staf.tmp.dir}"/>
-      <mkdir dir="${tests.run.dir}/${tests.run.time}"/>
-      <mkdir dir="${tests.run.dir}/${tests.run.time}/config"/>
-      <mkdir dir="${tests.run.dir}/${tests.run.time}/report"/>
-      <!-- these will serve for after-the-fact archiving the logs -->
-      <mkdir dir="${tests.run.dir}/${tests.run.time}/staf-logs"/>
-      <mkdir dir="${tests.run.dir}/${tests.run.time}/server-logs"/>
-      <mkdir dir="${tests.run.dir}/${tests.run.time}/coverage"/>
-      
-      <!-- 3. perform the config back up if necessary -->
-      <copy file="${tests.config}" 
-            tofile="${tests.config.backup}"
-            overwrite="false"/>
-      <!-- 4. generate the timestamped config file that will be used for this run -->
-      <copy file="${tests.config.stubs}"
-            tofile="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}">
-        <filterchain>
-          <expandproperties/>
-        </filterchain>
-      </copy>
-      <!-- 5. this is a windows-specific measure to replace the windows file
-              separator by a forward slash. Staf otherwise fails to find the
-              files.
-       -->
-      <replace file="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}" token="\" value="/"/>
-      <!-- 6. copy the generated config in place of the previous one -->
-      <copy file="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}"
-            tofile="${tests.config}"
-            overwrite="true"/>
-    <!-- python config - bottom -->
-  </target>
-  
-  <target name="run-tests-cant-ldap" if="opends.port.ldap.taken">
-    <echo>Port [${opends.port.ldap}] already used</echo>
-  </target>
-  <target name="run-tests-cant-ldaps" if="opends.port.ldaps.taken">
-    <echo>Port [${opends.port.ldaps}] already used</echo>
-  </target>
-  <target name="run-tests-cant-jmx" if="opends.port.jmx.taken">
-    <echo>Port [${opends.port.jmx}] already used</echo>
-  </target>
-  <target name="run-tests-cant-staf" unless="staf.running">
-    <echo>Staf is NOT running. Use the start target and try again</echo>
-  </target>
-  <target name="run-tests-cant-package" unless="product.package.available">
-    <echo>the package [${product.package}] is not available</echo>
-  </target>
-  <target name="run-tests-cant" 
-          depends="run-tests-cant-ldap,run-tests-cant-ldaps,run-tests-cant-jmx,run-tests-cant-staf,run-tests-cant-package"
-          unless="run-tests.proceed">
-    <echo>Could not run the tests for the afore mentioned reasons</echo>
-    <fail message="Could not run the functional tests"/>
-  </target>
-  <target name="run-tests"
-    depends="run-my-tests-define,status-do,run-tests-check,run-tests-cant,run-tests-prepare,run-my-tests-default-plan" 
-    if="run-tests.proceed">
-    <property name="tests.request" value="EXECUTE FILE ${tests.xml} JOBNAME OpenDS_Functional_Tests SCRIPTFILE ${tests.config} WAIT CLEARLOGS"/>
-    <condition property="tests.replay.script" value="replay.bat" else="replay.sh">
-      <os family="windows"/>
-    </condition>
-    <echo>Generating replay script to allow you to re-execute the tests in the same conditions</echo>
-    <copy file="${staf.installer.dir}${file.separator}${tests.replay.script}"
-          tofile="${tests.run.dir}${file.separator}${tests.run.time}${file.separator}${tests.replay.script}">
-      <filterchain>
-        <expandproperties/>
-      </filterchain>
-    </copy>
-    <echo>While the tests are running you may tail the job logs at</echo>
-    <echo>${staf.home}/logs/MACHINE/</echo>
-    <echo>Running tests. This will take more than a while.</echo>
-    <property name="CLASSPATH" value="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
-    <exec
-      dir="${staf.bin.dir}"
-      executable="${staf.executable}"
-      >
-      <arg line="LOCAL STAX ${tests.request}"/>
-      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
-      <env key="LD_LIBRARY_PATH" value="${staf.lib.dir}"/>
-      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
-      <env key="STAFCODEPAGE" value="LATIN_1"/>
-    </exec>
-    <!-- restore the original config file to avoid it to be mistakenly commited
-         with the generated values    -->
-    <delete file="${tests.config}"/>
-    <move file="${tests.config.backup}" 
-          tofile="${tests.config}"/>
-    <echo file="${tests.run.dir}/last.run">${tests.run.time}</echo>
-    <if>
-      <available file="${staf.tmp.dir}/${product.name}/logs" />
-      <then>
-        <echo>Saving server logs</echo>
-        <copy todir="${tests.run.dir}/${tests.run.time}/server-logs">
-          <fileset dir="${staf.tmp.dir}/${product.name}/logs"/>
-        </copy>
-      </then>
-    </if>
-    <echo>Saving Staf/Stax logs</echo>
-    <copy todir="${tests.run.dir}/${tests.run.time}/staf-logs">
-      <fileset dir="${staf.home}/logs"/>
-    </copy>
-    <!--<delete dir="${staf.home}/logs" />-->
-    <echo>Saving report</echo>
-    <copy todir="${tests.run.dir}/${tests.run.time}/report">
-      <fileset dir="${staf.tmp.dir}">
-        <include name="r*"/>
-      </fileset>
-    </copy>
-    <delete file="${staf.tmp.dir}/percentage.properties"/>
-    <copy file="${staf.tmp.dir}/my-report.html" tofile="${staf.tmp.dir}/plot.all.percentage">
-      <filterchain>
-        <linecontains>
-         <contains value='font size="+2'/>
-        </linecontains>
-        <tokenfilter>
-          <replaceregex pattern=".*font size=.+2..(\d+)%./font.*" replace="YVALUE=\1"/>
-        </tokenfilter>
-      </filterchain>
-    </copy>
-    <echo>You may access the tests report at</echo>
-    <echo>${tests.run.dir}/${tests.run.time}/report/my-report.html</echo>
-    <antcall target="send-mail"/>
-  </target>
-  
-  <target name="run-my-tests-get-contrib-check">
-    <available file="${temp.dir}/ant-contrib.zip" property="ant-contrib.downloaded" />
-  </target>
-  <target name="run-my-tests-get-contrib" depends="run-my-tests-get-contrib-check,download-do-prepare-check-proxy,download-do-prepare-set-proxy" unless="ant-contrib.downloaded">
-    <mkdir dir="${temp.dir}" />
-    <get src="http://easynews.dl.sourceforge.net/sourceforge/ant-contrib/ant-contrib-1.0b3-bin.zip" dest="${temp.dir}/ant-contrib.zip"/>
-  </target>
-  <target name="run-my-tests-expand-check">
-    <available file="${temp.dir}/ant-contrib" property="ant-contrib.expanded" />
-  </target>
-  <target name="run-my-tests-expand" depends="run-my-tests-get-contrib,run-my-tests-expand-check" unless="ant-contrib.expanded">
-    <unzip src="${temp.dir}/ant-contrib.zip" dest="${temp.dir}" />
-  </target>
-
-  <target name="run-my-tests-define" depends="run-my-tests-expand">
-    <taskdef resource="net/sf/antcontrib/antlib.xml">
-      <classpath>
-        <fileset dir="${temp.dir}/ant-contrib"> 
-          <include name="**/*.jar"/>
-        </fileset>
-      </classpath>
-    </taskdef>
-  </target>
-  
-  <target name="run-my-tests" depends="run-my-tests-define">
-    <condition property="already.customized" value="true" else="false">
-      <available file="${test.plan.custom}" />
-    </condition>
-    <if>
-      <equals arg1="${already.customized}" arg2="true" />
-      <then>
-        <input message="A previously customized test plan was detected. Do you want to change the list of suites to run?" validargs="y,n" defaultvalue="n" addproperty="prompt.do" />
-      </then>
-      <else>
-        <echo>No previous customized test plan found.</echo>
-        <property name="prompt.do" value="y" />
-      </else>
-    </if>
-    
-    <if>
-      <equals arg1="${prompt.do}" arg2="y" />
-      <then>
-        <delete file="${test.plan.custom}" />
-        <foreach list="${test.plan.list}" param="test" target="run-my-tests-prompt"/>
-      </then>
-    </if>
-    
-    <echo>You may now run those tests simply by calling 'build run-tests'</echo>
-    <!-- <antcall target="run-tests" /> -->
-  </target>
-
-  <target name="run-my-tests-prompt">
-    <input message="Do you want to execute ${test}?" validargs="y,n" defaultvalue="y" addproperty="answer"/>
-    <if>
-      <equals arg1="${answer}" arg2="y" />
-      <then>
-        <echo file="${test.plan.custom}" append="true">${test}
-</echo>
-      </then>
-    </if>
-  </target>
-  <target name="run-my-tests-default-plan" depends="run-my-tests-define" unless="custom-suites.on">
-    <delete file="${test.plan.default}"/>
-    <foreach list="${test.plan.list}" param="test" target="run-my-tests-default-plan-add"/>
-  </target>
-  <target name="run-my-tests-default-plan-add">
-    <echo file="${test.plan.default}" append="true">${test}
-</echo>
-  </target>
-  
-  
-  <target name="send-mail-prepare">
-    <condition property="test.successful">
-      <available file="${staf.tmp.dir}/my-report.html"/>
-    </condition>
-    <condition property="email.send">
-      <equals arg1="${email.enabled}" arg2="y"
-              casesensitive="false" trim="true"/>
-    </condition>
-  </target>
-
-  <target name="send-mail-get-percentage" depends="send-mail-prepare" if="test.successful">
-    <echo>test report found.Proceeding...</echo>
-    <delete file="${staf.tmp.dir}/percentage.properties"/>
-    <copy file="${staf.tmp.dir}/my-report.html" tofile="${staf.tmp.dir}/percentage.properties">
-      <filterchain>
-        <linecontains>
-         <contains value='font size="+2'/>
-        </linecontains>
-        <tokenfilter>
-          <replaceregex pattern=".*font size=.+2..(.*\d+)%./font.*" replace="test.percentage=\1"/>
-        </tokenfilter>
-      </filterchain>
-    </copy>
-    <property file="${staf.tmp.dir}/percentage.properties"/>
-    <echo>Test Success Rate: ${test.percentage}%</echo>
-  </target>
-
-  <target name="send-mail" if="email.send" depends="send-mail-get-percentage">
-    <condition property="email.send.noauth">
-      <or>
-        <not>
-          <isset property="email.server.user"/>
-        </not>
-        <not>
-          <length string="${email.server.user}" when="greater"
-                  trim="true" length="0"/>
-        </not>
-      </or>
-    </condition>
-    <condition property="email.file" 
-               value="${staf.tmp.dir}/my-report.html" 
-               else="staf-installer/failure.html">
-      <available file="${staf.tmp.dir}/my-report.html"/>
-    </condition>
-    <condition property="email.subject"
-               value="FT - Run - ${daily.date} - ${os.name} - ${os.arch} - ${test.percentage}%"
-               else="FT - Failed -${daily.date} - ${os.name} - ${os.arch}">
-      <available file="${staf.tmp.dir}/my-report.html"/>
-    </condition>
-    <antcall target="send-mail-noauth"/>
-    <antcall target="send-mail-withauth"/>
-  </target>
-  <target name="send-mail-noauth" if="email.send.noauth">
-    <mail from="${email.from}" 
-          tolist="${email.to}" 
-          subject="${email.subject}"
-          mailhost="${email.server.host}"
-          mailport="${email.server.port}"
-          messagefile="${email.file}"
-          messagemimetype="text/html" />
-  </target>
-  <target name="send-mail-withauth" unless="email.send.noauth">
-    <mail from="${email.from}" 
-          tolist="${email.to}" 
-          subject="${email.subject}"
-          mailhost="${email.server.host}"
-          mailport="${email.server.port}"
-          user="${email.server.user}"
-          password="${email.server.pwd}"
-          messagefile="${email.file}"
-          messagemimetype="text/html" />
-  </target>
-  
-  <target name="daily">
-    <property name="tests.run.daily" value="true"/>
-  </target>
-  
-  <target name="run-daily" depends="run-my-tests-define,status-do,daily,download-daily,coverage-instrument,run-tests"/>
-  
-  <target name="coverage-init">
-    <path id="emma.lib">
-      <pathelement location="${project.home}/ext/emma/lib/emma.jar"     />
-      <pathelement location="${project.home}/ext/emma/lib/emma_ant.jar" />
-    </path>
-
-    <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
-  </target>
-  
-  <target name="coverage-on" depends="coverage-init">
-    <property name="coverage.on" value="true"/>
-  </target>
-  
-  <target name="coverage-instrument" depends="status-do,run-tests-build-pkg" if="coverage.on">
-    <delete dir="${staf.tmp.dir}/coverage-instr" />
-    <mkdir dir="${staf.tmp.dir}/coverage-instr" />
-    <!-- unzip the original package in a temporary location to make the
-         changes necessary so that the coverage tool is called
-     -->
-    <unzip src="${product.package}" 
-           dest="${staf.tmp.dir}/coverage-instr"/>
-
-    <!-- Add emma in the package along with the other librairies
-         this has the advantage of being automatically picked up by the scripts
-    -->
-    <copy file="${project.home}/ext/emma/lib/emma.jar" 
-          tofile="${staf.tmp.dir}/coverage-instr/${product.name}/lib/emma.jar"/>
-    
-    <!-- move the original product package to make room for the coverage 
-         enabled package 
-     -->
-    <move file="${product.package}" tofile="${product.package}.nocov"/>
-    
-    <!-- intrument the OpenDS java archive to gather coverage -->
-    <java classpath="${staf.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}lib${file.separator}emma.jar"
-          classname="emma" fork="true">
-      <jvmarg value="-Demma.metadata.out.file=${staf.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}coverage.em" />
-      <arg value="instr" />
-      <arg value="-m" />
-      <arg value="overwrite" />
-      <arg value="-ip" />
-      <arg value="${staf.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}lib${file.separator}OpenDS.jar:${staf.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}lib${file.separator}extensions${file.separator}snmp-mib2605.jar" />
-    </java>
-    <echo>Writing properties file</echo>
-    <echo file="${staf.tmp.dir}/coverage-instr/${product.name}/classes/emma.properties">coverage.out.file=${staf.tmp.dir}/emma.coverage</echo> 
-    <!-- Repackage the product with coverage enabled scripts -->          
-    <zip basedir="${staf.tmp.dir}/coverage-instr" destfile="${product.package}">
-      <zipfileset dir="${staf.tmp.dir}/coverage-instr" 
-                  includes="${product.name}/setup,${product.name}/uninstall,${product.name}/upgrade,${product.name}/bin/*,${product.name}/lib/*.sh"
-           filemode="755" dirmode="755" />
-    </zip>
-    <!-- <delete dir="${staf.tmp.dir}/coverage-instr"/> -->
-  </target>
-  
-  <target name="coverage-report" if="coverage.on">
-    <delete dir="${staf.tmp.dir}/coverage/all" />
-    <mkdir dir="${staf.tmp.dir}/coverage/all" />
-    <emma enabled="${coverage.on}" >
-      <report >
-        <infileset dir="${staf.tmp.dir}" includes="**/*.em,**/*.ec" />
-
-        <sourcepath>
-          <dirset dir="${project.home}" >
-            <include name="src" />
-          </dirset>
-        </sourcepath>
-
-        <html outfile="${staf.tmp.dir}/coverage/all/index.html"
-              columns="name, method, line"
-              sort="+line, +name"
-              metrics="line:80"
-        />
-      </report>
-    </emma>
-  </target>
-  
-  <target name="restore-pkg" if="coverage.on">
-    <delete file="${product.package}"/>
-    <move file="${product.package}.nocov" tofile="${product.package}"/> 
-  </target>
-
-  <target name="daily-coverage" depends="coverage-on,run-daily,restore-pkg,coverage-report"/>
-  
-  <target name="testwithcoverage" depends="run-my-tests-define,coverage-on,coverage-instrument,run-tests,restore-pkg,coverage-report"/> 
-<!-- Run tests section - bottom -->
-  
-<!-- Uninstallation section - top    -->
-  <target name="uninstall-do-jar"
-          description="Uninstall the staf"
-          if="staf.install.is.jar">
-    <echo message="Uninstalling staf, please wait..."                        />
-    <java jar="${staf.install.dir}/_uninst/uninstall.jar" fork="true">
-      <arg value="-silent" />
-    </java>
-    <sleep seconds="5" />
-    <delete dir="${staf.install.dir}" />
-  </target>
-  <target name="uninstall-do-tar"
-          description="Uninstall the staf"
-          unless="staf.install.is.jar">
-    <echo message="Uninstalling staf, please wait..."                        />
-    <exec executable="${staf.install.dir}/STAFUninst"/>
-    <sleep seconds="5" />
-    <delete dir="${staf.install.dir}" />
-  </target>
-
-  <target name="uninstall-do" if="staf.installed">
-    <condition property="staf.install.is.jar">
-      <available file="${staf.install.dir}/_uninst/uninstall.jar"/>
-    </condition>
-    <antcall target="uninstall-do-jar"/>
-    <antcall target="uninstall-do-tar"/>
-  </target>
-  <target name="uninstall-dont-not-installed" unless="staf.installed">
-    <echo>Staf is not installed.</echo>
-  </target>
-  <target name="uninstall-dont-running" if="staf.running">
-    <echo>Staf is running. Stop staf before uninstalling.</echo>
-    <echo>Use either the 'stop' or the 'wipeout' target.</echo>
-  </target>
-  <target 
-    name="uninstall-dont" 
-    depends="uninstall-dont-running,uninstall-dont-not-installed" />
-  
-  <target name="uninstall" depends="status-do,uninstall-do,uninstall-dont">
-  </target>
-<!-- Uninstallation section - bottom -->
-  
-<!-- Start section - top       -->
-  <target name="start-do" 
-          description="start the staf"
-          if="staf.installed"
-          unless="staf.running" >
-    <echo message="Starting staf daemon ... on ${os.myname}" />
-    <condition property="staf.spawn">
-      <not>
-        <isset property="staf.spawn"/>
-      </not>
-    </condition>
-    <echo message="Starting STAF..."/>
-    <exec
-      dir="${staf.bin.dir}"
-      executable="${staf.daemon}"
-      spawn="${staf.spawn}">
-     <arg value="${staf.config}"/>
-     <env key="${path.var}" path="${java.home}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin${path.separator}${path.current}"/>
-     <env key="LD_LIBRARY_PATH" path="${staf.install.dir}/lib"/>
-     <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:${project.home}/ext/svnkit/svnkit.jar${path.separator}${e.CLASSPATH}"/>
-     <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
-     <env key="STAFCODEPAGE" value="LATIN_1"/>
-     <env key="STAF_INSTANCE_NAME" value="STAF"/>
-   </exec>
-   <echo message="Waiting for service to become available..."/>
-    <waitfor maxwait="3" maxwaitunit="minute" 
-             checkevery="10" checkeveryunit="second"
-             timeoutproperty="timeout">
-      <socket server="${host.name}" port="${staf.port}"/>
-    </waitfor>
-    <echo message="STAF is now ready to serve requests"/>
-   </target>
-  <target name="start-dont" if="staf.running">
-    <echo>Staf is already running.</echo>
-  </target>
-  <target name="start" depends="status-do">
-    <antcall target="start-do"/>
-    <antcall target="start-dont"/>
-  </target>
-  <target name="start-nodetach">
-    <property name="staf.spawn" value="false"/>
-    <antcall target="start"/>
-  </target>
-
-<!-- Start section - bottom    -->
-  
-<!-- Stop section - top     -->
-  <target name="stop-do" if="staf.running">
-    <echo>Stopping staf...</echo>
-    <exec
-      executable="${staf.executable}" 
-      >
-      <env key="${path.var}" path="${java.home}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin${path.separator}${path.current}"/>
-      <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
-      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
-      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
-      <env key="STAFCODEPAGE" value="LATIN_1"/>
-      <arg line="local shutdown shutdown"/>
-    </exec>
-    <echo message="Waiting for service to shutdown gracefully..."/>
-    <waitfor maxwait="3" maxwaitunit="minute"
-             checkevery="10" checkeveryunit="second" 
-             timeoutproperty="timeoutSocketListening">
-      <not>
-        <socket server="${host.name}" port="${staf.port}"/>
-      </not>
-    </waitfor>
-    <echo message="STAF stopped"/>
-  </target>
-  <target name="stop-dont" unless="staf.running">
-    <echo>Staf is not running.</echo>
-  </target>
-  <target name="stop" depends="status-do">
-    <antcall target="stop-do"/>
-    <antcall target="stop-dont"/>
-  </target>
-<!-- Stop section - bottom  -->
-  
-<!-- Status section - top    -->
-  <!-- Bits status section - top -->
-    <target name="status-archive-downloaded?" if="bits.all.downloaded.before">
-      <echo>Staf bits are ready to be installed. Use 'install' target.</echo>
-    </target>
-    <target name="status-archive-not-downloaded?" unless="bits.all.downloaded.before">
-      <echo>No staf bits found. Use the get-bits or bootstrap target.</echo>
-    </target>
-  <!-- Bits status section - bottom -->
-  
-  <!-- Installation status section - top -->
-    <target name="status-staf-installed?" if="staf.installed">
-      <echo>Found staf installed in [${staf.install.dir}]</echo>
-      <antcall target="status-staf-running?"       />
-      <antcall target="status-staf-not-running?"   />
-    </target>
-    <target name="status-staf-not-installed?" unless="staf.installed">
-      <echo>Could not find staf installation.</echo>
-      <echo>Checking if the bits here and ready for installation...</echo>
-      <antcall target="status-archive-downloaded?" />
-      <antcall target="status-archive-not-downloaded?" />
-    </target>
-  <!-- Installation status section - bottom -->
-    
-  <!-- Running status section - top -->
-    <target name="status-staf-running?" if="staf.running">
-      <echo>staf is listening on port [${staf.port.default}]</echo>
-      <echo>You're all set to run the functional tests.</echo>
-    </target>  
-    <target name="status-staf-not-running?" unless="staf.running">
-      <echo>staf is NOT running. Use the 'start' target.</echo>
-    </target>
-  <!-- Running status section - bottom -->
-
-
-  <!-- Get status section - top -->
-    <target name="status-do" unless="status-do.already.run" >
-      <!-- check if the various archives needed have already been downloaded -->
-      <condition property="bits.staf.downloaded.before">
-        <available file="${bits.download.dir}/${bits.staf.archive}"/>
-      </condition>
-      <condition property="bits.services.downloaded.before" >
-        <and>
-          <available file="${bits.download.dir}/${bits.stax.archive}" />
-          <available file="${bits.download.url}/${bits.email.archive}" />
-          <available file="${bits.download.url}/${bits.event.archive}" />
-          <available file="${bits.download.url}/${bits.eventmanager.archive}" />
-          <available file="${bits.download.url}/${bits.http.archive}" />
-        </and>
-      </condition>
-      <condition property="bits.tomcat.downloaded.before">
-        <available file="${bits.webcontainer.download.dir}/${bits.tomcat.archive}"/>
-      </condition>
-      <condition property="bits.all.downloaded.before">
-        <and>
-          <isset property="bits.staf.downloaded.before"/>
-          <isset property="bits.services.downloaded.before"/>
-          <isset property="bits.tomcat.downloaded.before"/>
-        </and>
-      </condition>
-      <available file="${daily.package}" property="daily.package.downloaded"/>
-      <available file="${tests.dir}/testcases/run-custom-suites.dat" property="custom-suites.on" />
-      <available file="${staf.install.dir}" 
-                type="dir" 
-                property="staf.installed" />
-      <condition property="staf.lib.dir" 
-        value="${staf.install.dir}${file.separator}bin" 
-        else="${staf.install.dir}${file.separator}lib">
-        <os family="windows"/>
-      </condition>
-  
-      <condition property="staf.running">
-        <socket port="${staf.port}" server="${host.name}"/>
-      </condition>
-
-      <condition property="staf.archive.is.jar">
-        <contains string="${bits.staf.archive}" substring=".jar"/>
-      </condition>
-      <condition property="staf.archive.is.tar">
-        <not>
-          <contains string="${bits.staf.archive}" substring=".jar"/>
-        </not>
-      </condition>
-      <condition property="binary.extension" value=".exe" else="">
-          <os family="windows"/>
-      </condition>
-      <condition property="script.extension" value=".bat" else="">
-          <os family="windows"/>
-      </condition>
-      
-      <condition property="path.var" value="Path" else="PATH">
-        <os family="windows"/>
-      </condition>
-      <macrodef name="propertycopy">
-        <attribute name="name"/>
-        <attribute name="from"/>
-        <sequential>
-          <property name="@{name}" value="${@{from}}"/>
-        </sequential>
-      </macrodef>
-      <property environment="e"/>
-      <propertycopy name="path.current" from="e.${path.var}"/>
-
-      <property name="staf.executable" 
-                value="${staf.bin.dir}${file.separator}STAF${binary.extension}"/> 
-      <property name="staf.daemon" 
-                value="${staf.bin.dir}${file.separator}STAFProc${binary.extension}"/> 
-      
-      <property name="status-do.already.run" value="true"/>
-    </target>
-  <!-- Get status section - bottom -->
-  
-  <!-- Status cli section - top -->
-    <target name="status" depends="status-do">
-      <condition property="is.platform.supported" value="yes" else="no" >
-        <isset property="platform.supported"/>
-      </condition>
-      <echo>Operating System Family  - ${os.myname}</echo>
-      <echo>Operating System Name    - ${os.name}</echo>
-      <echo>Operating System Version - ${os.version}</echo>
-      <echo>Machine Architecture     - ${os.arch}</echo>
-      <echo>Platform Supported       - ${is.platform.supported}</echo>
-      <echo>Java Home                - ${java.home}</echo>
-      <echo>Java Version             - ${java.version}</echo>
-      <!--
-      <echo>PATH                     - ${path.current}</echo>
-      <echo>CLASSPATH                - ${e.CLASSPATH}</echo> 
-      -->
-      <antcall target="status-staf-installed?"     />
-      <antcall target="status-staf-not-installed?" />
-    </target>
-  <!-- Status cli section - bottom -->
-<!-- Status section - bottom -->
-
-<!-- Macros section - top -->
-  <target name="bootstrap" depends="run-my-tests-define">
-    <antcall target="download"  />
-    <antcall target="install"   />
-    <antcall target="start"     />
-  </target>
-  
-  <target name="wipeout">
-    <antcall target="stop"/>
-    <echo>Allow a minute for STAF to bring all the JVMs down</echo>
-    <sleep seconds="60"/>
-    <antcall target="uninstall"/>
-  </target>
-
-  <target name="restart">
-    <antcall target="stop"  inheritAll="false" />
-    <sleep seconds="10"                        />
-    <antcall target="start" inheritAll="false" />
-  </target>
-<!--  Macros section - bottom -->
-  <target name="javadoc" depends="status-do" if="staf.installed">
-    <delete dir="${staf.home}/doc"/>
-    <mkdir dir="${staf.home}/doc"/>
-    <java jar="${staf.install.dir}/services/stax/STAXDoc.jar" fork="true">
-      <arg value="-d"/> 
-      <arg value="${staf.home}/doc"/>
-      <!--<arg value="testcases"/>
-      <arg value="testcases/aci"/>
-      <arg value="testcases/backends"/>
-      <arg value="testcases/core"/>
-      <arg value="testcases/schema"/>
-      <arg value="testcases/security"/>
-      <arg value="testcases/security/account_activation"/>
-      <arg value="testcases/security/auth_pwd_syntax"/>
-      <arg value="testcases/security/bind_no_pwd"/>
-      <arg value="testcases/security/jks"/>
-      <arg value="testcases/security/pkcs12"/>
-      <arg value="testcases/security/pwd_policy"/>
-      <arg value="testcases/security/pwd_policy_root"/>
-      <arg value="testcases/security/pwd_storage"/>
-      <arg value="testcases/security/pwd_validator"/>
-      <arg value="testcases/security/sasl"/>
-      <arg value="testcases/security/startTLS"/>-->
-      <arg value="../shared/functions"/>
-      <arg value="testcases/sample" />
-    </java>
-  </target>
-  
-  <target name="properties">
-    <echoproperties/>
-  </target>
-  
-  <target name="get-dtd" depends="status-do">
-    <property name="stax.dtd" value="${staf.home}/stax.dtd"/>
-    <exec
-      dir="${staf.bin.dir}"
-      executable="${staf.executable}"
-      output="${stax.dtd}"
-      >
-      <arg line="LOCAL STAX get dtd"/>
-      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
-      <env key="LD_LIBRARY_PATH" value="${staf.lib.dir}"/>
-      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
-      <env key="STAFCODEPAGE" value="LATIN_1"/>
-    </exec>
-    <replace file="${stax.dtd}">
-      <replacetoken>Response
---------
-</replacetoken>
-      <replacevalue></replacevalue>
-    </replace>
-  </target>
-  
-  <target name="generate-report">
-    <delete file="${staf.tmp.dir}/my-report.html"/>
-    <xslt processor="trax"
-          in="${staf.tmp.dir}/tests-log.xml" 
-          out="${staf.tmp.dir}/my-report.html"
-          style="shared/xsl/my-report.xsl">
-    </xslt>
-  </target>
-  
-  <target name="opends">
-    <ant dir="../.." target="package" inheritAll="false" />
-  </target>
-</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/staf.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/staf.xml
new file mode 100644
index 0000000..58c6f15
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/staf.xml
@@ -0,0 +1,250 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+<project name="staf">
+
+  <description>
+    Manage STAF (install/uninstall, start/stop).
+  </description>
+
+  <!-- Install STAF and services -->
+  <target name="install">
+    <if>
+      <not>
+        <available file="${staf.install.dir}/bin/STAF.cfg"/>
+      </not>
+      <then>
+        <mkdir dir="${tmp.dir}"/>
+
+        <!-- Install STAF -->
+        <echo>Installing staf, please wait...</echo>
+        <mkdir dir="${staf.install.dir}"/>
+        <gunzip src="${archives.dir}/${staf.archive}" dest="${tmp.dir}"/>
+        <untar dest="${tmp.dir}">
+          <fileset dir="${tmp.dir}">
+            <include name="*.tar"/>
+          </fileset>
+        </untar>
+        <chmod file="${tmp.dir}/staf/STAFInst" perm="755"/>
+        <exec executable="${tmp.dir}/staf/STAFInst">
+          <arg value="-source"/>
+          <arg value="${tmp.dir}/staf"/>
+          <arg value="-target"/>
+          <arg value="${staf.install.dir}"/>
+          <arg value="-acceptlicense"/>
+        </exec>
+        <delete dir="${repository.dir}/staf"/>
+
+        <!-- Install services -->
+        <echo>Installing services, please wait...</echo>
+        <mkdir dir="${staf.install.dir}/services"/>
+        <unzip src="${archives.dir}/${email.archive}"
+           dest="${staf.install.dir}/services"/>
+        <unzip src="${archives.dir}/${event.archive}"
+           dest="${staf.install.dir}/services"/>
+        <unzip src="${archives.dir}/${eventmanager.archive}"
+           dest="${staf.install.dir}/services"/>
+        <unzip src="${archives.dir}/${stax.archive}"
+           dest="${staf.install.dir}/services"/>
+        <unzip src="${archives.dir}/${http.archive}"
+           dest="${staf.install.dir}/services"/>
+
+        <!-- Add DSML service extension -->
+        <mkdir dir="${staf.install.dir}/services/dsml"/>
+        <copy todir="${staf.install.dir}/services/dsml">
+          <fileset dir="${basedir}/../staf-tests/shared/dsml"
+               includes="dsmlService.jar"/>
+        </copy>
+
+        <delete includeemptydirs="true">
+          <fileset dir="${tmp.dir}" includes="**/*"/>
+        </delete>
+      </then>
+      <else>
+        <echo>Staf is already installed in [${staf.install.dir}]</echo>
+      </else>
+    </if>
+
+    <!-- Copy functional-tests.cfg -->
+    <mkdir dir="${staf.config.dir}"/>
+    <copy file="${staf.config.stubs}" tofile="${staf.config.file}">
+      <filterchain>
+        <expandproperties/>
+      </filterchain>
+    </copy>
+  </target>
+
+  <!-- Uninstall STAF and services -->
+  <target name="uninstall">
+    <if>
+      <available file="${staf.install.dir}/bin/STAF.cfg"/>
+      <then>
+        <echo>Uninstalling staf, please wait...</echo>
+        <exec executable="${staf.install.dir}/STAFUninst"/>
+        <delete dir="${staf.install.dir}"/>
+      </then>
+      <else>
+        <echo>Staf is not installed</echo>
+      </else>
+    </if>
+  </target>
+
+  <!-- Start STAF -->
+  <target name="start">
+    <if>
+      <not>
+        <socket port="${staf.port}" server="${host.name}"/>
+      </not>
+      <then>
+        <echo>Starting staf, please wait...</echo>
+        <exec dir="${staf.bin.dir}"
+              executable="${staf.daemon}"
+              spawn="true">
+          <arg value="${staf.config.file}"/>
+          <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
+          <env key="LD_LIBRARY_PATH" path="${staf.install.dir}/lib"/>
+          <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:${project.home}/ext/svnkit/svnkit.jar:."/>
+          <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+          <env key="STAFCODEPAGE" value="LATIN_1"/>
+          <env key="STAF_INSTANCE_NAME" value="STAF"/>
+        </exec>
+
+        <echo>Waiting for service to become available...</echo>
+        <waitfor maxwait="3"
+             maxwaitunit="minute"
+             checkevery="10"
+             checkeveryunit="second"
+             timeoutproperty="timeout">
+          <socket server="${host.name}" port="${staf.port}"/>
+        </waitfor>
+
+        <echo>STAF is now ready to serve requests</echo>
+      </then>
+      <else>
+        <echo>Staf is already listening on port [${staf.port}]</echo>
+      </else>
+    </if>
+  </target>
+
+  <!-- Stop STAF -->
+  <target name="stop">
+    <if>
+      <socket port="${staf.port}" server="${host.name}"/>
+      <then>
+        <echo>Stopping staf, please wait...</echo>
+        <exec executable="${staf.executable}">
+          <arg line="local shutdown shutdown"/>
+          <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
+          <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
+          <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:."/>
+          <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+          <env key="STAFCODEPAGE" value="LATIN_1"/>
+        </exec>
+
+        <echo>Waiting for service to shutdown gracefully...</echo>
+        <waitfor maxwait="3"
+             maxwaitunit="minute"
+             checkevery="10"
+             checkeveryunit="second"
+             timeoutproperty="timeoutSocketListening">
+          <not>
+            <socket server="${host.name}" port="${staf.port}"/>
+          </not>
+        </waitfor>
+
+        <echo>STAF stopped</echo>
+      </then>
+      <else>
+        <echo>Staf is not running</echo>
+      </else>
+    </if>
+  </target>
+
+  <!-- Display STAF status -->
+  <target name="status">
+    <echo>Operating System Family  - ${os.myname}</echo>
+    <echo>Operating System Name    - ${os.name}</echo>
+    <echo>Operating System Version - ${os.version}</echo>
+    <echo>Machine Architecture     - ${os.arch}</echo>
+    <echo>Java Home                - ${java.path}</echo>
+    <echo>Java Version             - ${java.version}</echo>
+
+    <echo></echo>
+    <if>
+      <available file="${staf.install.dir}/bin/STAF.cfg"/>
+      <then>
+
+        <echo>Staf is installed in [${staf.install.dir}]</echo>
+      </then>
+      <else>
+        <echo>Staf is not installed</echo>
+      </else>
+    </if>
+
+    <echo></echo>
+    <if>
+      <socket port="${staf.port}" server="${host.name}"/>
+      <then>
+        <echo>Staf is listening on port [${staf.port}]</echo>
+      </then>
+      <else>
+        <echo>Staf is not running</echo>
+      </else>
+    </if>
+  </target>
+
+  <!-- Display STAF gui -->
+  <target name="gui">
+    <exec dir="${staf.install.dir}"
+          executable="${java.path}/bin/java"
+          spawn="true">
+      <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
+      <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
+      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:."/>
+      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+      <env key="STAFCODEPAGE" value="LATIN_1"/>
+      <arg value="-classpath"/>
+      <arg value="${staf.install.dir}/services/stax/STAXMon.jar${path.separator}${staf.lib.dir}/JSTAF.jar"/>
+      <arg value="com.ibm.staf.service.stax.STAXMonitor"/>
+    </exec>
+  </target>
+
+  <!-- Display jvmlogs -->
+  <target name="jvmlogs">
+    <exec dir="${staf.install.dir}"
+          executable="${java.path}/bin/java"
+          spawn="true">
+      <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
+      <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/>
+      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:."/>
+      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+      <env key="STAFCODEPAGE" value="LATIN_1"/>
+      <arg value="-classpath"/>
+      <arg value="${staf.lib.dir}${path.separator}${staf.lib.dir}/JSTAF.jar"/>
+      <arg value="com.ibm.staf.STAFJVMLogViewer"/>
+    </exec>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/tests.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/tests.xml
new file mode 100644
index 0000000..0f23b6f
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/tests.xml
@@ -0,0 +1,301 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+<project name="tests">
+  <description>
+    Execute the tests.
+  </description>
+
+  <target name="run">
+    <tstamp>
+      <format property="tests.run.time" pattern="yyyy.MM.dd-HH.mm.ss"/>
+    </tstamp>
+
+      <!-- clean up some -->
+    <delete dir="${tests.tmp.dir}"/>
+
+      <!-- make all the necessary directories for this test run -->
+    <mkdir dir="${tests.tmp.dir}"/>
+    <mkdir dir="${tests.run.dir}/${tests.run.time}"/>
+    <mkdir dir="${tests.run.dir}/${tests.run.time}/config"/>
+    <mkdir dir="${tests.run.dir}/${tests.run.time}/report"/>
+      <!-- these will serve for after-the-fact archiving the logs -->
+    <mkdir dir="${tests.run.dir}/${tests.run.time}/staf-logs"/>
+    <mkdir dir="${tests.run.dir}/${tests.run.time}/server-logs"/>
+    <mkdir dir="${tests.run.dir}/${tests.run.time}/coverage"/>
+
+    <delete file="${test.plan.default}"/>
+    <for list="${test.plan.list}" param="item">
+      <sequential>
+      <echo file="${test.plan.default}" append="true">@{item}
+</echo>
+      </sequential>
+    </for>
+
+    <!-- generate the timestamped config file that will be used for this run -->
+    <copy file="${tests.config.stubs}"
+          tofile="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}">
+      <filterchain>
+        <expandproperties/>
+      </filterchain>
+    </copy>
+
+    <!-- this is a windows-specific measure to replace the windows file
+         separator by a forward slash. Staf otherwise fails to find the files. -->
+    <replace file="${tests.run.dir}/${tests.run.time}/config/${tests.config.file}" token="\" value="/"/>
+
+    <property name="tests.request" value="EXECUTE FILE ${tests.xml} JOBNAME OpenDS_Functional_Tests SCRIPTFILE ${tests.run.dir}/${tests.run.time}/config/${tests.config.file} WAIT CLEARLOGS"/>
+
+    <echo>While the tests are running you may tail the job logs at</echo>
+    <echo>${staf.install.dir}/logs/MACHINE/${host.name}</echo>
+    <echo>Running tests. This will take more than a while.</echo>
+    <property name="CLASSPATH" value="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
+    <exec
+      dir="${staf.bin.dir}"
+      executable="${staf.executable}"
+      >
+      <arg line="LOCAL STAX ${tests.request}"/>
+      <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}${e.CLASSPATH}"/>
+      <env key="LD_LIBRARY_PATH" value="${staf.lib.dir}"/>
+      <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/>
+      <env key="STAFCODEPAGE" value="LATIN_1"/>
+    </exec>
+
+    <symlink link="${tests.run.dir}/latest" resource="${tests.run.time}" overwrite="true"/>
+    <if>
+      <available file="${tests.tmp.dir}/${product.name}/logs"/>
+      <then>
+        <echo>Saving server logs</echo>
+        <copy todir="${tests.run.dir}/${tests.run.time}/server-logs">
+          <fileset dir="${tests.tmp.dir}/${product.name}/logs"/>
+        </copy>
+      </then>
+    </if>
+    <echo>Saving Staf/Stax logs</echo>
+    <copy todir="${tests.run.dir}/${tests.run.time}/staf-logs">
+      <fileset dir="${staf.install.dir}/logs"/>
+    </copy>
+    <delete dir="${staf.install.dir}/logs"/>
+    <echo>Saving report</echo>
+    <copy todir="${tests.run.dir}/${tests.run.time}/report">
+      <fileset dir="${tests.tmp.dir}">
+        <include name="r*"/>
+      </fileset>
+    </copy>
+    <delete file="${tests.tmp.dir}/percentage.properties"/>
+  </target>
+
+  <target name="configure">
+    <condition property="already.customized" value="true" else="false">
+      <available file="${test.plan.custom}" />
+    </condition>
+    <if>
+      <equals arg1="${already.customized}" arg2="true" />
+      <then>
+        <input message="A previously customized test plan was detected. Do you want to change the list of suites to run?" validargs="y,n" defaultvalue="n" addproperty="prompt.do" />
+      </then>
+      <else>
+        <echo>No previous customized test plan found.</echo>
+        <property name="prompt.do" value="y" />
+      </else>
+    </if>
+    <if>
+      <equals arg1="${prompt.do}" arg2="y" />
+      <then>
+        <delete file="${test.plan.custom}" />
+
+        <for param="item">
+          <dirset dir="${tests.dir}/testcases"
+                  includes="*">
+            <type type="dir"/>
+          </dirset>
+          <sequential>
+            <var name="test" unset="true"/>
+            <var name="answer" unset="true"/>
+
+            <basename property="test" file="@{item}"/>
+            <input message="Do you want to execute ${test}?" validargs="y,n" defaultvalue="y" addproperty="answer"/>
+            <if>
+              <equals arg1="${answer}" arg2="y" />
+              <then>
+                <echo file="${test.plan.custom}" append="true">${test}
+</echo>
+              </then>
+            </if>
+          </sequential>
+        </for>
+      </then>
+    </if>
+  </target>
+
+  <target name="send-mail-prepare">
+    <condition property="test.successful">
+      <available file="${tests.tmp.dir}/my-report.html"/>
+    </condition>
+    <condition property="email.send">
+      <equals arg1="${email.enabled}" arg2="y"
+              casesensitive="false" trim="true"/>
+    </condition>
+  </target>
+  <target name="send-mail-get-percentage" depends="send-mail-prepare" if="test.successful">
+    <echo>test report found.Proceeding...</echo>
+    <delete file="${tests.tmp.dir}/percentage.properties"/>
+    <copy file="${tests.tmp.dir}/my-report.html" tofile="${tests.tmp.dir}/percentage.properties">
+      <filterchain>
+        <linecontains>
+          <contains value='font size="+2'/>
+        </linecontains>
+        <tokenfilter>
+          <replaceregex pattern=".*font size=.+2..(.*\d+)%./font.*" replace="test.percentage=\1"/>
+        </tokenfilter>
+      </filterchain>
+    </copy>
+    <property file="${tests.tmp.dir}/percentage.properties"/>
+    <echo>Test Success Rate: ${test.percentage}%</echo>
+  </target>
+  <target name="send-mail" if="email.send" depends="send-mail-get-percentage">
+    <condition property="email.send.noauth">
+      <or>
+        <not>
+          <isset property="email.server.user"/>
+        </not>
+        <not>
+          <length string="${email.server.user}" when="greater"
+                  trim="true" length="0"/>
+        </not>
+      </or>
+    </condition>
+    <condition property="email.file"
+               value="${tests.tmp.dir}/my-report.html"
+               else="staf-installer/failure.html">
+      <available file="${tests.tmp.dir}/my-report.html"/>
+    </condition>
+    <condition property="email.subject"
+               value="FT - Run - ${daily.date} - ${os.name} - ${os.arch} - ${test.percentage}%"
+               else="FT - Failed -${daily.date} - ${os.name} - ${os.arch}">
+      <available file="${tests.tmp.dir}/my-report.html"/>
+    </condition>
+    <antcall target="send-mail-noauth"/>
+    <antcall target="send-mail-withauth"/>
+  </target>
+  <target name="send-mail-noauth" if="email.send.noauth">
+    <mail from="${email.from}"
+          tolist="${email.to}"
+          subject="${email.subject}"
+          mailhost="${email.server.host}"
+          mailport="${email.server.port}"
+          messagefile="${email.file}"
+          messagemimetype="text/html" />
+  </target>
+  <target name="send-mail-withauth" unless="email.send.noauth">
+    <mail from="${email.from}"
+          tolist="${email.to}"
+          subject="${email.subject}"
+          mailhost="${email.server.host}"
+          mailport="${email.server.port}"
+          user="${email.server.user}"
+          password="${email.server.pwd}"
+          messagefile="${email.file}"
+          messagemimetype="text/html" />
+  </target>
+  <target name="coverage-init">
+    <path id="emma.lib">
+      <pathelement location="${project.home}/ext/emma/lib/emma.jar"     />
+      <pathelement location="${project.home}/ext/emma/lib/emma_ant.jar" />
+    </path>
+    <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
+  </target>
+  <target name="coverage-on" depends="coverage-init">
+    <property name="coverage.on" value="true"/>
+  </target>
+  <target name="coverage-instrument" if="coverage.on">
+    <delete dir="${tests.tmp.dir}/coverage-instr" />
+    <mkdir dir="${tests.tmp.dir}/coverage-instr" />
+    <!-- unzip the original package in a temporary location to make the
+         changes necessary so that the coverage tool is called
+     -->
+    <unzip src="${product.package}"
+           dest="${tests.tmp.dir}/coverage-instr"/>
+
+    <!-- Add emma in the package along with the other librairies
+         this has the advantage of being automatically picked up by the scripts
+    -->
+    <copy file="${project.home}/ext/emma/lib/emma.jar"
+          tofile="${tests.tmp.dir}/coverage-instr/${product.name}/lib/emma.jar"/>
+
+    <!-- move the original product package to make room for the coverage
+         enabled package
+     -->
+    <move file="${product.package}" tofile="${product.package}.nocov"/>
+
+    <!-- intrument the OpenDS java archive to gather coverage -->
+    <java classpath="${tests.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}lib${file.separator}emma.jar"
+          classname="emma" fork="true">
+      <jvmarg value="-Demma.metadata.out.file=${tests.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}coverage.em" />
+      <arg value="instr" />
+      <arg value="-m" />
+      <arg value="overwrite" />
+      <arg value="-ip" />
+      <arg value="${tests.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}lib${file.separator}OpenDS.jar:${tests.tmp.dir}${file.separator}coverage-instr${file.separator}${product.name}${file.separator}lib${file.separator}extensions${file.separator}snmp-mib2605.jar" />
+    </java>
+    <echo>Writing properties file</echo>
+    <echo file="${tests.tmp.dir}/coverage-instr/${product.name}/classes/emma.properties">coverage.out.file=${tests.tmp.dir}/emma.coverage
+    </echo>
+    <!-- Repackage the product with coverage enabled scripts -->
+    <zip basedir="${tests.tmp.dir}/coverage-instr" destfile="${product.package}">
+      <zipfileset dir="${tests.tmp.dir}/coverage-instr"
+                  includes="${product.name}/setup,${product.name}/uninstall,${product.name}/upgrade,${product.name}/bin/*,${product.name}/lib/*.sh"
+           filemode="755" dirmode="755" />
+    </zip>
+    <!-- <delete dir="${tests.tmp.dir}/coverage-instr"/> -->
+  </target>
+  <target name="coverage-report" if="coverage.on">
+    <delete dir="${tests.tmp.dir}/coverage/all" />
+    <mkdir dir="${tests.tmp.dir}/coverage/all" />
+    <emma enabled="${coverage.on}" >
+      <report >
+        <infileset dir="${tests.tmp.dir}" includes="**/*.em,**/*.ec" />
+        <sourcepath>
+          <dirset dir="${project.home}" >
+            <include name="src" />
+          </dirset>
+        </sourcepath>
+        <html outfile="${tests.tmp.dir}/coverage/all/index.html"
+              columns="name, method, line"
+              sort="+line, +name"
+              metrics="line:80"
+        />
+      </report>
+    </emma>
+  </target>
+  <target name="restore-pkg" if="coverage.on">
+    <delete file="${product.package}"/>
+    <move file="${product.package}.nocov" tofile="${product.package}"/>
+  </target>
+  <target name="testwithcoverage" depends="coverage-on,coverage-instrument,restore-pkg,coverage-report"/>
+<!-- Run tests section - bottom -->
+
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/usage.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/usage.xml
new file mode 100644
index 0000000..32b70bc
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/usage.xml
@@ -0,0 +1,66 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+
+<project name="usage">
+
+  <description>
+    Display usage.
+  </description>
+
+  <!-- Display usage -->
+  <target name="usage"
+          description="Gives a message that helps using this file">
+    <echo>
+      --general--
+      usage                   : print this message
+      properties              : print ant properties
+
+      --dependencies--
+      dependencies-download   : download the archives necessary to install staf
+      dependencies-remove     : remove the archives previously downloaded
+
+      --staf--
+      staf-install            : install the staf
+      staf-start              : start staf without services
+      staf-controler-start    : start staf without services
+      staf-remote-start       : start staf with all the services
+      staf-stop               : stop staf
+      staf-uninstall          : uninstall
+      staf-status             : report if staf is installed and running
+      staf-gui                : start the STAX gui
+      staf-jvmlogs            : start the STAF jvm log viewer
+
+      --tests--
+      tests-configure         : configure the functional tests
+      tests-func-configure    : configure the functional tests
+      tests-stress-configure  : configure the stress tests
+      tests-run               : run the functional tests
+      tests-func-run          : run the functional tests
+      tests-stress-run        : run the stress tests
+    </echo>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/user.xml b/opendj-sdk/opends/tests/staf-tests/shared/ant/user.xml
new file mode 100644
index 0000000..4581cf3
--- /dev/null
+++ b/opendj-sdk/opends/tests/staf-tests/shared/ant/user.xml
@@ -0,0 +1,184 @@
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2008 Sun Microsystems, Inc.
+ ! -->
+<project name="user">
+
+  <description>
+    Configure user variables.
+  </description>
+
+  <target name="configure">
+    <echo>* Framework configuration</echo>
+    <input message="   Enter path to OpenDS archive:"
+           defaultvalue="${opends.dir}"
+           addproperty="opends.dir.input"/>
+    <input message="   Enter OpenDS archive name:"
+           defaultvalue="${opends.zip}"
+           addproperty="opends.zip.input"/>
+    <input message="   Enter path to logs directory:"
+           defaultvalue="${logs.dir}"
+           addproperty="logs.dir.input"/>
+    <input message="   Enter path to repository directory:"
+           defaultvalue="${repository.dir}"
+           addproperty="repository.dir.input"/>
+    <input message="   Use proxy?"
+           defaultvalue="${proxy.enabled}"
+           validargs="y,n"
+           addproperty="proxy.enabled.input"/>
+    <if>
+      <equals arg1="${proxy.enabled.input}" arg2="y"/>
+      <then>
+        <input message="   Enter proxy host:"
+               defaultvalue="${proxy.host}"
+               addproperty="proxy.host.input"/>
+        <input message="   Enter proxy port:"
+               defaultvalue="${proxy.port}"
+               addproperty="proxy.port.input"/>
+        <input message="   Enter proxy user:"
+               defaultvalue="${proxy.user}"
+               addproperty="proxy.user.input"/>
+        <input message="   Enter proxy password:"
+               defaultvalue="${proxy.pass}"
+               addproperty="proxy.pass.input"/>
+      </then>
+      <else>
+        <property name="proxy.host.input" value="${proxy.host}"/>
+        <property name="proxy.port.input" value="${proxy.port}"/>
+        <property name="proxy.user.input" value="${proxy.user}"/>
+        <property name="proxy.pass.input" value="${proxy.pass}"/>
+      </else>
+    </if>
+
+    <echo>* STAF configuration</echo>
+    <input message="   Enter STAF version:"
+           defaultvalue="${staf.version}"
+           addproperty="staf.version.input"/>
+    <input message="   Enter STAX version:"
+           defaultvalue="${stax.version}"
+           addproperty="stax.version.input"/>
+    <input message="   Enter Email service version:"
+           defaultvalue="${email.version}"
+           addproperty="email.version.input"/>
+    <input message="   Enter Event service version:"
+           defaultvalue="${event.version}"
+           addproperty="event.version.input"/>
+    <input message="   Enter EventManager service version:"
+           defaultvalue="${eventmanager.version}"
+           addproperty="eventmanager.version.input"/>
+    <input message="   Enter HTTP service version:"
+           defaultvalue="${http.version}"
+           addproperty="http.version.input"/>
+    <input message="   Enter Tomcat service version:"
+           defaultvalue="${tomcat.version}"
+           addproperty="tomcat.version.input"/>
+    <input message="   Enter hostname:"
+           defaultvalue="${host.name}"
+           addproperty="host.name.input"/>
+    <input message="   Enter STAF port:"
+           defaultvalue="${staf.port}"
+           addproperty="staf.port.input"/>
+
+    <echo>* Tests configuration</echo>
+    <input message="   Enter Java home path:"
+           defaultvalue="${java.path}"
+           addproperty="java.path.input"/>
+    <input message="   Enter OpenDS ldap port:"
+           defaultvalue="${opends.port.ldap}"
+           addproperty="opends.port.ldap.input"/>
+    <input message="   Enter OpenDS secure ldap port:"
+           defaultvalue="${opends.port.ldaps}"
+           addproperty="opends.port.ldaps.input"/>
+    <input message="   Enter OpenDS jmx port:"
+           defaultvalue="${opends.port.jmx}"
+           addproperty="opends.port.jmx.input"/>
+    <input message="   Enter OpenDS admin DN (also called root DN):"
+           defaultvalue="${opends.admin.dn}"
+           addproperty="opends.admin.dn.input"/>
+    <input message="   Enter OpenDS admin password:"
+           defaultvalue="${opends.admin.pwd}"
+           addproperty="opends.admin.pwd.input"/>
+    <input message="   Enter OpenDMK lib directory:"
+           defaultvalue="${snmp.opendmk.lib.dir}"
+           addproperty="snmp.opendmk.lib.dir.input"/>
+    <input message="   Send report email?"
+           defaultvalue="${email.enabled}"
+           validargs="y,n"
+           addproperty="email.enabled.input"/>
+    <if>
+      <equals arg1="${email.enabled.input}" arg2="y"/>
+      <then>
+        <input message="   Email will appear to be from:"
+               defaultvalue="${email.from}"
+               addproperty="email.from.input"/>
+        <input message="   Send email to:"
+               defaultvalue="${email.to}"
+               addproperty="email.to.input"/>
+        <input message="   Enter SMTP server host:"
+               defaultvalue="${email.server.host}"
+               addproperty="email.server.host.input"/>
+        <input message="   Enter SMTP server port:"
+               defaultvalue="${email.server.port}"
+               addproperty="email.server.port.input"/>
+        <input message="   Enter SMTP server user:"
+               defaultvalue="${email.server.user}"
+               addproperty="email.server.user.input"/>
+        <input message="   Enter SMTP server password:"
+               defaultvalue="${email.server.pwd}"
+               addproperty="email.server.pwd.input"/>
+      </then>
+      <else>
+        <property name="email.from.input" value="${email.from}"/>
+        <property name="email.to.input" value="${email.to}"/>
+        <property name="email.server.host.input" value="${email.server.host}"/>
+        <property name="email.server.port.input" value="${email.server.port}"/>
+        <property name="email.server.user.input" value="${email.server.user}"/>
+        <property name="email.server.pwd.input" value="${email.server.pwd}"/>
+      </else>
+    </if>
+
+    <propertyselector property="input.list"
+                      delimiter=","
+                      match="(.*)\.input"
+                      select="\1"
+                      casesensitive="false"/>
+
+    <echo>Saving ...</echo>
+    <echo file="${basedir}/user.properties"># User-defined values
+# This file is generated by "build user-configure" command
+    </echo>
+    <for list="${input.list}" param="item">
+      <sequential>
+        <var name="val" value="${@{item}.input}"/>
+        <echo file="${basedir}/user.properties" append="true">
+@{item}=${val}</echo>
+      </sequential>
+    </for>
+  </target>
+
+  <target name="unconfigure">
+    <delete file="${basedir}/user.properties"/>
+  </target>
+</project>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/windows-x86-32.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/windows-x86-32.properties
deleted file mode 100644
index 404306f..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/windows-x86-32.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-bits.staf.archive=STAF323-setup-win32.jar
-
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/windows-x86-64.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/windows-x86-64.properties
deleted file mode 100644
index bcc5f49..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/windows-x86-64.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-staf.archive.name=STAF323-setup-win64.jar
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/windows.properties b/opendj-sdk/opends/tests/staf-tests/shared/ant/windows.properties
deleted file mode 100644
index 404306f..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/windows.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-bits.staf.archive=STAF323-setup-win32.jar
-
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/staf/failure.html b/opendj-sdk/opends/tests/staf-tests/shared/staf/failure.html
deleted file mode 100644
index f30fbbc..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/staf/failure.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-  <body>
-    <center>
-      <img src="http://pangea.stanford.edu/courses/GES41L/motivation/failure.gif">
-    </center>
-  </body>
-</html>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/staf/replay.bat b/opendj-sdk/opends/tests/staf-tests/shared/staf/replay.bat
deleted file mode 100644
index 40c9ddb..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/staf/replay.bat
+++ /dev/null
@@ -1,37 +0,0 @@
-@echo off
-
-rem CDDL HEADER START
-rem
-rem The contents of this file are subject to the terms of the
-rem Common Development and Distribution License, Version 1.0 only
-rem (the "License").  You may not use this file except in compliance
-rem with the License.
-rem
-rem You can obtain a copy of the license at
-rem trunk/opends/resource/legal-notices/OpenDS.LICENSE
-rem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-rem See the License for the specific language governing permissions
-rem and limitations under the License.
-rem
-rem When distributing Covered Code, include this CDDL HEADER in each
-rem file and include the License file at
-rem trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-rem add the following below this CDDL HEADER, with the fields enclosed
-rem information:
-rem      Portions Copyright [yyyy] [name of copyright owner]
-rem
-rem CDDL HEADER END
-rem
-rem
-rem      Copyright 2007-2008 Sun Microsystems, Inc.
-
-echo Backing configuration up
-move "${tests.config}" "${tests.config.backup}"
-echo Loading configuration as of ${tests.run.time}
-copy "${tests.run.dir}${file.separator}${tests.run.time}${file.separator}config${file.separator}${tests.config.file}" "${tests.config}"
-echo Starting test run
-"${staf.install.dir}${file.separator}bin${file.separator}STAF.exe" local STAX "${tests.request}"
-echo Removing configuration of ${tests.run.time}
-del /f "${tests.config}"
-echo Restoring original configuration
-move "${tests.config.backup}" "${tests.config}"
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/staf/replay.sh b/opendj-sdk/opends/tests/staf-tests/shared/staf/replay.sh
deleted file mode 100644
index f6550bb..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/staf/replay.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# information:
-#      Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#      Copyright 2007-2008 Sun Microsystems, Inc.
-
-echo "Backing configuration up"
-me "${tests.config}" "${tests.config.backup}"
-echo "Loading configuration as of ${tests.run.time}"
-cp "${tests.run.dir}${file.separator}${tests.run.time}${file.separator}config${file.separator}${tests.config.file}" "${tests.config}"
-echo "Starting test run"
-"${staf.install.dir}${file.separator}bin${file.separator}STAF" local STAX "${tests.request}"
-echo "Removing configuration of ${tests.run.time}"
-rm -f "${tests.config}"
-echo "Restoring original configuration"
-mv "${tests.config.backup}" "${tests.config}"
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/staf/functional-tests.cfg b/opendj-sdk/opends/tests/staf-tests/shared/staf/staf-controler.cfg
similarity index 91%
rename from opendj-sdk/opends/tests/staf-tests/shared/staf/functional-tests.cfg
rename to opendj-sdk/opends/tests/staf-tests/shared/staf/staf-controler.cfg
index ed34917..a04b6fd 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/staf/functional-tests.cfg
+++ b/opendj-sdk/opends/tests/staf-tests/shared/staf/staf-controler.cfg
@@ -40,8 +40,8 @@
 
 # LOG SERVICE CONFIGURATION
 SERVICE Log LIBRARY STAFLog \
-  PARMS "Directory {STAF/Config/STAFRoot}/../logs"
-  
+  PARMS "Directory {STAF/Config/STAFRoot}/logs"
+
 # ZIP SERVICE CONFIGURATION
 SERVICE Zip LIBRARY STAFZip
 
@@ -50,23 +50,23 @@
 #  OPTION JVMName=EventJVM \
 #  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
 SERVICE Event LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/event/STAFEvent.jar 
+  EXECUTE {STAF/Config/STAFRoot}/services/event/STAFEvent.jar
 
-# EVENTMANAGER SERVICE CONFIGURATION  
+# EVENTMANAGER SERVICE CONFIGURATION
 #  OPTION JVMName=EventManagerJVM \
-#  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}  
+#  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
 #  PARMS "EVENTSERVICENAME=Event" \
 SERVICE EventManager LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/eventmanager/STAFEventManager.jar 
+  EXECUTE {STAF/Config/STAFRoot}/services/eventmanager/STAFEventManager.jar
 
 # STAX SERVICE CONFIGURATION
 #  OPTION JVMName=StaxJVM \
 SERVICE Stax LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar 
+  EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar
 #  EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar \
 #  OPTION JVMName=STAXJVM \
 #  OPTION J2=-Xoss1m -Xss1m -Xmx384m
-  
+
 #EMAIL SERVICE CONFIGURATION
 #  OPTION JVMName=EmailJVM \
 #  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
@@ -82,7 +82,7 @@
   OPTION JVMNAME=httpJVM  \
   OPTION J2=-Xmx128m -Xms32m \
     -Djavax.net.ssl.trustStorePassword=changeit \
-    -Djavax.net.ssl.trustStore={STAF/Config/STAFRoot}/services/DSML/tomcatCertificate 
+    -Djavax.net.ssl.trustStore={STAF/Config/STAFRoot}/services/DSML/tomcatCertificate
 
 #DSML SERVICE CONFIGURATION
 #uncomment following if you want it to be in separate JVMs
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS.properties b/opendj-sdk/opends/tests/staf-tests/shared/staf/staf-slave.cfg
similarity index 67%
rename from opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS.properties
rename to opendj-sdk/opends/tests/staf-tests/shared/staf/staf-slave.cfg
index b71edf3..28635dc 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/ant/SunOS.properties
+++ b/opendj-sdk/opends/tests/staf-tests/shared/staf/staf-slave.cfg
@@ -21,4 +21,17 @@
 # CDDL HEADER END
 #
 #
-#      Copyright 2007-2008 Sun Microsystems, Inc.
+#      Copyright 2008 Sun Microsystems, Inc.
+
+# Turn on tracing of internal errors and deprecated options
+trace enable tracepoints "error deprecated"
+
+# Enable TCP/IP connections
+interface tcp library STAFTCP option port=${staf.port}
+
+# Set default local trust
+trust machine local://local level 5
+trust machine tcp://* level 5
+
+# Add default service loader
+serviceloader library STAFDSLS
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/staf/stress-tests.cfg b/opendj-sdk/opends/tests/staf-tests/shared/staf/stress-tests.cfg
deleted file mode 100755
index b1f25a0..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/staf/stress-tests.cfg
+++ /dev/null
@@ -1,51 +0,0 @@
-# Turn on tracing of internal errors and deprecated options
-trace enable tracepoints "error deprecated"
-
-# Enable TCP/IP connections
-interface tcp library STAFTCP option port=${staf.port}
-
-# Set default local trust
-trust machine local://local level 5
-trust level 5 machine tcp://localhost
-# this is required for the Zip Service to be able to expand archives
-trust level 5 user anonymous
-
-# Default Service Loader Service
-serviceloader library STAFDSLS
-
-# LOG SERVICE CONFIGURATION
-SERVICE Log LIBRARY STAFLog \
-  PARMS "Directory {STAF/Config/STAFRoot}/../logs"
-  
-# ZIP SERVICE CONFIGURATION
-SERVICE Zip LIBRARY STAFZip
-
-# EVENT SERVICE CONFIGURATION
-#  PARMS "MAXATTEMPTS 5 ACKNOWLEDGETIMEOUT 30000" \
-#  OPTION JVMName=EventJVM \
-#  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
-SERVICE Event LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/event/STAFEvent.jar
-
-# EVENTMANAGER SERVICE CONFIGURATION  
-#  OPTION JVMName=EventManagerJVM \
-#  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}  
-#  PARMS "EVENTSERVICENAME=Event" \
-SERVICE EventManager LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/eventmanager/STAFEventManager.jar 
-
-# STAX SERVICE CONFIGURATION
-#  OPTION JVMName=StaxJVM \
-#  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension} \
-#  OPTION J2=-Xmx384m
-SERVICE Stax LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar 
-  
-#EMAIL SERVICE CONFIGURATION
-#  OPTION JVMName=EmailJVM \
-#  OPTION JVM=${java.home}${file.separator}bin${file.separator}java${binary.extension}
-SERVICE Email LIBRARY JSTAF \
-  EXECUTE {STAF/Config/STAFRoot}/services/email/STAFEmail.jar
-  
-SET MAXQUEUESIZE 10000
-
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/tests/config.py.stubs b/opendj-sdk/opends/tests/staf-tests/shared/tests/config.py.stubs
index 6701aa7..95e8560 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/tests/config.py.stubs
+++ b/opendj-sdk/opends/tests/staf-tests/shared/tests/config.py.stubs
@@ -27,12 +27,12 @@
 TEST_JVM_STRING             = '${java.version}(${sun.arch.data.model} bits)'
 STAF_LOCAL_HOSTNAME         = 'localhost'
 STAF_REMOTE_HOSTNAME        = 'localhost'
-TMPDIR                      = '${staf.tmp.dir}'
+TMPDIR                      = '${tests.tmp.dir}'
 PSWDFILE                    = '%s/password' % TMPDIR
 OPENDSDIR                   = '${project.home}'
 OPENDSNAME                  = '${product.name}'
 ZIPNAME                     = '${product.name}.zip'
-ZIPPATH                     = '${product.package.dir}'
+ZIPPATH                     = '${opends.dir}'
 TESTS_ROOT                  = '%s/tests/staf-tests' % OPENDSDIR
 TESTS_DIR                   = '%s/functional-tests' % TESTS_ROOT
 TESTS_SHARED_DIR            = '%s/shared' % TESTS_DIR
@@ -47,7 +47,7 @@
 DIRECTORY_INSTANCE_SSL_PORT = '${opends.port.ldaps}'
 DIRECTORY_INSTANCE_SFX      = 'dc=com'
 DIRECTORY_INSTANCE_BE       = 'userRoot'
-JAVA_HOME                   = '${java.home}'
+JAVA_HOME                   = '${java.path}'
 LOGS_ROOT                   = '%s' % TMPDIR
 LOGS_URI                    = ''
 SEND_MAIL_AFTER_TEST_RUN    = '${staf.email.send}'
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/tests/runStressTests.xml b/opendj-sdk/opends/tests/staf-tests/shared/tests/runStressTests.xml
deleted file mode 100755
index e5ed85e..0000000
--- a/opendj-sdk/opends/tests/staf-tests/shared/tests/runStressTests.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License").  You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- !      Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- !      Copyright 2006-2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-  <defaultcall function="main" />
-  <function name="main">
-    <sequence>
-      <!--- Load the environment for the test suite execution -->
-      <import machine="STAF_LOCAL_HOSTNAME"
-              file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR" />
-      <call function="'loadEnvironment'" />
-
-      <!-- The Functional Tests -->
-      <import machine="STAF_LOCAL_HOSTNAME"
-              file="'%s/testcases/import_ldif/import_ldif.xml' % TESTS_DIR" />
-              
-      <script>
-        # this function return a well-formatted testcase name
-        def getTestCaseName(name):
-          return '%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],name)
-          
-        # this functions adds a known issue to a testcase's known issues list
-        issuesList=[]
-        def knownIssue(issue):
-          issuesList.append(issue)
-        
-        class functionToRun:
-          def __init__(self, name):
-            self.name = name
-          
-          def getName(self):
-            return self.name
-          
-        testlog=open('%s/tests-log.xml' % TMPDIR,'w')
-        testlog.write('&lt;qa&gt;\n')
-        testlog.write('  &lt;functional-tests&gt;\n')
-        testlog.write('    &lt;results&gt;\n')
-        testlog.close()
-          
-        suitesFileName='%s/testcases/run-custom-suites.dat' % TESTS_DIR
-        
-        if not os.path.exists(suitesFileName):
-          suitesFileName='%s/testcases/run-default-suites.dat' % TESTS_DIR
-          
-        f = open(suitesFileName, 'r')
-        functionsToRun = []
-        for line in f.readlines():
-          functionsToRun.append(functionToRun(line.rstrip()))
-        f.close()
-      </script>
-      <iterate var="function" in="functionsToRun">
-        <sequence>
-          <message>'calling function [%s]' % function.getName()</message>
-          <call function="function.getName()" />
-        </sequence>
-      </iterate>
-      
-      <!-- in this section we'll compute the coverage for all the tests
-           if coverage is turned on
-           so far I could only get through this on either machines with a lot
-           of memory or small sets of tests
-      -->
-      <if expr="os.path.exists('%s/lib/emma.jar' % dsPath)">
-        <sequence>
-          <script>
-            coverageFiles=''
-            for group in os.listdir('%s/coverage/' % TMPDIR):
-              coverageFiles+='%s/coverage/%s/coverage.ec' % (TMPDIR,group)
-          </script>
-          <call function="'runCommand'">
-              { 'name'      : 'Generate global coverage xml report',
-                'command'   : 'java',
-                'arguments' : ' -Xms64M -Xmx1024M -cp %s/lib/emma.jar emma report -r xml,html -in %s/coverage.em,%s -Dreport.xml.out.file=%s/coverage/coverage.xml -Dreport.html.out.file=%s/coverage/coverage.html -sp %s/../../../src' % (dsPath,dsPath,coverageFiles,TMPDIR,TMPDIR,TMPDIR),
-                'path'      : TMPDIR
-              }
-          </call>
-          <script>
-            from java.io import FileInputStream
-            from javax.xml.transform.stream import StreamSource
-            from javax.xml.transform.stream import StreamResult
-            from javax.xml.parsers import DocumentBuilderFactory
-            from org.w3c.dom import *
-            
-            factory = DocumentBuilderFactory.newInstance() 
-            builder = factory.newDocumentBuilder()
-            
-            input = FileInputStream("%s/coverage/coverage.xml" % TMPDIR)
-            document = builder.parse(input)
-            dom = document.getDocumentElement()
-            coverageNodes = dom.getElementsByTagName("all").item(0).getChildNodes()
-            for coverageNodeIndex in range(coverageNodes.getLength()):
-              thisNode = coverageNodes.item(coverageNodeIndex)
-              if thisNode.getNodeName() == 'coverage':
-                thisNodeAttributes = thisNode.getAttributes()
-                if thisNodeAttributes.getNamedItem("type").getNodeValue() == 'block, %':
-                  rawCoverage = thisNodeAttributes.getNamedItem("value").getNodeValue()
-                  coverage = rawCoverage.split('%')[0]
-            testlog=open('%s/tests-log.xml' % TMPDIR,'a')
-            testlog.seek(0,2)
-            testlog.write("      &lt;all&gt;\n")
-            testlog.write("        &lt;coverage&gt;\n")
-            testlog.write("          %s\n" % coverage)
-            testlog.write("        &lt;/coverage&gt;\n")
-            testlog.write("      &lt;/all&gt;\n")
-            testlog.close()
-          </script>
-        </sequence>
-        <else>
-          <script>
-            testlog=open('%s/tests-log.xml' % TMPDIR,'a')
-            testlog.seek(0,2)
-            testlog.write("      &lt;all&gt;\n")
-            testlog.write("        &lt;coverage&gt;\n")
-            testlog.write("          N/A\n")
-            testlog.write("        &lt;/coverage&gt;\n")
-            testlog.write("      &lt;/all&gt;\n")
-            testlog.close()
-          </script>
-        </else>
-      </if>
-
-      <!-- here goes the section where we get the product's info -->
-      <call function="'GetVar'">
-        { 'location'  : STAF_REMOTE_HOSTNAME,
-          'type'      : 'shared',
-          'variable'  : 'Job%s_ServerInfo' % STAXJobID
-        }
-      </call>
-
-      <if expr="RC != 0">
-        <script>
-          STAFResult='{}'
-        </script>
-      </if>
-            
-      <!-- Build the Servers Information Dictionary -->
-      <script> 
-        ServersInfoDict=eval(STAFResult)
-
-        ServerVersion='unknown'
-        ServerBuildId='unknown'
-        ServerJavaVersion='unknown'
-        ServerJavaVendor='unknown'
-        ServerJVMVersion='unknown'
-        ServerJVMVendor='unknown'
-        ServerSystemOS='unknown'
-        ServerSystemName='unknown'
-        ServerSvnRevision='unknown'
-        
-        if ServersInfoDict.has_key('%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)):
-          ServerInfoDict=ServersInfoDict['%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)]
-          
-          ServerInfoKey='server version'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerVersion=ServerInfoDict[ServerInfoKey]
-          
-          ServerInfoKey='server buildid'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerBuildId=ServerInfoDict[ServerInfoKey]
-          
-          ServerInfoKey='java version'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerJavaVersion=ServerInfoDict[ServerInfoKey]
-          
-          ServerInfoKey='java vendor'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerJavaVendor=ServerInfoDict[ServerInfoKey]
-
-          ServerInfoKey='jvm version'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerJVMVersion=ServerInfoDict[ServerInfoKey]
-
-          ServerInfoKey='jvm vendor'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerJVMVendor=ServerInfoDict[ServerInfoKey]
-
-          ServerInfoKey='system os'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerSystemOS=ServerInfoDict[ServerInfoKey]
-
-          ServerInfoKey='system name'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerSystemName=ServerInfoDict[ServerInfoKey]
-
-          ServerInfoKey='svn revision'
-          if ServerInfoDict.has_key(ServerInfoKey):
-            ServerSvnRevision=ServerInfoDict[ServerInfoKey]
-          
-        else:
-          ServerInfoDict='No key found (%s/%s)' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
-        
-        testlog=open('%s/tests-log.xml' % TMPDIR,'a')
-        testlog.seek(0,2)
-        testlog.write('    &lt;/results&gt;\n')
-        testlog.write('    &lt;identification&gt;\n')
-        testlog.write('      &lt;version&gt;\n')
-        testlog.write('        %s\n' % ServerVersion)
-        testlog.write('      &lt;/version&gt;\n')    
-        testlog.write('      &lt;buildid&gt;\n')
-        testlog.write('        %s\n' % ServerBuildId)
-        testlog.write('      &lt;/buildid&gt;\n')
-        testlog.write('      &lt;revision&gt;\n')
-        testlog.write('        %s\n' % ServerSvnRevision)
-        testlog.write('      &lt;/revision&gt;\n')                 
-        testlog.write('      &lt;platform&gt;\n')
-        testlog.write('        %s\n' % ServerSystemOS)
-        testlog.write('      &lt;/platform&gt;\n')
-        testlog.write('      &lt;jvm-version&gt;\n')
-        testlog.write('        %s\n' % ServerJVMVersion)
-        testlog.write('      &lt;/jvm-version&gt;\n')
-        testlog.write('      &lt;jvm-vendor&gt;\n')
-        testlog.write('        %s\n' % ServerJVMVendor)
-        testlog.write('      &lt;/jvm-vendor&gt;\n')        
-        testlog.write('    &lt;/identification&gt;\n')
-        testlog.write('  &lt;/functional-tests&gt;\n')
-        testlog.write('&lt;/qa&gt;\n')
-        testlog.close()
-      </script>
-    </sequence>
-  </function>
-</stax>
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 14f11be..01a23e2 100644
--- a/opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/tests/runTestJob.xml
@@ -60,7 +60,7 @@
           else:
             ServerOsString='Unknown Operating System'
         except NameError,details:
-            ServerOsString='Unknown Operating System'    
+            ServerOsString='Unknown Operating System'
 
         try:
           if TEST_JVM_STRING:
@@ -77,17 +77,17 @@
             logsURI=''
         except NameError,details:
             logsURI=''
-            
+
       </script>
-      
+
       <job name="'Job: %s %s' % (STAF_REMOTE_HOSTNAME,ServerOsString) " monitor="1" clearlogs="'Enabled'" logtcstartstop="'Enabled'">
-        <job-file>'%s/shared/tests/runFuncTests.xml' % TESTS_ROOT</job-file>
+        <job-file>'%s/shared/tests/runTests.xml' % TESTS_ROOT</job-file>
         <job-scriptfiles machine="STAF_LOCAL_HOSTNAME"> STAXJobScriptFiles </job-scriptfiles>
         <job-action>
           <log>'Started sub-job %s on %s, %s' % (STAXSubJobID,STAF_REMOTE_HOSTNAME,ServerOsString )</log>
         </job-action>
       </job>
-      
+
       <if expr="RC == 0">
         <sequence>
           <message>
@@ -107,11 +107,11 @@
           </sequence>
         </else>
       </if>
-      
+
       <!--- Import required shared xml libraries -->
       <import machine="STAF_LOCAL_HOSTNAME"
               file="'%s/stafcmd.xml' % TESTS_FUNCTIONS_DIR" />
-      
+
       <!-- FixMe
         dirty workaround because utils.xml now depends on environment.xml
         to avoid loading environment.xml I'll just set the required vars here
@@ -123,7 +123,7 @@
       </script>
       <import machine="STAF_LOCAL_HOSTNAME"
         file="'%s/utils.xml' % (TESTS_FUNCTIONS_DIR)" />
-      
+
       <!-- Get Directory Server Variables -->
       <call function="'GetVar'">
         { 'location'  : STAF_REMOTE_HOSTNAME,
@@ -131,19 +131,19 @@
           'variable'  : 'Job%s_ServerInfo' % STAXSubJobID
         }
       </call>
-      
+
       <if expr="RC != 0">
         <script>
           STAFResult='{}'
         </script>
       </if>
-      
+
       <!-- Build the Servers Information Dictionary -->
-      <script> 
-        
+      <script>
+
         ServersInfoDict=eval(STAFResult)
 
-        ServerName='unknown'        
+        ServerName='unknown'
         ServerVersion='unknown'
         ServerBuildId='unknown'
         ServerJavaVersion='unknown'
@@ -157,32 +157,32 @@
         ServerSvnRevision='unknown'
         ServerPackage='%s/%s' % (ZIPPATH,ZIPNAME)
         ServerSNMPJarFile='%s' % SNMP_OPENDMK_JARFILE
-        
-        if ServersInfoDict.has_key('%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)):       
+
+        if ServersInfoDict.has_key('%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)):
           ServerInfoDict=ServersInfoDict['%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)]
 
-          ServerName=OPENDSNAME         
+          ServerName=OPENDSNAME
 
           ServerInfoKey='server version'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerVersion=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='server buildid'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerBuildId=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='java version'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerJavaVersion=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='java vendor'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerJavaVendor=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='jvm version'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerJVMVersion=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='jvm vendor'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerJVMVendor=ServerInfoDict[ServerInfoKey]
@@ -190,24 +190,24 @@
           ServerInfoKey='jvm architecture'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerJVMArchitecture=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='system os'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerSystemOS=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='system name'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerSystemName=ServerInfoDict[ServerInfoKey]
-          
+
           ServerInfoKey='svn revision'
           if ServerInfoDict.has_key(ServerInfoKey):
             ServerSvnRevision=ServerInfoDict[ServerInfoKey]
-                                                                                                
+
         else:
           ServerInfoDict='No key found (%s/%s)' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
 
         if ServerOsString == 'Unknown Operating System':
-          ServerOsString=ServerSystemOS        
+          ServerOsString=ServerSystemOS
 
         if ServerJVMString == 'Unknown JVM':
           ServerJVMString=ServerJVMVersion
@@ -227,10 +227,10 @@
       <call function="'GetVar'">
         { 'location'  : STAF_REMOTE_HOSTNAME,
           'type'      : 'shared',
-          'variable'  : 'Job%s_LogsDir' % STAXSubJobID 
+          'variable'  : 'Job%s_LogsDir' % STAXSubJobID
         }
       </call>
-      
+
       <if expr="RC == 0">
         <script>
           logsDir=STAFResult
@@ -239,24 +239,24 @@
         <sequence>
           <message>
             'Unable to retrieve LogsDir variable, RC=%s,Result=%s.' % (RC,STAFResult)
-          </message>          
+          </message>
           <script>
             logsDir='%s' % TMPDIR
           </script>
         </sequence>
       </else>
       </if>
-      
+
       <script>
         logsReportDir='%s/reports' % logsDir
         logsTestsDir='%s/testlogs' % logsDir
       </script>
-      
+
       <call function="'createFolder'">
-        { 'location'   : STAF_LOCAL_HOSTNAME, 
+        { 'location'   : STAF_LOCAL_HOSTNAME,
           'foldername' : logsReportDir }
       </call>
-            
+
       <script>
         resultQuery=[]
         textfile= '%s/results.txt' % logsReportDir
@@ -264,7 +264,7 @@
       </script>
 
       <iterate var="thisChild" in="listOfChildren">
-        <sequence>                              
+        <sequence>
           <stafcmd name="'STAF Command: Log Query All'">
             <location>'%s' % STAF_LOCAL_HOSTNAME </location>
             <service>'log'</service>
@@ -282,12 +282,12 @@
                 'Log Query on STAX_Job_%s Completed. RC=%s' % (thisChild,RC)
               </message>
               <iterate var="line" in="resultQuery">
-        
+
                 <script>
                  txtfh.write('%s\n' % line)
                 </script>
-      
-              </iterate> 
+
+              </iterate>
             </sequence>
             <else>
               <sequence>
@@ -302,26 +302,26 @@
         </sequence>
       </iterate>
 
-      <script> 
-        txtfh.close() 
+      <script>
+        txtfh.close()
       </script>
 
       <!-- Write XML File for results -->
       <script>
         import re
         xmlfile= '%s/results.xml' % logsReportDir
-        xmlfh=open(xmlfile,'w') 
+        xmlfh=open(xmlfile,'w')
         errorfile= '%s/results.errors' % logsReportDir
         errorfh=open(errorfile,'w')
       </script>
-      
+
       <!-- Build the test case dictionary object -->
       <script>
         testDict={}
         testCaseList=[]
         try:
           txtfh=open(textfile,'r')
-        
+
           try:
             for line in txtfh.readlines():
               element=eval(line)
@@ -329,11 +329,11 @@
               level=element['level']
               message=element['message']
               timestamp=element['timestamp']
-              
+
               startValueDict={}
               stopValueDict={}
               statusValueDict={}
-              
+
               if level == 'Start':
                 tcpattern=re.compile("(Testcase): (.*)")
                 tcmatch = tcpattern.search(message)
@@ -344,20 +344,20 @@
                     for key in testDict[tcname].keys():
                       value=testDict[tcname][key]
                       startValueDict[key]=value
-                  
+
                   startValueDict['start']=timestamp
                   testDict[tcname]=startValueDict
-                  
+
                   testCaseList.append(tcname.strip())
-                
+
                 else:
                   errorfh.write('Warning: No match Start element %s.\n' % element)
-              
+
               elif level == 'Stop':
-                
+
                 tcpattern=re.compile("(Testcase): (.*), ElapsedTime: (.*)")
                 tcmatch = tcpattern.search(message)
-                
+
                 if tcmatch:
                   tctype=tcmatch.group(1)
                   tcname=tcmatch.group(2)
@@ -366,19 +366,19 @@
                     for key in testDict[tcname].keys():
                       value=testDict[tcname][key]
                       stopValueDict[key]=value
-                  
+
                   stopValueDict['stop']=timestamp
                   stopValueDict['duration']=tctime
                   testDict[tcname]=stopValueDict
-                
+
                 else:
                   errorfh.write('Warning: No match Stop element %s.\n' % element)
-              
+
               elif level == 'Status':
-                
+
                 tcpattern=re.compile("(Testcase): (.*), Pass: (.*), Fail: (.*), ElapsedTime: (.*), NumStarts: (.*)")
                 tcmatch = tcpattern.search(message)
-                
+
                 if tcmatch:
                   tctype=tcmatch.group(1)
                   tcname=tcmatch.group(2)
@@ -386,29 +386,29 @@
                   tcfail=tcmatch.group(4)
                   tctime=tcmatch.group(5)
                   tcnums=tcmatch.group(6)
-                  
+
                   if testDict.has_key(tcname):
-                    
+
                     for key in testDict[tcname].keys():
                       value=testDict[tcname][key]
                       statusValueDict[key]=value
-                  
+
                   statusValueDict['pass']=tcpass
                   statusValueDict['fail']=tcfail
                   testDict[tcname]=statusValueDict
-                
+
                 else:
                   errorfh.write('Warning: No match Status element %s.\n' % element)
-              
+
               elif level == 'Info':
                 errorfh.write('Warning: Info element %s.\n' % element)
-              
+
               else:
                 errorfh.write('Error: Unknown element %s.\n' % element)
-        
+
           finally:
             txtfh.close()
-        
+
         except IOError:
           errorfh.write('Error: Unable to open %s. Reason IOError.' % textfile )
       </script>
@@ -417,30 +417,30 @@
       <script>
         localstaf =test_env.staf(STAF_LOCAL_HOSTNAME)
         remotestaf=test_env.staf(STAF_REMOTE_HOSTNAME)
-        
+
         stax = test_env.stax(STAF_LOCAL_HOSTNAME)
         event = test_env.event(STAF_LOCAL_HOSTNAME)
         eventman = test_env.eventmanager(STAF_LOCAL_HOSTNAME)
         email = test_env.email(STAF_LOCAL_HOSTNAME)
         http = test_env.http(STAF_LOCAL_HOSTNAME)
         dsml = test_env.dsml(STAF_LOCAL_HOSTNAME)
-                        
+
         xmlfh.write('&lt;qa&gt;\n')
         xmlfh.write('  &lt;functional-tests&gt;\n')
         xmlfh.write('    &lt;identification&gt;\n')
         xmlfh.write('      &lt;sut product="opends"&gt;\n')
         xmlfh.write('        &lt;name&gt;\n')
         xmlfh.write('          %s\n' % ServerName)
-        xmlfh.write('        &lt;/name&gt;\n')    
+        xmlfh.write('        &lt;/name&gt;\n')
         xmlfh.write('        &lt;version&gt;\n')
         xmlfh.write('          %s\n' % ServerVersion)
-        xmlfh.write('        &lt;/version&gt;\n')    
+        xmlfh.write('        &lt;/version&gt;\n')
         xmlfh.write('        &lt;buildid&gt;\n')
         xmlfh.write('          %s\n' % ServerBuildId)
         xmlfh.write('        &lt;/buildid&gt;\n')
         xmlfh.write('        &lt;revision&gt;\n')
         xmlfh.write('          %s\n' % ServerSvnRevision)
-        xmlfh.write('        &lt;/revision&gt;\n')                 
+        xmlfh.write('        &lt;/revision&gt;\n')
         xmlfh.write('        &lt;hostname&gt;\n')
         xmlfh.write('          %s\n' % STAF_REMOTE_HOSTNAME)
         xmlfh.write('        &lt;/hostname&gt;\n')
@@ -470,7 +470,7 @@
         xmlfh.write('        &lt;/jvm-bin&gt;\n')
         xmlfh.write('        &lt;os-label&gt;\n')
         xmlfh.write('          %s\n' % ServerOsString)
-        xmlfh.write('        &lt;/os-label&gt;\n')         
+        xmlfh.write('        &lt;/os-label&gt;\n')
         xmlfh.write('        &lt;server-package&gt;\n')
         xmlfh.write('          %s\n' % ServerPackage)
         xmlfh.write('        &lt;/server-package&gt;\n')
@@ -494,8 +494,8 @@
         xmlfh.write('        &lt;md5-sum&gt;\n')
         xmlfh.write('          TDB\n')
         xmlfh.write('        &lt;/md5-sum&gt;\n')
-        xmlfh.write('      &lt;/sut&gt;\n')        
-        xmlfh.write('      &lt;testware&gt;\n') 
+        xmlfh.write('      &lt;/sut&gt;\n')
+        xmlfh.write('      &lt;testware&gt;\n')
         xmlfh.write('        &lt;staf&gt;\n')
         xmlfh.write('          &lt;local&gt;\n')
         xmlfh.write('            &lt;hostname&gt;\n')
@@ -529,7 +529,7 @@
         xmlfh.write('          &lt;/library&gt;\n')
         xmlfh.write('          &lt;executable&gt;\n')
         xmlfh.write('            %s\n' % stax.executable)
-        xmlfh.write('          &lt;/executable&gt;\n')        
+        xmlfh.write('          &lt;/executable&gt;\n')
         xmlfh.write('          &lt;options&gt;\n')
         xmlfh.write('            %s\n' % stax.options)
         xmlfh.write('          &lt;/options&gt;\n')
@@ -546,7 +546,7 @@
         xmlfh.write('          &lt;/library&gt;\n')
         xmlfh.write('          &lt;executable&gt;\n')
         xmlfh.write('            %s\n' % event.executable)
-        xmlfh.write('          &lt;/executable&gt;\n')        
+        xmlfh.write('          &lt;/executable&gt;\n')
         xmlfh.write('          &lt;options&gt;\n')
         xmlfh.write('            %s\n' % event.options)
         xmlfh.write('          &lt;/options&gt;\n')
@@ -563,7 +563,7 @@
         xmlfh.write('          &lt;/library&gt;\n')
         xmlfh.write('          &lt;executable&gt;\n')
         xmlfh.write('            %s\n' % eventman.executable)
-        xmlfh.write('          &lt;/executable&gt;\n')        
+        xmlfh.write('          &lt;/executable&gt;\n')
         xmlfh.write('          &lt;options&gt;\n')
         xmlfh.write('            %s\n' % eventman.options)
         xmlfh.write('          &lt;/options&gt;\n')
@@ -580,7 +580,7 @@
         xmlfh.write('          &lt;/library&gt;\n')
         xmlfh.write('          &lt;executable&gt;\n')
         xmlfh.write('            %s\n' % email.executable)
-        xmlfh.write('          &lt;/executable&gt;\n')        
+        xmlfh.write('          &lt;/executable&gt;\n')
         xmlfh.write('          &lt;options&gt;\n')
         xmlfh.write('            %s\n' % email.options)
         xmlfh.write('          &lt;/options&gt;\n')
@@ -597,7 +597,7 @@
         xmlfh.write('          &lt;/library&gt;\n')
         xmlfh.write('          &lt;executable&gt;\n')
         xmlfh.write('            %s\n' % http.executable)
-        xmlfh.write('          &lt;/executable&gt;\n')        
+        xmlfh.write('          &lt;/executable&gt;\n')
         xmlfh.write('          &lt;options&gt;\n')
         xmlfh.write('            %s\n' % http.options)
         xmlfh.write('          &lt;/options&gt;\n')
@@ -614,14 +614,14 @@
         xmlfh.write('          &lt;/library&gt;\n')
         xmlfh.write('          &lt;executable&gt;\n')
         xmlfh.write('            %s\n' % dsml.executable)
-        xmlfh.write('          &lt;/executable&gt;\n')        
+        xmlfh.write('          &lt;/executable&gt;\n')
         xmlfh.write('          &lt;options&gt;\n')
         xmlfh.write('            %s\n' % dsml.options)
         xmlfh.write('          &lt;/options&gt;\n')
         xmlfh.write('          &lt;params&gt;\n')
         xmlfh.write('            %s\n' % dsml.params)
         xmlfh.write('          &lt;/params&gt;\n')
-        xmlfh.write('        &lt;/service&gt;\n')        
+        xmlfh.write('        &lt;/service&gt;\n')
         xmlfh.write('      &lt;/testware&gt;\n')
         xmlfh.write('      &lt;tests-dir&gt;\n')
         xmlfh.write('        %s\n' % logsDir)
@@ -635,11 +635,11 @@
         xmlfh.write('    &lt;/identification&gt;\n')
         xmlfh.write('    &lt;results&gt;\n')
       </script>
-      
+
       <!-- XML Report Results -->
       <script>
         for tcname in testCaseList:
-          
+
           if testDict.has_key(tcname):
             tcnamesplit=tcname.split(":")
             if tcnamesplit[0]:
@@ -651,74 +651,74 @@
             else:
               tcgroup=tcname
               tcsuite=tcname
-            
+
             if testDict[tcname].has_key('pass'):
               tcpass=testDict[tcname]['pass']
             else:
               tcpass='0'
-            
+
             if testDict[tcname].has_key('fail'):
               tcfail=testDict[tcname]['fail']
             else:
               tcfail='0'
-            
+
             if testDict[tcname].has_key('start'):
               tcstart=testDict[tcname]['start']
             else:
               tcstart='unknown'
-            
+
             if testDict[tcname].has_key('stop'):
               tcstop=testDict[tcname]['stop']
             else:
               tcstop='unknown'
-            
+
             if testDict[tcname].has_key('duration'):
               tcduration=testDict[tcname]['duration']
             else:
               duration='unknown'
-          
+
           else:
             errorfh.write('No key for testcase %s.\n' % tcname)
-          
+
           if int(tcfail) == 0 and int(tcpass) > 0:
             tcresult='pass'
-          elif int(tcfail) == 0 and int(tcpass) == 0: 
+          elif int(tcfail) == 0 and int(tcpass) == 0:
             tcresult='unknown'
           else:
             tcresult='fail'
 
           tcdurationsecs=test_time().timeToSeconds(tcduration)
-          
+
           xmlfh.write('      &lt;testgroup name="%s"&gt;\n' % tcgroup)
           xmlfh.write('        &lt;testsuite name="%s"&gt;\n' % tcsuite)
           xmlfh.write('          &lt;testcase group="%s" suite="%s" name="%s" result="%s" start="%s" stop="%s" duration="%s"/&gt;\n' % (tcgroup,tcsuite,tcname,tcresult,tcstart,tcstop,tcdurationsecs))
           xmlfh.write('        &lt;/testsuite&gt;\n')
           xmlfh.write('      &lt;/testgroup&gt;\n')
       </script>
-      
+
       <!-- XML Report Post -->
       <script>
         xmlfh.write('    &lt;/results&gt;\n')
         xmlfh.write('  &lt;/functional-tests&gt;\n')
         xmlfh.write('&lt;/qa&gt;\n')
       </script>
-      
+
       <script>
-        xmlfh.close() 
-        errorfh.close() 
+        xmlfh.close()
+        errorfh.close()
       </script>
-      
+
       <message>
         'XML Report Written to %s.' % xmlfile
       </message>
 
-      <!-- Generate the standard test report showing all testcases -->      
+      <!-- Generate the standard test report showing all testcases -->
       <script>
         _message='Generated standard test report.'
         xslfile= '%s/xsl/gen-alltests-report.xsl' % TESTS_SHARED_DIR
         htmlfile= '%s/results.html' % logsReportDir
 
-        standardReport=report_generation()      
+        standardReport=report_generation()
 
         stringParamsDict={}
 
@@ -731,42 +731,42 @@
       </script>
       <message>_message</message>
 
-      <!-- Generate the test report by test groups-->      
+      <!-- Generate the test report by test groups-->
       <script>
         _message='Generated groups test report.'
         xslfile= '%s/xsl/gen-groups-report.xsl' % TESTS_SHARED_DIR
         htmlfile= '%s/groups.html' % logsReportDir
         testslog= '%s/tests-log.xml' % logsTestsDir
-        groupsReport=report_generation()      
+        groupsReport=report_generation()
         stringParamsDict={ 'tests-log' : testslog }
-        
+
         try:
           groupsReport.transformReport(xslfile,xmlfile,htmlfile,stringParamsDict)
         except IOError,details:
-          _message='Unable to generate groups test report %s.' % details          
+          _message='Unable to generate groups test report %s.' % details
         except:
           _message='Unable to generate groups test report !!!'
       </script>
       <message>_message</message>
 
-      <!-- Generate the test report by test suites -->      
+      <!-- Generate the test report by test suites -->
       <script>
         _message='Generated suites test reports.'
 
         testGroupDirsList=os.listdir(logsTestsDir)
         for testGroupName in testGroupDirsList:
-        
+
           groupDir='%s/%s' % (logsTestsDir,testGroupName)
-        
+
           if os.path.isdir(groupDir):
-        
+
             xmlfile='%s/results.xml' % logsReportDir
             htmlfile='%s/%s.html' % (groupDir,testGroupName)
             xslfile= '%s/xsl/gen-suites-report.xsl' % TESTS_SHARED_DIR
-        
+
             suitesReport=report_generation()
             stringParamsDict={ 'group' : testGroupName, 'tests-log' : testslog }
-        
+
             try:
               suitesReport.transformReport(xslfile,xmlfile,htmlfile,stringParamsDict)
             except IOError,details:
@@ -782,7 +782,7 @@
         xslfile= '%s/xsl/id.xsl' % TESTS_SHARED_DIR
         htmlfile= '%s/id.html' % logsReportDir
 
-        idReport=report_generation()      
+        idReport=report_generation()
 
         stringParamsDict={}
 
@@ -793,16 +793,16 @@
         except:
           _message='Unable to generate product identification test report !!!'
       </script>
-      <message>_message</message>                                
+      <message>_message</message>
 
       <!-- Generate the summary text file -->
-      <script>          
+      <script>
         _message='Generated the summary text report'
         mysummaryxsl='%s/xsl/gen-text-summary.xsl' % TESTS_SHARED_DIR
         mysummarytext='%s/summary.txt' % logsReportDir
         mysummaryxml=xmlfile
 
-        summaryReport=report_generation()      
+        summaryReport=report_generation()
 
         stringParamsDict={}
 
@@ -812,13 +812,13 @@
           _message='Unable to generate summary text file %s.' % details
       </script>
       <message>_message</message>
-           
+
       <if expr="SEND_MAIL_AFTER_TEST_RUN == 'TRUE'">
         <sequence>
           <message>
             'Sending Email Test Report to %s.' % SEND_MAIL_TO
           </message>
-          
+
           <script>
             try:
               if SEND_MAIL_REPORT:
@@ -835,7 +835,7 @@
                 MailToList=[]
             except NameError,details:
                 MailToList=[]
-            
+
             try:
               if SEND_MAIL_SUBJECT:
                 MailSubject= SEND_MAIL_SUBJECT
@@ -843,16 +843,16 @@
                 MailSubject= 'OpenDS Test Report for %s' % STAF_REMOTE_HOSTNAME
             except NameError,details:
                 MailSubject= 'OpenDS Test Report for %s' % STAF_REMOTE_HOSTNAME
-                            
+
             MailSendTo= ' '
           </script>
-          
+
           <iterate var="Recipient" in="MailToList">
             <script>
              MailSendTo='to %s %s' % (Recipient,MailSendTo)
             </script>
           </iterate>
-          
+
           <stafcmd name="'STAF Command: Send test report %s' % MailSendTo">
             <location>'%s' % STAF_LOCAL_HOSTNAME </location>
             <service>'email'</service>
@@ -860,7 +860,7 @@
               'send %s contenttype "text/html" file %s subject "%s" noheader' % (MailSendTo,MailSendReport,MailSubject)
             </request>
           </stafcmd>
-          
+
           <if expr="RC != 0">
             <message log="1" level="'Error'">
               'Send test report failed. RC: %s STAFResult: %s' % (RC,STAFResult)
@@ -874,6 +874,6 @@
         </sequence>
       </if>
     </sequence>
-  
+
   </function>
 </stax>
diff --git a/opendj-sdk/opends/tests/staf-tests/shared/tests/runFuncTests.xml b/opendj-sdk/opends/tests/staf-tests/shared/tests/runTests.xml
similarity index 99%
rename from opendj-sdk/opends/tests/staf-tests/shared/tests/runFuncTests.xml
rename to opendj-sdk/opends/tests/staf-tests/shared/tests/runTests.xml
index d3d7607..5c355e5 100755
--- a/opendj-sdk/opends/tests/staf-tests/shared/tests/runFuncTests.xml
+++ b/opendj-sdk/opends/tests/staf-tests/shared/tests/runTests.xml
@@ -72,7 +72,7 @@
       <iterate var="group" in="groupsToRun" >
 
         <sequence>
-        
+
           <!-- The job that executes the tests -->
           <script>
             STAXParentID=STAXJobID
@@ -87,7 +87,7 @@
             </job-function>
             <job-function-args eval='1'>
               STAXParentID
-            </job-function-args>        
+            </job-function-args>
             <job-scriptfiles machine="STAF_LOCAL_HOSTNAME">
               STAXJobScriptFiles
             </job-scriptfiles>
@@ -97,7 +97,7 @@
               </log>
             </job-action>
           </job>
-    
+
           <if expr="RC == 0">
             <sequence>
               <message>
@@ -115,9 +115,9 @@
               </sequence>
             </else>
           </if>
-      
+
         </sequence>
-        
+
       </iterate>
 
       <!-- in this section we'll compute the coverage for all the tests
@@ -315,7 +315,7 @@
         testlog.write('&lt;/qa&gt;\n')
         testlog.close()
       </script>
-      
+
       <return>listOfChildren</return>
 
     </sequence>
diff --git a/opendj-sdk/opends/tests/staf-tests/stress-tests/config/config.py b/opendj-sdk/opends/tests/staf-tests/stress-tests/config/config.py
deleted file mode 100755
index 2c499f2..0000000
--- a/opendj-sdk/opends/tests/staf-tests/stress-tests/config/config.py
+++ /dev/null
@@ -1,30 +0,0 @@
-TEST_OS_STRING              = 'Linux'
-TEST_HW_STRING              = 'i386'
-TEST_JVM_STRING             = '1.6.0_01(32 bits)'
-STAF_LOCAL_HOSTNAME         = 'localhost'
-STAF_REMOTE_HOSTNAME        = 'localhost'
-TMPDIR                      = '/path/to/opends/tests/functional-run/tmp'
-PSWDFILE                    = '%s/password' % TMPDIR
-OPENDSDIR                   = '/path/to/opends'
-OPENDSNAME                  = 'OpenDS-0.9.0'
-ZIPNAME                     = 'OpenDS-0.9.0.zip'
-ZIPPATH                     = '/path/to/opends/build/package'
-TESTS_ROOT                  = '%s/tests' % OPENDSDIR
-TESTS_DIR                   = '%s/functional-tests' % TESTS_ROOT
-TESTS_SHARED_DIR            = '%s/shared' % TESTS_DIR
-TESTS_FUNCTIONS_DIR         = '%s/functions' % TESTS_SHARED_DIR
-TESTS_DATA_DIR              = '%s/data' % TESTS_SHARED_DIR
-TESTS_JAVA_DIR		    = '%s/java' % TESTS_SHARED_DIR
-DIRECTORY_INSTANCE_DN       = 'cn=myself'
-DIRECTORY_INSTANCE_PSWD     = 'password'
-DIRECTORY_INSTANCE_DIR      = '%s' % TMPDIR
-DIRECTORY_INSTANCE_HOST     = 'localhost'
-DIRECTORY_INSTANCE_PORT     = '1389'
-DIRECTORY_INSTANCE_SSL_PORT = '1636'
-DIRECTORY_INSTANCE_SFX      = 'dc=com'
-DIRECTORY_INSTANCE_BE       = 'userRoot'
-JAVA_HOME                   = '/path/to/java/6/jdk1.6.0_01/jre'
-LOGS_ROOT                   = '%s' % TMPDIR
-LOGS_URI                    = ''
-SEND_MAIL_AFTER_TEST_RUN    = 'false'
-SEND_MAIL_TO                = ''

--
Gitblit v1.10.0