aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2009-04-22 19:11:54 +0000
committerSean Dague2009-04-22 19:11:54 +0000
commitb0ac6cd0e0bea641d652cb9ef8b8167bafcadee5 (patch)
treef7e09fde72716acc94879850a43384cf12410e6b
parentensure we've got a clean data environment prior to running the region (diff)
downloadopensim-SC_OLD-b0ac6cd0e0bea641d652cb9ef8b8167bafcadee5.zip
opensim-SC_OLD-b0ac6cd0e0bea641d652cb9ef8b8167bafcadee5.tar.gz
opensim-SC_OLD-b0ac6cd0e0bea641d652cb9ef8b8167bafcadee5.tar.bz2
opensim-SC_OLD-b0ac6cd0e0bea641d652cb9ef8b8167bafcadee5.tar.xz
add cleardb to estate tests
-rw-r--r--OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs40
1 files changed, 24 insertions, 16 deletions
diff --git a/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs b/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs
index 1f44b4b..8659aa2 100644
--- a/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs
+++ b/OpenSim/Data/MySQL/Tests/MySQLEstateTest.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 // clear db incase to ensure we are in a clean state
57 ClearDB(database);
58
56 regionDb = new MySQLDataStore(); 59 regionDb = new MySQLDataStore();
57 regionDb.Initialise(connect); 60 regionDb.Initialise(connect);
58 db = new MySQLEstateStore(); 61 db = new MySQLEstateStore();
@@ -72,24 +75,29 @@ namespace OpenSim.Data.MySQL.Tests
72 { 75 {
73 regionDb.Dispose(); 76 regionDb.Dispose();
74 } 77 }
78 ClearDB(database);
79 }
80
81 private void ClearDB(MySQLManager manager)
82 {
75 // if a new table is added, it has to be dropped here 83 // if a new table is added, it has to be dropped here
76 if (database != null) 84 if (manager != null)
77 { 85 {
78 database.ExecuteSql("drop table migrations"); 86 manager.ExecuteSql("drop table migrations");
79 database.ExecuteSql("drop table prims"); 87 manager.ExecuteSql("drop table prims");
80 database.ExecuteSql("drop table primshapes"); 88 manager.ExecuteSql("drop table primshapes");
81 database.ExecuteSql("drop table primitems"); 89 manager.ExecuteSql("drop table primitems");
82 database.ExecuteSql("drop table terrain"); 90 manager.ExecuteSql("drop table terrain");
83 database.ExecuteSql("drop table land"); 91 manager.ExecuteSql("drop table land");
84 database.ExecuteSql("drop table landaccesslist"); 92 manager.ExecuteSql("drop table landaccesslist");
85 database.ExecuteSql("drop table regionban"); 93 manager.ExecuteSql("drop table regionban");
86 database.ExecuteSql("drop table regionsettings"); 94 manager.ExecuteSql("drop table regionsettings");
87 database.ExecuteSql("drop table estate_managers"); 95 manager.ExecuteSql("drop table estate_managers");
88 database.ExecuteSql("drop table estate_groups"); 96 manager.ExecuteSql("drop table estate_groups");
89 database.ExecuteSql("drop table estate_users"); 97 manager.ExecuteSql("drop table estate_users");
90 database.ExecuteSql("drop table estateban"); 98 manager.ExecuteSql("drop table estateban");
91 database.ExecuteSql("drop table estate_settings"); 99 manager.ExecuteSql("drop table estate_settings");
92 database.ExecuteSql("drop table estate_map"); 100 manager.ExecuteSql("drop table estate_map");
93 } 101 }
94 } 102 }
95 } 103 }