From 0d97a7da226d93b8b87467efde523aa2120ceabc Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 07 Jun 2013 14:08:13 +0000
Subject: [PATCH] Fix for OPENDJ-925, OPENDJ-926, and overall schema management. Review CR-1806. Back a few years ago, when we did the SVR4 package, we split the schema into read-only (Install) and writable (Instance). With the template model in 2.6, the whole schema is under config, and we should never edit/change the one in the template. So, I've removed all code related to the 2 locations for schema, reverted some I10N messages to their previous versions, and tidy up code and tests. All unit-tests are passing. And it's also possible to change the instance.loc and run setup and have a fully functioning server :-)

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 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 19f6e89..5a4b967 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
@@ -283,8 +283,8 @@
               buildRoot + File.separator + "build");
       File   buildDir = new File(buildDirStr);
       File   unitRoot  = new File(buildDir, "unit-tests");
-      File   testInstallRoot  = null;
-      File   testInstanceRoot  = null;
+      File   testInstallRoot;
+      File   testInstanceRoot;
       if (installedRoot == null) {
          testInstallRoot = new File(unitRoot, "package-install");
          testInstanceRoot = new File(unitRoot, "package-instance");
@@ -349,7 +349,7 @@
       File testResourceDir  = new File(testSrcRoot, "resource");
       // Set the class variable
       testConfigDir    = new File(testInstanceRoot, "config");
-      File testSchemaDir    = new File(testInstallRoot, "config");
+      File testSchemaDir    = new File(testInstanceRoot, "config");
       File testClassesDir   = new File(testInstanceRoot, "classes");
       File testLibDir       = new File(testInstallRoot, "lib");
       File testBinDir       = new File(testInstallRoot, "bin");
@@ -1721,12 +1721,14 @@
 
     String systemOut = TestCaseUtils.getSystemOutContents();
     if (systemOut.length() > 0) {
-      logsContents.append(EOL + "System.out contents:" + EOL + systemOut);
+      logsContents.append(EOL).append("System.out contents:")
+          .append(EOL).append(systemOut);
     }
 
     String systemErr = TestCaseUtils.getSystemErrContents();
     if (systemErr.length() > 0) {
-      logsContents.append(EOL + "System.err contents:" + EOL + systemErr);
+      logsContents.append(EOL).append("System.err contents:")
+          .append(EOL).append(systemErr);
     }
   }
 
@@ -1810,7 +1812,7 @@
         bytes = bout.toByteArray();
       }
       finally {
-        if (close && is != null) {
+        if (close) {
           try {
             is.close();
           }

--
Gitblit v1.10.0