From fe633f9735001a318a810fab6807e78b60a3a56e Mon Sep 17 00:00:00 2001
From: Steven Murray <Steve.Murray@cern.ch>
Date: Fri, 2 Oct 2020 17:12:21 +0200
Subject: [PATCH] Added further empty table checks to the Setup phase of the
 catalogue unit tests

---
 catalogue/CatalogueTest.cpp | 44 ++++++++++++++++++++++++++++++-------
 1 file changed, 36 insertions(+), 8 deletions(-)

diff --git a/catalogue/CatalogueTest.cpp b/catalogue/CatalogueTest.cpp
index c5caaff042..dc7c9aedbf 100644
--- a/catalogue/CatalogueTest.cpp
+++ b/catalogue/CatalogueTest.cpp
@@ -283,29 +283,57 @@ void cta_catalogue_CatalogueTest::SetUp() {
       throw exception::Exception("Found one of more admin users after emptying the database");
     }
 
-    if(!m_catalogue->getMediaTypes().empty()) {
-      throw exception::Exception("Found one of more media types after emptying the database");
+    if(m_catalogue->getArchiveFilesItor().hasMore()) {
+      throw exception::Exception("Found one of more archive files after emptying the database");
     }
 
-    if(!m_catalogue->getStorageClasses().empty()) {
-      throw exception::Exception("Found one of more storage classes after emptying the database");
+    if(!m_catalogue->getArchiveRoutes().empty()) {
+      throw exception::Exception("Found one of more archive routes after emptying the database");
     }
 
-    if(!m_catalogue->getTapePools().empty()) {
-      throw exception::Exception("Found one of more tape pools after emptying the database");
+    if(m_catalogue->getDeletedArchiveFilesItor().hasMore()) {
+      throw exception::Exception("Found one of more deleted archive files after emptying the database");
     }
 
-    if(!m_catalogue->getArchiveRoutes().empty()) {
-      throw exception::Exception("Found one of more archive routes after emptying the database");
+    if(!m_catalogue->getAllDiskSystems().empty()) {
+      throw exception::Exception("Found one of more disk systems after emptying the database");
     }
 
     if(!m_catalogue->getLogicalLibraries().empty()) {
       throw exception::Exception("Found one of more logical libraries after emptying the database");
     }
 
+    if(!m_catalogue->getMediaTypes().empty()) {
+      throw exception::Exception("Found one of more media types after emptying the database");
+    }
+
+    if(!m_catalogue->getMountPolicies().empty()) {
+      throw exception::Exception("Found one of more mount policies after emptying the database");
+    }
+
+    if(!m_catalogue->getRequesterGroupMountRules().empty()) {
+      throw exception::Exception("Found one of more requester group mount rules after emptying the database");
+    }
+
+    if(!m_catalogue->getRequesterMountRules().empty()) {
+      throw exception::Exception("Found one of more requester mount rules after emptying the database");
+    }
+
+    if(!m_catalogue->getStorageClasses().empty()) {
+      throw exception::Exception("Found one of more storage classes after emptying the database");
+    }
+
     if(!m_catalogue->getTapes().empty()) {
       throw exception::Exception("Found one of more tapes after emptying the database");
     }
+
+    if(!m_catalogue->getTapePools().empty()) {
+      throw exception::Exception("Found one of more tape pools after emptying the database");
+    }
+
+    if(!m_catalogue->getVirtualOrganizations().empty()) {
+      throw exception::Exception("Found one of more virtual organizations after emptying the database");
+    }
   } catch(exception::Exception &ex) {
     ex.getMessage().str(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
     throw;
-- 
GitLab