From 1f0dc4a22dbfb54e350c966215bc30e385129366 Mon Sep 17 00:00:00 2001
From: el_kaboing <el_kaboing@localhost>
Date: Tue, 12 Sep 2006 20:40:56 +0000
Subject: [PATCH] Fixed some boo-boos and missed files for JavaDocs.
---
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/schema/SchemaRFCTests.java | 2
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests13.java | 3 +
opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSIntegrationTests.java | 52 +++++++++++++++++++++++---
opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests9.java | 2
opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestOutput.java | 15 +++++++
opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSMgr.java | 14 ++++++
opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestListener.java | 23 ++++++++++-
7 files changed, 99 insertions(+), 12 deletions(-)
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSIntegrationTests.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSIntegrationTests.java
index d56a85c..1c427c6 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSIntegrationTests.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSIntegrationTests.java
@@ -32,11 +32,8 @@
import org.opends.server.tools.LDAPSearch;
/**
- * This class defines a base test case that should be subclassed by all
- * unit tests used by the Directory Server.
- * <p>
- * This class adds the ability to print error messages and automatically
- * have them include the class name.
+ * This class defines an abstract test case that should be subclassed by all
+ * integration tests used by OpenDS.
*/
public abstract class OpenDSIntegrationTests {
// The print stream to use for printing error messages.
@@ -85,6 +82,12 @@
this.errorStream = errorStream;
}
+ /**
+ * Compares the return code from an ldap operation with the expected value.
+ *
+ * @param retCode The return code received from the ldap operation.
+ * @param expCode The expected value for the return code.
+ */
public void compareExitCode(int retCode, int expCode)
{
System.out.println("Return code is " + Integer.toString(retCode) + ", expecting " + Integer.toString(expCode));
@@ -92,11 +95,16 @@
{
if (retCode == 999)
System.out.println("OpenDS could not restart");
- // throw a fail in the testng framewok
+ // throw a fail in the testng framework
assert retCode==expCode;
}
}
+ /**
+ * Converts a string array of ldap paramters to a string.
+ *
+ * @param cmd[] The string array of ldap parameters
+ */
public String cmdArrayToString(String cmd[])
{
String outStr = cmd[0];
@@ -108,6 +116,20 @@
return outStr;
}
+ /**
+ * Starts OpenDS
+ *
+ * @param dsee_home The home directory for the OpenDS
+ * installation.
+ * @param hostname The hostname for the server where OpenDS
+ * is installed.
+ * @param port The port number for OpenDS.
+ * @param bindDN The bind DN.
+ * @param bindPW The password for the bind DN.
+ * @param logDir The directory for the log files that are
+ *
+ * @return 0 if OpenDS started successfully, 1 if not.
+ */
public int startOpenDS(String dsee_home, String hostname, String port, String bindDN, String bindPW, String logDir) throws Exception
{
int isAliveCounter = 0;
@@ -145,6 +167,13 @@
return 0;
}
+ /**
+ * Stops OpenDS
+ *
+ * @param dsee_home The home directory for the OpenDS
+ * installation.
+ * @param port The port number for OpenDS.
+ */
public void stopOpenDS(String dsee_home, String port) throws Exception
{
String myArgs[] = {"-p", port};
@@ -153,6 +182,17 @@
System.out.println("OpenDS has stopped.");
}
+ /**
+ * Tests OpenDS to see if it has started.
+ *
+ * @param hostname The hostname for the server where OpenDS
+ * is installed.
+ * @param port The port number for OpenDS.
+ * @param bindDN The bind DN.
+ * @param bindPW The password for the bind DN.
+ *
+ * @return 0 if OpenDS has started, 1 if not.
+ */
public int isAlive(String hostname, String port, String bindDN, String bindPW)
{
String isAlive_args[] = {"-h", hostname, "-p", port, "-D", bindDN, "-w", bindPW, "-b", "", "-s", "base", "(objectclass=*)"};
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSMgr.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSMgr.java
index 9709bf3..7b57d87 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSMgr.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSMgr.java
@@ -29,18 +29,28 @@
import java.io.*;
import org.opends.server.tools.StopDS;
+/**
+ * This class manages the starting and stopping OpenDS.
+ * This class is used for the Integration Tests on Windows platforms.
+ */
public class OpenDSMgr
extends Thread
{
private String dsee_home;
private String port;
+ /**
+ * Creates a new OpenDSMgr..
+ */
public OpenDSMgr(String in_dsee_home, String in_port)
{
dsee_home = in_dsee_home;
port = in_port;
}
+ /**
+ * Starts a new thread to start OpenDS.
+ */
public void run()
{
try
@@ -53,6 +63,9 @@
}
}
+ /**
+ * Starts OpenDS in a new thread.
+ */
public void startDS() throws Exception
{
String osName = new String(System.getProperty("os.name"));
@@ -61,7 +74,6 @@
if (osName.indexOf("Windows") >= 0) // For Windows
{
exec_cmd = "CMD /C " + dsee_home + "\\bin\\start-ds";
- System.out.println(exec_cmd);
}
else
{
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestListener.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestListener.java
index 03b3777..5e905b1 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestListener.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestListener.java
@@ -33,32 +33,51 @@
import org.opends.server.tools.*;
/**
- * This class contains the TestNG tests for the Schema startup.
+ * This class contains the listener classes for TestNG.
*/
@Test
public class OpenDSTestListener extends TestListenerAdapter
{
private int m_counter = 0;
+ /**
+ * Writes the string, "FAIL," to the test output.
+ *
+ * @param tr Object of the class, ITestResult
+ */
@Override
public void onTestFailure(ITestResult tr)
{
log("FAIL");
}
+ /**
+ * Writes the string, "SKIPPED," to the test output.
+ *
+ * @param tr Object of the class, ITestResult
+ */
@Override
public void onTestSkipped(ITestResult tr)
{
log("SKIPPED");
}
+ /**
+ * Writes the string, "PASS," to the test output.
+ *
+ * @param tr Object of the class, ITestResult
+ */
@Override
public void onTestSuccess(ITestResult tr)
{
log("PASS");
}
-
+ /**
+ * Writes the a string to standard out.
+ *
+ * @param str String to send to standard out.
+ */
private void log(String str)
{
System.out.print(str + "\n");
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestOutput.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestOutput.java
index bb33407..d9ed149 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestOutput.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/OpenDSTestOutput.java
@@ -29,18 +29,30 @@
import java.io.*;
import junit.framework.*;
+/**
+ * This class manages the redirection of the output.
+ */
public class OpenDSTestOutput
{
private PrintStream std_out;
private PrintStream std_err;
private PrintStream ps;
+ /**
+ * Creates a new OpenDSTestOutput.
+ */
public OpenDSTestOutput()
{
std_out = System.out;
std_err = System.out;
}
+ /**
+ * Redirects standard out and standard error to a file.
+ *
+ * @param dirname Directory
+ * @param filename Filename
+ */
public void redirectOutput(String dirname, String filename) throws Exception
{
ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(new File(dirname, filename))));
@@ -48,6 +60,9 @@
System.setOut(ps);
}
+ /**
+ * Resets output streams to standard out and standard error.
+ */
public void resetOutput()
{
if((ps != null) && (std_err != null) && (std_out != null))
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests13.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests13.java
index 23c8495..1929e5f 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests13.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests13.java
@@ -37,7 +37,8 @@
public class ImportTests13 extends BackendTests
{
/**
- * Add a new branch when importing data.
+ * Import data to OpenDS with one --excludeAttribute, one --includeFilter, and
+ * one --excludeBranch parameter.
*
* @param hostname The hostname for the server where OpenDS
* is installed.
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests9.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests9.java
index ccf387e..85beaa4 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests9.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/backend/ImportTests9.java
@@ -37,7 +37,7 @@
public class ImportTests9 extends BackendTests
{
/**
- * Import data to OpenDS with three --excludeAttribute parameters.
+ * Import data to OpenDS with three --excludeFilters parameters.
*
* @param hostname The hostname for the server where OpenDS
* is installed.
diff --git a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/schema/SchemaRFCTests.java b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/schema/SchemaRFCTests.java
index 7b5484e..a65a83d 100644
--- a/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/schema/SchemaRFCTests.java
+++ b/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/schema/SchemaRFCTests.java
@@ -248,7 +248,7 @@
}
/**
- * Add an entry that is covered by rfc 2978.
+ * Add an entry that is covered by rfc 2798.
*
* @param hostname The hostname for the server where OpenDS
* is installed.
--
Gitblit v1.10.0