aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs54
1 files changed, 48 insertions, 6 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 9e77e7d..c5770d3 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -54,17 +54,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
54 54
55 IConfigSource config = new IniConfigSource(); 55 IConfigSource config = new IniConfigSource();
56 56
57 config.AddConfig("Modules"); 57// config.AddConfig("Modules");
58 config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector"); 58// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector");
59 config.AddConfig("AvatarService"); 59// config.AddConfig("AvatarService");
60 config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService"); 60// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService");
61 config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 61// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
62 config.AddConfig("NPC"); 62 config.AddConfig("NPC");
63 config.Configs["NPC"].Set("Enabled", "true"); 63 config.Configs["NPC"].Set("Enabled", "true");
64 64
65 AvatarFactoryModule afm = new AvatarFactoryModule(); 65 AvatarFactoryModule afm = new AvatarFactoryModule();
66 TestScene scene = SceneSetupHelpers.SetupScene(); 66 TestScene scene = SceneSetupHelpers.SetupScene();
67 SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule(), new LocalAvatarServicesConnector()); 67 SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule());
68 TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1)); 68 TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
69// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); 69// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
70 70
@@ -88,5 +88,47 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
88 Assert.That(npc, Is.Not.Null); 88 Assert.That(npc, Is.Not.Null);
89 Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); 89 Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
90 } 90 }
91
92// [Test]
93// public void TestMove()
94// {
95// TestHelper.InMethod();
96//// log4net.Config.XmlConfigurator.Configure();
97//
98// IConfigSource config = new IniConfigSource();
99//
100// config.AddConfig("Modules");
101// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector");
102// config.AddConfig("AvatarService");
103// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService");
104// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
105// config.AddConfig("NPC");
106// config.Configs["NPC"].Set("Enabled", "true");
107//
108// TestScene scene = SceneSetupHelpers.SetupScene();
109// SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule(), new LocalAvatarServicesConnector());
110// TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
111//// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
112//
113// // 8 is the index of the first baked texture in AvatarAppearance
114// UUID originalFace8TextureId = TestHelper.ParseTail(0x10);
115// Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero);
116// Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8);
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// }
91 } 133 }
92} \ No newline at end of file 134} \ No newline at end of file