aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-11 20:56:18 +0100
committerJustin Clark-Casey (justincc)2011-08-11 20:56:18 +0100
commit83ca5a101d5578282ba0fd7177fcb618f70d3cc9 (patch)
treedf4f15c5cccfd0f9aa053dc0df9fcddc4ee39631 /OpenSim/Region/ScriptEngine/Shared
parentAdd missing System.Xml reference which is required to build on Windows but no... (diff)
downloadopensim-SC_OLD-83ca5a101d5578282ba0fd7177fcb618f70d3cc9.zip
opensim-SC_OLD-83ca5a101d5578282ba0fd7177fcb618f70d3cc9.tar.gz
opensim-SC_OLD-83ca5a101d5578282ba0fd7177fcb618f70d3cc9.tar.bz2
opensim-SC_OLD-83ca5a101d5578282ba0fd7177fcb618f70d3cc9.tar.xz
Split out to-be-common setup stuff from TestOsOwnerSaveAppearance()
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs48
1 files changed, 33 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
index fc8b551..2218a1f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
@@ -50,35 +50,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
50 [TestFixture] 50 [TestFixture]
51 public class OSSL_ApiAppearanceTest 51 public class OSSL_ApiAppearanceTest
52 { 52 {
53 [Test] 53 protected Scene m_scene;
54 public void TestOsOwnerSaveAppearance() 54 protected XEngine.XEngine m_engine;
55 {
56 TestHelpers.InMethod();
57// log4net.Config.XmlConfigurator.Configure();
58 55
56 [SetUp]
57 public void SetUp()
58 {
59 IConfigSource initConfigSource = new IniConfigSource(); 59 IConfigSource initConfigSource = new IniConfigSource();
60 IConfig config = initConfigSource.AddConfig("XEngine"); 60 IConfig config = initConfigSource.AddConfig("XEngine");
61 config.Set("Enabled", "true"); 61 config.Set("Enabled", "true");
62 config.Set("AllowOSFunctions", "true"); 62 config.Set("AllowOSFunctions", "true");
63 config.Set("OSFunctionThreatLevel", "Severe"); 63 config.Set("OSFunctionThreatLevel", "Severe");
64 64
65 m_scene = SceneHelpers.SetupScene();
66 SceneHelpers.SetupSceneModules(m_scene, new AvatarFactoryModule());
67
68 m_engine = new XEngine.XEngine();
69 m_engine.Initialise(initConfigSource);
70 m_engine.AddRegion(m_scene);
71 }
72
73 /// <summary>
74 /// Test creation of an NPC where the appearance data comes from a notecard
75 /// </summary>
76// [Test]
77// public void TestOsNpcCreateFromNotecard()
78// {
79// TestHelpers.InMethod();
80//// log4net.Config.XmlConfigurator.Configure();
81// }
82
83 [Test]
84 public void TestOsOwnerSaveAppearance()
85 {
86 TestHelpers.InMethod();
87// log4net.Config.XmlConfigurator.Configure();
88
65 UUID userId = TestHelpers.ParseTail(0x1); 89 UUID userId = TestHelpers.ParseTail(0x1);
66 float newHeight = 1.9f; 90 float newHeight = 1.9f;
67 91
68 Scene scene = SceneHelpers.SetupScene(); 92 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
69 SceneHelpers.SetupSceneModules(scene, new AvatarFactoryModule());
70 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
71 sp.Appearance.AvatarHeight = newHeight; 93 sp.Appearance.AvatarHeight = newHeight;
72 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId); 94 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
73 SceneObjectPart part = so.RootPart; 95 SceneObjectPart part = so.RootPart;
74 scene.AddSceneObject(so); 96 m_scene.AddSceneObject(so);
75
76 XEngine.XEngine engine = new XEngine.XEngine();
77 engine.Initialise(initConfigSource);
78 engine.AddRegion(scene);
79 97
80 OSSL_Api osslApi = new OSSL_Api(); 98 OSSL_Api osslApi = new OSSL_Api();
81 osslApi.Initialize(engine, part, part.LocalId, part.UUID); 99 osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
82 100
83 string notecardName = "appearanceNc"; 101 string notecardName = "appearanceNc";
84 102
@@ -90,7 +108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
90 TaskInventoryItem ncItem = items[0]; 108 TaskInventoryItem ncItem = items[0];
91 Assert.That(ncItem.Name, Is.EqualTo(notecardName)); 109 Assert.That(ncItem.Name, Is.EqualTo(notecardName));
92 110
93 AssetBase ncAsset = scene.AssetService.Get(ncItem.AssetID.ToString()); 111 AssetBase ncAsset = m_scene.AssetService.Get(ncItem.AssetID.ToString());
94 Assert.That(ncAsset, Is.Not.Null); 112 Assert.That(ncAsset, Is.Not.Null);
95 113
96 AssetNotecard anc = new AssetNotecard(UUID.Zero, ncAsset.Data); 114 AssetNotecard anc = new AssetNotecard(UUID.Zero, ncAsset.Data);