From 696bd448334c89607c95385f05a53e2ab72cb984 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 17 Aug 2011 00:37:33 +0100 Subject: Add new regression TestRezAttachmentsOnAvatarEntrance() to do simple attachments check --- .../Attachments/Tests/AttachmentsModuleTests.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 7f25864..8c79ab4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -38,6 +38,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Region.CoreModules.Avatar.Attachments; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; using OpenSim.Region.CoreModules.World.Serialiser; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; using OpenSim.Region.Framework.Scenes; @@ -65,8 +66,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. Util.FireAndForgetMethod = FireAndForgetMethod.None; - scene = SceneHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); - SceneHelpers.SetupSceneModules(scene, new AttachmentsModule()); + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + + scene = SceneHelpers.SetupScene(); + SceneHelpers.SetupSceneModules(scene, config, new AttachmentsModule(), new BasicInventoryAccessModule()); agent1 = UUID.Random(); random = new Random(); @@ -114,16 +119,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - UUID spId = TestHelpers.ParseTail(0x1); + UUID userId = TestHelpers.ParseTail(0x1); UUID attItemId = TestHelpers.ParseTail(0x2); UUID attAssetId = TestHelpers.ParseTail(0x3); - AgentCircuitData acd = SceneHelpers.GenerateAgentData(spId); + UserAccountHelpers.CreateUserWithInventory(scene, userId); + InventoryItemBase attItem + = UserInventoryHelpers.CreateInventoryItem( + scene, "att", attItemId, attAssetId, userId, InventoryType.Object); + + AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); acd.Appearance = new AvatarAppearance(); - acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItemId, attAssetId); + acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID); ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd); -// Assert.That(presence.HasAttachments(), Is.True); + Assert.That(presence.HasAttachments(), Is.True); } // I'm commenting this test because scene setup NEEDS InventoryService to -- cgit v1.1