aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/Tests/AssetTests.cs6
-rw-r--r--OpenSim/Data/Tests/BasicDataServiceTest.cs12
-rw-r--r--OpenSim/Data/Tests/DefaultTestConns.cs10
-rw-r--r--OpenSim/Data/Tests/EstateTests.cs18
-rw-r--r--OpenSim/Data/Tests/InventoryTests.cs28
-rw-r--r--OpenSim/Data/Tests/PropertyScrambler.cs2
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs152
7 files changed, 114 insertions, 114 deletions
diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs
index 5982a09..70880cf 100644
--- a/OpenSim/Data/Tests/AssetTests.cs
+++ b/OpenSim/Data/Tests/AssetTests.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Data.Tests
110 public void T010_StoreReadVerifyAssets() 110 public void T010_StoreReadVerifyAssets()
111 { 111 {
112 TestHelpers.InMethod(); 112 TestHelpers.InMethod();
113 113
114 AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); 114 AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString());
115 AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); 115 AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString());
116 AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); 116 AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString());
@@ -128,7 +128,7 @@ namespace OpenSim.Data.Tests
128 a1.UploadAttempts = 0; 128 a1.UploadAttempts = 0;
129 a2.UploadAttempts = 0; 129 a2.UploadAttempts = 0;
130 a3.UploadAttempts = 0; 130 a3.UploadAttempts = 0;
131 131
132 AssetBase a1a = m_db.GetAsset(uuid1); 132 AssetBase a1a = m_db.GetAsset(uuid1);
133 a1a.UploadAttempts = 0; 133 a1a.UploadAttempts = 0;
134 Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); 134 Assert.That(a1a, Constraints.PropertyCompareConstraint(a1));
@@ -190,7 +190,7 @@ namespace OpenSim.Data.Tests
190 public void T020_CheckForWeirdCreatorID() 190 public void T020_CheckForWeirdCreatorID()
191 { 191 {
192 TestHelpers.InMethod(); 192 TestHelpers.InMethod();
193 193
194 // It is expected that eventually the CreatorID might be an arbitrary string (an URI) 194 // It is expected that eventually the CreatorID might be an arbitrary string (an URI)
195 // rather than a valid UUID (?). This test is to make sure that the database layer does not 195 // rather than a valid UUID (?). This test is to make sure that the database layer does not
196 // attempt to convert CreatorID to GUID, but just passes it both ways as a string. 196 // attempt to convert CreatorID to GUID, but just passes it both ways as a string.
diff --git a/OpenSim/Data/Tests/BasicDataServiceTest.cs b/OpenSim/Data/Tests/BasicDataServiceTest.cs
index acfebd0..79691e4 100644
--- a/OpenSim/Data/Tests/BasicDataServiceTest.cs
+++ b/OpenSim/Data/Tests/BasicDataServiceTest.cs
@@ -41,11 +41,11 @@ using System.Reflection;
41 41
42namespace OpenSim.Data.Tests 42namespace OpenSim.Data.Tests
43{ 43{
44 /// <summary>This is a base class for testing any Data service for any DBMS. 44 /// <summary>This is a base class for testing any Data service for any DBMS.
45 /// Requires NUnit 2.5 or better (to support the generics). 45 /// Requires NUnit 2.5 or better (to support the generics).
46 /// </summary> 46 /// </summary>
47 /// <remarks> 47 /// <remarks>
48 /// FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with 48 /// FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with
49 /// AssetTests`2 : System.MemberAccessException : Cannot create an instance of OpenSim.Data.Tests.AssetTests`2[TConn,TAssetData] because Type.ContainsGenericParameters is true. 49 /// AssetTests`2 : System.MemberAccessException : Cannot create an instance of OpenSim.Data.Tests.AssetTests`2[TConn,TAssetData] because Type.ContainsGenericParameters is true.
50 /// and similar on EstateTests, InventoryTests and RegionTests. 50 /// and similar on EstateTests, InventoryTests and RegionTests.
51 /// Runs fine with mono 2.10.8.1, so easiest thing is to wait until min Mono version uplifts. 51 /// Runs fine with mono 2.10.8.1, so easiest thing is to wait until min Mono version uplifts.
@@ -60,7 +60,7 @@ namespace OpenSim.Data.Tests
60 private TService m_service; 60 private TService m_service;
61 private string m_file; 61 private string m_file;
62 62
63 // TODO: Is this in the right place here? 63 // TODO: Is this in the right place here?
64 // Later: apparently it's not, but does it matter here? 64 // Later: apparently it's not, but does it matter here?
65// protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 65// protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
66 66
@@ -68,7 +68,7 @@ namespace OpenSim.Data.Tests
68 68
69 public BasicDataServiceTest() 69 public BasicDataServiceTest()
70 : this("") 70 : this("")
71 { 71 {
72 } 72 }
73 73
74 public BasicDataServiceTest(string conn) 74 public BasicDataServiceTest(string conn)
@@ -226,7 +226,7 @@ namespace OpenSim.Data.Tests
226 } 226 }
227 } 227 }
228 228
229 /// <summary>Clear tables listed as parameters (without dropping them). 229 /// <summary>Clear tables listed as parameters (without dropping them).
230 /// </summary> 230 /// </summary>
231 /// <param name="tables"></param> 231 /// <param name="tables"></param>
232 protected virtual void ResetMigrations(params string[] stores) 232 protected virtual void ResetMigrations(params string[] stores)
@@ -251,7 +251,7 @@ namespace OpenSim.Data.Tests
251 } 251 }
252 } 252 }
253 253
254 /// <summary>Clear tables listed as parameters (without dropping them). 254 /// <summary>Clear tables listed as parameters (without dropping them).
255 /// </summary> 255 /// </summary>
256 /// <param name="tables"></param> 256 /// <param name="tables"></param>
257 protected virtual void ClearTables(params string[] tables) 257 protected virtual void ClearTables(params string[] tables)
diff --git a/OpenSim/Data/Tests/DefaultTestConns.cs b/OpenSim/Data/Tests/DefaultTestConns.cs
index 7c47bdd..5ad238b 100644
--- a/OpenSim/Data/Tests/DefaultTestConns.cs
+++ b/OpenSim/Data/Tests/DefaultTestConns.cs
@@ -39,16 +39,16 @@ namespace OpenSim.Data.Tests
39 /// a connection string for testing one of the supported databases. 39 /// a connection string for testing one of the supported databases.
40 /// The connections must be in the section [TestConnections] with names matching the connection class 40 /// The connections must be in the section [TestConnections] with names matching the connection class
41 /// name for the specific database, e.g.: 41 /// name for the specific database, e.g.:
42 /// 42 ///
43 /// [TestConnections] 43 /// [TestConnections]
44 /// MySqlConnection="..." 44 /// MySqlConnection="..."
45 /// SqlConnection="..." 45 /// SqlConnection="..."
46 /// SqliteConnection="..." 46 /// SqliteConnection="..."
47 /// 47 ///
48 /// Note that the conn string may also be set explicitly in the [TestCase()] attribute of test classes 48 /// Note that the conn string may also be set explicitly in the [TestCase()] attribute of test classes
49 /// based on BasicDataServiceTest.cs. 49 /// based on BasicDataServiceTest.cs.
50 /// </summary> 50 /// </summary>
51 51
52 static class DefaultTestConns 52 static class DefaultTestConns
53 { 53 {
54 private static Dictionary<Type, string> conns = new Dictionary<Type, string>(); 54 private static Dictionary<Type, string> conns = new Dictionary<Type, string>();
@@ -63,8 +63,8 @@ namespace OpenSim.Data.Tests
63 Assembly asm = Assembly.GetExecutingAssembly(); 63 Assembly asm = Assembly.GetExecutingAssembly();
64 string sType = connType.Name; 64 string sType = connType.Name;
65 65
66 // Note: when running from NUnit, the DLL is located in some temp dir, so how do we get 66 // Note: when running from NUnit, the DLL is located in some temp dir, so how do we get
67 // to the INI file? Ok, so put it into the resources! 67 // to the INI file? Ok, so put it into the resources!
68 // string iniName = Path.Combine(Path.GetDirectoryName(asm.Location), "TestDataConnections.ini"); 68 // string iniName = Path.Combine(Path.GetDirectoryName(asm.Location), "TestDataConnections.ini");
69 69
70 string[] allres = asm.GetManifestResourceNames(); 70 string[] allres = asm.GetManifestResourceNames();
diff --git a/OpenSim/Data/Tests/EstateTests.cs b/OpenSim/Data/Tests/EstateTests.cs
index e2b2d12..cf3f2b4 100644
--- a/OpenSim/Data/Tests/EstateTests.cs
+++ b/OpenSim/Data/Tests/EstateTests.cs
@@ -100,7 +100,7 @@ namespace OpenSim.Data.Tests
100 public void T010_EstateSettingsSimpleStorage_MinimumParameterSet() 100 public void T010_EstateSettingsSimpleStorage_MinimumParameterSet()
101 { 101 {
102 TestHelpers.InMethod(); 102 TestHelpers.InMethod();
103 103
104 EstateSettingsSimpleStorage( 104 EstateSettingsSimpleStorage(
105 REGION_ID, 105 REGION_ID,
106 DataTestUtil.STRING_MIN, 106 DataTestUtil.STRING_MIN,
@@ -133,7 +133,7 @@ namespace OpenSim.Data.Tests
133 public void T011_EstateSettingsSimpleStorage_MaximumParameterSet() 133 public void T011_EstateSettingsSimpleStorage_MaximumParameterSet()
134 { 134 {
135 TestHelpers.InMethod(); 135 TestHelpers.InMethod();
136 136
137 EstateSettingsSimpleStorage( 137 EstateSettingsSimpleStorage(
138 REGION_ID, 138 REGION_ID,
139 DataTestUtil.STRING_MAX(64), 139 DataTestUtil.STRING_MAX(64),
@@ -166,7 +166,7 @@ namespace OpenSim.Data.Tests
166 public void T012_EstateSettingsSimpleStorage_AccurateParameterSet() 166 public void T012_EstateSettingsSimpleStorage_AccurateParameterSet()
167 { 167 {
168 TestHelpers.InMethod(); 168 TestHelpers.InMethod();
169 169
170 EstateSettingsSimpleStorage( 170 EstateSettingsSimpleStorage(
171 REGION_ID, 171 REGION_ID,
172 DataTestUtil.STRING_MAX(1), 172 DataTestUtil.STRING_MAX(1),
@@ -199,7 +199,7 @@ namespace OpenSim.Data.Tests
199 public void T012_EstateSettingsRandomStorage() 199 public void T012_EstateSettingsRandomStorage()
200 { 200 {
201 TestHelpers.InMethod(); 201 TestHelpers.InMethod();
202 202
203 // Letting estate store generate rows to database for us 203 // Letting estate store generate rows to database for us
204 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 204 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
205 new PropertyScrambler<EstateSettings>() 205 new PropertyScrambler<EstateSettings>()
@@ -220,7 +220,7 @@ namespace OpenSim.Data.Tests
220 public void T020_EstateSettingsManagerList() 220 public void T020_EstateSettingsManagerList()
221 { 221 {
222 TestHelpers.InMethod(); 222 TestHelpers.InMethod();
223 223
224 // Letting estate store generate rows to database for us 224 // Letting estate store generate rows to database for us
225 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 225 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
226 226
@@ -241,7 +241,7 @@ namespace OpenSim.Data.Tests
241 public void T021_EstateSettingsUserList() 241 public void T021_EstateSettingsUserList()
242 { 242 {
243 TestHelpers.InMethod(); 243 TestHelpers.InMethod();
244 244
245 // Letting estate store generate rows to database for us 245 // Letting estate store generate rows to database for us
246 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 246 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
247 247
@@ -262,7 +262,7 @@ namespace OpenSim.Data.Tests
262 public void T022_EstateSettingsGroupList() 262 public void T022_EstateSettingsGroupList()
263 { 263 {
264 TestHelpers.InMethod(); 264 TestHelpers.InMethod();
265 265
266 // Letting estate store generate rows to database for us 266 // Letting estate store generate rows to database for us
267 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 267 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
268 268
@@ -283,7 +283,7 @@ namespace OpenSim.Data.Tests
283 public void T022_EstateSettingsBanList() 283 public void T022_EstateSettingsBanList()
284 { 284 {
285 TestHelpers.InMethod(); 285 TestHelpers.InMethod();
286 286
287 // Letting estate store generate rows to database for us 287 // Letting estate store generate rows to database for us
288 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 288 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
289 289
@@ -310,7 +310,7 @@ namespace OpenSim.Data.Tests
310 310
311 #endregion 311 #endregion
312 312
313 #region Parametrizable Test Implementations 313 #region Parametrizable Test Implementations
314 314
315 private void EstateSettingsSimpleStorage( 315 private void EstateSettingsSimpleStorage(
316 UUID regionId, 316 UUID regionId,
diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs
index e4ec5c1..da6e7d4 100644
--- a/OpenSim/Data/Tests/InventoryTests.cs
+++ b/OpenSim/Data/Tests/InventoryTests.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Data.Tests
46{ 46{
47 [TestFixture(Description = "Inventory store tests (MySQL)")] 47 [TestFixture(Description = "Inventory store tests (MySQL)")]
48 public class MySqlInventoryTests : InventoryTests<MySqlConnection, MySQLInventoryData> 48 public class MySqlInventoryTests : InventoryTests<MySqlConnection, MySQLInventoryData>
49 { 49 {
50 } 50 }
51 51
52 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore> 52 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore>
@@ -102,7 +102,7 @@ namespace OpenSim.Data.Tests
102 public void T001_LoadEmpty() 102 public void T001_LoadEmpty()
103 { 103 {
104 TestHelpers.InMethod(); 104 TestHelpers.InMethod();
105 105
106 Assert.That(db.getInventoryFolder(zero), Is.Null); 106 Assert.That(db.getInventoryFolder(zero), Is.Null);
107 Assert.That(db.getInventoryFolder(folder1), Is.Null); 107 Assert.That(db.getInventoryFolder(folder1), Is.Null);
108 Assert.That(db.getInventoryFolder(folder2), Is.Null); 108 Assert.That(db.getInventoryFolder(folder2), Is.Null);
@@ -122,7 +122,7 @@ namespace OpenSim.Data.Tests
122 public void T010_FolderNonParent() 122 public void T010_FolderNonParent()
123 { 123 {
124 TestHelpers.InMethod(); 124 TestHelpers.InMethod();
125 125
126 InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2); 126 InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2);
127 // the folder will go in 127 // the folder will go in
128 db.addInventoryFolder(f1); 128 db.addInventoryFolder(f1);
@@ -134,7 +134,7 @@ namespace OpenSim.Data.Tests
134 public void T011_FolderCreate() 134 public void T011_FolderCreate()
135 { 135 {
136 TestHelpers.InMethod(); 136 TestHelpers.InMethod();
137 137
138 InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1); 138 InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1);
139 // TODO: this is probably wrong behavior, but is what we have 139 // TODO: this is probably wrong behavior, but is what we have
140 // db.updateInventoryFolder(f1); 140 // db.updateInventoryFolder(f1);
@@ -159,7 +159,7 @@ namespace OpenSim.Data.Tests
159 public void T012_FolderList() 159 public void T012_FolderList()
160 { 160 {
161 TestHelpers.InMethod(); 161 TestHelpers.InMethod();
162 162
163 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); 163 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3);
164 db.addInventoryFolder(f2); 164 db.addInventoryFolder(f2);
165 165
@@ -175,7 +175,7 @@ namespace OpenSim.Data.Tests
175 public void T013_FolderHierarchy() 175 public void T013_FolderHierarchy()
176 { 176 {
177 TestHelpers.InMethod(); 177 TestHelpers.InMethod();
178 178
179 int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned) 179 int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned)
180 Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); 180 Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
181 n = db.getFolderHierarchy(folder1).Count; 181 n = db.getFolderHierarchy(folder1).Count;
@@ -190,7 +190,7 @@ namespace OpenSim.Data.Tests
190 public void T014_MoveFolder() 190 public void T014_MoveFolder()
191 { 191 {
192 TestHelpers.InMethod(); 192 TestHelpers.InMethod();
193 193
194 InventoryFolderBase f2 = db.getInventoryFolder(folder2); 194 InventoryFolderBase f2 = db.getInventoryFolder(folder2);
195 f2.ParentID = folder3; 195 f2.ParentID = folder3;
196 db.moveInventoryFolder(f2); 196 db.moveInventoryFolder(f2);
@@ -206,7 +206,7 @@ namespace OpenSim.Data.Tests
206 public void T015_FolderHierarchy() 206 public void T015_FolderHierarchy()
207 { 207 {
208 TestHelpers.InMethod(); 208 TestHelpers.InMethod();
209 209
210 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); 210 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
211 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))"); 211 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
212 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))"); 212 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
@@ -219,7 +219,7 @@ namespace OpenSim.Data.Tests
219 public void T100_NoItems() 219 public void T100_NoItems()
220 { 220 {
221 TestHelpers.InMethod(); 221 TestHelpers.InMethod();
222 222
223 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); 223 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
224 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))"); 224 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))");
225 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))"); 225 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))");
@@ -233,7 +233,7 @@ namespace OpenSim.Data.Tests
233 public void T101_CreatItems() 233 public void T101_CreatItems()
234 { 234 {
235 TestHelpers.InMethod(); 235 TestHelpers.InMethod();
236 236
237 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); 237 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1));
238 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); 238 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2));
239 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); 239 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3));
@@ -244,7 +244,7 @@ namespace OpenSim.Data.Tests
244 public void T102_CompareItems() 244 public void T102_CompareItems()
245 { 245 {
246 TestHelpers.InMethod(); 246 TestHelpers.InMethod();
247 247
248 InventoryItemBase i1 = db.getInventoryItem(item1); 248 InventoryItemBase i1 = db.getInventoryItem(item1);
249 InventoryItemBase i2 = db.getInventoryItem(item2); 249 InventoryItemBase i2 = db.getInventoryItem(item2);
250 InventoryItemBase i3 = db.getInventoryItem(item3); 250 InventoryItemBase i3 = db.getInventoryItem(item3);
@@ -263,7 +263,7 @@ namespace OpenSim.Data.Tests
263 public void T103_UpdateItem() 263 public void T103_UpdateItem()
264 { 264 {
265 TestHelpers.InMethod(); 265 TestHelpers.InMethod();
266 266
267 // TODO: probably shouldn't have the ability to have an 267 // TODO: probably shouldn't have the ability to have an
268 // owner of an item in a folder not owned by the user 268 // owner of an item in a folder not owned by the user
269 269
@@ -283,7 +283,7 @@ namespace OpenSim.Data.Tests
283 public void T104_RandomUpdateItem() 283 public void T104_RandomUpdateItem()
284 { 284 {
285 TestHelpers.InMethod(); 285 TestHelpers.InMethod();
286 286
287 PropertyScrambler<InventoryFolderBase> folderScrambler = 287 PropertyScrambler<InventoryFolderBase> folderScrambler =
288 new PropertyScrambler<InventoryFolderBase>() 288 new PropertyScrambler<InventoryFolderBase>()
289 .DontScramble(x => x.Owner) 289 .DontScramble(x => x.Owner)
@@ -342,7 +342,7 @@ namespace OpenSim.Data.Tests
342 public void T999_StillNull() 342 public void T999_StillNull()
343 { 343 {
344 TestHelpers.InMethod(); 344 TestHelpers.InMethod();
345 345
346 // After all tests are run, these should still return no results 346 // After all tests are run, these should still return no results
347 Assert.That(db.getInventoryFolder(zero), Is.Null); 347 Assert.That(db.getInventoryFolder(zero), Is.Null);
348 Assert.That(db.getInventoryItem(zero), Is.Null); 348 Assert.That(db.getInventoryItem(zero), Is.Null);
diff --git a/OpenSim/Data/Tests/PropertyScrambler.cs b/OpenSim/Data/Tests/PropertyScrambler.cs
index e0f5862..0d291df 100644
--- a/OpenSim/Data/Tests/PropertyScrambler.cs
+++ b/OpenSim/Data/Tests/PropertyScrambler.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Data.Tests
42 public class PropertyScrambler<T> 42 public class PropertyScrambler<T>
43 { 43 {
44 readonly System.Collections.Generic.List<string> membersToNotScramble = new List<string>(); 44 readonly System.Collections.Generic.List<string> membersToNotScramble = new List<string>();
45 45
46 private void AddExpressionToNotScrableList(Expression expression) 46 private void AddExpressionToNotScrableList(Expression expression)
47 { 47 {
48 UnaryExpression unaryExpression = expression as UnaryExpression; 48 UnaryExpression unaryExpression = expression as UnaryExpression;
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index e1503d0..4f81594 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Data.Tests
83 public UUID item3 = UUID.Random(); 83 public UUID item3 = UUID.Random();
84 84
85 public static Random random = new Random(); 85 public static Random random = new Random();
86 86
87 public string itemname1 = "item1"; 87 public string itemname1 = "item1";
88 88
89 public uint localID = 1; 89 public uint localID = 1;
@@ -111,10 +111,10 @@ namespace OpenSim.Data.Tests
111 111
112 private void ClearDB() 112 private void ClearDB()
113 { 113 {
114 string[] reg_tables = new string[] { 114 string[] reg_tables = new string[] {
115 "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" 115 "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings"
116 }; 116 };
117 117
118 if (m_rebuildDB) 118 if (m_rebuildDB)
119 { 119 {
120 DropTables(reg_tables); 120 DropTables(reg_tables);
@@ -145,7 +145,7 @@ namespace OpenSim.Data.Tests
145 public void T001_LoadEmpty() 145 public void T001_LoadEmpty()
146 { 146 {
147 TestHelpers.InMethod(); 147 TestHelpers.InMethod();
148 148
149 List<SceneObjectGroup> objs = db.LoadObjects(region1); 149 List<SceneObjectGroup> objs = db.LoadObjects(region1);
150 List<SceneObjectGroup> objs3 = db.LoadObjects(region3); 150 List<SceneObjectGroup> objs3 = db.LoadObjects(region3);
151 List<LandData> land = db.LoadLandObjects(region1); 151 List<LandData> land = db.LoadLandObjects(region1);
@@ -154,21 +154,21 @@ namespace OpenSim.Data.Tests
154 Assert.That(objs3.Count, Is.EqualTo(0), "Assert.That(objs3.Count, Is.EqualTo(0))"); 154 Assert.That(objs3.Count, Is.EqualTo(0), "Assert.That(objs3.Count, Is.EqualTo(0))");
155 Assert.That(land.Count, Is.EqualTo(0), "Assert.That(land.Count, Is.EqualTo(0))"); 155 Assert.That(land.Count, Is.EqualTo(0), "Assert.That(land.Count, Is.EqualTo(0))");
156 } 156 }
157 157
158 // SOG round trips 158 // SOG round trips
159 // * store objects, make sure they save 159 // * store objects, make sure they save
160 // * update 160 // * update
161 161
162 [Test] 162 [Test]
163 public void T010_StoreSimpleObject() 163 public void T010_StoreSimpleObject()
164 { 164 {
165 TestHelpers.InMethod(); 165 TestHelpers.InMethod();
166 166
167 SceneObjectGroup sog = NewSOG("object1", prim1, region1); 167 SceneObjectGroup sog = NewSOG("object1", prim1, region1);
168 SceneObjectGroup sog2 = NewSOG("object2", prim2, region1); 168 SceneObjectGroup sog2 = NewSOG("object2", prim2, region1);
169 169
170 // in case the objects don't store 170 // in case the objects don't store
171 try 171 try
172 { 172 {
173 db.StoreObject(sog, region1); 173 db.StoreObject(sog, region1);
174 } 174 }
@@ -177,8 +177,8 @@ namespace OpenSim.Data.Tests
177 m_log.Error(e.ToString()); 177 m_log.Error(e.ToString());
178 Assert.Fail(); 178 Assert.Fail();
179 } 179 }
180 180
181 try 181 try
182 { 182 {
183 db.StoreObject(sog2, region1); 183 db.StoreObject(sog2, region1);
184 } 184 }
@@ -190,15 +190,15 @@ namespace OpenSim.Data.Tests
190 190
191 // This tests the ADO.NET driver 191 // This tests the ADO.NET driver
192 List<SceneObjectGroup> objs = db.LoadObjects(region1); 192 List<SceneObjectGroup> objs = db.LoadObjects(region1);
193 193
194 Assert.That(objs.Count, Is.EqualTo(2), "Assert.That(objs.Count, Is.EqualTo(2))"); 194 Assert.That(objs.Count, Is.EqualTo(2), "Assert.That(objs.Count, Is.EqualTo(2))");
195 } 195 }
196 196
197 [Test] 197 [Test]
198 public void T011_ObjectNames() 198 public void T011_ObjectNames()
199 { 199 {
200 TestHelpers.InMethod(); 200 TestHelpers.InMethod();
201 201
202 List<SceneObjectGroup> objs = db.LoadObjects(region1); 202 List<SceneObjectGroup> objs = db.LoadObjects(region1);
203 foreach (SceneObjectGroup sog in objs) 203 foreach (SceneObjectGroup sog in objs)
204 { 204 {
@@ -207,12 +207,12 @@ namespace OpenSim.Data.Tests
207 Assert.That(p.Name, Is.EqualTo(p.Description), "Assert.That(p.Name, Is.EqualTo(p.Description))"); 207 Assert.That(p.Name, Is.EqualTo(p.Description), "Assert.That(p.Name, Is.EqualTo(p.Description))");
208 } 208 }
209 } 209 }
210 210
211 [Test] 211 [Test]
212 public void T012_SceneParts() 212 public void T012_SceneParts()
213 { 213 {
214 TestHelpers.InMethod(); 214 TestHelpers.InMethod();
215 215
216 UUID tmp0 = UUID.Random(); 216 UUID tmp0 = UUID.Random();
217 UUID tmp1 = UUID.Random(); 217 UUID tmp1 = UUID.Random();
218 UUID tmp2 = UUID.Random(); 218 UUID tmp2 = UUID.Random();
@@ -225,10 +225,10 @@ namespace OpenSim.Data.Tests
225 sog.AddPart(p1); 225 sog.AddPart(p1);
226 sog.AddPart(p2); 226 sog.AddPart(p2);
227 sog.AddPart(p3); 227 sog.AddPart(p3);
228 228
229 SceneObjectPart[] parts = sog.Parts; 229 SceneObjectPart[] parts = sog.Parts;
230 Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); 230 Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))");
231 231
232 db.StoreObject(sog, newregion); 232 db.StoreObject(sog, newregion);
233 List<SceneObjectGroup> sogs = db.LoadObjects(newregion); 233 List<SceneObjectGroup> sogs = db.LoadObjects(newregion);
234 Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); 234 Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))");
@@ -236,18 +236,18 @@ namespace OpenSim.Data.Tests
236 236
237 SceneObjectPart[] newparts = newsog.Parts; 237 SceneObjectPart[] newparts = newsog.Parts;
238 Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); 238 Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))");
239 239
240 Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))"); 240 Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))");
241 Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))"); 241 Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))");
242 Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))"); 242 Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))");
243 Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))"); 243 Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))");
244 } 244 }
245 245
246 [Test] 246 [Test]
247 public void T013_DatabasePersistency() 247 public void T013_DatabasePersistency()
248 { 248 {
249 TestHelpers.InMethod(); 249 TestHelpers.InMethod();
250 250
251 // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data 251 // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data
252 // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored 252 // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored
253 // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently. 253 // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently.
@@ -298,7 +298,7 @@ namespace OpenSim.Data.Tests
298 298
299 SceneObjectPart sop = new SceneObjectPart(); 299 SceneObjectPart sop = new SceneObjectPart();
300 SceneObjectGroup sog = new SceneObjectGroup(sop); 300 SceneObjectGroup sog = new SceneObjectGroup(sop);
301 301
302 sop.RegionHandle = regionh; 302 sop.RegionHandle = regionh;
303 sop.UUID = uuid; 303 sop.UUID = uuid;
304 sop.LocalId = localid; 304 sop.LocalId = localid;
@@ -360,10 +360,10 @@ namespace OpenSim.Data.Tests
360 Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))"); 360 Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))");
361 Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))"); 361 Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))");
362 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); 362 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))");
363 363
364 // This is necessary or object will not be inserted in DB 364 // This is necessary or object will not be inserted in DB
365 sop.Flags = PrimFlags.None; 365 sop.Flags = PrimFlags.None;
366 366
367 // Inserts group in DB 367 // Inserts group in DB
368 db.StoreObject(sog,region3); 368 db.StoreObject(sog,region3);
369 List<SceneObjectGroup> sogs = db.LoadObjects(region3); 369 List<SceneObjectGroup> sogs = db.LoadObjects(region3);
@@ -372,7 +372,7 @@ namespace OpenSim.Data.Tests
372 db.StoreObject(sog,region3); 372 db.StoreObject(sog,region3);
373 sogs = db.LoadObjects(region3); 373 sogs = db.LoadObjects(region3);
374 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); 374 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
375 375
376 376
377 // Tests if the parameters were inserted correctly 377 // Tests if the parameters were inserted correctly
378 SceneObjectPart p = sogs[0].RootPart; 378 SceneObjectPart p = sogs[0].RootPart;
@@ -414,12 +414,12 @@ namespace OpenSim.Data.Tests
414 Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd), "Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd))"); 414 Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd), "Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd))");
415 Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow), "Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow))"); 415 Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow), "Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow))");
416 } 416 }
417 417
418 [Test] 418 [Test]
419 public void T014_UpdateObject() 419 public void T014_UpdateObject()
420 { 420 {
421 TestHelpers.InMethod(); 421 TestHelpers.InMethod();
422 422
423 string text1 = "object1 text"; 423 string text1 = "object1 text";
424 SceneObjectGroup sog = FindSOG("object1", region1); 424 SceneObjectGroup sog = FindSOG("object1", region1);
425 sog.RootPart.Text = text1; 425 sog.RootPart.Text = text1;
@@ -459,7 +459,7 @@ namespace OpenSim.Data.Tests
459 PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); 459 PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
460 pbshap = PrimitiveBaseShape.Default; 460 pbshap = PrimitiveBaseShape.Default;
461 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); 461 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
462 462
463 // Updates the region with new values 463 // Updates the region with new values
464 SceneObjectGroup sog2 = FindSOG("Adam West", region3); 464 SceneObjectGroup sog2 = FindSOG("Adam West", region3);
465 Assert.That(sog2,Is.Not.Null); 465 Assert.That(sog2,Is.Not.Null);
@@ -488,11 +488,11 @@ namespace OpenSim.Data.Tests
488 sog2.RootPart.LinkNum = linknum; 488 sog2.RootPart.LinkNum = linknum;
489 sog2.RootPart.ClickAction = clickaction; 489 sog2.RootPart.ClickAction = clickaction;
490 sog2.RootPart.Scale = scale; 490 sog2.RootPart.Scale = scale;
491 491
492 db.StoreObject(sog2, region3); 492 db.StoreObject(sog2, region3);
493 List<SceneObjectGroup> sogs = db.LoadObjects(region3); 493 List<SceneObjectGroup> sogs = db.LoadObjects(region3);
494 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); 494 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
495 495
496 SceneObjectGroup retsog = FindSOG("West Adam", region3); 496 SceneObjectGroup retsog = FindSOG("West Adam", region3);
497 Assert.That(retsog,Is.Not.Null); 497 Assert.That(retsog,Is.Not.Null);
498 SceneObjectPart p = retsog.RootPart; 498 SceneObjectPart p = retsog.RootPart;
@@ -519,7 +519,7 @@ namespace OpenSim.Data.Tests
519 Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))"); 519 Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))");
520 Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))"); 520 Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))");
521 } 521 }
522 522
523 /// <summary> 523 /// <summary>
524 /// Test storage and retrieval of a scene object with a large number of parts. 524 /// Test storage and retrieval of a scene object with a large number of parts.
525 /// </summary> 525 /// </summary>
@@ -527,12 +527,12 @@ namespace OpenSim.Data.Tests
527 public void T015_LargeSceneObjects() 527 public void T015_LargeSceneObjects()
528 { 528 {
529 TestHelpers.InMethod(); 529 TestHelpers.InMethod();
530 530
531 UUID id = UUID.Random(); 531 UUID id = UUID.Random();
532 Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>(); 532 Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>();
533 SceneObjectGroup sog = NewSOG("Test SOG", id, region4); 533 SceneObjectGroup sog = NewSOG("Test SOG", id, region4);
534 mydic.Add(sog.RootPart.UUID,sog.RootPart); 534 mydic.Add(sog.RootPart.UUID,sog.RootPart);
535 for (int i = 0; i < 30; i++) 535 for (int i = 0; i < 30; i++)
536 { 536 {
537 UUID tmp = UUID.Random(); 537 UUID tmp = UUID.Random();
538 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); 538 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp);
@@ -542,20 +542,20 @@ namespace OpenSim.Data.Tests
542 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); 542 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
543 Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); 543 Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next());
544 Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); 544 Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next());
545 545
546 sop.GroupPosition = groupos; 546 sop.GroupPosition = groupos;
547 sop.RotationOffset = rotoff; 547 sop.RotationOffset = rotoff;
548 sop.OffsetPosition = offset; 548 sop.OffsetPosition = offset;
549 sop.Velocity = velocity; 549 sop.Velocity = velocity;
550 sop.AngularVelocity = angvelo; 550 sop.AngularVelocity = angvelo;
551 sop.Acceleration = accel; 551 sop.Acceleration = accel;
552 552
553 mydic.Add(tmp,sop); 553 mydic.Add(tmp,sop);
554 sog.AddPart(sop); 554 sog.AddPart(sop);
555 } 555 }
556 556
557 db.StoreObject(sog, region4); 557 db.StoreObject(sog, region4);
558 558
559 SceneObjectGroup retsog = FindSOG("Test SOG", region4); 559 SceneObjectGroup retsog = FindSOG("Test SOG", region4);
560 SceneObjectPart[] parts = retsog.Parts; 560 SceneObjectPart[] parts = retsog.Parts;
561 for (int i = 0; i < 30; i++) 561 for (int i = 0; i < 30; i++)
@@ -574,7 +574,7 @@ namespace OpenSim.Data.Tests
574 public void T016_RandomSogWithSceneParts() 574 public void T016_RandomSogWithSceneParts()
575 { 575 {
576 TestHelpers.InMethod(); 576 TestHelpers.InMethod();
577 577
578 PropertyScrambler<SceneObjectPart> scrambler = 578 PropertyScrambler<SceneObjectPart> scrambler =
579 new PropertyScrambler<SceneObjectPart>() 579 new PropertyScrambler<SceneObjectPart>()
580 .DontScramble(x => x.UUID); 580 .DontScramble(x => x.UUID);
@@ -634,22 +634,22 @@ namespace OpenSim.Data.Tests
634 SceneObjectGroup sog = FindSOG(name, region1); 634 SceneObjectGroup sog = FindSOG(name, region1);
635 if (sog == null) 635 if (sog == null)
636 { 636 {
637 sog = NewSOG(name, prim1, region1); 637 sog = NewSOG(name, prim1, region1);
638 db.StoreObject(sog, region1); 638 db.StoreObject(sog, region1);
639 } 639 }
640 return sog; 640 return sog;
641 } 641 }
642 642
643 // NOTE: it is a bad practice to rely on some of the previous tests having been run before. 643 // NOTE: it is a bad practice to rely on some of the previous tests having been run before.
644 // If the tests are run manually, one at a time, each starts with full class init (DB cleared). 644 // If the tests are run manually, one at a time, each starts with full class init (DB cleared).
645 // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order. 645 // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order.
646 // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*! 646 // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*!
647 647
648 [Test] 648 [Test]
649 public void T020_PrimInventoryEmpty() 649 public void T020_PrimInventoryEmpty()
650 { 650 {
651 TestHelpers.InMethod(); 651 TestHelpers.InMethod();
652 652
653 SceneObjectGroup sog = GetMySOG("object1"); 653 SceneObjectGroup sog = GetMySOG("object1");
654 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 654 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
655 Assert.That(t, Is.Null); 655 Assert.That(t, Is.Null);
@@ -673,14 +673,14 @@ namespace OpenSim.Data.Tests
673 public void T021_PrimInventoryBasic() 673 public void T021_PrimInventoryBasic()
674 { 674 {
675 TestHelpers.InMethod(); 675 TestHelpers.InMethod();
676 676
677 SceneObjectGroup sog = GetMySOG("object1"); 677 SceneObjectGroup sog = GetMySOG("object1");
678 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); 678 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
679 679
680 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True); 680 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
681 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 681 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
682 Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))"); 682 Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))");
683 683
684 StoreInventory(sog); 684 StoreInventory(sog);
685 685
686 SceneObjectGroup sog1 = FindSOG("object1", region1); 686 SceneObjectGroup sog1 = FindSOG("object1", region1);
@@ -708,12 +708,12 @@ namespace OpenSim.Data.Tests
708 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 708 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
709 Assert.That(t, Is.Null); 709 Assert.That(t, Is.Null);
710 } 710 }
711 711
712 [Test] 712 [Test]
713 public void T025_PrimInventoryPersistency() 713 public void T025_PrimInventoryPersistency()
714 { 714 {
715 TestHelpers.InMethod(); 715 TestHelpers.InMethod();
716 716
717 InventoryItemBase i = new InventoryItemBase(); 717 InventoryItemBase i = new InventoryItemBase();
718 UUID id = UUID.Random(); 718 UUID id = UUID.Random();
719 i.ID = id; 719 i.ID = id;
@@ -752,11 +752,11 @@ namespace OpenSim.Data.Tests
752 i.Flags = flags; 752 i.Flags = flags;
753 int creationd = random.Next(); 753 int creationd = random.Next();
754 i.CreationDate = creationd; 754 i.CreationDate = creationd;
755 755
756 SceneObjectGroup sog = GetMySOG("object1"); 756 SceneObjectGroup sog = GetMySOG("object1");
757 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True); 757 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
758 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id); 758 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id);
759 759
760 Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))"); 760 Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))");
761 Assert.That(t.AssetID,Is.EqualTo(assetid), "Assert.That(t.AssetID,Is.EqualTo(assetid))"); 761 Assert.That(t.AssetID,Is.EqualTo(assetid), "Assert.That(t.AssetID,Is.EqualTo(assetid))");
762 Assert.That(t.BasePermissions,Is.EqualTo(baseperm), "Assert.That(t.BasePermissions,Is.EqualTo(baseperm))"); 762 Assert.That(t.BasePermissions,Is.EqualTo(baseperm), "Assert.That(t.BasePermissions,Is.EqualTo(baseperm))");
@@ -780,13 +780,13 @@ namespace OpenSim.Data.Tests
780 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); 780 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))");
781 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); 781 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))");
782 } 782 }
783 783
784 [Test] 784 [Test]
785 [ExpectedException(typeof(ArgumentException))] 785 [ExpectedException(typeof(ArgumentException))]
786 public void T026_PrimInventoryMany() 786 public void T026_PrimInventoryMany()
787 { 787 {
788 TestHelpers.InMethod(); 788 TestHelpers.InMethod();
789 789
790 UUID i1,i2,i3,i4; 790 UUID i1,i2,i3,i4;
791 i1 = UUID.Random(); 791 i1 = UUID.Random();
792 i2 = UUID.Random(); 792 i2 = UUID.Random();
@@ -796,14 +796,14 @@ namespace OpenSim.Data.Tests
796 InventoryItemBase ib2 = NewItem(i2, zero, zero, RandomName(), zero); 796 InventoryItemBase ib2 = NewItem(i2, zero, zero, RandomName(), zero);
797 InventoryItemBase ib3 = NewItem(i3, zero, zero, RandomName(), zero); 797 InventoryItemBase ib3 = NewItem(i3, zero, zero, RandomName(), zero);
798 InventoryItemBase ib4 = NewItem(i4, zero, zero, RandomName(), zero); 798 InventoryItemBase ib4 = NewItem(i4, zero, zero, RandomName(), zero);
799 799
800 SceneObjectGroup sog = FindSOG("object1", region1); 800 SceneObjectGroup sog = FindSOG("object1", region1);
801 801
802 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True); 802 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True);
803 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True); 803 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True);
804 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True); 804 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True);
805 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True); 805 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True);
806 806
807 TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1); 807 TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1);
808 Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))"); 808 Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))");
809 TaskInventoryItem t2 = sog.GetInventoryItem(sog.RootPart.LocalId, i2); 809 TaskInventoryItem t2 = sog.GetInventoryItem(sog.RootPart.LocalId, i2);
@@ -818,7 +818,7 @@ namespace OpenSim.Data.Tests
818 public void T052_RemoveObject() 818 public void T052_RemoveObject()
819 { 819 {
820 TestHelpers.InMethod(); 820 TestHelpers.InMethod();
821 821
822 db.RemoveObject(prim1, region1); 822 db.RemoveObject(prim1, region1);
823 SceneObjectGroup sog = FindSOG("object1", region1); 823 SceneObjectGroup sog = FindSOG("object1", region1);
824 Assert.That(sog, Is.Null); 824 Assert.That(sog, Is.Null);
@@ -828,7 +828,7 @@ namespace OpenSim.Data.Tests
828 public void T100_DefaultRegionInfo() 828 public void T100_DefaultRegionInfo()
829 { 829 {
830 TestHelpers.InMethod(); 830 TestHelpers.InMethod();
831 831
832 RegionSettings r1 = db.LoadRegionSettings(region1); 832 RegionSettings r1 = db.LoadRegionSettings(region1);
833 Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))"); 833 Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))");
834 834
@@ -840,7 +840,7 @@ namespace OpenSim.Data.Tests
840 public void T101_UpdateRegionInfo() 840 public void T101_UpdateRegionInfo()
841 { 841 {
842 TestHelpers.InMethod(); 842 TestHelpers.InMethod();
843 843
844 int agentlimit = random.Next(); 844 int agentlimit = random.Next();
845 double objectbonus = random.Next(); 845 double objectbonus = random.Next();
846 int maturity = random.Next(); 846 int maturity = random.Next();
@@ -900,9 +900,9 @@ namespace OpenSim.Data.Tests
900 r1.FixedSun = true; 900 r1.FixedSun = true;
901 r1.SunPosition = sunpos; 901 r1.SunPosition = sunpos;
902 r1.Covenant = cov; 902 r1.Covenant = cov;
903 903
904 db.StoreRegionSettings(r1); 904 db.StoreRegionSettings(r1);
905 905
906 RegionSettings r1a = db.LoadRegionSettings(region1); 906 RegionSettings r1a = db.LoadRegionSettings(region1);
907 Assert.That(r1a.RegionUUID, Is.EqualTo(region1), "Assert.That(r1a.RegionUUID, Is.EqualTo(region1))"); 907 Assert.That(r1a.RegionUUID, Is.EqualTo(region1), "Assert.That(r1a.RegionUUID, Is.EqualTo(region1))");
908 Assert.That(r1a.BlockTerraform,Is.True); 908 Assert.That(r1a.BlockTerraform,Is.True);
@@ -939,14 +939,14 @@ namespace OpenSim.Data.Tests
939 //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))"); 939 //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))");
940 Assert.That(r1a.FixedSun,Is.True); 940 Assert.That(r1a.FixedSun,Is.True);
941 Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))"); 941 Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))");
942 Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); 942 Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))");
943 } 943 }
944 944
945 [Test] 945 [Test]
946 public void T300_NoTerrain() 946 public void T300_NoTerrain()
947 { 947 {
948 TestHelpers.InMethod(); 948 TestHelpers.InMethod();
949 949
950 Assert.That(db.LoadTerrain(zero), Is.Null); 950 Assert.That(db.LoadTerrain(zero), Is.Null);
951 Assert.That(db.LoadTerrain(region1), Is.Null); 951 Assert.That(db.LoadTerrain(region1), Is.Null);
952 Assert.That(db.LoadTerrain(region2), Is.Null); 952 Assert.That(db.LoadTerrain(region2), Is.Null);
@@ -957,13 +957,13 @@ namespace OpenSim.Data.Tests
957 public void T301_CreateTerrain() 957 public void T301_CreateTerrain()
958 { 958 {
959 TestHelpers.InMethod(); 959 TestHelpers.InMethod();
960 960
961 double[,] t1 = GenTerrain(height1); 961 double[,] t1 = GenTerrain(height1);
962 db.StoreTerrain(t1, region1); 962 db.StoreTerrain(t1, region1);
963 963
964 // store terrain is async 964 // store terrain is async
965 Thread.Sleep(1000); 965 Thread.Sleep(1000);
966 966
967 Assert.That(db.LoadTerrain(zero), Is.Null); 967 Assert.That(db.LoadTerrain(zero), Is.Null);
968 Assert.That(db.LoadTerrain(region1), Is.Not.Null); 968 Assert.That(db.LoadTerrain(region1), Is.Not.Null);
969 Assert.That(db.LoadTerrain(region2), Is.Null); 969 Assert.That(db.LoadTerrain(region2), Is.Null);
@@ -974,7 +974,7 @@ namespace OpenSim.Data.Tests
974 public void T302_FetchTerrain() 974 public void T302_FetchTerrain()
975 { 975 {
976 TestHelpers.InMethod(); 976 TestHelpers.InMethod();
977 977
978 double[,] baseterrain1 = GenTerrain(height1); 978 double[,] baseterrain1 = GenTerrain(height1);
979 double[,] baseterrain2 = GenTerrain(height2); 979 double[,] baseterrain2 = GenTerrain(height2);
980 double[,] t1 = db.LoadTerrain(region1); 980 double[,] t1 = db.LoadTerrain(region1);
@@ -986,7 +986,7 @@ namespace OpenSim.Data.Tests
986 public void T303_UpdateTerrain() 986 public void T303_UpdateTerrain()
987 { 987 {
988 TestHelpers.InMethod(); 988 TestHelpers.InMethod();
989 989
990 double[,] baseterrain1 = GenTerrain(height1); 990 double[,] baseterrain1 = GenTerrain(height1);
991 double[,] baseterrain2 = GenTerrain(height2); 991 double[,] baseterrain2 = GenTerrain(height2);
992 db.StoreTerrain(baseterrain2, region1); 992 db.StoreTerrain(baseterrain2, region1);
@@ -1003,7 +1003,7 @@ namespace OpenSim.Data.Tests
1003 public void T400_EmptyLand() 1003 public void T400_EmptyLand()
1004 { 1004 {
1005 TestHelpers.InMethod(); 1005 TestHelpers.InMethod();
1006 1006
1007 Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))"); 1007 Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))");
1008 Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))"); 1008 Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))");
1009 Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))"); 1009 Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))");
@@ -1025,15 +1025,15 @@ namespace OpenSim.Data.Tests
1025 for (int x = 0; x < Constants.RegionSize; x++) 1025 for (int x = 0; x < Constants.RegionSize; x++)
1026 for (int y = 0; y < Constants.RegionSize; y++) 1026 for (int y = 0; y < Constants.RegionSize; y++)
1027 terret[x,y] = value; 1027 terret[x,y] = value;
1028 1028
1029 return terret; 1029 return terret;
1030 } 1030 }
1031 1031
1032 private bool CompareTerrain(double[,] one, double[,] two) 1032 private bool CompareTerrain(double[,] one, double[,] two)
1033 { 1033 {
1034 for (int x = 0; x < Constants.RegionSize; x++) 1034 for (int x = 0; x < Constants.RegionSize; x++)
1035 for (int y = 0; y < Constants.RegionSize; y++) 1035 for (int y = 0; y < Constants.RegionSize; y++)
1036 if (one[x,y] != two[x,y]) 1036 if (one[x,y] != two[x,y])
1037 return false; 1037 return false;
1038 1038
1039 return true; 1039 return true;
@@ -1053,12 +1053,12 @@ namespace OpenSim.Data.Tests
1053 // common failure case is people adding new fields that aren't 1053 // common failure case is people adding new fields that aren't
1054 // initialized, but have non-null db constraints. We should 1054 // initialized, but have non-null db constraints. We should
1055 // honestly be passing more and more null things in here. 1055 // honestly be passing more and more null things in here.
1056 // 1056 //
1057 // Please note that in Sqlite.BuildPrim there is a commented out inline version 1057 // Please note that in Sqlite.BuildPrim there is a commented out inline version
1058 // of this so you can debug and step through the build process and check the fields 1058 // of this so you can debug and step through the build process and check the fields
1059 // 1059 //
1060 // Real World Value: Tests for situation where extending a SceneObjectGroup/SceneObjectPart 1060 // Real World Value: Tests for situation where extending a SceneObjectGroup/SceneObjectPart
1061 // causes the application to crash at the database layer because of null values 1061 // causes the application to crash at the database layer because of null values
1062 // in NOT NULL fields 1062 // in NOT NULL fields
1063 // 1063 //
1064 private SceneObjectGroup NewSOG(string name, UUID uuid, UUID regionId) 1064 private SceneObjectGroup NewSOG(string name, UUID uuid, UUID regionId)
@@ -1082,7 +1082,7 @@ namespace OpenSim.Data.Tests
1082 1082
1083 return sog; 1083 return sog;
1084 } 1084 }
1085 1085
1086 private SceneObjectPart NewSOP(string name, UUID uuid) 1086 private SceneObjectPart NewSOP(string name, UUID uuid)
1087 { 1087 {
1088 SceneObjectPart sop = new SceneObjectPart(); 1088 SceneObjectPart sop = new SceneObjectPart();
@@ -1096,7 +1096,7 @@ namespace OpenSim.Data.Tests
1096 return sop; 1096 return sop;
1097 } 1097 }
1098 1098
1099 // These are copied from the Inventory Item tests 1099 // These are copied from the Inventory Item tests
1100 1100
1101 private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) 1101 private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset)
1102 { 1102 {
@@ -1114,7 +1114,7 @@ namespace OpenSim.Data.Tests
1114 private static string RandomName() 1114 private static string RandomName()
1115 { 1115 {
1116 StringBuilder name = new StringBuilder(); 1116 StringBuilder name = new StringBuilder();
1117 int size = random.Next(5,12); 1117 int size = random.Next(5,12);
1118 char ch ; 1118 char ch ;
1119 for (int i=0; i<size; i++) 1119 for (int i=0; i<size; i++)
1120 { 1120 {