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

neil_a_wilson
04.08.2007 a2e51900097d69625a86d3f5ddeb213dd3d191cb
Update TestCaseUtils.startServer() so that the unit test package that it
creates can actually be used to run the server (it copies all of the necessary
class files and libraries into place so the scripts in bin can find them).
1 files modified
23 ■■■■ changed files
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java 23 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
@@ -170,9 +170,9 @@
    // Get the build root and use it to create a test package directory.
    String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT);
    File   testRoot  = new File(buildRoot + File.separator + "build" +
                                File.separator + "unit-tests" + File.separator +
                                "package");
    File   buildDir  = new File(buildRoot, "build");
    File   unitRoot  = new File(buildDir, "unit-tests");
    File   testRoot  = new File(unitRoot, "package");
    File   testSrcRoot = new File(buildRoot + File.separator + "tests" +
                                  File.separator + "unit-tests-testng");
@@ -197,11 +197,19 @@
    // Copy the configuration, schema, and MakeLDIF resources into the
    // appropriate place under the test package.
    File serverClassesDir = new File(buildDir, "classes");
    File unitClassesDir   = new File(unitRoot, "classes");
    File libDir           = new File(buildRoot, "lib");
    File resourceDir   = new File(buildRoot, "resource");
    File testResourceDir = new File(testSrcRoot, "resource");
    File testConfigDir = new File(testRoot, "config");
    File testClassesDir   = new File(testRoot, "classes");
    File testLibDir       = new File(testRoot, "lib");
    File testBinDir = new File(testRoot, "bin");
    copyDirectory(serverClassesDir, testClassesDir);
    copyDirectory(unitClassesDir, testClassesDir);
    copyDirectory(libDir, testLibDir);
    copyDirectory(new File(resourceDir, "bin"), testBinDir);
    copyDirectory(new File(resourceDir, "config"), testConfigDir);
    copyDirectory(new File(resourceDir, "schema"),
@@ -222,6 +230,15 @@
             new File(testConfigDir, "client-cert.p12"));
    for (File f : testBinDir.listFiles())
    {
      try
      {
        FilePermission.setPermissions(f, FilePermission.decodeUNIXMode("755"));
      } catch (Exception e) {}
    }
    // Make the shell scripts in the bin directory executable, if possible.
    OperatingSystem os = DirectoryServer.getOperatingSystem();
    if ((os != null) && OperatingSystem.isUNIXBased(os) &&