diff options
author | BlueWall | 2011-03-21 22:06:43 -0400 |
---|---|---|
committer | BlueWall | 2011-03-21 22:06:43 -0400 |
commit | e3c327a305dcf795f372b940f34538a19bf92218 (patch) | |
tree | b034355a12c4d87410809aa19bf6015e611e1e22 /OpenSim/Region/Framework/Scenes/Tests | |
parent | Merge branch 'master' of /home/opensim/src/OpenSim/Core (diff) | |
parent | Thanks Kevin Cozens for a patch that: (diff) | |
download | opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.zip opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.tar.gz opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.tar.bz2 opensim-SC_OLD-e3c327a305dcf795f372b940f34538a19bf92218.tar.xz |
Merge branch 'master' of /home/opensim/src/OpenSim/Core
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
12 files changed, 288 insertions, 101 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs new file mode 100644 index 0000000..855b589 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using System.Threading; | ||
33 | using System.Timers; | ||
34 | using Timer=System.Timers.Timer; | ||
35 | using Nini.Config; | ||
36 | using NUnit.Framework; | ||
37 | using OpenMetaverse; | ||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.Framework.Scenes; | ||
41 | using OpenSim.Region.Framework.Interfaces; | ||
42 | using OpenSim.Region.CoreModules.World.Serialiser; | ||
43 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | ||
44 | using OpenSim.Tests.Common; | ||
45 | using OpenSim.Tests.Common.Mock; | ||
46 | using OpenSim.Tests.Common.Setup; | ||
47 | |||
48 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
49 | { | ||
50 | /// <summary> | ||
51 | /// Attachment tests | ||
52 | /// </summary> | ||
53 | [TestFixture] | ||
54 | public class AttachmentTests | ||
55 | { | ||
56 | public Scene scene, scene2; | ||
57 | public UUID agent1; | ||
58 | public static Random random; | ||
59 | public ulong region1, region2; | ||
60 | public AgentCircuitData acd1; | ||
61 | public SceneObjectGroup sog1, sog2, sog3; | ||
62 | |||
63 | [TestFixtureSetUp] | ||
64 | public void Init() | ||
65 | { | ||
66 | TestHelper.InMethod(); | ||
67 | |||
68 | scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); | ||
69 | scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); | ||
70 | |||
71 | ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); | ||
72 | interregionComms.Initialise(new IniConfigSource()); | ||
73 | interregionComms.PostInitialise(); | ||
74 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); | ||
75 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); | ||
76 | |||
77 | agent1 = UUID.Random(); | ||
78 | random = new Random(); | ||
79 | sog1 = NewSOG(UUID.Random(), scene, agent1); | ||
80 | sog2 = NewSOG(UUID.Random(), scene, agent1); | ||
81 | sog3 = NewSOG(UUID.Random(), scene, agent1); | ||
82 | |||
83 | //ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); | ||
84 | region1 = scene.RegionInfo.RegionHandle; | ||
85 | region2 = scene2.RegionInfo.RegionHandle; | ||
86 | |||
87 | SceneSetupHelpers.AddRootAgent(scene, agent1); | ||
88 | } | ||
89 | |||
90 | [Test] | ||
91 | public void T030_TestAddAttachments() | ||
92 | { | ||
93 | TestHelper.InMethod(); | ||
94 | |||
95 | ScenePresence presence = scene.GetScenePresence(agent1); | ||
96 | |||
97 | presence.AddAttachment(sog1); | ||
98 | presence.AddAttachment(sog2); | ||
99 | presence.AddAttachment(sog3); | ||
100 | |||
101 | Assert.That(presence.HasAttachments(), Is.True); | ||
102 | Assert.That(presence.ValidateAttachments(), Is.True); | ||
103 | } | ||
104 | |||
105 | [Test] | ||
106 | public void T031_RemoveAttachments() | ||
107 | { | ||
108 | TestHelper.InMethod(); | ||
109 | |||
110 | ScenePresence presence = scene.GetScenePresence(agent1); | ||
111 | presence.RemoveAttachment(sog1); | ||
112 | presence.RemoveAttachment(sog2); | ||
113 | presence.RemoveAttachment(sog3); | ||
114 | Assert.That(presence.HasAttachments(), Is.False); | ||
115 | } | ||
116 | |||
117 | // I'm commenting this test because scene setup NEEDS InventoryService to | ||
118 | // be non-null | ||
119 | //[Test] | ||
120 | public void T032_CrossAttachments() | ||
121 | { | ||
122 | TestHelper.InMethod(); | ||
123 | |||
124 | ScenePresence presence = scene.GetScenePresence(agent1); | ||
125 | ScenePresence presence2 = scene2.GetScenePresence(agent1); | ||
126 | presence2.AddAttachment(sog1); | ||
127 | presence2.AddAttachment(sog2); | ||
128 | |||
129 | ISharedRegionModule serialiser = new SerialiserModule(); | ||
130 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); | ||
131 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); | ||
132 | |||
133 | Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); | ||
134 | |||
135 | //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); | ||
136 | Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); | ||
137 | Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); | ||
138 | } | ||
139 | |||
140 | private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent) | ||
141 | { | ||
142 | SceneObjectPart sop = new SceneObjectPart(); | ||
143 | sop.Name = RandomName(); | ||
144 | sop.Description = RandomName(); | ||
145 | sop.Text = RandomName(); | ||
146 | sop.SitName = RandomName(); | ||
147 | sop.TouchName = RandomName(); | ||
148 | sop.UUID = uuid; | ||
149 | sop.Shape = PrimitiveBaseShape.Default; | ||
150 | sop.Shape.State = 1; | ||
151 | sop.OwnerID = agent; | ||
152 | |||
153 | SceneObjectGroup sog = new SceneObjectGroup(sop); | ||
154 | sog.SetScene(scene); | ||
155 | |||
156 | return sog; | ||
157 | } | ||
158 | |||
159 | private static string RandomName() | ||
160 | { | ||
161 | StringBuilder name = new StringBuilder(); | ||
162 | int size = random.Next(5,12); | ||
163 | char ch; | ||
164 | for (int i = 0; i < size; i++) | ||
165 | { | ||
166 | ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; | ||
167 | name.Append(ch); | ||
168 | } | ||
169 | |||
170 | return name.ToString(); | ||
171 | } | ||
172 | } | ||
173 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index b3c3e22..667b74e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | |||
@@ -32,7 +32,6 @@ using System.Text; | |||
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using NUnit.Framework; | 34 | using NUnit.Framework; |
35 | using NUnit.Framework.SyntaxHelpers; | ||
36 | using OpenMetaverse; | 35 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | 37 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 9244bc3..ca635d7 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | |||
@@ -28,7 +28,6 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | ||
32 | using OpenMetaverse; | 31 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | 33 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 4969b09..a6a95ef 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -28,7 +28,6 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | ||
32 | using OpenMetaverse; | 31 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | 33 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index 39116b6..0d26026 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | |||
@@ -30,7 +30,6 @@ using System.Collections.Generic; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using NUnit.Framework.SyntaxHelpers; | ||
34 | using OpenMetaverse; | 33 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index b84298f..bdfcd1d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -29,7 +29,6 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using NUnit.Framework.SyntaxHelpers; | ||
33 | using OpenMetaverse; | 32 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 34 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index c78038f..8876a43 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | |||
@@ -30,7 +30,6 @@ using System.Collections.Generic; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using NUnit.Framework.SyntaxHelpers; | ||
34 | using OpenMetaverse; | 33 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ef52363..efb757f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -34,12 +34,12 @@ using System.Timers; | |||
34 | using Timer=System.Timers.Timer; | 34 | using Timer=System.Timers.Timer; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using NUnit.Framework; | 36 | using NUnit.Framework; |
37 | using NUnit.Framework.SyntaxHelpers; | ||
38 | using OpenMetaverse; | 37 | using OpenMetaverse; |
39 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | 39 | using OpenSim.Framework.Communications; |
41 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; | ||
43 | using OpenSim.Region.CoreModules.World.Serialiser; | 43 | using OpenSim.Region.CoreModules.World.Serialiser; |
44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | 44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; |
45 | using OpenSim.Tests.Common; | 45 | using OpenSim.Tests.Common; |
@@ -116,9 +116,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
116 | agent.ChildrenCapSeeds = new Dictionary<ulong, string>(); | 116 | agent.ChildrenCapSeeds = new Dictionary<ulong, string>(); |
117 | agent.child = true; | 117 | agent.child = true; |
118 | 118 | ||
119 | if (scene.PresenceService == null) | ||
120 | Console.WriteLine("Presence Service is null"); | ||
121 | |||
122 | scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID); | 119 | scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID); |
123 | 120 | ||
124 | string reason; | 121 | string reason; |
@@ -175,25 +172,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
175 | 172 | ||
176 | Assert.That(neighbours.Count, Is.EqualTo(2)); | 173 | Assert.That(neighbours.Count, Is.EqualTo(2)); |
177 | } | 174 | } |
178 | |||
179 | public void fixNullPresence() | ||
180 | { | ||
181 | string firstName = "testfirstname"; | ||
182 | |||
183 | AgentCircuitData agent = new AgentCircuitData(); | ||
184 | agent.AgentID = agent1; | ||
185 | agent.firstname = firstName; | ||
186 | agent.lastname = "testlastname"; | ||
187 | agent.SessionID = UUID.Zero; | ||
188 | agent.SecureSessionID = UUID.Zero; | ||
189 | agent.circuitcode = 123; | ||
190 | agent.BaseFolder = UUID.Zero; | ||
191 | agent.InventoryFolder = UUID.Zero; | ||
192 | agent.startpos = Vector3.Zero; | ||
193 | agent.CapsPath = GetRandomCapsObjectPath(); | ||
194 | |||
195 | acd1 = agent; | ||
196 | } | ||
197 | 175 | ||
198 | [Test] | 176 | [Test] |
199 | public void T013_TestRemoveNeighbourRegion() | 177 | public void T013_TestRemoveNeighbourRegion() |
@@ -211,24 +189,36 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
211 | CompleteAvatarMovement | 189 | CompleteAvatarMovement |
212 | */ | 190 | */ |
213 | } | 191 | } |
214 | 192 | ||
215 | // I'm commenting this test, because this is not supposed to happen here | 193 | /// <summary> |
216 | //[Test] | 194 | /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region |
217 | public void T020_TestMakeRootAgent() | 195 | /// </summary> |
196 | /// <remarks> | ||
197 | /// Please note that unlike the other tests here, this doesn't rely on structures | ||
198 | /// </remarks> | ||
199 | [Test] | ||
200 | public void TestChildAgentEstablished() | ||
218 | { | 201 | { |
219 | TestHelper.InMethod(); | 202 | TestHelper.InMethod(); |
220 | 203 | // log4net.Config.XmlConfigurator.Configure(); | |
221 | ScenePresence presence = scene.GetScenePresence(agent1); | 204 | |
222 | Assert.That(presence.IsChildAgent, Is.False, "Starts out as a root agent"); | 205 | UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); |
223 | 206 | ||
224 | presence.MakeChildAgent(); | 207 | TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); |
225 | Assert.That(presence.IsChildAgent, Is.True, "Did not change to child agent after MakeChildAgent"); | 208 | TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); |
226 | 209 | ||
227 | // Accepts 0 but rejects Constants.RegionSize | 210 | IConfigSource configSource = new IniConfigSource(); |
228 | Vector3 pos = new Vector3(0,unchecked(Constants.RegionSize-1),0); | 211 | configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); |
229 | presence.MakeRootAgent(pos,true); | 212 | EntityTransferModule etm = new EntityTransferModule(); |
230 | Assert.That(presence.IsChildAgent, Is.False, "Did not go back to root agent"); | 213 | |
231 | Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); | 214 | SceneSetupHelpers.SetupSceneModules(myScene1, configSource, etm); |
215 | |||
216 | SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); | ||
217 | ScenePresence childPresence = myScene2.GetScenePresence(agent1); | ||
218 | |||
219 | // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents | ||
220 | // Assert.That(childPresence, Is.Not.Null); | ||
221 | // Assert.That(childPresence.IsChildAgent, Is.True); | ||
232 | } | 222 | } |
233 | 223 | ||
234 | // I'm commenting this test because it does not represent | 224 | // I'm commenting this test because it does not represent |
@@ -333,63 +323,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
333 | Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); | 323 | Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); |
334 | Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); | 324 | Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); |
335 | } | 325 | } |
336 | 326 | ||
337 | [Test] | 327 | public void fixNullPresence() |
338 | public void T030_TestAddAttachments() | ||
339 | { | ||
340 | TestHelper.InMethod(); | ||
341 | |||
342 | ScenePresence presence = scene.GetScenePresence(agent1); | ||
343 | |||
344 | presence.AddAttachment(sog1); | ||
345 | presence.AddAttachment(sog2); | ||
346 | presence.AddAttachment(sog3); | ||
347 | |||
348 | Assert.That(presence.HasAttachments(), Is.True); | ||
349 | Assert.That(presence.ValidateAttachments(), Is.True); | ||
350 | } | ||
351 | |||
352 | [Test] | ||
353 | public void T031_RemoveAttachments() | ||
354 | { | ||
355 | TestHelper.InMethod(); | ||
356 | |||
357 | ScenePresence presence = scene.GetScenePresence(agent1); | ||
358 | presence.RemoveAttachment(sog1); | ||
359 | presence.RemoveAttachment(sog2); | ||
360 | presence.RemoveAttachment(sog3); | ||
361 | Assert.That(presence.HasAttachments(), Is.False); | ||
362 | } | ||
363 | |||
364 | // I'm commenting this test because scene setup NEEDS InventoryService to | ||
365 | // be non-null | ||
366 | //[Test] | ||
367 | public void T032_CrossAttachments() | ||
368 | { | 328 | { |
369 | TestHelper.InMethod(); | 329 | string firstName = "testfirstname"; |
370 | |||
371 | ScenePresence presence = scene.GetScenePresence(agent1); | ||
372 | ScenePresence presence2 = scene2.GetScenePresence(agent1); | ||
373 | presence2.AddAttachment(sog1); | ||
374 | presence2.AddAttachment(sog2); | ||
375 | |||
376 | ISharedRegionModule serialiser = new SerialiserModule(); | ||
377 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); | ||
378 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); | ||
379 | |||
380 | Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); | ||
381 | 330 | ||
382 | //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); | 331 | AgentCircuitData agent = new AgentCircuitData(); |
383 | Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); | 332 | agent.AgentID = agent1; |
384 | Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); | 333 | agent.firstname = firstName; |
385 | } | 334 | agent.lastname = "testlastname"; |
335 | agent.SessionID = UUID.Zero; | ||
336 | agent.SecureSessionID = UUID.Zero; | ||
337 | agent.circuitcode = 123; | ||
338 | agent.BaseFolder = UUID.Zero; | ||
339 | agent.InventoryFolder = UUID.Zero; | ||
340 | agent.startpos = Vector3.Zero; | ||
341 | agent.CapsPath = GetRandomCapsObjectPath(); | ||
386 | 342 | ||
387 | [TearDown] | 343 | acd1 = agent; |
388 | public void TearDown() | ||
389 | { | ||
390 | if (MainServer.Instance != null) MainServer.Instance.Stop(); | ||
391 | } | 344 | } |
392 | 345 | ||
393 | public static string GetRandomCapsObjectPath() | 346 | public static string GetRandomCapsObjectPath() |
394 | { | 347 | { |
395 | UUID caps = UUID.Random(); | 348 | UUID caps = UUID.Random(); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs new file mode 100644 index 0000000..abcce66 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using System.Threading; | ||
33 | using System.Timers; | ||
34 | using Timer=System.Timers.Timer; | ||
35 | using Nini.Config; | ||
36 | using NUnit.Framework; | ||
37 | using OpenMetaverse; | ||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.Framework.Scenes; | ||
41 | using OpenSim.Region.Framework.Interfaces; | ||
42 | using OpenSim.Region.CoreModules.World.Serialiser; | ||
43 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | ||
44 | using OpenSim.Tests.Common; | ||
45 | using OpenSim.Tests.Common.Mock; | ||
46 | using OpenSim.Tests.Common.Setup; | ||
47 | |||
48 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
49 | { | ||
50 | /// <summary> | ||
51 | /// Scene presence tests | ||
52 | /// </summary> | ||
53 | [TestFixture] | ||
54 | public class SceneTests | ||
55 | { | ||
56 | /// <summary> | ||
57 | /// Very basic scene update test. Should become more elaborate with time. | ||
58 | /// </summary> | ||
59 | [Test] | ||
60 | public void TestUpdateScene() | ||
61 | { | ||
62 | TestHelper.InMethod(); | ||
63 | |||
64 | Scene scene = SceneSetupHelpers.SetupScene(); | ||
65 | scene.Update(); | ||
66 | |||
67 | Assert.That(scene.Frame, Is.EqualTo(1)); | ||
68 | } | ||
69 | } | ||
70 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs index cafe48a..8588f7f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs | |||
@@ -29,7 +29,6 @@ using System; | |||
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using NUnit.Framework.SyntaxHelpers; | ||
33 | using OpenMetaverse; | 32 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 34 | using OpenSim.Framework.Communications; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index fe59d4f..8138bcc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -34,7 +34,6 @@ using System.Timers; | |||
34 | using Timer=System.Timers.Timer; | 34 | using Timer=System.Timers.Timer; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | using NUnit.Framework; | 36 | using NUnit.Framework; |
37 | using NUnit.Framework.SyntaxHelpers; | ||
38 | using OpenMetaverse; | 37 | using OpenMetaverse; |
39 | using OpenMetaverse.Assets; | 38 | using OpenMetaverse.Assets; |
40 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index 5e6124b..6b70865 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs | |||
@@ -28,7 +28,6 @@ | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Text; | 29 | using System.Text; |
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | ||
32 | using OpenMetaverse; | 31 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |