From 563aa03d5cf51a54c29f31c9d9cd10650e24ed22 Mon Sep 17 00:00:00 2001
From: pkupczyk <pkupczyk>
Date: Mon, 8 Feb 2016 10:29:17 +0000
Subject: [PATCH] Add more verbose logging to TestInitializer to find why some
 of the tests that run on Hudson fail with a missing index file errors
 (locally they run fine).

SVN: 35647
---
 .../openbis/generic/server/util/TestInitializer.java  | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TestInitializer.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TestInitializer.java
index 30e6536fbbb..10e76ce195d 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TestInitializer.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TestInitializer.java
@@ -115,6 +115,10 @@ public class TestInitializer
                 System.setProperty("script-folder", scriptFolder);
 
                 IndexCreationUtil.main(databaseKind, temporaryFile.getAbsolutePath(), String.valueOf(getCreateDBFromScratch()));
+
+                operationLog.info("Created Lucene index in '" + temporaryFile.getAbsolutePath() + "'. The index is based on data from '"
+                        + scriptFolder + "' script folder.");
+
             } catch (Exception ex)
             {
                 operationLog.error("Couldn't create Lucene index", ex);
@@ -166,6 +170,9 @@ public class TestInitializer
     {
         File targetPath = new File(TestInitializer.LUCENE_INDEX_PATH).getAbsoluteFile();
         FileUtilities.deleteRecursively(targetPath);
+
+        operationLog.info("Removed Lucene index from '" + targetPath + "'.");
+
         targetPath.mkdirs();
         File srcPath = new File(LUCENE_INDEX_TEMPLATE_PATH).getAbsoluteFile();
         try
@@ -180,8 +187,12 @@ public class TestInitializer
                 });
             new File(srcPath, FullTextIndexerRunnable.FULL_TEXT_INDEX_MARKER_FILENAME)
                     .createNewFile();
+
+            operationLog.info("Copied Lucene index from '" + srcPath + "' to '" + targetPath + "'.");
+
         } catch (IOException ex)
         {
+            operationLog.error("Could not copy Lucene index from '" + srcPath + "' to '" + targetPath + "'.", ex);
             throw new IOExceptionUnchecked(ex);
         }
     }
-- 
GitLab