From 949a7f32c5c94a53fa8fd70f8ab0cb7a5e157d50 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 07 Sep 2006 19:25:31 +0000
Subject: [PATCH] Update the TestCaseUtils.startServer() method to build the appropriate server root environment there rather than in the ant script.  This will make it easier to run the tests in an IDE rather than from the command line.

---
 opends/build.xml |   58 +++++-----------------------------------------------------
 1 files changed, 5 insertions(+), 53 deletions(-)

diff --git a/opends/build.xml b/opends/build.xml
index e867500..4c345df 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -53,8 +53,6 @@
 
   <property name="unittest.classes.dir"
        location="${build.dir}/unit-tests/classes" />
-  <property name="unittest.package.dir"
-       location="${build.dir}/unit-tests/package" />
   <property name="unittest.report.dir"
        location="${build.dir}/unit-tests/report"/>
 
@@ -579,54 +577,9 @@
 
 
 
-  <!-- Create a minimal install suitable for running unit tests. -->
-  <target name="testpackage" depends="testinit">
-    <mkdir dir="${unittest.package.dir}"                 />
-    <mkdir dir="${unittest.package.dir}/bak"             />
-    <mkdir dir="${unittest.package.dir}/classes"         />
-    <mkdir dir="${unittest.package.dir}/config"          />
-    <mkdir dir="${unittest.package.dir}/config/schema"   />
-    <mkdir dir="${unittest.package.dir}/config/messages" />
-    <mkdir dir="${unittest.package.dir}/config/MakeLDIF" />
-    <mkdir dir="${unittest.package.dir}/db"              />
-    <mkdir dir="${unittest.package.dir}/changelogDb"     />
-    <mkdir dir="${unittest.package.dir}/ldif"            />
-    <mkdir dir="${unittest.package.dir}/lib"             />
-    <mkdir dir="${unittest.package.dir}/locks"           />
-    <mkdir dir="${unittest.package.dir}/logs"            />
-
-    <jar jarfile="${unittest.package.dir}/lib/OpenDS.jar"
-         basedir="${classes.dir}" compress="true" index="true" />
-
-    <jar jarfile="${unittest.package.dir}/lib/OpenDS-tests.jar"
-         basedir="${unittest.classes.dir}" compress="true" index="true" />
-
-    <copy todir="${unittest.package.dir}/lib">
-      <fileset file="${lib.dir}/*.jar" />
-    </copy>
-
-    <copy todir="${unittest.package.dir}/config">
-      <fileset file="${config.dir}/*" />
-    </copy>
-
-    <copy todir="${unittest.package.dir}/config/schema">
-      <fileset dir="${resource.dir}/schema" />
-    </copy>
-
-    <copy todir="${unittest.package.dir}/config/messages">
-      <fileset dir="${resource.dir}/messages" />
-    </copy>
-
-    <copy todir="${unittest.package.dir}/config/MakeLDIF">
-      <fileset dir="${resource.dir}/MakeLDIF" />
-    </copy>
-  </target>
-
-
-
   <!-- Execute the Directory Server TestNG unit tests in text mode. -->
   <target name="test"
-          depends="testinit,testpackage,runtests"
+          depends="testinit,runtests"
           description="Execute the Directory Server TestNG unit tests in text mode.">
   </target>
 
@@ -652,11 +605,13 @@
             enableAssert="false">
       <classpath>
         <pathelement location="${coverage.instr.dir}" />
+        <pathelement location="${classes.dir}" />
+        <pathelement location="${unittest.classes.dir}" />
 
         <path refid="run.classpath" />
         <path refid="emma.lib" />
 
-        <fileset dir="${unittest.package.dir}/lib">
+        <fileset dir="${lib.dir}">
           <include name="*.jar" />
         </fileset>
 
@@ -666,10 +621,7 @@
       </classpath>
       <jvmarg  value="-Demma.coverage.out.file=${coverage.data.dir}/coverage.emma" />
       <jvmarg value="-Demma.coverage.out.merge=false" />
-      <jvmarg value="-Dorg.opends.server.ForceDaemonThreads=true" />
-      <jvmarg value="-Dorg.opends.server.ServerRoot=${unittest.package.dir}" />
-      <jvmarg value="-Dorg.opends.server.ConfigClass=org.opends.server.config.ConfigFileHandler" />
-      <jvmarg value="-Dorg.opends.server.ConfigFile=${unittest.package.dir}/config/config.ldif" />
+      <jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}" />
       <xmlfileset dir="${testng.dir}" includes="testng.xml" />
     </testng>
 

--
Gitblit v1.10.0