diff options
author | Kunnis | 2009-08-09 02:01:21 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-16 13:35:44 -0400 |
commit | 23d478f2fa06d1dedabfb24cf6ff763b586173ce (patch) | |
tree | 072fdcfe343d84cf01b0881045fc96fb8403c324 /OpenSim/Data/MySQL/Tests | |
parent | Add copyright header. Formatting cleanup. (diff) | |
download | opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.zip opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.gz opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.bz2 opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.xz |
Adding in Reflection-based testing, to ensure that all properties are covered.
Diffstat (limited to 'OpenSim/Data/MySQL/Tests')
-rw-r--r-- | OpenSim/Data/MySQL/Tests/MySQLGridTest.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs | 12 |
2 files changed, 17 insertions, 3 deletions
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 | |||
62 | m_log.Error("Exception {0}", e); | 62 | m_log.Error("Exception {0}", e); |
63 | Assert.Ignore(); | 63 | Assert.Ignore(); |
64 | } | 64 | } |
65 | |||
66 | // This actually does the roll forward assembly stuff | ||
67 | Assembly assem = GetType().Assembly; | ||
68 | Migration m = new Migration(database.Connection, assem, "GridStore"); | ||
69 | |||
70 | m.Update(); | ||
65 | } | 71 | } |
66 | 72 | ||
67 | [TestFixtureTearDown] | 73 | [TestFixtureTearDown] |
68 | public void Cleanup() | 74 | public void Cleanup() |
69 | { | 75 | { |
76 | m_log.Warn("Cleaning up."); | ||
70 | if (db != null) | 77 | if (db != null) |
71 | { | 78 | { |
72 | db.Dispose(); | 79 | db.Dispose(); |
@@ -74,6 +81,7 @@ namespace OpenSim.Data.MySQL.Tests | |||
74 | // if a new table is added, it has to be dropped here | 81 | // if a new table is added, it has to be dropped here |
75 | if (database != null) | 82 | if (database != null) |
76 | { | 83 | { |
84 | database.ExecuteSql("drop table migrations"); | ||
77 | database.ExecuteSql("drop table regions"); | 85 | database.ExecuteSql("drop table regions"); |
78 | } | 86 | } |
79 | } | 87 | } |
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 | |||
53 | try | 53 | try |
54 | { | 54 | { |
55 | database = new MySQLManager(connect); | 55 | database = new MySQLManager(connect); |
56 | DropTables(); | ||
56 | db = new MySQLInventoryData(); | 57 | db = new MySQLInventoryData(); |
57 | db.Initialise(connect); | 58 | db.Initialise(connect); |
58 | } | 59 | } |
@@ -72,10 +73,15 @@ namespace OpenSim.Data.MySQL.Tests | |||
72 | } | 73 | } |
73 | if (database != null) | 74 | if (database != null) |
74 | { | 75 | { |
75 | database.ExecuteSql("drop table inventoryitems"); | 76 | DropTables(); |
76 | database.ExecuteSql("drop table inventoryfolders"); | ||
77 | database.ExecuteSql("drop table migrations"); | ||
78 | } | 77 | } |
79 | } | 78 | } |
79 | |||
80 | private void DropTables() | ||
81 | { | ||
82 | database.ExecuteSql("drop table IF EXISTS inventoryitems"); | ||
83 | database.ExecuteSql("drop table IF EXISTS inventoryfolders"); | ||
84 | database.ExecuteSql("drop table IF EXISTS migrations"); | ||
85 | } | ||
80 | } | 86 | } |
81 | } | 87 | } |