aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
diff options
context:
space:
mode:
authorSean Dague2009-04-22 19:00:40 +0000
committerSean Dague2009-04-22 19:00:40 +0000
commit45b90ceef1b73994f729275eae112870ff34cb64 (patch)
tree76390ae57cc6d6caa1fd304e8164ff1bc9c37eb2 /OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
parent* Fix the other windows build break. Hopefully that shoudl be the last one (diff)
downloadopensim-SC-45b90ceef1b73994f729275eae112870ff34cb64.zip
opensim-SC-45b90ceef1b73994f729275eae112870ff34cb64.tar.gz
opensim-SC-45b90ceef1b73994f729275eae112870ff34cb64.tar.bz2
opensim-SC-45b90ceef1b73994f729275eae112870ff34cb64.tar.xz
ensure we've got a clean data environment prior to running the region
tests
Diffstat (limited to 'OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs')
-rw-r--r--OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs41
1 files changed, 24 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
index 294a80e..e3f9413 100644
--- a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
+++ b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs
@@ -53,6 +53,9 @@ namespace OpenSim.Data.MySQL.Tests
53 try 53 try
54 { 54 {
55 database = new MySQLManager(connect); 55 database = new MySQLManager(connect);
56 // this is important in case a previous run ended badly
57 ClearDB(database);
58
56 db = new MySQLDataStore(); 59 db = new MySQLDataStore();
57 db.Initialise(connect); 60 db.Initialise(connect);
58 } 61 }
@@ -70,24 +73,28 @@ namespace OpenSim.Data.MySQL.Tests
70 { 73 {
71 db.Dispose(); 74 db.Dispose();
72 } 75 }
73 // if a new table is added, it has to be dropped here 76 ClearDB(database);
74 if (database != null) 77 }
78
79 private void ClearDB(MySQLManager manager)
80 {
81 if (manager != null)
75 { 82 {
76 database.ExecuteSql("drop table migrations"); 83 manager.ExecuteSql("drop table migrations");
77 database.ExecuteSql("drop table prims"); 84 manager.ExecuteSql("drop table prims");
78 database.ExecuteSql("drop table primshapes"); 85 manager.ExecuteSql("drop table primshapes");
79 database.ExecuteSql("drop table primitems"); 86 manager.ExecuteSql("drop table primitems");
80 database.ExecuteSql("drop table terrain"); 87 manager.ExecuteSql("drop table terrain");
81 database.ExecuteSql("drop table land"); 88 manager.ExecuteSql("drop table land");
82 database.ExecuteSql("drop table landaccesslist"); 89 manager.ExecuteSql("drop table landaccesslist");
83 database.ExecuteSql("drop table regionban"); 90 manager.ExecuteSql("drop table regionban");
84 database.ExecuteSql("drop table regionsettings"); 91 manager.ExecuteSql("drop table regionsettings");
85 database.ExecuteSql("drop table estate_managers"); 92 manager.ExecuteSql("drop table estate_managers");
86 database.ExecuteSql("drop table estate_groups"); 93 manager.ExecuteSql("drop table estate_groups");
87 database.ExecuteSql("drop table estate_users"); 94 manager.ExecuteSql("drop table estate_users");
88 database.ExecuteSql("drop table estateban"); 95 manager.ExecuteSql("drop table estateban");
89 database.ExecuteSql("drop table estate_settings"); 96 manager.ExecuteSql("drop table estate_settings");
90 database.ExecuteSql("drop table estate_map"); 97 manager.ExecuteSql("drop table estate_map");
91 } 98 }
92 } 99 }
93 } 100 }