From 60646df757715c436c47d28b6c530935e9f0ad4f Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 09 Oct 2006 01:57:06 +0000
Subject: [PATCH] Add a number of test cases for the LDAP tools (LDAPSearch, LDAPModify, LDAPCompare, LDAPDelete, and LDAPPasswordModify).
---
opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
index 082aa90..1c0cd69 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
@@ -593,4 +593,29 @@
public static List<Entry> makeEntries(String... lines) throws Exception {
return entriesFromLdifString(makeLdif(lines));
}
+
+ /**
+ * Creates a temporary text file with the specified contents. It will be
+ * marked for automatic deletion when the JVM exits.
+ *
+ * @return The absolute path to the file that was created.
+ *
+ * @throws Exception If an unexpected problem occurs.
+ */
+ public static String createTempFile(String... lines)
+ throws Exception
+ {
+ File f = File.createTempFile("LDAPModifyTestCase", ".txt");
+ f.deleteOnExit();
+
+ FileWriter w = new FileWriter(f);
+ for (String s : lines)
+ {
+ w.write(s + System.getProperty("line.separator"));
+ }
+
+ w.close();
+
+ return f.getAbsolutePath();
+ }
}
--
Gitblit v1.10.0