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/util/CertificateManagerTestCase.java | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/util/CertificateManagerTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/util/CertificateManagerTestCase.java
index 11e8bb5..90ef7cf 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/util/CertificateManagerTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/util/CertificateManagerTestCase.java
@@ -57,13 +57,18 @@
CertificateManager.mayUseCertificateManager();
+ // Get the build root and use it to create a test package directory.
+ public static final String BUILD_ROOT =
+ System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT);
+
/**
* The path to a JKS key store file.
*/
public static final String JKS_KEY_STORE_PATH =
- System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT) + File.separator +
- "build" + File.separator + "unit-tests" + File.separator +
+ System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR,
+ BUILD_ROOT + File.separator + "build") +
+ File.separator + "unit-tests" + File.separator +
"package-instance" +
File.separator + "config" + File.separator + "server.keystore";
@@ -73,8 +78,9 @@
* The path to a PKCS#12 key store file.
*/
public static final String PKCS12_KEY_STORE_PATH =
- System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT) + File.separator +
- "build" + File.separator + "unit-tests" + File.separator +
+ System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR,
+ BUILD_ROOT + File.separator + "build") +
+ File.separator + "unit-tests" + File.separator +
"package-instance" +
File.separator + "config" + File.separator + "server-cert.p12";
@@ -84,8 +90,9 @@
* The path to the unit test working directory.
*/
public static final String TEST_DIR =
- System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT) + File.separator +
- "build" + File.separator + "unit-tests" + File.separator +
+ System.getProperty(TestCaseUtils.PROPERTY_BUILD_DIR,
+ BUILD_ROOT + File.separator + "build") +
+ File.separator + "unit-tests" + File.separator +
"package-instance";
--
Gitblit v1.10.0