aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-03 22:51:46 +0100
committerJustin Clark-Casey (justincc)2011-08-03 22:51:46 +0100
commitd78fe441916b6e66cd5c071bcbbf027bb28feabd (patch)
tree85b8742b44b888864dad83ca11c2e8adb9f9eadd
parentstop avatar service being set up in NPC TestCreate() - it's no longer used (diff)
downloadopensim-SC-d78fe441916b6e66cd5c071bcbbf027bb28feabd.zip
opensim-SC-d78fe441916b6e66cd5c071bcbbf027bb28feabd.tar.gz
opensim-SC-d78fe441916b6e66cd5c071bcbbf027bb28feabd.tar.bz2
opensim-SC-d78fe441916b6e66cd5c071bcbbf027bb28feabd.tar.xz
Add passing but incomplete NPC move regression test
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs72
1 files changed, 25 insertions, 47 deletions
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
53// log4net.Config.XmlConfigurator.Configure(); 53// log4net.Config.XmlConfigurator.Configure();
54 54
55 IConfigSource config = new IniConfigSource(); 55 IConfigSource config = new IniConfigSource();
56
57// config.AddConfig("Modules");
58// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector");
59// config.AddConfig("AvatarService");
60// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService");
61// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
62 config.AddConfig("NPC"); 56 config.AddConfig("NPC");
63 config.Configs["NPC"].Set("Enabled", "true"); 57 config.Configs["NPC"].Set("Enabled", "true");
64 58
@@ -89,46 +83,30 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
89 Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); 83 Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
90 } 84 }
91 85
92// [Test] 86 [Test]
93// public void TestMove() 87 public void TestMove()
94// { 88 {
95// TestHelper.InMethod(); 89 TestHelper.InMethod();
96//// log4net.Config.XmlConfigurator.Configure(); 90 log4net.Config.XmlConfigurator.Configure();
97// 91
98// IConfigSource config = new IniConfigSource(); 92 IConfigSource config = new IniConfigSource();
99// 93
100// config.AddConfig("Modules"); 94 config.AddConfig("NPC");
101// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector"); 95 config.Configs["NPC"].Set("Enabled", "true");
102// config.AddConfig("AvatarService"); 96
103// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService"); 97 TestScene scene = SceneSetupHelpers.SetupScene();
104// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 98 SceneSetupHelpers.SetupSceneModules(scene, config, new NPCModule());
105// config.AddConfig("NPC"); 99 TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
106// config.Configs["NPC"].Set("Enabled", "true"); 100// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
107// 101
108// TestScene scene = SceneSetupHelpers.SetupScene(); 102 Vector3 startPos = new Vector3(128, 128, 30);
109// SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule(), new LocalAvatarServicesConnector()); 103 INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
110// TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1)); 104 UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, originalClient.AgentId);
111//// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); 105
112// 106 ScenePresence npc = scene.GetScenePresence(npcId);
113// // 8 is the index of the first baked texture in AvatarAppearance 107 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
114// UUID originalFace8TextureId = TestHelper.ParseTail(0x10); 108
115// Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero); 109 // Not yet complete
116// Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8); 110 }
117// originalTef.TextureID = originalFace8TextureId;
118//
119// // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell
120// // ScenePresence.SendInitialData() to reset our entire appearance.
121// scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId));
122//
123// afm.SetAppearance(originalClient, originalTe, null);
124//
125// INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
126// UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, originalClient.AgentId);
127//
128// ScenePresence npc = scene.GetScenePresence(npcId);
129//
130// Assert.That(npc, Is.Not.Null);
131// Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
132// }
133 } 111 }
134} \ No newline at end of file 112} \ No newline at end of file