diff options
author | Justin Clarke Casey | 2008-11-14 20:06:44 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-14 20:06:44 +0000 |
commit | 2bb4b45626322c3789fc56545c64f2f9aacdb6fb (patch) | |
tree | fe39575b5be48ab31b9ba6782739549f6829a8be /OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | |
parent | Mantis #2618 (diff) | |
download | opensim-SC-2bb4b45626322c3789fc56545c64f2f9aacdb6fb.zip opensim-SC-2bb4b45626322c3789fc56545c64f2f9aacdb6fb.tar.gz opensim-SC-2bb4b45626322c3789fc56545c64f2f9aacdb6fb.tar.bz2 opensim-SC-2bb4b45626322c3789fc56545c64f2f9aacdb6fb.tar.xz |
* Move test scene construction infrastructure methods to a separate class for future common use
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs index c306433..52447a7 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | |||
@@ -26,7 +26,6 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using Nini.Config; | ||
30 | using NUnit.Framework; | 29 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | 30 | using NUnit.Framework.SyntaxHelpers; |
32 | using OpenMetaverse; | 31 | using OpenMetaverse; |
@@ -54,43 +53,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
54 | // I don't care, just leave log4net off | 53 | // I don't care, just leave log4net off |
55 | } | 54 | } |
56 | } | 55 | } |
57 | |||
58 | /// <summary> | ||
59 | /// Set up a test scene | ||
60 | /// </summary> | ||
61 | private TestScene SetupScene() | ||
62 | { | ||
63 | RegionInfo regInfo = new RegionInfo(1000, 1000, null, null); | ||
64 | regInfo.RegionName = "Unit test region"; | ||
65 | AgentCircuitManager acm = new AgentCircuitManager(); | ||
66 | //CommunicationsManager cm = new CommunicationsManager(null, null, null, false, null); | ||
67 | CommunicationsManager cm = null; | ||
68 | //SceneCommunicationService scs = new SceneCommunicationService(cm); | ||
69 | SceneCommunicationService scs = null; | ||
70 | StorageManager sm = new OpenSim.Region.Environment.StorageManager("OpenSim.Data.Null.dll", "", ""); | ||
71 | IConfigSource configSource = new IniConfigSource(); | ||
72 | |||
73 | return new TestScene(regInfo, acm, cm, scs, null, sm, null, null, false, false, false, configSource, null); | ||
74 | } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Add a test object | ||
78 | /// </summary> | ||
79 | /// <param name="scene"></param> | ||
80 | /// <returns></returns> | ||
81 | private SceneObjectPart AddSceneObject(Scene scene) | ||
82 | { | ||
83 | SceneObjectGroup sceneObject = new SceneObjectGroup(); | ||
84 | SceneObjectPart part | ||
85 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); | ||
86 | //part.UpdatePrimFlags(false, false, true); | ||
87 | part.ObjectFlags |= (uint)PrimFlags.Phantom; | ||
88 | sceneObject.SetRootPart(part); | ||
89 | |||
90 | scene.AddNewSceneObject(sceneObject, false); | ||
91 | |||
92 | return part; | ||
93 | } | ||
94 | 56 | ||
95 | /// <summary> | 57 | /// <summary> |
96 | /// Test adding an object to a scene. | 58 | /// Test adding an object to a scene. |
@@ -98,8 +60,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
98 | [Test] | 60 | [Test] |
99 | public void TestAddSceneObject() | 61 | public void TestAddSceneObject() |
100 | { | 62 | { |
101 | Scene scene = SetupScene(); | 63 | Scene scene = SceneTestUtils.SetupScene(); |
102 | SceneObjectPart part = AddSceneObject(scene); | 64 | SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); |
103 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 65 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); |
104 | 66 | ||
105 | //System.Console.WriteLine("retrievedPart : {0}", retrievedPart); | 67 | //System.Console.WriteLine("retrievedPart : {0}", retrievedPart); |
@@ -112,8 +74,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
112 | /// </summary> | 74 | /// </summary> |
113 | public void TestRemoveSceneObject() | 75 | public void TestRemoveSceneObject() |
114 | { | 76 | { |
115 | TestScene scene = SetupScene();; | 77 | TestScene scene = SceneTestUtils.SetupScene(); |
116 | SceneObjectPart part = AddSceneObject(scene); | 78 | SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); |
117 | scene.DeleteSceneObject(part.ParentGroup, false); | 79 | scene.DeleteSceneObject(part.ParentGroup, false); |
118 | 80 | ||
119 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 81 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); |