From d78fe441916b6e66cd5c071bcbbf027bb28feabd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Aug 2011 22:51:46 +0100 Subject: Add passing but incomplete NPC move regression test --- .../World/NPC/Tests/NPCModuleTests.cs | 72 ++++++++-------------- 1 file changed, 25 insertions(+), 47 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World') diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index c5770d3..46e39ef 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs @@ -53,12 +53,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests // log4net.Config.XmlConfigurator.Configure(); IConfigSource config = new IniConfigSource(); - -// config.AddConfig("Modules"); -// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector"); -// config.AddConfig("AvatarService"); -// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService"); -// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.AddConfig("NPC"); config.Configs["NPC"].Set("Enabled", "true"); @@ -89,46 +83,30 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); } -// [Test] -// public void TestMove() -// { -// TestHelper.InMethod(); -//// log4net.Config.XmlConfigurator.Configure(); -// -// IConfigSource config = new IniConfigSource(); -// -// config.AddConfig("Modules"); -// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector"); -// config.AddConfig("AvatarService"); -// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService"); -// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); -// config.AddConfig("NPC"); -// config.Configs["NPC"].Set("Enabled", "true"); -// -// TestScene scene = SceneSetupHelpers.SetupScene(); -// SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule(), new LocalAvatarServicesConnector()); -// TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1)); -//// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); -// -// // 8 is the index of the first baked texture in AvatarAppearance -// UUID originalFace8TextureId = TestHelper.ParseTail(0x10); -// Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero); -// Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8); -// originalTef.TextureID = originalFace8TextureId; -// -// // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell -// // ScenePresence.SendInitialData() to reset our entire appearance. -// scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId)); -// -// afm.SetAppearance(originalClient, originalTe, null); -// -// INPCModule npcModule = scene.RequestModuleInterface(); -// UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, originalClient.AgentId); -// -// ScenePresence npc = scene.GetScenePresence(npcId); -// -// Assert.That(npc, Is.Not.Null); -// Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); -// } + [Test] + public void TestMove() + { + TestHelper.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + + IConfigSource config = new IniConfigSource(); + + config.AddConfig("NPC"); + config.Configs["NPC"].Set("Enabled", "true"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + SceneSetupHelpers.SetupSceneModules(scene, config, new NPCModule()); + TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1)); +// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); + + Vector3 startPos = new Vector3(128, 128, 30); + INPCModule npcModule = scene.RequestModuleInterface(); + UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, originalClient.AgentId); + + ScenePresence npc = scene.GetScenePresence(npcId); + Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); + + // Not yet complete + } } } \ No newline at end of file -- cgit v1.1