* Improves SceneSetupHelper to allow the tester to choose a real or mock, inventory and asset, service modules. The boolean startServices was replaced with realServices string. If the string contains the word asset, it will start a real asset module, if it contains inventory, it starts a real inventory. Otherwise, it use mock (NullPlugin-like) objects, for tests that don't really need functionality.

* SetupScene is now actually sharing the asset and inventory modules if the tester wishes to have multiple regions connected. To link regions, just start SetupScene with the same CommunicationManager for all scenes. SceneSetupHelper will hold a static reference to the modules and won't initialize them again, just run the scenes through the modules AddRegion, RegionLoaded and PostInitialize.

* With the recent changes, both asset and inventory (and in the future, user) services should always be asked from the scene, not instantiated alone. The tests should reflect this new behavior and always start a scene.
This commit is contained in:
Arthur Valadares
2009-08-11 12:07:54 -03:00
parent eba23048ca
commit 18aa2ea0c5
9 changed files with 248 additions and 171 deletions

View File

@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene(false);
Scene scene = SceneSetupHelpers.SetupScene("");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
CommunicationsManager cm = scene.CommsManager;
@@ -363,7 +363,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
public void TestReplicateArchivePathToUserInventory()
{
TestHelper.InMethod();
Scene scene = SceneSetupHelpers.SetupScene(false);
Scene scene = SceneSetupHelpers.SetupScene("");
CommunicationsManager commsManager = scene.CommsManager;
CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);

View File

@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
Scene scene = SceneSetupHelpers.SetupScene(false);
Scene scene = SceneSetupHelpers.SetupScene("asset");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
SceneObjectPart part1;

View File

@@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
public void Init()
{
m_serialiserModule = new SerialiserModule();
m_scene = SceneSetupHelpers.SetupScene(false);
m_scene = SceneSetupHelpers.SetupScene("");
SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule);
}