mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

el_kaboing
17.34.2006 7b8e6a1df8808c8396af2a3707e7c88af0328fc0
Added the ability for the integration test suite to make the directory that is specified for the 
log files. That directory is specified in the testng.xml file and can be modified by the user.
1 files added
2 files modified
33 ■■■■ changed files
opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/bob/BobStartupTests.java
@@ -45,7 +45,7 @@
 *  Setup for bob tests
*/
  @Parameters({ "hostname", "port", "bindDN", "bindPW", "integration_test_home", "logDir" })
  @Test(alwaysRun=true, dependsOnMethods = { "org.opends.server.integration.quickstart.QuickstartAddTests.testQuickstartAdd1" })
  @Test(alwaysRun=true, dependsOnMethods = { "org.opends.server.integration.quickstart.QuickstartAddTests.testQuickstartAdd2" })
  public void testBobStartup1(String hostname, String port, String bindDN, String bindPW, String integration_test_home, String logDir) throws Exception
  {
    System.out.println("*********************************************");
opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/QuickstartAddTests.java
@@ -43,17 +43,32 @@
/**
 *  Setup for quickstartadd tests
*/
  @Parameters({ "hostname", "port", "bindDN", "bindPW", "integration_test_home", "logDir" })
  @Parameters({ "integration_test_home", "logDir" })
  @Test
  public void testQuickstartAdd1(String hostname, String port, String bindDN, String bindPW, String integration_test_home, String logDir) throws Exception
  public void testQuickstartAdd1(String integration_test_home, String logDir) throws Exception
  {
    System.out.println("*********************************************");
    System.out.println("QuickstartAdd test 1");
    String exec_cmd = integration_test_home + "/quickstart/checklogdir.sh " + logDir;
    Runtime rtime = Runtime.getRuntime();
    Process child = rtime.exec(exec_cmd);
    child.waitFor();
    compareExitCode(0, 0);
  }
  @Parameters({ "hostname", "port", "bindDN", "bindPW", "integration_test_home", "logDir" })
  @Test(alwaysRun=true, dependsOnMethods = { "org.opends.server.integration.quickstart.QuickstartAddTests.testQuickstartAdd1" })
  public void testQuickstartAdd2(String hostname, String port, String bindDN, String bindPW, String integration_test_home, String logDir) throws Exception
  {
    System.out.println("*********************************************");
    System.out.println("QuickstartAdd test 2");
    String datafile = integration_test_home + "/quickstart/data/quickstart.ldif";
    String quickstartadd_args[] = {"-a", "-h", hostname, "-p", port, "-D", bindDN, "-w", bindPW, "-f", datafile};
    ds_output.redirectOutput(logDir, "QuickstartAdd1.txt");
    ds_output.redirectOutput(logDir, "QuickstartAdd2.txt");
    int retCode = LDAPModify.mainModify(quickstartadd_args);
    ds_output.resetOutput();
    int expCode = 0;
opendj-sdk/opends/tests/integration-tests-testng/src/server/org/opends/server/integration/quickstart/checklogdir.sh
New file
@@ -0,0 +1,10 @@
#!/bin/sh
LOGDIR=$1
if [ -d "${LOGDIR}" ]
then
    echo "${LOGDIR} currently exists"
else
    mkdir -p ${LOGDIR}
    echo "${LOGDIR} created"
fi