Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

bulletsim
BlueWall 2011-04-14 21:16:30 -04:00
commit 37d2b6243b
8 changed files with 20 additions and 53 deletions

View File

@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");

View File

@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
m_archiverModule = new InventoryArchiverModule(); m_archiverModule = new InventoryArchiverModule();
m_scene = SceneSetupHelpers.SetupScene("asset inventory"); m_scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
} }

View File

@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
// Create user // Create user
@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@ -223,7 +223,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password"); UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password");
@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
// Create user // Create user
@ -327,7 +327,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
@ -394,7 +394,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure(); //log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
string folder1ExistingName = "a"; string folder1ExistingName = "a";
@ -445,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
string folder1ExistingName = "a"; string folder1ExistingName = "a";

View File

@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
config.AddConfig("Modules"); config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
m_scene = SceneSetupHelpers.SetupScene("Inventory"); m_scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam); SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam);
// Create user // Create user

View File

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

View File

@ -117,11 +117,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid"); Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
sceneB.RegisterRegionWithGrid(); sceneB.RegisterRegionWithGrid();
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid"); Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
sceneA.RegisterRegionWithGrid(); sceneA.RegisterRegionWithGrid();

View File

@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = CreateUser(scene); UserAccount user1 = CreateUser(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart; SceneObjectPart sop1 = sog1.RootPart;
@ -127,7 +127,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = CreateUser(scene); UserAccount user1 = CreateUser(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart; SceneObjectPart sop1 = sog1.RootPart;

View File

@ -66,32 +66,7 @@ namespace OpenSim.Tests.Common.Setup
/// <returns></returns> /// <returns></returns>
public static TestScene SetupScene() public static TestScene SetupScene()
{ {
return SetupScene(""); return SetupScene("Unit test region", UUID.Random(), 1000, 1000);
}
/// <summary>
/// Set up a test scene
/// </summary>
///
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
/// <returns></returns>
public static TestScene SetupScene(String realServices)
{
return SetupScene("Unit test region", UUID.Random(), 1000, 1000, realServices);
}
/// <summary>
/// Set up a test scene
/// </summary>
/// <param name="name">Name of the region</param>
/// <param name="id">ID of the region</param>
/// <param name="x">X co-ordinate of the region</param>
/// <param name="y">Y co-ordinate of the region</param>
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
/// <returns></returns>
public static TestScene SetupScene(string name, UUID id, uint x, uint y)
{
return SetupScene(name, id, x, y, "");
} }
/// <summary> /// <summary>
@ -103,10 +78,8 @@ namespace OpenSim.Tests.Common.Setup
/// <param name="x">X co-ordinate of the region</param> /// <param name="x">X co-ordinate of the region</param>
/// <param name="y">Y co-ordinate of the region</param> /// <param name="y">Y co-ordinate of the region</param>
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param> /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
/// <returns></returns> /// <returns></returns>
public static TestScene SetupScene( public static TestScene SetupScene(string name, UUID id, uint x, uint y)
string name, UUID id, uint x, uint y, String realServices)
{ {
Console.WriteLine("Setting up test scene {0}", name); Console.WriteLine("Setting up test scene {0}", name);
@ -130,12 +103,11 @@ namespace OpenSim.Tests.Common.Setup
IRegionModule godsModule = new GodsModule(); IRegionModule godsModule = new GodsModule();
godsModule.Initialise(testScene, new IniConfigSource()); godsModule.Initialise(testScene, new IniConfigSource());
testScene.AddModule(godsModule.Name, godsModule); testScene.AddModule(godsModule.Name, godsModule);
realServices = realServices.ToLower();
LocalAssetServicesConnector assetService = StartAssetService(testScene); LocalAssetServicesConnector assetService = StartAssetService(testScene);
StartAuthenticationService(testScene); StartAuthenticationService(testScene);
LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene); LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene);
StartGridService(testScene, true); StartGridService(testScene);
LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); LocalPresenceServicesConnector presenceService = StartPresenceService(testScene);
@ -218,24 +190,19 @@ namespace OpenSim.Tests.Common.Setup
return inventoryService; return inventoryService;
} }
private static LocalGridServicesConnector StartGridService(Scene testScene, bool real) private static LocalGridServicesConnector StartGridService(Scene testScene)
{ {
IConfigSource config = new IniConfigSource(); IConfigSource config = new IniConfigSource();
config.AddConfig("Modules"); config.AddConfig("Modules");
config.AddConfig("GridService"); config.AddConfig("GridService");
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
if (real)
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
LocalGridServicesConnector gridService = new LocalGridServicesConnector(); LocalGridServicesConnector gridService = new LocalGridServicesConnector();
gridService.Initialise(config); gridService.Initialise(config);
//else
// config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
gridService.AddRegion(testScene); gridService.AddRegion(testScene);
gridService.RegionLoaded(testScene); gridService.RegionLoaded(testScene);
//testScene.AddRegionModule(m_gridService.Name, m_gridService);
return gridService; return gridService;
} }