diff options
author | Justin Clarke Casey | 2009-02-03 20:13:34 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-03 20:13:34 +0000 |
commit | 2009d1aa01ca615dbcd4b69d3cab179741d9ee1f (patch) | |
tree | f5bf449fa6194041fd2a07dbd0de243822e33fb1 /OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | |
parent | * Lock the parts for the old group while we're clearing it as well - not much... (diff) | |
download | opensim-SC_OLD-2009d1aa01ca615dbcd4b69d3cab179741d9ee1f.zip opensim-SC_OLD-2009d1aa01ca615dbcd4b69d3cab179741d9ee1f.tar.gz opensim-SC_OLD-2009d1aa01ca615dbcd4b69d3cab179741d9ee1f.tar.bz2 opensim-SC_OLD-2009d1aa01ca615dbcd4b69d3cab179741d9ee1f.tar.xz |
* Fission SceneObjectTests into basic and linking sets
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Tests/SceneObjectLinkingTests.cs (renamed from OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs) | 103 |
1 files changed, 6 insertions, 97 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectLinkingTests.cs index 2164b0d..30b0987 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -40,67 +40,11 @@ using OpenSim.Tests.Common.Setup; | |||
40 | namespace OpenSim.Region.Environment.Scenes.Tests | 40 | namespace OpenSim.Region.Environment.Scenes.Tests |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// Scene object tests | 43 | /// Linking tests |
44 | /// </summary> | 44 | /// </summary> |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class SceneObjectTests | 46 | public class SceneObjectLinkingTests |
47 | { | 47 | { |
48 | /// <summary> | ||
49 | /// Test adding an object to a scene. | ||
50 | /// </summary> | ||
51 | [Test] | ||
52 | public void TestAddSceneObject() | ||
53 | { | ||
54 | Scene scene = SceneSetupHelpers.SetupScene(); | ||
55 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); | ||
56 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
57 | |||
58 | //System.Console.WriteLine("retrievedPart : {0}", retrievedPart); | ||
59 | // If the parts have the same UUID then we will consider them as one and the same | ||
60 | Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); | ||
61 | } | ||
62 | |||
63 | /// <summary> | ||
64 | /// Test deleting an object from a scene. | ||
65 | /// </summary> | ||
66 | [Test] | ||
67 | public void TestDeleteSceneObject() | ||
68 | { | ||
69 | TestScene scene = SceneSetupHelpers.SetupScene(); | ||
70 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); | ||
71 | scene.DeleteSceneObject(part.ParentGroup, false); | ||
72 | |||
73 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
74 | Assert.That(retrievedPart, Is.Null); | ||
75 | } | ||
76 | |||
77 | /// <summary> | ||
78 | /// Test deleting an object asynchronously | ||
79 | /// </summary> | ||
80 | [Test] | ||
81 | public void TestDeleteSceneObjectAsync() | ||
82 | { | ||
83 | UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); | ||
84 | |||
85 | TestScene scene = SceneSetupHelpers.SetupScene(); | ||
86 | |||
87 | // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. | ||
88 | AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; | ||
89 | sogd.Enabled = false; | ||
90 | |||
91 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); | ||
92 | |||
93 | IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); | ||
94 | scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); | ||
95 | |||
96 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
97 | Assert.That(retrievedPart, Is.Not.Null); | ||
98 | |||
99 | sogd.InventoryDeQueueAndDelete(); | ||
100 | SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); | ||
101 | Assert.That(retrievedPart2, Is.Null); | ||
102 | } | ||
103 | |||
104 | [Test] | 48 | [Test] |
105 | public void TestLinkDelink2SceneObjects() | 49 | public void TestLinkDelink2SceneObjects() |
106 | { | 50 | { |
@@ -300,41 +244,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
300 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) | 244 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) |
301 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) | 245 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) |
302 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); | 246 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); |
303 | } | 247 | } |
304 | |||
305 | /// <summary> | ||
306 | /// Test deleting an object asynchronously to user inventory. | ||
307 | /// </summary> | ||
308 | [Test] | ||
309 | public void TestDeleteSceneObjectAsyncToUserInventory() | ||
310 | { | ||
311 | //log4net.Config.XmlConfigurator.Configure(); | ||
312 | |||
313 | UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); | ||
314 | string myObjectName = "Fred"; | ||
315 | |||
316 | TestScene scene = SceneSetupHelpers.SetupScene(); | ||
317 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName); | ||
318 | |||
319 | Assert.That( | ||
320 | scene.CommsManager.UserAdminService.AddUser( | ||
321 | "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), | ||
322 | Is.EqualTo(agentId)); | ||
323 | |||
324 | IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); | ||
325 | |||
326 | CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId); | ||
327 | Assert.That(userInfo, Is.Not.Null); | ||
328 | Assert.That(userInfo.RootFolder, Is.Not.Null); | ||
329 | |||
330 | SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); | ||
331 | |||
332 | // Check that we now have the taken part in our inventory | ||
333 | Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name)); | ||
334 | |||
335 | // Check that the taken part has actually disappeared | ||
336 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | ||
337 | Assert.That(retrievedPart, Is.Null); | ||
338 | } | ||
339 | } | 248 | } |
340 | } \ No newline at end of file | 249 | } |