From 476ad3057670a1276f15f224f2ca2ba07a360896 Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Wed, 19 Jan 2011 12:17:58 +0000
Subject: [PATCH] test: workaround for running tests on hudson with psql 9

SVN: 19497
---
 .../postgresql/PostgreSQLAdminDAO.java        | 37 +++++++++----------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/postgresql/PostgreSQLAdminDAO.java b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/postgresql/PostgreSQLAdminDAO.java
index 7b9208c2d47..30e5cbb4cd5 100644
--- a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/postgresql/PostgreSQLAdminDAO.java
+++ b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/postgresql/PostgreSQLAdminDAO.java
@@ -54,15 +54,13 @@ public class PostgreSQLAdminDAO extends AbstractDatabaseAdminDAO
 
     private static final String CREATE_PLPGSQL = "create language plpgsql;";
 
-    private static final String CREATE_TABLE_DATABASE_VERSION_LOGS_SQL =
-            "create table "
-                    + DatabaseVersionLogDAO.DB_VERSION_LOG
-                    + " (db_version varchar(4) not null, "
-                    + "module_name varchar(250), run_status varchar(10), run_status_timestamp timestamp, "
-                    + "module_code bytea, run_exception bytea);";
+    private static final String CREATE_TABLE_DATABASE_VERSION_LOGS_SQL = "create table "
+            + DatabaseVersionLogDAO.DB_VERSION_LOG + " (db_version varchar(4) not null, "
+            + "module_name varchar(250), run_status varchar(10), run_status_timestamp timestamp, "
+            + "module_code bytea, run_exception bytea);";
 
-    private static final Logger operationLog =
-            LogFactory.getLogger(LogCategory.OPERATION, PostgreSQLAdminDAO.class);
+    private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION,
+            PostgreSQLAdminDAO.class);
 
     /**
      * Creates an instance.
@@ -140,8 +138,7 @@ public class PostgreSQLAdminDAO extends AbstractDatabaseAdminDAO
                 }
             } else
             {
-                operationLog.error("Database role '" + role
-                        + "' couldn't be created:", ex);
+                operationLog.error("Database role '" + role + "' couldn't be created:", ex);
                 throw ex;
             }
         }
@@ -200,15 +197,15 @@ public class PostgreSQLAdminDAO extends AbstractDatabaseAdminDAO
             getJdbcTemplate().execute(CREATE_PLPGSQL);
         } catch (RuntimeException ex)
         {
-            if (ex instanceof DataAccessException
-                    && DBUtilities.isDuplicateObjectException((DataAccessException) ex))
-            {
-                operationLog.warn("Cannot create language PL/PgSQL since it already exists.");
-            } else
-            {
-                operationLog.error("Failed to create language PL/PgSQL.", ex);
-                throw ex;
-            }
+            // if (ex instanceof DataAccessException
+            // && DBUtilities.isDuplicateObjectException((DataAccessException) ex))
+            // {
+            // operationLog.warn("Cannot create language PL/PgSQL since it already exists.");
+            // } else
+            // {
+            operationLog.error("Failed to create language PL/PgSQL.", ex);
+            // throw ex;
+            // }
         }
     }
 
@@ -262,7 +259,7 @@ public class PostgreSQLAdminDAO extends AbstractDatabaseAdminDAO
         if (operationLog.isDebugEnabled())
         {
             operationLog.debug("Searching for mass upload files in directory '"
-                    + dumpFolder.getAbsolutePath() + "'."); 
+                    + dumpFolder.getAbsolutePath() + "'.");
         }
         String[] csvFiles = dumpFolder.list(new FilenameFilter()
             {
-- 
GitLab