From 23d478f2fa06d1dedabfb24cf6ff763b586173ce Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sun, 9 Aug 2009 02:01:21 -0500 Subject: Adding in Reflection-based testing, to ensure that all properties are covered. --- OpenSim/Data/MySQL/Tests/MySQLGridTest.cs | 8 ++++++++ OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data/MySQL/Tests') diff --git a/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs b/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs index 7c36375..d1d5c2a 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs @@ -62,11 +62,18 @@ namespace OpenSim.Data.MySQL.Tests m_log.Error("Exception {0}", e); Assert.Ignore(); } + + // This actually does the roll forward assembly stuff + Assembly assem = GetType().Assembly; + Migration m = new Migration(database.Connection, assem, "GridStore"); + + m.Update(); } [TestFixtureTearDown] public void Cleanup() { + m_log.Warn("Cleaning up."); if (db != null) { db.Dispose(); @@ -74,6 +81,7 @@ namespace OpenSim.Data.MySQL.Tests // if a new table is added, it has to be dropped here if (database != null) { + database.ExecuteSql("drop table migrations"); database.ExecuteSql("drop table regions"); } } diff --git a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs index 23c1ec5..a3a32dc 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs @@ -53,6 +53,7 @@ namespace OpenSim.Data.MySQL.Tests try { database = new MySQLManager(connect); + DropTables(); db = new MySQLInventoryData(); db.Initialise(connect); } @@ -72,10 +73,15 @@ namespace OpenSim.Data.MySQL.Tests } if (database != null) { - database.ExecuteSql("drop table inventoryitems"); - database.ExecuteSql("drop table inventoryfolders"); - database.ExecuteSql("drop table migrations"); + DropTables(); } } + + private void DropTables() + { + database.ExecuteSql("drop table IF EXISTS inventoryitems"); + database.ExecuteSql("drop table IF EXISTS inventoryfolders"); + database.ExecuteSql("drop table IF EXISTS migrations"); + } } } -- cgit v1.1