aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlexRa2010-05-18 14:30:17 +0300
committerAlexRa2010-05-23 11:47:51 +0300
commit6322a085b3141bbf91ad11f86e9e8c8d5c5b3be5 (patch)
tree78eda9a99a435ac4feda1a9c28324a1caa4a623d
parentMSSQL: added asset_flags, CreatorID to migrations (diff)
downloadopensim-SC_OLD-6322a085b3141bbf91ad11f86e9e8c8d5c5b3be5.zip
opensim-SC_OLD-6322a085b3141bbf91ad11f86e9e8c8d5c5b3be5.tar.gz
opensim-SC_OLD-6322a085b3141bbf91ad11f86e9e8c8d5c5b3be5.tar.bz2
opensim-SC_OLD-6322a085b3141bbf91ad11f86e9e8c8d5c5b3be5.tar.xz
Minor corrections in BasicDataServiceTest.cs
(added more functions for cleaning up DB from the derived tests)
-rw-r--r--OpenSim/Data/Tests/BasicDataServiceTest.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Data/Tests/BasicDataServiceTest.cs b/OpenSim/Data/Tests/BasicDataServiceTest.cs
index 82f29d6..e91a45d 100644
--- a/OpenSim/Data/Tests/BasicDataServiceTest.cs
+++ b/OpenSim/Data/Tests/BasicDataServiceTest.cs
@@ -167,5 +167,46 @@ namespace OpenSim.Data.Tests
167 } 167 }
168 } 168 }
169 } 169 }
170
171 /// <summary>Clear tables listed as parameters (without dropping them).
172 /// </summary>
173 /// <param name="tables"></param>
174 protected virtual void ResetMigrations(params string[] stores)
175 {
176 string lst = "";
177 foreach (string store in stores)
178 {
179 string s = "'" + store + "'";
180 if (lst == "")
181 lst = s;
182 else
183 lst += ", " + s;
184 }
185
186 try
187 {
188 ExecuteSql("DELETE FROM `migrations` where name in (" + lst + ");");
189 }
190 catch
191 {
192 }
193 }
194
195 /// <summary>Clear tables listed as parameters (without dropping them).
196 /// </summary>
197 /// <param name="tables"></param>
198 protected virtual void ClearTables(params string[] tables)
199 {
200 foreach (string tbl in tables)
201 {
202 try
203 {
204 ExecuteSql("DELETE FROM " + tbl + ";");
205 }
206 catch
207 {
208 }
209 }
210 }
170 } 211 }
171} 212}