aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs11
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs38
6 files changed, 58 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index c140ec0..01e5ae0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
67 67
68 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 68 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
69 69
70 Scene scene = SceneSetupHelpers.SetupScene(); 70 Scene scene = SceneSetupHelpers.SetupScene(false);
71 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 71 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
72 CommunicationsManager cm = scene.CommsManager; 72 CommunicationsManager cm = scene.CommsManager;
73 73
@@ -119,6 +119,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
119 lock (this) 119 lock (this)
120 { 120 {
121 archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream); 121 archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream);
122 AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer;
123 while (assetServer.HasWaitingRequests())
124 assetServer.ProcessNextRequest();
125
122 Monitor.Wait(this, 60000); 126 Monitor.Wait(this, 60000);
123 } 127 }
124 128
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 04c3289..165a607 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -34,6 +34,7 @@ using NUnit.Framework;
34using NUnit.Framework.SyntaxHelpers; 34using NUnit.Framework.SyntaxHelpers;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Communications.Cache;
37using OpenSim.Framework.Serialization; 38using OpenSim.Framework.Serialization;
38using OpenSim.Region.CoreModules.World.Serialiser; 39using OpenSim.Region.CoreModules.World.Serialiser;
39using OpenSim.Region.CoreModules.World.Terrain; 40using OpenSim.Region.CoreModules.World.Terrain;
@@ -67,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
67 SerialiserModule serialiserModule = new SerialiserModule(); 68 SerialiserModule serialiserModule = new SerialiserModule();
68 TerrainModule terrainModule = new TerrainModule(); 69 TerrainModule terrainModule = new TerrainModule();
69 70
70 Scene scene = SceneSetupHelpers.SetupScene(); 71 Scene scene = SceneSetupHelpers.SetupScene(false);
71 SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); 72 SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
72 73
73 SceneObjectPart part1; 74 SceneObjectPart part1;
@@ -114,6 +115,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
114 lock (this) 115 lock (this)
115 { 116 {
116 archiverModule.ArchiveRegion(archiveWriteStream); 117 archiverModule.ArchiveRegion(archiveWriteStream);
118 AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer;
119 while (assetServer.HasWaitingRequests())
120 assetServer.ProcessNextRequest();
121
117 Monitor.Wait(this, 60000); 122 Monitor.Wait(this, 60000);
118 } 123 }
119 124
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index c781305..c00ef3c 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
57 public UUID agent1, agent2, agent3; 57 public UUID agent1, agent2, agent3;
58 public static Random random; 58 public static Random random;
59 public ulong region1,region2,region3; 59 public ulong region1,region2,region3;
60 public CommunicationsManager cm; 60 public TestCommunicationsManager cm;
61 public AgentCircuitData acd1; 61 public AgentCircuitData acd1;
62 public SceneObjectGroup sog1, sog2, sog3; 62 public SceneObjectGroup sog1, sog2, sog3;
63 public TestClient testclient; 63 public TestClient testclient;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index 80d2ba9..a0c956e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
60 60
61 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); 61 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
62 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); 62 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
63 CommunicationsManager cm = new TestCommunicationsManager(); 63 TestCommunicationsManager cm = new TestCommunicationsManager();
64 64
65 // shared module 65 // shared module
66 IRegionModule interregionComms = new RESTInterregionComms(); 66 IRegionModule interregionComms = new RESTInterregionComms();
diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
index 3b39d36..93891c0 100644
--- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
+++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
@@ -60,8 +60,7 @@ namespace OpenSim.Tests.Common.Mock
60 m_inventoryDataPlugin = new TestInventoryDataPlugin(); 60 m_inventoryDataPlugin = new TestInventoryDataPlugin();
61 61
62 SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); 62 SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin());
63 m_assetCache = new AssetCache(assetService); 63 m_assetCache = new AssetCache(assetService);
64 m_assetCache.AssetServer.Start();
65 64
66 LocalInventoryService lis = new LocalInventoryService(); 65 LocalInventoryService lis = new LocalInventoryService();
67 lis.AddPlugin(m_inventoryDataPlugin); 66 lis.AddPlugin(m_inventoryDataPlugin);
@@ -76,5 +75,13 @@ namespace OpenSim.Tests.Common.Mock
76 LocalBackEndServices gs = new LocalBackEndServices(); 75 LocalBackEndServices gs = new LocalBackEndServices();
77 m_gridService = gs; 76 m_gridService = gs;
78 } 77 }
78
79 /// <summary>
80 /// Start services that take care of business using their own threads.
81 /// </summary>
82 public void StartServices()
83 {
84 m_assetCache.AssetServer.Start();
85 }
79 } 86 }
80} 87}
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 3bcd949..ea4f0af 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -52,10 +52,39 @@ namespace OpenSim.Tests.Common.Setup
52 /// <summary> 52 /// <summary>
53 /// Set up a test scene 53 /// Set up a test scene
54 /// </summary> 54 /// </summary>
55 ///
56 /// Automatically starts service threads, as would the normal runtime.
57 ///
55 /// <returns></returns> 58 /// <returns></returns>
56 public static TestScene SetupScene() 59 public static TestScene SetupScene()
57 { 60 {
58 return SetupScene("Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager()); 61 return SetupScene(true);
62 }
63
64 /// <summary>
65 /// Set up a test scene
66 /// </summary>
67 ///
68 /// <param name="startServices">Start associated service threads for the scene</param>
69 /// <returns></returns>
70 public static TestScene SetupScene(bool startServices)
71 {
72 return SetupScene(
73 "Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), startServices);
74 }
75
76 /// <summary>
77 /// Set up a test scene
78 /// </summary>
79 /// <param name="name">Name of the region</param>
80 /// <param name="id">ID of the region</param>
81 /// <param name="x">X co-ordinate of the region</param>
82 /// <param name="y">Y co-ordinate of the region</param>
83 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
84 /// <returns></returns>
85 public static TestScene SetupScene(string name, UUID id, uint x, uint y, TestCommunicationsManager cm)
86 {
87 return SetupScene(name, id, x, y, cm, true);
59 } 88 }
60 89
61 /// <summary> 90 /// <summary>
@@ -66,8 +95,10 @@ namespace OpenSim.Tests.Common.Setup
66 /// <param name="x">X co-ordinate of the region</param> 95 /// <param name="x">X co-ordinate of the region</param>
67 /// <param name="y">Y co-ordinate of the region</param> 96 /// <param name="y">Y co-ordinate of the region</param>
68 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> 97 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
98 /// <param name="startServices">Start associated threads for the services used by the scene</param>
69 /// <returns></returns> 99 /// <returns></returns>
70 public static TestScene SetupScene(string name, UUID id, uint x, uint y, CommunicationsManager cm) 100 public static TestScene SetupScene(
101 string name, UUID id, uint x, uint y, TestCommunicationsManager cm, bool startServices)
71 { 102 {
72 Console.WriteLine("Setting up test scene {0}", name); 103 Console.WriteLine("Setting up test scene {0}", name);
73 104
@@ -102,6 +133,9 @@ namespace OpenSim.Tests.Common.Setup
102 testScene.PhysicsScene 133 testScene.PhysicsScene
103 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test"); 134 = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test");
104 135
136 if (startServices)
137 cm.StartServices();
138
105 return testScene; 139 return testScene;
106 } 140 }
107 141