diff options
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 11 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 38 |
2 files changed, 45 insertions, 4 deletions
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 | ||