aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/Tests/AssetTests.cs7
-rw-r--r--OpenSim/Data/Tests/EstateTests.cs17
-rw-r--r--OpenSim/Data/Tests/InventoryTests.cs29
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs88
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs26
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs4
6 files changed, 133 insertions, 38 deletions
diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs
index 32f74a9..b5ae244 100644
--- a/OpenSim/Data/Tests/AssetTests.cs
+++ b/OpenSim/Data/Tests/AssetTests.cs
@@ -32,6 +32,7 @@ using NUnit.Framework;
32using NUnit.Framework.Constraints; 32using NUnit.Framework.Constraints;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Tests.Common;
35using System.Data.Common; 36using System.Data.Common;
36using log4net; 37using log4net;
37 38
@@ -105,6 +106,8 @@ namespace OpenSim.Data.Tests
105 [Test] 106 [Test]
106 public void T001_LoadEmpty() 107 public void T001_LoadEmpty()
107 { 108 {
109 TestHelper.InMethod();
110
108 Assert.That(m_db.ExistsAsset(uuid1), Is.False); 111 Assert.That(m_db.ExistsAsset(uuid1), Is.False);
109 Assert.That(m_db.ExistsAsset(uuid2), Is.False); 112 Assert.That(m_db.ExistsAsset(uuid2), Is.False);
110 Assert.That(m_db.ExistsAsset(uuid3), Is.False); 113 Assert.That(m_db.ExistsAsset(uuid3), Is.False);
@@ -113,6 +116,8 @@ namespace OpenSim.Data.Tests
113 [Test] 116 [Test]
114 public void T010_StoreReadVerifyAssets() 117 public void T010_StoreReadVerifyAssets()
115 { 118 {
119 TestHelper.InMethod();
120
116 AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); 121 AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString());
117 AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); 122 AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString());
118 AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); 123 AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString());
@@ -178,6 +183,8 @@ namespace OpenSim.Data.Tests
178 [Test] 183 [Test]
179 public void T020_CheckForWeirdCreatorID() 184 public void T020_CheckForWeirdCreatorID()
180 { 185 {
186 TestHelper.InMethod();
187
181 // It is expected that eventually the CreatorID might be an arbitrary string (an URI) 188 // It is expected that eventually the CreatorID might be an arbitrary string (an URI)
182 // rather than a valid UUID (?). This test is to make sure that the database layer does not 189 // rather than a valid UUID (?). This test is to make sure that the database layer does not
183 // attempt to convert CreatorID to GUID, but just passes it both ways as a string. 190 // attempt to convert CreatorID to GUID, but just passes it both ways as a string.
diff --git a/OpenSim/Data/Tests/EstateTests.cs b/OpenSim/Data/Tests/EstateTests.cs
index 3354e28..8d332da 100644
--- a/OpenSim/Data/Tests/EstateTests.cs
+++ b/OpenSim/Data/Tests/EstateTests.cs
@@ -31,6 +31,7 @@ using NUnit.Framework;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Tests.Common;
34using System.Text; 35using System.Text;
35using log4net; 36using log4net;
36using System.Reflection; 37using System.Reflection;
@@ -106,6 +107,8 @@ namespace OpenSim.Data.Tests
106 [Test] 107 [Test]
107 public void T010_EstateSettingsSimpleStorage_MinimumParameterSet() 108 public void T010_EstateSettingsSimpleStorage_MinimumParameterSet()
108 { 109 {
110 TestHelper.InMethod();
111
109 EstateSettingsSimpleStorage( 112 EstateSettingsSimpleStorage(
110 REGION_ID, 113 REGION_ID,
111 DataTestUtil.STRING_MIN, 114 DataTestUtil.STRING_MIN,
@@ -137,6 +140,8 @@ namespace OpenSim.Data.Tests
137 [Test] 140 [Test]
138 public void T011_EstateSettingsSimpleStorage_MaximumParameterSet() 141 public void T011_EstateSettingsSimpleStorage_MaximumParameterSet()
139 { 142 {
143 TestHelper.InMethod();
144
140 EstateSettingsSimpleStorage( 145 EstateSettingsSimpleStorage(
141 REGION_ID, 146 REGION_ID,
142 DataTestUtil.STRING_MAX(64), 147 DataTestUtil.STRING_MAX(64),
@@ -168,6 +173,8 @@ namespace OpenSim.Data.Tests
168 [Test] 173 [Test]
169 public void T012_EstateSettingsSimpleStorage_AccurateParameterSet() 174 public void T012_EstateSettingsSimpleStorage_AccurateParameterSet()
170 { 175 {
176 TestHelper.InMethod();
177
171 EstateSettingsSimpleStorage( 178 EstateSettingsSimpleStorage(
172 REGION_ID, 179 REGION_ID,
173 DataTestUtil.STRING_MAX(1), 180 DataTestUtil.STRING_MAX(1),
@@ -199,6 +206,8 @@ namespace OpenSim.Data.Tests
199 [Test] 206 [Test]
200 public void T012_EstateSettingsRandomStorage() 207 public void T012_EstateSettingsRandomStorage()
201 { 208 {
209 TestHelper.InMethod();
210
202 // Letting estate store generate rows to database for us 211 // Letting estate store generate rows to database for us
203 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 212 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
204 new PropertyScrambler<EstateSettings>() 213 new PropertyScrambler<EstateSettings>()
@@ -218,6 +227,8 @@ namespace OpenSim.Data.Tests
218 [Test] 227 [Test]
219 public void T020_EstateSettingsManagerList() 228 public void T020_EstateSettingsManagerList()
220 { 229 {
230 TestHelper.InMethod();
231
221 // Letting estate store generate rows to database for us 232 // Letting estate store generate rows to database for us
222 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 233 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
223 234
@@ -237,6 +248,8 @@ namespace OpenSim.Data.Tests
237 [Test] 248 [Test]
238 public void T021_EstateSettingsUserList() 249 public void T021_EstateSettingsUserList()
239 { 250 {
251 TestHelper.InMethod();
252
240 // Letting estate store generate rows to database for us 253 // Letting estate store generate rows to database for us
241 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 254 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
242 255
@@ -256,6 +269,8 @@ namespace OpenSim.Data.Tests
256 [Test] 269 [Test]
257 public void T022_EstateSettingsGroupList() 270 public void T022_EstateSettingsGroupList()
258 { 271 {
272 TestHelper.InMethod();
273
259 // Letting estate store generate rows to database for us 274 // Letting estate store generate rows to database for us
260 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 275 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
261 276
@@ -275,6 +290,8 @@ namespace OpenSim.Data.Tests
275 [Test] 290 [Test]
276 public void T022_EstateSettingsBanList() 291 public void T022_EstateSettingsBanList()
277 { 292 {
293 TestHelper.InMethod();
294
278 // Letting estate store generate rows to database for us 295 // Letting estate store generate rows to database for us
279 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 296 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
280 297
diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs
index 758f970..cf3bac1 100644
--- a/OpenSim/Data/Tests/InventoryTests.cs
+++ b/OpenSim/Data/Tests/InventoryTests.cs
@@ -30,6 +30,7 @@ using log4net.Config;
30using NUnit.Framework; 30using NUnit.Framework;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Tests.Common;
33using log4net; 34using log4net;
34using System.Reflection; 35using System.Reflection;
35using System.Data.Common; 36using System.Data.Common;
@@ -113,6 +114,8 @@ namespace OpenSim.Data.Tests
113 [Test] 114 [Test]
114 public void T001_LoadEmpty() 115 public void T001_LoadEmpty()
115 { 116 {
117 TestHelper.InMethod();
118
116 Assert.That(db.getInventoryFolder(zero), Is.Null); 119 Assert.That(db.getInventoryFolder(zero), Is.Null);
117 Assert.That(db.getInventoryFolder(folder1), Is.Null); 120 Assert.That(db.getInventoryFolder(folder1), Is.Null);
118 Assert.That(db.getInventoryFolder(folder2), Is.Null); 121 Assert.That(db.getInventoryFolder(folder2), Is.Null);
@@ -131,6 +134,8 @@ namespace OpenSim.Data.Tests
131 [Test] 134 [Test]
132 public void T010_FolderNonParent() 135 public void T010_FolderNonParent()
133 { 136 {
137 TestHelper.InMethod();
138
134 InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2); 139 InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2);
135 // the folder will go in 140 // the folder will go in
136 db.addInventoryFolder(f1); 141 db.addInventoryFolder(f1);
@@ -141,6 +146,8 @@ namespace OpenSim.Data.Tests
141 [Test] 146 [Test]
142 public void T011_FolderCreate() 147 public void T011_FolderCreate()
143 { 148 {
149 TestHelper.InMethod();
150
144 InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1); 151 InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1);
145 // TODO: this is probably wrong behavior, but is what we have 152 // TODO: this is probably wrong behavior, but is what we have
146 // db.updateInventoryFolder(f1); 153 // db.updateInventoryFolder(f1);
@@ -153,7 +160,7 @@ namespace OpenSim.Data.Tests
153 db.addInventoryFolder(f1); 160 db.addInventoryFolder(f1);
154 InventoryFolderBase f1a = db.getUserRootFolder(owner1); 161 InventoryFolderBase f1a = db.getUserRootFolder(owner1);
155 Assert.That(folder1, Is.EqualTo(f1a.ID), "Assert.That(folder1, Is.EqualTo(f1a.ID))"); 162 Assert.That(folder1, Is.EqualTo(f1a.ID), "Assert.That(folder1, Is.EqualTo(f1a.ID))");
156 Assert.That(name1, Text.Matches(f1a.Name), "Assert.That(name1, Text.Matches(f1a.Name))"); 163 Assert.That(name1, Is.StringMatching(f1a.Name), "Assert.That(name1, Text.Matches(f1a.Name))");
157 } 164 }
158 165
159 // we now have the following tree 166 // we now have the following tree
@@ -164,6 +171,8 @@ namespace OpenSim.Data.Tests
164 [Test] 171 [Test]
165 public void T012_FolderList() 172 public void T012_FolderList()
166 { 173 {
174 TestHelper.InMethod();
175
167 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); 176 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3);
168 db.addInventoryFolder(f2); 177 db.addInventoryFolder(f2);
169 178
@@ -178,6 +187,8 @@ namespace OpenSim.Data.Tests
178 [Test] 187 [Test]
179 public void T013_FolderHierarchy() 188 public void T013_FolderHierarchy()
180 { 189 {
190 TestHelper.InMethod();
191
181 int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned) 192 int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned)
182 Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); 193 Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
183 n = db.getFolderHierarchy(folder1).Count; 194 n = db.getFolderHierarchy(folder1).Count;
@@ -191,6 +202,8 @@ namespace OpenSim.Data.Tests
191 [Test] 202 [Test]
192 public void T014_MoveFolder() 203 public void T014_MoveFolder()
193 { 204 {
205 TestHelper.InMethod();
206
194 InventoryFolderBase f2 = db.getInventoryFolder(folder2); 207 InventoryFolderBase f2 = db.getInventoryFolder(folder2);
195 f2.ParentID = folder3; 208 f2.ParentID = folder3;
196 db.moveInventoryFolder(f2); 209 db.moveInventoryFolder(f2);
@@ -205,6 +218,8 @@ namespace OpenSim.Data.Tests
205 [Test] 218 [Test]
206 public void T015_FolderHierarchy() 219 public void T015_FolderHierarchy()
207 { 220 {
221 TestHelper.InMethod();
222
208 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); 223 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
209 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))"); 224 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
210 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))"); 225 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
@@ -216,6 +231,8 @@ namespace OpenSim.Data.Tests
216 [Test] 231 [Test]
217 public void T100_NoItems() 232 public void T100_NoItems()
218 { 233 {
234 TestHelper.InMethod();
235
219 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); 236 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
220 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))"); 237 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))");
221 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))"); 238 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))");
@@ -228,6 +245,8 @@ namespace OpenSim.Data.Tests
228 [Test] 245 [Test]
229 public void T101_CreatItems() 246 public void T101_CreatItems()
230 { 247 {
248 TestHelper.InMethod();
249
231 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); 250 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1));
232 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); 251 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2));
233 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); 252 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3));
@@ -237,6 +256,8 @@ namespace OpenSim.Data.Tests
237 [Test] 256 [Test]
238 public void T102_CompareItems() 257 public void T102_CompareItems()
239 { 258 {
259 TestHelper.InMethod();
260
240 InventoryItemBase i1 = db.getInventoryItem(item1); 261 InventoryItemBase i1 = db.getInventoryItem(item1);
241 InventoryItemBase i2 = db.getInventoryItem(item2); 262 InventoryItemBase i2 = db.getInventoryItem(item2);
242 InventoryItemBase i3 = db.getInventoryItem(item3); 263 InventoryItemBase i3 = db.getInventoryItem(item3);
@@ -254,6 +275,8 @@ namespace OpenSim.Data.Tests
254 [Test] 275 [Test]
255 public void T103_UpdateItem() 276 public void T103_UpdateItem()
256 { 277 {
278 TestHelper.InMethod();
279
257 // TODO: probably shouldn't have the ability to have an 280 // TODO: probably shouldn't have the ability to have an
258 // owner of an item in a folder not owned by the user 281 // owner of an item in a folder not owned by the user
259 282
@@ -272,6 +295,8 @@ namespace OpenSim.Data.Tests
272 [Test] 295 [Test]
273 public void T104_RandomUpdateItem() 296 public void T104_RandomUpdateItem()
274 { 297 {
298 TestHelper.InMethod();
299
275 PropertyScrambler<InventoryFolderBase> folderScrambler = 300 PropertyScrambler<InventoryFolderBase> folderScrambler =
276 new PropertyScrambler<InventoryFolderBase>() 301 new PropertyScrambler<InventoryFolderBase>()
277 .DontScramble(x => x.Owner) 302 .DontScramble(x => x.Owner)
@@ -329,6 +354,8 @@ namespace OpenSim.Data.Tests
329 [Test] 354 [Test]
330 public void T999_StillNull() 355 public void T999_StillNull()
331 { 356 {
357 TestHelper.InMethod();
358
332 // After all tests are run, these should still return no results 359 // After all tests are run, these should still return no results
333 Assert.That(db.getInventoryFolder(zero), Is.Null); 360 Assert.That(db.getInventoryFolder(zero), Is.Null);
334 Assert.That(db.getInventoryItem(zero), Is.Null); 361 Assert.That(db.getInventoryItem(zero), Is.Null);
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index 9598716..44cf1ab 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -35,6 +35,7 @@ using OpenMetaverse;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Tests.Common;
38using log4net; 39using log4net;
39using System.Reflection; 40using System.Reflection;
40using System.Data.Common; 41using System.Data.Common;
@@ -120,15 +121,18 @@ namespace OpenSim.Data.Tests
120 string[] reg_tables = new string[] { 121 string[] reg_tables = new string[] {
121 "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" 122 "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings"
122 }; 123 };
124
123 if (m_rebuildDB) 125 if (m_rebuildDB)
124 { 126 {
125 DropTables(reg_tables); 127 DropTables(reg_tables);
126 ResetMigrations("RegionStore"); 128 ResetMigrations("RegionStore");
127 }else 129 }
130 else
131 {
128 ClearTables(reg_tables); 132 ClearTables(reg_tables);
133 }
129 } 134 }
130 135
131
132 // Test Plan 136 // Test Plan
133 // Prims 137 // Prims
134 // - empty test - 001 138 // - empty test - 001
@@ -147,6 +151,8 @@ namespace OpenSim.Data.Tests
147 [Test] 151 [Test]
148 public void T001_LoadEmpty() 152 public void T001_LoadEmpty()
149 { 153 {
154 TestHelper.InMethod();
155
150 List<SceneObjectGroup> objs = db.LoadObjects(region1); 156 List<SceneObjectGroup> objs = db.LoadObjects(region1);
151 List<SceneObjectGroup> objs3 = db.LoadObjects(region3); 157 List<SceneObjectGroup> objs3 = db.LoadObjects(region3);
152 List<LandData> land = db.LoadLandObjects(region1); 158 List<LandData> land = db.LoadLandObjects(region1);
@@ -163,6 +169,8 @@ namespace OpenSim.Data.Tests
163 [Test] 169 [Test]
164 public void T010_StoreSimpleObject() 170 public void T010_StoreSimpleObject()
165 { 171 {
172 TestHelper.InMethod();
173
166 SceneObjectGroup sog = NewSOG("object1", prim1, region1); 174 SceneObjectGroup sog = NewSOG("object1", prim1, region1);
167 SceneObjectGroup sog2 = NewSOG("object2", prim2, region1); 175 SceneObjectGroup sog2 = NewSOG("object2", prim2, region1);
168 176
@@ -196,6 +204,8 @@ namespace OpenSim.Data.Tests
196 [Test] 204 [Test]
197 public void T011_ObjectNames() 205 public void T011_ObjectNames()
198 { 206 {
207 TestHelper.InMethod();
208
199 List<SceneObjectGroup> objs = db.LoadObjects(region1); 209 List<SceneObjectGroup> objs = db.LoadObjects(region1);
200 foreach (SceneObjectGroup sog in objs) 210 foreach (SceneObjectGroup sog in objs)
201 { 211 {
@@ -208,6 +218,8 @@ namespace OpenSim.Data.Tests
208 [Test] 218 [Test]
209 public void T012_SceneParts() 219 public void T012_SceneParts()
210 { 220 {
221 TestHelper.InMethod();
222
211 UUID tmp0 = UUID.Random(); 223 UUID tmp0 = UUID.Random();
212 UUID tmp1 = UUID.Random(); 224 UUID tmp1 = UUID.Random();
213 UUID tmp2 = UUID.Random(); 225 UUID tmp2 = UUID.Random();
@@ -241,6 +253,8 @@ namespace OpenSim.Data.Tests
241 [Test] 253 [Test]
242 public void T013_DatabasePersistency() 254 public void T013_DatabasePersistency()
243 { 255 {
256 TestHelper.InMethod();
257
244 // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data 258 // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data
245 // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored 259 // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored
246 // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently. 260 // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently.
@@ -416,6 +430,8 @@ namespace OpenSim.Data.Tests
416 [Test] 430 [Test]
417 public void T014_UpdateObject() 431 public void T014_UpdateObject()
418 { 432 {
433 TestHelper.InMethod();
434
419 string text1 = "object1 text"; 435 string text1 = "object1 text";
420 SceneObjectGroup sog = FindSOG("object1", region1); 436 SceneObjectGroup sog = FindSOG("object1", region1);
421 sog.RootPart.Text = text1; 437 sog.RootPart.Text = text1;
@@ -517,15 +533,20 @@ namespace OpenSim.Data.Tests
517 Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))"); 533 Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))");
518 Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))"); 534 Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))");
519 } 535 }
520 536
537 /// <summary>
538 /// Test storage and retrieval of a scene object with a large number of parts.
539 /// </summary>
521 [Test] 540 [Test]
522 public void T015_LargeSceneObjects() 541 public void T015_LargeSceneObjects()
523 { 542 {
543 TestHelper.InMethod();
544
524 UUID id = UUID.Random(); 545 UUID id = UUID.Random();
525 Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>(); 546 Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>();
526 SceneObjectGroup sog = NewSOG("Test SOG", id, region4); 547 SceneObjectGroup sog = NewSOG("Test SOG", id, region4);
527 mydic.Add(sog.RootPart.UUID,sog.RootPart); 548 mydic.Add(sog.RootPart.UUID,sog.RootPart);
528 for (int i=0;i<30;i++) 549 for (int i = 0; i < 30; i++)
529 { 550 {
530 UUID tmp = UUID.Random(); 551 UUID tmp = UUID.Random();
531 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); 552 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp);
@@ -544,13 +565,14 @@ namespace OpenSim.Data.Tests
544 sop.Acceleration = accel; 565 sop.Acceleration = accel;
545 566
546 mydic.Add(tmp,sop); 567 mydic.Add(tmp,sop);
547 sog.AddPart(sop); 568 sog.AddPart(sop);
548 db.StoreObject(sog, region4);
549 } 569 }
550 570
571 db.StoreObject(sog, region4);
572
551 SceneObjectGroup retsog = FindSOG("Test SOG", region4); 573 SceneObjectGroup retsog = FindSOG("Test SOG", region4);
552 SceneObjectPart[] parts = retsog.Parts; 574 SceneObjectPart[] parts = retsog.Parts;
553 for (int i=0;i<30;i++) 575 for (int i = 0; i < 30; i++)
554 { 576 {
555 SceneObjectPart cursop = mydic[parts[i].UUID]; 577 SceneObjectPart cursop = mydic[parts[i].UUID];
556 Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition), "Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition))"); 578 Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition), "Assert.That(cursop.GroupPosition,Is.EqualTo(parts[i].GroupPosition))");
@@ -565,6 +587,8 @@ namespace OpenSim.Data.Tests
565 //[Test] 587 //[Test]
566 public void T016_RandomSogWithSceneParts() 588 public void T016_RandomSogWithSceneParts()
567 { 589 {
590 TestHelper.InMethod();
591
568 PropertyScrambler<SceneObjectPart> scrambler = 592 PropertyScrambler<SceneObjectPart> scrambler =
569 new PropertyScrambler<SceneObjectPart>() 593 new PropertyScrambler<SceneObjectPart>()
570 .DontScramble(x => x.UUID); 594 .DontScramble(x => x.UUID);
@@ -631,15 +655,16 @@ namespace OpenSim.Data.Tests
631 return sog; 655 return sog;
632 } 656 }
633 657
634
635 // NOTE: it is a bad practice to rely on some of the previous tests having been run before. 658 // NOTE: it is a bad practice to rely on some of the previous tests having been run before.
636 // If the tests are run manually, one at a time, each starts with full class init (DB cleared). 659 // If the tests are run manually, one at a time, each starts with full class init (DB cleared).
637 // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order. 660 // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order.
638 // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*! 661 // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*!
639 662
640 [Test] 663 [Test]
641 public void T020_PrimInventoryEmpty() 664 public void T020_PrimInventoryEmpty()
642 { 665 {
666 TestHelper.InMethod();
667
643 SceneObjectGroup sog = GetMySOG("object1"); 668 SceneObjectGroup sog = GetMySOG("object1");
644 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 669 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
645 Assert.That(t, Is.Null); 670 Assert.That(t, Is.Null);
@@ -659,10 +684,11 @@ namespace OpenSim.Data.Tests
659 db.StorePrimInventory(sog.RootPart.UUID, list); 684 db.StorePrimInventory(sog.RootPart.UUID, list);
660 } 685 }
661 686
662
663 [Test] 687 [Test]
664 public void T021_PrimInventoryBasic() 688 public void T021_PrimInventoryBasic()
665 { 689 {
690 TestHelper.InMethod();
691
666 SceneObjectGroup sog = GetMySOG("object1"); 692 SceneObjectGroup sog = GetMySOG("object1");
667 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); 693 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
668 694
@@ -690,20 +716,19 @@ namespace OpenSim.Data.Tests
690 Assert.That(t2.Name, Is.EqualTo("My New Name"), "Assert.That(t.Name, Is.EqualTo(\"My New Name\"))"); 716 Assert.That(t2.Name, Is.EqualTo("My New Name"), "Assert.That(t.Name, Is.EqualTo(\"My New Name\"))");
691 717
692 // Removing inventory 718 // Removing inventory
693
694 List<TaskInventoryItem> list = new List<TaskInventoryItem>(); 719 List<TaskInventoryItem> list = new List<TaskInventoryItem>();
695 db.StorePrimInventory(prim1, list); 720 db.StorePrimInventory(prim1, list);
696 721
697 sog = FindSOG("object1", region1); 722 sog = FindSOG("object1", region1);
698 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 723 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
699 Assert.That(t, Is.Null); 724 Assert.That(t, Is.Null);
700
701 } 725 }
702
703 726
704 [Test] 727 [Test]
705 public void T025_PrimInventoryPersistency() 728 public void T025_PrimInventoryPersistency()
706 { 729 {
730 TestHelper.InMethod();
731
707 InventoryItemBase i = new InventoryItemBase(); 732 InventoryItemBase i = new InventoryItemBase();
708 UUID id = UUID.Random(); 733 UUID id = UUID.Random();
709 i.ID = id; 734 i.ID = id;
@@ -775,6 +800,8 @@ namespace OpenSim.Data.Tests
775 [ExpectedException(typeof(ArgumentException))] 800 [ExpectedException(typeof(ArgumentException))]
776 public void T026_PrimInventoryMany() 801 public void T026_PrimInventoryMany()
777 { 802 {
803 TestHelper.InMethod();
804
778 UUID i1,i2,i3,i4; 805 UUID i1,i2,i3,i4;
779 i1 = UUID.Random(); 806 i1 = UUID.Random();
780 i2 = UUID.Random(); 807 i2 = UUID.Random();
@@ -805,15 +832,18 @@ namespace OpenSim.Data.Tests
805 [Test] 832 [Test]
806 public void T052_RemoveObject() 833 public void T052_RemoveObject()
807 { 834 {
835 TestHelper.InMethod();
836
808 db.RemoveObject(prim1, region1); 837 db.RemoveObject(prim1, region1);
809 SceneObjectGroup sog = FindSOG("object1", region1); 838 SceneObjectGroup sog = FindSOG("object1", region1);
810 Assert.That(sog, Is.Null); 839 Assert.That(sog, Is.Null);
811 } 840 }
812 841
813
814 [Test] 842 [Test]
815 public void T100_DefaultRegionInfo() 843 public void T100_DefaultRegionInfo()
816 { 844 {
845 TestHelper.InMethod();
846
817 RegionSettings r1 = db.LoadRegionSettings(region1); 847 RegionSettings r1 = db.LoadRegionSettings(region1);
818 Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))"); 848 Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))");
819 849
@@ -824,6 +854,8 @@ namespace OpenSim.Data.Tests
824 [Test] 854 [Test]
825 public void T101_UpdateRegionInfo() 855 public void T101_UpdateRegionInfo()
826 { 856 {
857 TestHelper.InMethod();
858
827 int agentlimit = random.Next(); 859 int agentlimit = random.Next();
828 double objectbonus = random.Next(); 860 double objectbonus = random.Next();
829 int maturity = random.Next(); 861 int maturity = random.Next();
@@ -922,13 +954,14 @@ namespace OpenSim.Data.Tests
922 //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))"); 954 //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))");
923 Assert.That(r1a.FixedSun,Is.True); 955 Assert.That(r1a.FixedSun,Is.True);
924 Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))"); 956 Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))");
925 Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); 957 Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))");
926
927 } 958 }
928 959
929 [Test] 960 [Test]
930 public void T300_NoTerrain() 961 public void T300_NoTerrain()
931 { 962 {
963 TestHelper.InMethod();
964
932 Assert.That(db.LoadTerrain(zero), Is.Null); 965 Assert.That(db.LoadTerrain(zero), Is.Null);
933 Assert.That(db.LoadTerrain(region1), Is.Null); 966 Assert.That(db.LoadTerrain(region1), Is.Null);
934 Assert.That(db.LoadTerrain(region2), Is.Null); 967 Assert.That(db.LoadTerrain(region2), Is.Null);
@@ -938,6 +971,8 @@ namespace OpenSim.Data.Tests
938 [Test] 971 [Test]
939 public void T301_CreateTerrain() 972 public void T301_CreateTerrain()
940 { 973 {
974 TestHelper.InMethod();
975
941 double[,] t1 = GenTerrain(height1); 976 double[,] t1 = GenTerrain(height1);
942 db.StoreTerrain(t1, region1); 977 db.StoreTerrain(t1, region1);
943 978
@@ -950,6 +985,8 @@ namespace OpenSim.Data.Tests
950 [Test] 985 [Test]
951 public void T302_FetchTerrain() 986 public void T302_FetchTerrain()
952 { 987 {
988 TestHelper.InMethod();
989
953 double[,] baseterrain1 = GenTerrain(height1); 990 double[,] baseterrain1 = GenTerrain(height1);
954 double[,] baseterrain2 = GenTerrain(height2); 991 double[,] baseterrain2 = GenTerrain(height2);
955 double[,] t1 = db.LoadTerrain(region1); 992 double[,] t1 = db.LoadTerrain(region1);
@@ -960,6 +997,8 @@ namespace OpenSim.Data.Tests
960 [Test] 997 [Test]
961 public void T303_UpdateTerrain() 998 public void T303_UpdateTerrain()
962 { 999 {
1000 TestHelper.InMethod();
1001
963 double[,] baseterrain1 = GenTerrain(height1); 1002 double[,] baseterrain1 = GenTerrain(height1);
964 double[,] baseterrain2 = GenTerrain(height2); 1003 double[,] baseterrain2 = GenTerrain(height2);
965 db.StoreTerrain(baseterrain2, region1); 1004 db.StoreTerrain(baseterrain2, region1);
@@ -972,6 +1011,8 @@ namespace OpenSim.Data.Tests
972 [Test] 1011 [Test]
973 public void T400_EmptyLand() 1012 public void T400_EmptyLand()
974 { 1013 {
1014 TestHelper.InMethod();
1015
975 Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))"); 1016 Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))");
976 Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))"); 1017 Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))");
977 Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))"); 1018 Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))");
@@ -1007,25 +1048,12 @@ namespace OpenSim.Data.Tests
1007 return true; 1048 return true;
1008 } 1049 }
1009 1050
1010
1011 private SceneObjectGroup FindSOG(string name, UUID r) 1051 private SceneObjectGroup FindSOG(string name, UUID r)
1012 { 1052 {
1013 List<SceneObjectGroup> objs = db.LoadObjects(r); 1053 List<SceneObjectGroup> objs = db.LoadObjects(r);
1014 foreach (SceneObjectGroup sog in objs) 1054 foreach (SceneObjectGroup sog in objs)
1015 { 1055 if (sog.Name == name)
1016 SceneObjectPart p = sog.RootPart;
1017 if (p.Name == name) {
1018 RegionInfo regionInfo = new RegionInfo();
1019 regionInfo.RegionID = r;
1020 regionInfo.RegionLocX = 0;
1021 regionInfo.RegionLocY = 0;
1022
1023 Scene scene = new Scene(regionInfo);
1024 sog.SetScene(scene);
1025
1026 return sog; 1056 return sog;
1027 }
1028 }
1029 1057
1030 return null; 1058 return null;
1031 } 1059 }
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 1d05b02..953ed85 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -378,6 +378,22 @@ namespace OpenSim.Framework.Servers.HttpServer
378 /// <param name="response"></param> 378 /// <param name="response"></param>
379 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) 379 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
380 { 380 {
381 if (request.HttpMethod == String.Empty) // Can't handle empty requests, not wasting a thread
382 {
383 try
384 {
385 SendHTML500(response);
386 }
387 catch
388 {
389 }
390
391 return;
392 }
393
394 string requestMethod = request.HttpMethod;
395 string uriString = request.RawUrl;
396
381 string reqnum = "unknown"; 397 string reqnum = "unknown";
382 int tickstart = Environment.TickCount; 398 int tickstart = Environment.TickCount;
383 399
@@ -495,7 +511,7 @@ namespace OpenSim.Framework.Servers.HttpServer
495 511
496 request.InputStream.Close(); 512 request.InputStream.Close();
497 513
498 // HTTP IN support. The script engine taes it from here 514 // HTTP IN support. The script engine takes it from here
499 // Nothing to worry about for us. 515 // Nothing to worry about for us.
500 // 516 //
501 if (buffer == null) 517 if (buffer == null)
@@ -609,9 +625,9 @@ namespace OpenSim.Framework.Servers.HttpServer
609 { 625 {
610 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e); 626 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e);
611 } 627 }
612 catch (InvalidOperationException e) 628 catch (Exception e)
613 { 629 {
614 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); 630 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString());
615 SendHTML500(response); 631 SendHTML500(response);
616 } 632 }
617 finally 633 finally
@@ -619,9 +635,9 @@ namespace OpenSim.Framework.Servers.HttpServer
619 // Every month or so this will wrap and give bad numbers, not really a problem 635 // Every month or so this will wrap and give bad numbers, not really a problem
620 // since its just for reporting, 200ms limit can be adjusted 636 // since its just for reporting, 200ms limit can be adjusted
621 int tickdiff = Environment.TickCount - tickstart; 637 int tickdiff = Environment.TickCount - tickstart;
622 if (tickdiff > 500) 638 if (tickdiff > 3000)
623 m_log.InfoFormat( 639 m_log.InfoFormat(
624 "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff); 640 "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff);
625 } 641 }
626 } 642 }
627 643
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 364dd6c..170c35f 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -642,7 +642,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
642 /// implemented by callers. 642 /// implemented by callers.
643 /// </summary> 643 /// </summary>
644 /// <param name="currentUser"></param> 644 /// <param name="currentUser"></param>
645 /// <param name="objId"></param> 645 /// <param name="objId">This is a scene object group UUID</param>
646 /// <param name="denyOnLocked"></param> 646 /// <param name="denyOnLocked"></param>
647 /// <returns></returns> 647 /// <returns></returns>
648 protected bool GenericObjectPermission(UUID currentUser, UUID objId, bool denyOnLocked) 648 protected bool GenericObjectPermission(UUID currentUser, UUID objId, bool denyOnLocked)
@@ -1896,7 +1896,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1896// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", 1896// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}",
1897// agentID, primID, face, me.ControlPermissions); 1897// agentID, primID, face, me.ControlPermissions);
1898 1898
1899 return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); 1899 return GenericObjectPermission(agentID, part.ParentGroup.UUID, true);
1900 } 1900 }
1901 1901
1902 private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) 1902 private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face)