From 35b36b3502042506bd0f499dfb110bfd6657e2ed Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Wed, 26 May 2010 21:09:55 +0000
Subject: [PATCH] Add support of build.dir redefinition for unit tests By default, most of the files generated at build time are located in <ws>/build. If -Dbuild.dir is used, it is possible to specify another directory. This change allows to run unit-tests in this kind of build environment.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java
index 36912e1..41e93e4 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java
@@ -85,8 +85,9 @@
 
       // create or clean a directory for the dbHandler
       String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
-      String path = buildRoot + File.separator + "build" + File.separator +
-        "unit-tests" + File.separator + "dbHandler";
+      String path = System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR,
+              buildRoot + File.separator + "build");
+      path = path + File.separator + "unit-tests" + File.separator + "dbHandler";
       testRoot = new File(path);
       if (testRoot.exists())
       {
@@ -306,8 +307,9 @@
 
       // create or clean a directory for the dbHandler
       String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
-      String path = buildRoot + File.separator + "build" + File.separator +
-        "unit-tests" + File.separator + "dbHandler";
+      String path = System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR,
+              buildRoot + File.separator + "build");
+      path = path + File.separator + "unit-tests" + File.separator + "dbHandler";
       testRoot = new File(path);
       if (testRoot.exists())
       {
@@ -415,8 +417,9 @@
 
       // create or clean a directory for the dbHandler
       String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
-      String path = buildRoot + File.separator + "build" + File.separator +
-      "unit-tests" + File.separator + "dbHandlercp";
+      String path = System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR,
+              buildRoot + File.separator + "build");
+      path = path + File.separator + "unit-tests" + File.separator + "dbHandler";
       testRoot = new File(path);
       if (testRoot.exists())
       {

--
Gitblit v1.10.0