aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-04-27 00:58:54 +0100
committerJustin Clark-Casey (justincc)2012-04-27 00:58:54 +0100
commit07e62df5582e28675275b3f5143ec37e5697d283 (patch)
tree25227c120e0f1ae39d01bfd7dba4b66ef3be0d59
parentOSSL: Removed check for CanRunConsoleCommand() in osKickAvatar. (diff)
downloadopensim-SC_OLD-07e62df5582e28675275b3f5143ec37e5697d283.zip
opensim-SC_OLD-07e62df5582e28675275b3f5143ec37e5697d283.tar.gz
opensim-SC_OLD-07e62df5582e28675275b3f5143ec37e5697d283.tar.bz2
opensim-SC_OLD-07e62df5582e28675275b3f5143ec37e5697d283.tar.xz
Add regression test for teleporting an agent between separated regions on the same simulator.
This involves a large amount of change in test scene setup code to allow test scenes to share shared modules SetupScene is now an instance method that requires an instantiation of SceneHelpers, though other SceneHelpers methods are still static May split these out into separate classes in the future.
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs177
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs2
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs218
-rw-r--r--OpenSim/Tests/Common/Mock/TestLandChannel.cs17
-rw-r--r--OpenSim/Tests/Torture/NPCTortureTests.cs2
-rw-r--r--OpenSim/Tests/Torture/ObjectTortureTests.cs2
-rw-r--r--OpenSim/Tests/Torture/ScriptTortureTests.cs2
49 files changed, 268 insertions, 307 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
index fd152c3..85e5cc6 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
50 TestHelpers.InMethod(); 50 TestHelpers.InMethod();
51 51
52 // Overkill - we only really need the asset service, not a whole scene. 52 // Overkill - we only really need the asset service, not a whole scene.
53 Scene scene = SceneHelpers.SetupScene(); 53 Scene scene = new SceneHelpers().SetupScene();
54 54
55 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); 55 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService);
56 TestOSHttpRequest req = new TestOSHttpRequest(); 56 TestOSHttpRequest req = new TestOSHttpRequest();
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index a5209b7..c25b58c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
60 CapabilitiesModule capsModule = new CapabilitiesModule(); 60 CapabilitiesModule capsModule = new CapabilitiesModule();
61 EventQueueGetModule eqgModule = new EventQueueGetModule(); 61 EventQueueGetModule eqgModule = new EventQueueGetModule();
62 62
63 m_scene = SceneHelpers.SetupScene(); 63 m_scene = new SceneHelpers().SetupScene();
64 SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule); 64 SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
65 } 65 }
66 66
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
index a575e36..1321470 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
158 TestHelpers.InMethod(); 158 TestHelpers.InMethod();
159// XmlConfigurator.Configure(); 159// XmlConfigurator.Configure();
160 160
161 TestScene scene = SceneHelpers.SetupScene(); 161 TestScene scene = new SceneHelpers().SetupScene();
162 uint myCircuitCode = 123456; 162 uint myCircuitCode = 123456;
163 UUID myAgentUuid = TestHelpers.ParseTail(0x1); 163 UUID myAgentUuid = TestHelpers.ParseTail(0x1);
164 UUID mySessionUuid = TestHelpers.ParseTail(0x2); 164 UUID mySessionUuid = TestHelpers.ParseTail(0x2);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
index 1b68d68..221f02b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
79 79
80 J2KDecoderModule j2kdm = new J2KDecoderModule(); 80 J2KDecoderModule j2kdm = new J2KDecoderModule();
81 81
82 scene = SceneHelpers.SetupScene(); 82 scene = new SceneHelpers().SetupScene();
83 SceneHelpers.SetupSceneModules(scene, j2kdm); 83 SceneHelpers.SetupSceneModules(scene, j2kdm);
84 84
85 tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene); 85 tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene);
diff --git a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
index 5adb845..c91b25f 100644
--- a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
+++ b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Asset.Tests
65 config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true"); 65 config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");
66 66
67 m_cache = new FlotsamAssetCache(); 67 m_cache = new FlotsamAssetCache();
68 m_scene = SceneHelpers.SetupScene(); 68 m_scene = new SceneHelpers().SetupScene();
69 SceneHelpers.SetupSceneModules(m_scene, config, m_cache); 69 SceneHelpers.SetupSceneModules(m_scene, config, m_cache);
70 } 70 }
71 71
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index bfe5e4a..42d07fd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
72 config.AddConfig("Modules"); 72 config.AddConfig("Modules");
73 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); 73 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
74 74
75 scene = SceneHelpers.SetupScene(); 75 scene = new SceneHelpers().SetupScene();
76 m_attMod = new AttachmentsModule(); 76 m_attMod = new AttachmentsModule();
77 SceneHelpers.SetupSceneModules(scene, config, m_attMod, new BasicInventoryAccessModule()); 77 SceneHelpers.SetupSceneModules(scene, config, m_attMod, new BasicInventoryAccessModule());
78 } 78 }
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
index 11a0a86..848b3bf 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
53 UUID userId = TestHelpers.ParseTail(0x1); 53 UUID userId = TestHelpers.ParseTail(0x1);
54 54
55 AvatarFactoryModule afm = new AvatarFactoryModule(); 55 AvatarFactoryModule afm = new AvatarFactoryModule();
56 TestScene scene = SceneHelpers.SetupScene(); 56 TestScene scene = new SceneHelpers().SetupScene();
57 SceneHelpers.SetupSceneModules(scene, afm); 57 SceneHelpers.SetupSceneModules(scene, afm);
58 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); 58 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
59 59
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
81 CoreAssetCache assetCache = new CoreAssetCache(); 81 CoreAssetCache assetCache = new CoreAssetCache();
82 82
83 AvatarFactoryModule afm = new AvatarFactoryModule(); 83 AvatarFactoryModule afm = new AvatarFactoryModule();
84 TestScene scene = SceneHelpers.SetupScene(assetCache); 84 TestScene scene = new SceneHelpers(assetCache).SetupScene();
85 SceneHelpers.SetupSceneModules(scene, afm); 85 SceneHelpers.SetupSceneModules(scene, afm);
86 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); 86 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
87 87
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
index 45b4264..7a197f7 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
78 config.AddConfig("FriendsService"); 78 config.AddConfig("FriendsService");
79 config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 79 config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
80 80
81 m_scene = SceneHelpers.SetupScene(); 81 m_scene = new SceneHelpers().SetupScene();
82 m_fm = new FriendsModule(); 82 m_fm = new FriendsModule();
83 SceneHelpers.SetupSceneModules(m_scene, config, m_fm); 83 SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
84 } 84 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 19ef571..90ae69d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
100// log4net.Config.XmlConfigurator.Configure(); 100// log4net.Config.XmlConfigurator.Configure();
101 101
102 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 102 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
103 Scene scene = SceneHelpers.SetupScene(); 103 Scene scene = new SceneHelpers().SetupScene();
104 SceneHelpers.SetupSceneModules(scene, archiverModule); 104 SceneHelpers.SetupSceneModules(scene, archiverModule);
105 105
106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index e409c8e..b112b6d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
61 SerialiserModule serialiserModule = new SerialiserModule(); 61 SerialiserModule serialiserModule = new SerialiserModule();
62 m_archiverModule = new InventoryArchiverModule(); 62 m_archiverModule = new InventoryArchiverModule();
63 63
64 m_scene = SceneHelpers.SetupScene(); 64 m_scene = new SceneHelpers().SetupScene();
65 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); 65 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
66 } 66 }
67 67
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 417c20c..6eb3605 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
62 62
63 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 63 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
64 64
65 Scene scene = SceneHelpers.SetupScene(); 65 Scene scene = new SceneHelpers().SetupScene();
66 SceneHelpers.SetupSceneModules(scene, archiverModule); 66 SceneHelpers.SetupSceneModules(scene, archiverModule);
67 67
68 // Create user 68 // Create user
@@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
179 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 179 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
180 180
181 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 181 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
182 Scene scene = SceneHelpers.SetupScene(); 182 Scene scene = new SceneHelpers().SetupScene();
183 183
184 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 184 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
185 185
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
222 222
223 SerialiserModule serialiserModule = new SerialiserModule(); 223 SerialiserModule serialiserModule = new SerialiserModule();
224 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 224 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
225 Scene scene = SceneHelpers.SetupScene(); 225 Scene scene = new SceneHelpers().SetupScene();
226 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 226 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
227 227
228 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); 228 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
@@ -247,7 +247,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
247 247
248 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 248 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
249 249
250 Scene scene = SceneHelpers.SetupScene(); 250 Scene scene = new SceneHelpers().SetupScene();
251 SceneHelpers.SetupSceneModules(scene, archiverModule); 251 SceneHelpers.SetupSceneModules(scene, archiverModule);
252 252
253 // Create user 253 // Create user
@@ -326,7 +326,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
326 TestHelpers.InMethod(); 326 TestHelpers.InMethod();
327// log4net.Config.XmlConfigurator.Configure(); 327// log4net.Config.XmlConfigurator.Configure();
328 328
329 Scene scene = SceneHelpers.SetupScene(); 329 Scene scene = new SceneHelpers().SetupScene();
330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
331 331
332 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); 332 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
@@ -393,7 +393,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
393 TestHelpers.InMethod(); 393 TestHelpers.InMethod();
394 //log4net.Config.XmlConfigurator.Configure(); 394 //log4net.Config.XmlConfigurator.Configure();
395 395
396 Scene scene = SceneHelpers.SetupScene(); 396 Scene scene = new SceneHelpers().SetupScene();
397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
398 398
399 string folder1ExistingName = "a"; 399 string folder1ExistingName = "a";
@@ -444,7 +444,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
444 TestHelpers.InMethod(); 444 TestHelpers.InMethod();
445// log4net.Config.XmlConfigurator.Configure(); 445// log4net.Config.XmlConfigurator.Configure();
446 446
447 Scene scene = SceneHelpers.SetupScene(); 447 Scene scene = new SceneHelpers().SetupScene();
448 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 448 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
449 449
450 string folder1ExistingName = "a"; 450 string folder1ExistingName = "a";
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 0f3ed27..a318a3c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -597,7 +597,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
597 597
598 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) 598 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
599 { 599 {
600 sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true); 600 if (sp.Scene.AttachmentsModule != null)
601 sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
601 } 602 }
602 603
603 protected void KillEntity(Scene scene, uint localID) 604 protected void KillEntity(Scene scene, uint localID)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index e74310c..d6afaa9 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
65 config.AddConfig("Modules"); 65 config.AddConfig("Modules");
66 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); 66 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
67 67
68 m_scene = SceneHelpers.SetupScene(); 68 m_scene = new SceneHelpers().SetupScene();
69 SceneHelpers.SetupSceneModules(m_scene, config, m_iam); 69 SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
70 70
71 // Create user 71 // Create user
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e05e8f6..053c6f5 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
68 SerialiserModule serialiserModule = new SerialiserModule(); 68 SerialiserModule serialiserModule = new SerialiserModule();
69 TerrainModule terrainModule = new TerrainModule(); 69 TerrainModule terrainModule = new TerrainModule();
70 70
71 m_scene = SceneHelpers.SetupScene(); 71 m_scene = new SceneHelpers().SetupScene();
72 SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); 72 SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
73 } 73 }
74 74
@@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
463 SerialiserModule serialiserModule = new SerialiserModule(); 463 SerialiserModule serialiserModule = new SerialiserModule();
464 TerrainModule terrainModule = new TerrainModule(); 464 TerrainModule terrainModule = new TerrainModule();
465 465
466 TestScene scene2 = SceneHelpers.SetupScene(); 466 TestScene scene2 = new SceneHelpers().SetupScene();
467 SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule); 467 SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule);
468 468
469 // Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is 469 // Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
607 SerialiserModule serialiserModule = new SerialiserModule(); 607 SerialiserModule serialiserModule = new SerialiserModule();
608 TerrainModule terrainModule = new TerrainModule(); 608 TerrainModule terrainModule = new TerrainModule();
609 609
610 Scene scene = SceneHelpers.SetupScene(); 610 Scene scene = new SceneHelpers().SetupScene();
611 SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); 611 SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
612 612
613 m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); 613 m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index e553ffa..b5ee4d2 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
64 { 64 {
65 m_pcm = new PrimCountModule(); 65 m_pcm = new PrimCountModule();
66 LandManagementModule lmm = new LandManagementModule(); 66 LandManagementModule lmm = new LandManagementModule();
67 m_scene = SceneHelpers.SetupScene(); 67 m_scene = new SceneHelpers().SetupScene();
68 SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); 68 SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm);
69 69
70 int xParcelDivider = (int)Constants.RegionSize - 1; 70 int xParcelDivider = (int)Constants.RegionSize - 1;
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
index 4326606..0545250 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests
53 public void SetUp() 53 public void SetUp()
54 { 54 {
55 m_module = new MoapModule(); 55 m_module = new MoapModule();
56 m_scene = SceneHelpers.SetupScene(); 56 m_scene = new SceneHelpers().SetupScene();
57 SceneHelpers.SetupSceneModules(m_scene, m_module); 57 SceneHelpers.SetupSceneModules(m_scene, m_module);
58 } 58 }
59 59
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index d1d2020..7825e3e 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
343 public void Init() 343 public void Init()
344 { 344 {
345 m_serialiserModule = new SerialiserModule(); 345 m_serialiserModule = new SerialiserModule();
346 m_scene = SceneHelpers.SetupScene(); 346 m_scene = new SceneHelpers().SetupScene();
347 SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule); 347 SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule);
348 } 348 }
349 349
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index dacd9b6..4d0aa6f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -437,6 +437,7 @@ namespace OpenSim.Region.Framework.Scenes
437 { 437 {
438 if (m_simulationService == null) 438 if (m_simulationService == null)
439 m_simulationService = RequestModuleInterface<ISimulationService>(); 439 m_simulationService = RequestModuleInterface<ISimulationService>();
440
440 return m_simulationService; 441 return m_simulationService;
441 } 442 }
442 } 443 }
@@ -3217,7 +3218,7 @@ namespace OpenSim.Region.Framework.Scenes
3217 try 3218 try
3218 { 3219 {
3219 m_log.DebugFormat( 3220 m_log.DebugFormat(
3220 "[SCENE]: Removing {0} agent {1} {2} from region {2}", 3221 "[SCENE]: Removing {0} agent {1} {2} from region {3}",
3221 (isChildAgent ? "child" : "root"), avatar.Name, agentID, RegionInfo.RegionName); 3222 (isChildAgent ? "child" : "root"), avatar.Name, agentID, RegionInfo.RegionName);
3222 3223
3223 m_sceneGraph.removeUserCount(!isChildAgent); 3224 m_sceneGraph.removeUserCount(!isChildAgent);
@@ -3879,7 +3880,10 @@ namespace OpenSim.Region.Framework.Scenes
3879 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2); 3880 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
3880 if (nearestParcel == null) 3881 if (nearestParcel == null)
3881 { 3882 {
3882 m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID); 3883 m_log.DebugFormat(
3884 "[SCENE]: Denying root agent entry to {0} in {1}: no allowed parcel",
3885 cAgentData.AgentID, RegionInfo.RegionName);
3886
3883 return false; 3887 return false;
3884 } 3888 }
3885 3889
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index a5d2b23..ea9fc93 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
45 { 45 {
46 static public Random random; 46 static public Random random;
47 SceneObjectGroup found; 47 SceneObjectGroup found;
48 Scene scene = SceneHelpers.SetupScene(); 48 Scene scene = new SceneHelpers().SetupScene();
49 49
50 [Test] 50 [Test]
51 public void T010_AddObjects() 51 public void T010_AddObjects()
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
index 9a60e50..1c33a5f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44 public void TestDuplicateObject() 44 public void TestDuplicateObject()
45 { 45 {
46 TestHelpers.InMethod(); 46 TestHelpers.InMethod();
47 Scene scene = SceneHelpers.SetupScene(); 47 Scene scene = new SceneHelpers().SetupScene();
48 48
49 UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010"); 49 UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
50 string part1Name = "part1"; 50 string part1Name = "part1";
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 7737d8e..453e077 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
88 { 88 {
89 TestHelpers.InMethod(); 89 TestHelpers.InMethod();
90 90
91 Scene scene = SceneHelpers.SetupScene(); 91 Scene scene = new SceneHelpers().SetupScene();
92 int partsToTestCount = 3; 92 int partsToTestCount = 3;
93 93
94 SceneObjectGroup so 94 SceneObjectGroup so
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
118 { 118 {
119 TestHelpers.InMethod(); 119 TestHelpers.InMethod();
120 120
121 Scene scene = SceneHelpers.SetupScene(); 121 Scene scene = new SceneHelpers().SetupScene();
122 122
123 string obj1Name = "Alfred"; 123 string obj1Name = "Alfred";
124 string obj2Name = "Betty"; 124 string obj2Name = "Betty";
@@ -152,7 +152,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
152 { 152 {
153 TestHelpers.InMethod(); 153 TestHelpers.InMethod();
154 154
155 Scene scene = SceneHelpers.SetupScene(); 155 Scene scene = new SceneHelpers().SetupScene();
156 int partsToTestCount = 3; 156 int partsToTestCount = 3;
157 157
158 SceneObjectGroup so 158 SceneObjectGroup so
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
185 { 185 {
186 TestHelpers.InMethod(); 186 TestHelpers.InMethod();
187 187
188 TestScene scene = SceneHelpers.SetupScene(); 188 TestScene scene = new SceneHelpers().SetupScene();
189 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 189 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
190 scene.DeleteSceneObject(part.ParentGroup, false); 190 scene.DeleteSceneObject(part.ParentGroup, false);
191 191
@@ -204,7 +204,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
204 204
205 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 205 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
206 206
207 TestScene scene = SceneHelpers.SetupScene(); 207 TestScene scene = new SceneHelpers().SetupScene();
208 208
209 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 209 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
210 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 210 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index 654b1a2..0076f41 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
61 61
62 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 62 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
63 63
64 TestScene scene = SceneHelpers.SetupScene(); 64 TestScene scene = new SceneHelpers().SetupScene();
65 IConfigSource configSource = new IniConfigSource(); 65 IConfigSource configSource = new IniConfigSource();
66 IConfig config = configSource.AddConfig("Startup"); 66 IConfig config = configSource.AddConfig("Startup");
67 config.Set("serverside_object_permissions", true); 67 config.Set("serverside_object_permissions", true);
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
100 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 100 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
101 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); 101 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
102 102
103 TestScene scene = SceneHelpers.SetupScene(); 103 TestScene scene = new SceneHelpers().SetupScene();
104 IConfigSource configSource = new IniConfigSource(); 104 IConfigSource configSource = new IniConfigSource();
105 IConfig config = configSource.AddConfig("Startup"); 105 IConfig config = configSource.AddConfig("Startup");
106 config.Set("serverside_object_permissions", true); 106 config.Set("serverside_object_permissions", true);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index be5b4a8..1add3dd 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
55 UUID ownerId = TestHelpers.ParseTail(0x1); 55 UUID ownerId = TestHelpers.ParseTail(0x1);
56 int nParts = 3; 56 int nParts = 3;
57 57
58 TestScene scene = SceneHelpers.SetupScene(); 58 TestScene scene = new SceneHelpers().SetupScene();
59 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10); 59 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
60 scene.AddSceneObject(sog1); 60 scene.AddSceneObject(sog1);
61 scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId }); 61 scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId });
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
71 71
72 bool debugtest = false; 72 bool debugtest = false;
73 73
74 Scene scene = SceneHelpers.SetupScene(); 74 Scene scene = new SceneHelpers().SetupScene();
75 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene); 75 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
76 SceneObjectGroup grp1 = part1.ParentGroup; 76 SceneObjectGroup grp1 = part1.ParentGroup;
77 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene); 77 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
153 153
154 bool debugtest = false; 154 bool debugtest = false;
155 155
156 Scene scene = SceneHelpers.SetupScene(); 156 Scene scene = new SceneHelpers().SetupScene();
157 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene); 157 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
158 SceneObjectGroup grp1 = part1.ParentGroup; 158 SceneObjectGroup grp1 = part1.ParentGroup;
159 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene); 159 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
286 TestHelpers.InMethod(); 286 TestHelpers.InMethod();
287 //log4net.Config.XmlConfigurator.Configure(); 287 //log4net.Config.XmlConfigurator.Configure();
288 288
289 TestScene scene = SceneHelpers.SetupScene(); 289 TestScene scene = new SceneHelpers().SetupScene();
290 290
291 string rootPartName = "rootpart"; 291 string rootPartName = "rootpart";
292 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); 292 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
@@ -325,7 +325,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
325 TestHelpers.InMethod(); 325 TestHelpers.InMethod();
326 //log4net.Config.XmlConfigurator.Configure(); 326 //log4net.Config.XmlConfigurator.Configure();
327 327
328 TestScene scene = SceneHelpers.SetupScene(); 328 TestScene scene = new SceneHelpers().SetupScene();
329 329
330 string rootPartName = "rootpart"; 330 string rootPartName = "rootpart";
331 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); 331 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
index b49c6e7..0a94c19 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52 TestHelpers.InMethod(); 52 TestHelpers.InMethod();
53// log4net.Config.XmlConfigurator.Configure(); 53// log4net.Config.XmlConfigurator.Configure();
54 54
55 Scene scene = SceneHelpers.SetupScene(); 55 Scene scene = new SceneHelpers().SetupScene();
56 SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene).ParentGroup; 56 SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene).ParentGroup;
57 57
58 g1.GroupResize(new Vector3(2, 3, 4)); 58 g1.GroupResize(new Vector3(2, 3, 4));
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
75 TestHelpers.InMethod(); 75 TestHelpers.InMethod();
76 //log4net.Config.XmlConfigurator.Configure(); 76 //log4net.Config.XmlConfigurator.Configure();
77 77
78 Scene scene = SceneHelpers.SetupScene(); 78 Scene scene = new SceneHelpers().SetupScene();
79 79
80 SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero); 80 SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero);
81 g1.RootPart.Scale = new Vector3(2, 3, 4); 81 g1.RootPart.Scale = new Vector3(2, 3, 4);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
index c582cf6..d2361f8 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52// UUID itemId = TestHelpers.ParseTail(0x2); 52// UUID itemId = TestHelpers.ParseTail(0x2);
53 string itemName = "Test Script Item"; 53 string itemName = "Test Script Item";
54 54
55 Scene scene = SceneHelpers.SetupScene(); 55 Scene scene = new SceneHelpers().SetupScene();
56 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId); 56 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
57 scene.AddNewSceneObject(so, true); 57 scene.AddNewSceneObject(so, true);
58 58
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
index 9fea3c6..6d255aa 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
50 [SetUp] 50 [SetUp]
51 public void SetUp() 51 public void SetUp()
52 { 52 {
53 m_scene = SceneHelpers.SetupScene(); 53 m_scene = new SceneHelpers().SetupScene();
54 } 54 }
55 55
56 [Test] 56 [Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index 360566d..742c769 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52 [SetUp] 52 [SetUp]
53 public void Init() 53 public void Init()
54 { 54 {
55 m_scene = SceneHelpers.SetupScene(); 55 m_scene = new SceneHelpers().SetupScene();
56 m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10); 56 m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10);
57 m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20); 57 m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20);
58 } 58 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index c13d82e..c7eaff9 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
58 58
59 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 59 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
60 60
61 TestScene scene = SceneHelpers.SetupScene(); 61 TestScene scene = new SceneHelpers().SetupScene();
62 IConfigSource configSource = new IniConfigSource(); 62 IConfigSource configSource = new IniConfigSource();
63 63
64 IConfig startupConfig = configSource.AddConfig("Startup"); 64 IConfig startupConfig = configSource.AddConfig("Startup");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index ed9b179..2e46377 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -67,10 +67,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
67 public void Init() 67 public void Init()
68 { 68 {
69 TestHelpers.InMethod(); 69 TestHelpers.InMethod();
70 70
71 scene = SceneHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); 71 SceneHelpers sh = new SceneHelpers();
72 scene2 = SceneHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); 72
73 scene3 = SceneHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000); 73 scene = sh.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
74 scene2 = sh.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
75 scene3 = sh.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
74 76
75 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); 77 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
76 interregionComms.Initialise(new IniConfigSource()); 78 interregionComms.Initialise(new IniConfigSource());
@@ -101,7 +103,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
101 TestHelpers.InMethod(); 103 TestHelpers.InMethod();
102// log4net.Config.XmlConfigurator.Configure(); 104// log4net.Config.XmlConfigurator.Configure();
103 105
104 TestScene scene = SceneHelpers.SetupScene(); 106 TestScene scene = new SceneHelpers().SetupScene();
105 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); 107 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
106 108
107 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null); 109 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
@@ -126,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
126 IConfig config = configSource.AddConfig("Modules"); 128 IConfig config = configSource.AddConfig("Modules");
127 config.Set("SimulationServices", "LocalSimulationConnectorModule"); 129 config.Set("SimulationServices", "LocalSimulationConnectorModule");
128 130
129 TestScene scene = SceneHelpers.SetupScene(); 131 TestScene scene = new SceneHelpers().SetupScene();
130 SceneHelpers.SetupSceneModules(scene, configSource, lsc); 132 SceneHelpers.SetupSceneModules(scene, configSource, lsc);
131 133
132 UUID agentId = TestHelpers.ParseTail(0x01); 134 UUID agentId = TestHelpers.ParseTail(0x01);
@@ -176,8 +178,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
176 178
177// UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); 179// UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
178 180
179 TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); 181 TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
180 TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); 182 TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
181 183
182 IConfigSource configSource = new IniConfigSource(); 184 IConfigSource configSource = new IniConfigSource();
183 IConfig config = configSource.AddConfig("Startup"); 185 IConfig config = configSource.AddConfig("Startup");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
index 89f8007..646e5fa 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
59 TestHelpers.InMethod(); 59 TestHelpers.InMethod();
60// log4net.Config.XmlConfigurator.Configure(); 60// log4net.Config.XmlConfigurator.Configure();
61 61
62 TestScene scene = SceneHelpers.SetupScene(); 62 TestScene scene = new SceneHelpers().SetupScene();
63 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); 63 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
64 sp.Flying = true; 64 sp.Flying = true;
65 sp.PhysicsCollisionUpdate(new CollisionEventUpdate()); 65 sp.PhysicsCollisionUpdate(new CollisionEventUpdate());
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
index cfea10d..1d1ff88 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
64 [SetUp] 64 [SetUp]
65 public void Init() 65 public void Init()
66 { 66 {
67 m_scene = SceneHelpers.SetupScene(); 67 m_scene = new SceneHelpers().SetupScene();
68 } 68 }
69 69
70 [Test] 70 [Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
index b7b8db4..313e350 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
50 [SetUp] 50 [SetUp]
51 public void Init() 51 public void Init()
52 { 52 {
53 m_scene = SceneHelpers.SetupScene(); 53 m_scene = new SceneHelpers().SetupScene();
54 m_sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1)); 54 m_sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
55 } 55 }
56 56
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index eb7bfbd..19542ff 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
61 // Not strictly necessary since FriendsModule assumes it is the default (!) 61 // Not strictly necessary since FriendsModule assumes it is the default (!)
62 config.Configs["Modules"].Set("EntityTransferModule", etm.Name); 62 config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
63 63
64 TestScene scene = SceneHelpers.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000); 64 TestScene scene = new SceneHelpers().SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
65 SceneHelpers.SetupSceneModules(scene, config, etm); 65 SceneHelpers.SetupSceneModules(scene, config, etm);
66 66
67 Vector3 teleportPosition = new Vector3(10, 11, 12); 67 Vector3 teleportPosition = new Vector3(10, 11, 12);
@@ -83,145 +83,58 @@ namespace OpenSim.Region.Framework.Scenes.Tests
83// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); 83// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
84 } 84 }
85 85
86 /// <summary> 86 [Test]
87 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common. 87 public void TestSameSimulatorSeparatedRegionsTeleport()
88 /// </summary>
89 /// Does not yet do what is says on the tin.
90 /// Commenting for now
91 //[Test, LongRunning]
92 public void TestSimpleNotNeighboursTeleport()
93 { 88 {
94 TestHelpers.InMethod(); 89 TestHelpers.InMethod();
95 ThreadRunResults results = new ThreadRunResults(); 90// log4net.Config.XmlConfigurator.Configure();
96 results.Result = false;
97 results.Message = "Test did not run";
98 TestRunning testClass = new TestRunning(results);
99 91
100 Thread testThread = new Thread(testClass.run); 92 UUID userId = TestHelpers.ParseTail(0x1);
101 93
102 // Seems kind of redundant to start a thread and then join it, however.. We need to protect against 94 EntityTransferModule etm = new EntityTransferModule();
103 // A thread abort exception in the simulator code. 95 LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
104 testThread.Start();
105 testThread.Join();
106 96
107 Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message); 97 IConfigSource config = new IniConfigSource();
108 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); 98 config.AddConfig("Modules");
109 } 99 // Not strictly necessary since FriendsModule assumes it is the default (!)
100 config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
101 config.Configs["Modules"].Set("SimulationServices", lscm.Name);
110 102
111 [TearDown] 103 SceneHelpers sh = new SceneHelpers();
112 public void TearDown() 104 TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
113 { 105 TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
114 try
115 {
116 if (MainServer.Instance != null) MainServer.Instance.Stop();
117 }
118 catch (NullReferenceException)
119 { }
120 }
121 106
122 } 107 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
123 108
124 public class ThreadRunResults 109 Vector3 teleportPosition = new Vector3(10, 11, 12);
125 { 110 Vector3 teleportLookAt = new Vector3(20, 21, 22);
126 public bool Result = false;
127 public string Message = string.Empty;
128 }
129 111
130 public class TestRunning 112 ScenePresence sp = SceneHelpers.AddScenePresence(sceneA, userId);
131 { 113 sp.AbsolutePosition = new Vector3(30, 31, 32);
132 public ThreadRunResults results; 114
133 public TestRunning(ThreadRunResults t) 115 // XXX: A very nasty hack to tell the client about the destination scene without having to crank the whole
134 { 116 // UDP stack (?)
135 results = t; 117 ((TestClient)sp.ControllingClient).TeleportTargetScene = sceneB;
136 } 118
137 public void run(object o) 119 sceneA.RequestTeleportLocation(
138 { 120 sp.ControllingClient,
139 121 sceneB.RegionInfo.RegionHandle,
140 //results.Result = true; 122 teleportPosition,
141 log4net.Config.XmlConfigurator.Configure(); 123 teleportLookAt,
142 124 (uint)TeleportFlags.ViaLocation);
143 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); 125
144 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); 126 Assert.That(sceneA.GetScenePresence(userId), Is.Null);
145 127
146 // shared module 128 ScenePresence sceneBSp = sceneB.GetScenePresence(userId);
147 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); 129 Assert.That(sceneBSp, Is.Not.Null);
148 130 Assert.That(sceneBSp.Scene.RegionInfo.RegionName, Is.EqualTo(sceneB.RegionInfo.RegionName));
149 131 Assert.That(sceneBSp.AbsolutePosition, Is.EqualTo(teleportPosition));
150 Scene sceneB = SceneHelpers.SetupScene("sceneB", sceneBId, 1010, 1010); 132
151 SceneHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); 133 // TODO: Add assertions to check correct circuit details in both scenes.
152 sceneB.RegisterRegionWithGrid(); 134
153 135 // Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera
154 Scene sceneA = SceneHelpers.SetupScene("sceneA", sceneAId, 1000, 1000); 136 // position instead).
155 SceneHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); 137// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
156 sceneA.RegisterRegionWithGrid();
157
158 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
159 TestClient client = (TestClient)SceneHelpers.AddScenePresence(sceneA, agentId).ControllingClient;
160
161 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
162
163 results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl);
164
165 if (!results.Result)
166 {
167 results.Message = "Incorrect caps object path set up in sceneA";
168 return;
169 }
170
171 /*
172 Assert.That(
173 sceneACapsModule.GetCapsPath(agentId),
174 Is.EqualTo(client.CapsSeedUrl),
175 "Incorrect caps object path set up in sceneA");
176 */
177 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
178
179
180 client.TeleportTargetScene = sceneB;
181 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
182
183 results.Result = (sceneB.GetScenePresence(agentId) != null);
184 if (!results.Result)
185 {
186 results.Message = "Client does not have an agent in sceneB";
187 return;
188 }
189
190 //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
191
192 //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");
193
194 results.Result = (sceneA.GetScenePresence(agentId) == null);
195 if (!results.Result)
196 {
197 results.Message = "Client still had an agent in sceneA";
198 return;
199 }
200
201 ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>();
202
203
204 results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort +
205 "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl);
206 if (!results.Result)
207 {
208 results.Message = "Incorrect caps object path set up in sceneB";
209 return;
210 }
211
212 // Temporary assertion - caps url construction should at least be doable through a method.
213 /*
214 Assert.That(
215 "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
216 Is.EqualTo(client.CapsSeedUrl),
217 "Incorrect caps object path set up in sceneB");
218 */
219 // This assertion will currently fail since we don't remove the caps paths when no longer needed
220 //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");
221
222 // TODO: Check that more of everything is as it should be
223
224 // TODO: test what happens if we try to teleport to a region that doesn't exist
225 } 138 }
226 } 139 }
227} 140} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index 5c9a77d..d722a09 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
60 { 60 {
61 TestHelpers.InMethod(); 61 TestHelpers.InMethod();
62 62
63 Scene scene = SceneHelpers.SetupScene(); 63 Scene scene = new SceneHelpers().SetupScene();
64 scene.Update(1); 64 scene.Update(1);
65 65
66 Assert.That(scene.Frame, Is.EqualTo(1)); 66 Assert.That(scene.Frame, Is.EqualTo(1));
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 55c80f5..d15141b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Tests
58 TestHelpers.InMethod(); 58 TestHelpers.InMethod();
59// log4net.Config.XmlConfigurator.Configure(); 59// log4net.Config.XmlConfigurator.Configure();
60 60
61 Scene scene = SceneHelpers.SetupScene(); 61 Scene scene = new SceneHelpers().SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
63 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 63 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
64 SceneObjectPart sop1 = sog1.RootPart; 64 SceneObjectPart sop1 = sog1.RootPart;
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Framework.Tests
81 TestHelpers.InMethod(); 81 TestHelpers.InMethod();
82// log4net.Config.XmlConfigurator.Configure(); 82// log4net.Config.XmlConfigurator.Configure();
83 83
84 Scene scene = SceneHelpers.SetupScene(); 84 Scene scene = new SceneHelpers().SetupScene();
85 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 85 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
86 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 86 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
87 SceneObjectPart sop1 = sog1.RootPart; 87 SceneObjectPart sop1 = sog1.RootPart;
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Framework.Tests
124 TestHelpers.InMethod(); 124 TestHelpers.InMethod();
125// log4net.Config.XmlConfigurator.Configure(); 125// log4net.Config.XmlConfigurator.Configure();
126 126
127 Scene scene = SceneHelpers.SetupScene(); 127 Scene scene = new SceneHelpers().SetupScene();
128 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 128 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
129 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 129 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
130 SceneObjectPart sop1 = sog1.RootPart; 130 SceneObjectPart sop1 = sog1.RootPart;
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Tests
153 TestHelpers.InMethod(); 153 TestHelpers.InMethod();
154// log4net.Config.XmlConfigurator.Configure(); 154// log4net.Config.XmlConfigurator.Configure();
155 155
156 Scene scene = SceneHelpers.SetupScene(); 156 Scene scene = new SceneHelpers().SetupScene();
157 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 157 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
158 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 158 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
159 SceneObjectPart sop1 = sog1.RootPart; 159 SceneObjectPart sop1 = sog1.RootPart;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
index 55fc1e7..44d2d45 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Tests
58 TestHelpers.InMethod(); 58 TestHelpers.InMethod();
59// log4net.Config.XmlConfigurator.Configure(); 59// log4net.Config.XmlConfigurator.Configure();
60 60
61 Scene scene = SceneHelpers.SetupScene(); 61 Scene scene = new SceneHelpers().SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); 62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
63 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); 63 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
64 InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID); 64 InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID);
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Tests
85 TestHelpers.InMethod(); 85 TestHelpers.InMethod();
86// log4net.Config.XmlConfigurator.Configure(); 86// log4net.Config.XmlConfigurator.Configure();
87 87
88 Scene scene = SceneHelpers.SetupScene(); 88 Scene scene = new SceneHelpers().SetupScene();
89 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); 89 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
90 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); 90 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
91 InventoryFolderBase folder1 91 InventoryFolderBase folder1
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index d9fe87c..198e487 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
47 public void Init() 47 public void Init()
48 { 48 {
49 // FIXME: We don't need a full scene here - it would be enough to set up the asset service. 49 // FIXME: We don't need a full scene here - it would be enough to set up the asset service.
50 Scene scene = SceneHelpers.SetupScene(); 50 Scene scene = new SceneHelpers().SetupScene();
51 m_assetService = scene.AssetService; 51 m_assetService = scene.AssetService;
52 m_uuidGatherer = new UuidGatherer(m_assetService); 52 m_uuidGatherer = new UuidGatherer(m_assetService);
53 } 53 }
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index d2f6327..ac638f1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
50 TestHelpers.InMethod(); 50 TestHelpers.InMethod();
51// log4net.Config.XmlConfigurator.Configure(); 51// log4net.Config.XmlConfigurator.Configure();
52 52
53 TestScene scene = SceneHelpers.SetupScene(); 53 TestScene scene = new SceneHelpers().SetupScene();
54 IConfigSource configSource = new IniConfigSource(); 54 IConfigSource configSource = new IniConfigSource();
55 IConfig config = configSource.AddConfig("Groups"); 55 IConfig config = configSource.AddConfig("Groups");
56 config.Set("Enabled", true); 56 config.Set("Enabled", true);
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index eea0b2e..a39257e 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
85 m_attMod = new AttachmentsModule(); 85 m_attMod = new AttachmentsModule();
86 m_npcMod = new NPCModule(); 86 m_npcMod = new NPCModule();
87 87
88 m_scene = SceneHelpers.SetupScene(); 88 m_scene = new SceneHelpers().SetupScene();
89 SceneHelpers.SetupSceneModules(m_scene, config, m_afMod, m_umMod, m_attMod, m_npcMod, new BasicInventoryAccessModule()); 89 SceneHelpers.SetupSceneModules(m_scene, config, m_afMod, m_umMod, m_attMod, m_npcMod, new BasicInventoryAccessModule());
90 } 90 }
91 91
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
index e2d0db2..49266e9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
63 IConfig config = initConfigSource.AddConfig("XEngine"); 63 IConfig config = initConfigSource.AddConfig("XEngine");
64 config.Set("Enabled", "true"); 64 config.Set("Enabled", "true");
65 65
66 m_scene = SceneHelpers.SetupScene(); 66 m_scene = new SceneHelpers().SetupScene();
67 SceneHelpers.SetupSceneModules(m_scene, initConfigSource); 67 SceneHelpers.SetupSceneModules(m_scene, initConfigSource);
68 68
69 m_engine = new XEngine.XEngine(); 69 m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 9cf9258..92a63bf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
58 IConfig config = initConfigSource.AddConfig("XEngine"); 58 IConfig config = initConfigSource.AddConfig("XEngine");
59 config.Set("Enabled", "true"); 59 config.Set("Enabled", "true");
60 60
61 Scene scene = SceneHelpers.SetupScene(); 61 Scene scene = new SceneHelpers().SetupScene();
62 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 62 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
63 63
64 XEngine.XEngine engine = new XEngine.XEngine(); 64 XEngine.XEngine engine = new XEngine.XEngine();
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
261 TestHelpers.InMethod(); 261 TestHelpers.InMethod();
262 262
263 // Create Prim1. 263 // Create Prim1.
264 Scene scene = SceneHelpers.SetupScene(); 264 Scene scene = new SceneHelpers().SetupScene();
265 string obj1Name = "Prim1"; 265 string obj1Name = "Prim1";
266 UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); 266 UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
267 SceneObjectPart part1 = 267 SceneObjectPart part1 =
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
index 7573dff..c51227b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
67 config = initConfigSource.AddConfig("NPC"); 67 config = initConfigSource.AddConfig("NPC");
68 config.Set("Enabled", "true"); 68 config.Set("Enabled", "true");
69 69
70 m_scene = SceneHelpers.SetupScene(); 70 m_scene = new SceneHelpers().SetupScene();
71 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule()); 71 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
72 72
73 m_engine = new XEngine.XEngine(); 73 m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
index 9d9fc51..9c36108 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
68 config = initConfigSource.AddConfig("NPC"); 68 config = initConfigSource.AddConfig("NPC");
69 config.Set("Enabled", "true"); 69 config.Set("Enabled", "true");
70 70
71 m_scene = SceneHelpers.SetupScene(); 71 m_scene = new SceneHelpers().SetupScene();
72 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule()); 72 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
73 73
74 m_engine = new XEngine.XEngine(); 74 m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
index 7d7bd82..a3f848c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
73 // to AssemblyResolver.OnAssemblyResolve fails. 73 // to AssemblyResolver.OnAssemblyResolve fails.
74 xEngineConfig.Set("AppDomainLoading", "false"); 74 xEngineConfig.Set("AppDomainLoading", "false");
75 75
76 m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource); 76 m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
77 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); 77 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
78 m_scene.StartScripts(); 78 m_scene.StartScripts();
79 } 79 }
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index 7a6b1cf..8e54707 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -58,57 +58,67 @@ namespace OpenSim.Tests.Common
58 /// </summary> 58 /// </summary>
59 public class SceneHelpers 59 public class SceneHelpers
60 { 60 {
61 public static TestScene SetupScene() 61 private AgentCircuitManager m_acm = new AgentCircuitManager();
62 private ISimulationDataService m_simDataService
63 = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
64 private IEstateDataService m_estateDataService;
65
66 private LocalAssetServicesConnector m_assetService;
67 private LocalAuthenticationServicesConnector m_authenticationService;
68 private LocalInventoryServicesConnector m_inventoryService;
69 private LocalGridServicesConnector m_gridService;
70 private LocalUserAccountServicesConnector m_userAccountService;
71 private LocalPresenceServicesConnector m_presenceService;
72
73 private CoreAssetCache m_cache;
74
75 public SceneHelpers() : this(null) {}
76
77 public SceneHelpers(CoreAssetCache cache)
62 { 78 {
63 return SetupScene(null); 79 m_assetService = StartAssetService(cache);
80 m_authenticationService = StartAuthenticationService();
81 m_inventoryService = StartInventoryService();
82 m_gridService = StartGridService();
83 m_userAccountService = StartUserAccountService();
84 m_presenceService = StartPresenceService();
85
86 m_inventoryService.PostInitialise();
87 m_assetService.PostInitialise();
88 m_userAccountService.PostInitialise();
89 m_presenceService.PostInitialise();
90
91 m_cache = cache;
64 } 92 }
65 93
66 /// <summary> 94 /// <summary>
67 /// Set up a test scene 95 /// Set up a test scene
68 /// </summary> 96 /// </summary>
69 /// <remarks> 97 /// <remarks>
70 /// Automatically starts service threads, as would the normal runtime. 98 /// Automatically starts services, as would the normal runtime.
71 /// </remarks> 99 /// </remarks>
72 /// <returns></returns> 100 /// <returns></returns>
73 public static TestScene SetupScene(CoreAssetCache cache) 101 public TestScene SetupScene()
74 { 102 {
75 return SetupScene("Unit test region", UUID.Random(), 1000, 1000, cache); 103 return SetupScene("Unit test region", UUID.Random(), 1000, 1000);
76 } 104 }
77 105
78 public static TestScene SetupScene(string name, UUID id, uint x, uint y) 106 public TestScene SetupScene(string name, UUID id, uint x, uint y)
79 {
80 return SetupScene(name, id, x, y, null);
81 }
82
83 /// <summary>
84 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
85 /// or a different, to get a brand new scene with new shared region modules.
86 /// </summary>
87 /// <param name="name">Name of the region</param>
88 /// <param name="id">ID of the region</param>
89 /// <param name="x">X co-ordinate of the region</param>
90 /// <param name="y">Y co-ordinate of the region</param>
91 /// <param name="cache"></param>
92 /// <returns></returns>
93 public static TestScene SetupScene(
94 string name, UUID id, uint x, uint y, CoreAssetCache cache)
95 { 107 {
96 return SetupScene(name, id, x, y, cache, new IniConfigSource()); 108 return SetupScene(name, id, x, y, new IniConfigSource());
97 } 109 }
98 110
99 /// <summary> 111 /// <summary>
100 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions 112 /// Set up a scene.
101 /// or a different, to get a brand new scene with new shared region modules.
102 /// </summary> 113 /// </summary>
103 /// <param name="name">Name of the region</param> 114 /// <param name="name">Name of the region</param>
104 /// <param name="id">ID of the region</param> 115 /// <param name="id">ID of the region</param>
105 /// <param name="x">X co-ordinate of the region</param> 116 /// <param name="x">X co-ordinate of the region</param>
106 /// <param name="y">Y co-ordinate of the region</param> 117 /// <param name="y">Y co-ordinate of the region</param>
107 /// <param name="cache"></param>
108 /// <param name="configSource"></param> 118 /// <param name="configSource"></param>
109 /// <returns></returns> 119 /// <returns></returns>
110 public static TestScene SetupScene( 120 public TestScene SetupScene(
111 string name, UUID id, uint x, uint y, CoreAssetCache cache, IConfigSource configSource) 121 string name, UUID id, uint x, uint y, IConfigSource configSource)
112 { 122 {
113 Console.WriteLine("Setting up test scene {0}", name); 123 Console.WriteLine("Setting up test scene {0}", name);
114 124
@@ -119,30 +129,47 @@ namespace OpenSim.Tests.Common
119 regInfo.RegionName = name; 129 regInfo.RegionName = name;
120 regInfo.RegionID = id; 130 regInfo.RegionID = id;
121 131
122 AgentCircuitManager acm = new AgentCircuitManager();
123 SceneCommunicationService scs = new SceneCommunicationService(); 132 SceneCommunicationService scs = new SceneCommunicationService();
124 133
125 ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
126 IEstateDataService estateDataService = null;
127
128 TestScene testScene = new TestScene( 134 TestScene testScene = new TestScene(
129 regInfo, acm, scs, simDataService, estateDataService, null, false, configSource, null); 135 regInfo, m_acm, scs, m_simDataService, m_estateDataService, null, false, configSource, null);
130 136
131 IRegionModule godsModule = new GodsModule(); 137 IRegionModule godsModule = new GodsModule();
132 godsModule.Initialise(testScene, new IniConfigSource()); 138 godsModule.Initialise(testScene, new IniConfigSource());
133 testScene.AddModule(godsModule.Name, godsModule); 139 testScene.AddModule(godsModule.Name, godsModule);
134 140
135 LocalAssetServicesConnector assetService = StartAssetService(testScene, cache); 141 // Add scene to services
136 StartAuthenticationService(testScene); 142 m_assetService.AddRegion(testScene);
137 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene); 143
138 StartGridService(testScene); 144 if (m_cache != null)
139 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); 145 {
140 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); 146 m_cache.AddRegion(testScene);
141 147 m_cache.RegionLoaded(testScene);
142 inventoryService.PostInitialise(); 148 testScene.AddRegionModule(m_cache.Name, m_cache);
143 assetService.PostInitialise(); 149 }
144 userAccountService.PostInitialise(); 150
145 presenceService.PostInitialise(); 151 m_assetService.RegionLoaded(testScene);
152 testScene.AddRegionModule(m_assetService.Name, m_assetService);
153
154 m_authenticationService.AddRegion(testScene);
155 m_authenticationService.RegionLoaded(testScene);
156 testScene.AddRegionModule(m_authenticationService.Name, m_authenticationService);
157
158 m_inventoryService.AddRegion(testScene);
159 m_inventoryService.RegionLoaded(testScene);
160 testScene.AddRegionModule(m_inventoryService.Name, m_inventoryService);
161
162 m_gridService.AddRegion(testScene);
163 m_gridService.RegionLoaded(testScene);
164 testScene.AddRegionModule(m_gridService.Name, m_gridService);
165
166 m_userAccountService.AddRegion(testScene);
167 m_userAccountService.RegionLoaded(testScene);
168 testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
169
170 m_presenceService.AddRegion(testScene);
171 m_presenceService.RegionLoaded(testScene);
172 testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
146 173
147 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); 174 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
148 testScene.SetModuleInterfaces(); 175 testScene.SetModuleInterfaces();
@@ -162,19 +189,17 @@ namespace OpenSim.Tests.Common
162 return testScene; 189 return testScene;
163 } 190 }
164 191
165 private static LocalAssetServicesConnector StartAssetService(Scene testScene, CoreAssetCache cache) 192 private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache)
166 { 193 {
167 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
168 IConfigSource config = new IniConfigSource(); 194 IConfigSource config = new IniConfigSource();
169
170 config.AddConfig("Modules"); 195 config.AddConfig("Modules");
171 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); 196 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
172 config.AddConfig("AssetService"); 197 config.AddConfig("AssetService");
173 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); 198 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
174 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 199 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
175 200
201 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
176 assetService.Initialise(config); 202 assetService.Initialise(config);
177 assetService.AddRegion(testScene);
178 203
179 if (cache != null) 204 if (cache != null)
180 { 205 {
@@ -184,56 +209,43 @@ namespace OpenSim.Tests.Common
184 cacheConfig.AddConfig("AssetCache"); 209 cacheConfig.AddConfig("AssetCache");
185 210
186 cache.Initialise(cacheConfig); 211 cache.Initialise(cacheConfig);
187 cache.AddRegion(testScene);
188 cache.RegionLoaded(testScene);
189 testScene.AddRegionModule(cache.Name, cache);
190 } 212 }
191
192 assetService.RegionLoaded(testScene);
193 testScene.AddRegionModule(assetService.Name, assetService);
194 213
195 return assetService; 214 return assetService;
196 } 215 }
197 216
198 private static void StartAuthenticationService(Scene testScene) 217 private static LocalAuthenticationServicesConnector StartAuthenticationService()
199 { 218 {
200 ISharedRegionModule service = new LocalAuthenticationServicesConnector();
201 IConfigSource config = new IniConfigSource(); 219 IConfigSource config = new IniConfigSource();
202
203 config.AddConfig("Modules"); 220 config.AddConfig("Modules");
204 config.AddConfig("AuthenticationService"); 221 config.AddConfig("AuthenticationService");
205 config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); 222 config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector");
206 config.Configs["AuthenticationService"].Set( 223 config.Configs["AuthenticationService"].Set(
207 "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); 224 "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
208 config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 225 config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
209 226
227 LocalAuthenticationServicesConnector service = new LocalAuthenticationServicesConnector();
210 service.Initialise(config); 228 service.Initialise(config);
211 service.AddRegion(testScene); 229
212 service.RegionLoaded(testScene); 230 return service;
213 testScene.AddRegionModule(service.Name, service);
214 //m_authenticationService = service;
215 } 231 }
216 232
217 private static LocalInventoryServicesConnector StartInventoryService(Scene testScene) 233 private static LocalInventoryServicesConnector StartInventoryService()
218 { 234 {
219 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
220
221 IConfigSource config = new IniConfigSource(); 235 IConfigSource config = new IniConfigSource();
222 config.AddConfig("Modules"); 236 config.AddConfig("Modules");
223 config.AddConfig("InventoryService"); 237 config.AddConfig("InventoryService");
224 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); 238 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
225 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); 239 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
226 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 240 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
227 241
242 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
228 inventoryService.Initialise(config); 243 inventoryService.Initialise(config);
229 inventoryService.AddRegion(testScene);
230 inventoryService.RegionLoaded(testScene);
231 testScene.AddRegionModule(inventoryService.Name, inventoryService);
232 244
233 return inventoryService; 245 return inventoryService;
234 } 246 }
235 247
236 private static LocalGridServicesConnector StartGridService(Scene testScene) 248 private static LocalGridServicesConnector StartGridService()
237 { 249 {
238 IConfigSource config = new IniConfigSource(); 250 IConfigSource config = new IniConfigSource();
239 config.AddConfig("Modules"); 251 config.AddConfig("Modules");
@@ -245,8 +257,6 @@ namespace OpenSim.Tests.Common
245 257
246 LocalGridServicesConnector gridService = new LocalGridServicesConnector(); 258 LocalGridServicesConnector gridService = new LocalGridServicesConnector();
247 gridService.Initialise(config); 259 gridService.Initialise(config);
248 gridService.AddRegion(testScene);
249 gridService.RegionLoaded(testScene);
250 260
251 return gridService; 261 return gridService;
252 } 262 }
@@ -256,7 +266,7 @@ namespace OpenSim.Tests.Common
256 /// </summary> 266 /// </summary>
257 /// <param name="testScene"></param> 267 /// <param name="testScene"></param>
258 /// <returns></returns> 268 /// <returns></returns>
259 private static LocalUserAccountServicesConnector StartUserAccountService(Scene testScene) 269 private static LocalUserAccountServicesConnector StartUserAccountService()
260 { 270 {
261 IConfigSource config = new IniConfigSource(); 271 IConfigSource config = new IniConfigSource();
262 config.AddConfig("Modules"); 272 config.AddConfig("Modules");
@@ -268,10 +278,6 @@ namespace OpenSim.Tests.Common
268 278
269 LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); 279 LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector();
270 userAccountService.Initialise(config); 280 userAccountService.Initialise(config);
271
272 userAccountService.AddRegion(testScene);
273 userAccountService.RegionLoaded(testScene);
274 testScene.AddRegionModule(userAccountService.Name, userAccountService);
275 281
276 return userAccountService; 282 return userAccountService;
277 } 283 }
@@ -280,7 +286,7 @@ namespace OpenSim.Tests.Common
280 /// Start a presence service 286 /// Start a presence service
281 /// </summary> 287 /// </summary>
282 /// <param name="testScene"></param> 288 /// <param name="testScene"></param>
283 private static LocalPresenceServicesConnector StartPresenceService(Scene testScene) 289 private static LocalPresenceServicesConnector StartPresenceService()
284 { 290 {
285 IConfigSource config = new IniConfigSource(); 291 IConfigSource config = new IniConfigSource();
286 config.AddConfig("Modules"); 292 config.AddConfig("Modules");
@@ -292,10 +298,6 @@ namespace OpenSim.Tests.Common
292 298
293 LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); 299 LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector();
294 presenceService.Initialise(config); 300 presenceService.Initialise(config);
295
296 presenceService.AddRegion(testScene);
297 presenceService.RegionLoaded(testScene);
298 testScene.AddRegionModule(presenceService.Name, presenceService);
299 301
300 return presenceService; 302 return presenceService;
301 } 303 }
@@ -313,19 +315,51 @@ namespace OpenSim.Tests.Common
313 /// <summary> 315 /// <summary>
314 /// Setup modules for a scene. 316 /// Setup modules for a scene.
315 /// </summary> 317 /// </summary>
316 /// <param name="scene"></param> 318 /// <remarks>
319 /// If called directly, then all the modules must be shared modules.
320 /// </remarks>
321 /// <param name="scenes"></param>
317 /// <param name="config"></param> 322 /// <param name="config"></param>
318 /// <param name="modules"></param> 323 /// <param name="modules"></param>
319 public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules) 324 public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules)
320 { 325 {
326 SetupSceneModules(new Scene[] { scene }, config, modules);
327 }
328
329 /// <summary>
330 /// Setup modules for a scene using their default settings.
331 /// </summary>
332 /// <param name="scenes"></param>
333 /// <param name="modules"></param>
334 public static void SetupSceneModules(Scene[] scenes, params object[] modules)
335 {
336 SetupSceneModules(scenes, new IniConfigSource(), modules);
337 }
338
339 /// <summary>
340 /// Setup modules for scenes.
341 /// </summary>
342 /// <remarks>
343 /// If called directly, then all the modules must be shared modules.
344 /// </remarks>
345 /// <param name="scenes"></param>
346 /// <param name="config"></param>
347 /// <param name="modules"></param>
348 public static void SetupSceneModules(Scene[] scenes, IConfigSource config, params object[] modules)
349 {
321 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>(); 350 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>();
322 foreach (object module in modules) 351 foreach (object module in modules)
323 { 352 {
324 if (module is IRegionModule) 353 if (module is IRegionModule)
325 { 354 {
326 IRegionModule m = (IRegionModule)module; 355 IRegionModule m = (IRegionModule)module;
327 m.Initialise(scene, config); 356
328 scene.AddModule(m.Name, m); 357 foreach (Scene scene in scenes)
358 {
359 m.Initialise(scene, config);
360 scene.AddModule(m.Name, m);
361 }
362
329 m.PostInitialise(); 363 m.PostInitialise();
330 } 364 }
331 else if (module is IRegionModuleBase) 365 else if (module is IRegionModuleBase)
@@ -345,15 +379,19 @@ namespace OpenSim.Tests.Common
345 379
346 foreach (IRegionModuleBase module in newModules) 380 foreach (IRegionModuleBase module in newModules)
347 { 381 {
348 module.AddRegion(scene); 382 foreach (Scene scene in scenes)
349 scene.AddRegionModule(module.Name, module); 383 {
384 module.AddRegion(scene);
385 scene.AddRegionModule(module.Name, module);
386 }
350 } 387 }
351 388
352 // RegionLoaded is fired after all modules have been appropriately added to all scenes 389 // RegionLoaded is fired after all modules have been appropriately added to all scenes
353 foreach (IRegionModuleBase module in newModules) 390 foreach (IRegionModuleBase module in newModules)
354 module.RegionLoaded(scene); 391 foreach (Scene scene in scenes)
392 module.RegionLoaded(scene);
355 393
356 scene.SetModuleInterfaces(); 394 foreach (Scene scene in scenes) { scene.SetModuleInterfaces(); }
357 } 395 }
358 396
359 /// <summary> 397 /// <summary>
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
index 0e4dfb9..4b4d52d 100644
--- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs
+++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
@@ -46,6 +46,14 @@ namespace OpenSim.Tests.Common.Mock
46 { 46 {
47 m_scene = scene; 47 m_scene = scene;
48 m_parcels = new List<ILandObject>(); 48 m_parcels = new List<ILandObject>();
49 SetupDefaultParcel();
50 }
51
52 private void SetupDefaultParcel()
53 {
54 ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
55 obj.LandData.Name = "Your Parcel";
56 m_parcels.Add(obj);
49 } 57 }
50 58
51 public List<ILandObject> ParcelsNearPoint(Vector3 position) 59 public List<ILandObject> ParcelsNearPoint(Vector3 position)
@@ -63,11 +71,7 @@ namespace OpenSim.Tests.Common.Mock
63 m_parcels.Clear(); 71 m_parcels.Clear();
64 72
65 if (setupDefaultParcel) 73 if (setupDefaultParcel)
66 { 74 SetupDefaultParcel();
67 ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
68 obj.LandData.Name = "Your Parcel";
69 m_parcels.Add(obj);
70 }
71 } 75 }
72 76
73 protected ILandObject GetNoLand() 77 protected ILandObject GetNoLand()
@@ -102,6 +106,5 @@ namespace OpenSim.Tests.Common.Mock
102 106
103 public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} 107 public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {}
104 public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} 108 public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {}
105
106 } 109 }
107} 110} \ No newline at end of file
diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs
index 0224505..731df68 100644
--- a/OpenSim/Tests/Torture/NPCTortureTests.cs
+++ b/OpenSim/Tests/Torture/NPCTortureTests.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Tests.Torture
98 umm = new UserManagementModule(); 98 umm = new UserManagementModule();
99 am = new AttachmentsModule(); 99 am = new AttachmentsModule();
100 100
101 scene = SceneHelpers.SetupScene(); 101 scene = new SceneHelpers().SetupScene();
102 SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule()); 102 SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule());
103 } 103 }
104 104
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index d0d2199..195d47b 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Tests.Torture
126 // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage 126 // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage
127 // collected when we teardown this test. If it's done in a member variable, even if that is subsequently 127 // collected when we teardown this test. If it's done in a member variable, even if that is subsequently
128 // nulled out, the garbage collect can be delayed. 128 // nulled out, the garbage collect can be delayed.
129 TestScene scene = SceneHelpers.SetupScene(); 129 TestScene scene = new SceneHelpers().SetupScene();
130 130
131// Process process = Process.GetCurrentProcess(); 131// Process process = Process.GetCurrentProcess();
132// long startProcessMemory = process.PrivateMemorySize64; 132// long startProcessMemory = process.PrivateMemorySize64;
diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs
index 2ef55b3..24f278f 100644
--- a/OpenSim/Tests/Torture/ScriptTortureTests.cs
+++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Tests.Torture
84 // to AssemblyResolver.OnAssemblyResolve fails. 84 // to AssemblyResolver.OnAssemblyResolve fails.
85 xEngineConfig.Set("AppDomainLoading", "false"); 85 xEngineConfig.Set("AppDomainLoading", "false");
86 86
87 m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource); 87 m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
88 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); 88 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
89 89
90 m_scene.EventManager.OnChatFromWorld += OnChatFromWorld; 90 m_scene.EventManager.OnChatFromWorld += OnChatFromWorld;