aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs39
1 files changed, 20 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index e347e67..ae879bb 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework.Communications.Cache;
35using OpenSim.Region.Communications.Local; 35using OpenSim.Region.Communications.Local;
36using OpenSim.Region.Environment.Scenes; 36using OpenSim.Region.Environment.Scenes;
37using OpenSim.Tests.Common.Mock; 37using OpenSim.Tests.Common.Mock;
38using OpenSim.Tests.Common.Setup;
38 39
39namespace OpenSim.Region.Environment.Scenes.Tests 40namespace OpenSim.Region.Environment.Scenes.Tests
40{ 41{
@@ -50,8 +51,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
50 [Test] 51 [Test]
51 public void TestAddSceneObject() 52 public void TestAddSceneObject()
52 { 53 {
53 Scene scene = SceneTestUtils.SetupScene(); 54 Scene scene = SceneSetupHelpers.SetupScene();
54 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 55 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
55 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 56 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
56 57
57 //System.Console.WriteLine("retrievedPart : {0}", retrievedPart); 58 //System.Console.WriteLine("retrievedPart : {0}", retrievedPart);
@@ -65,8 +66,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests
65 [Test] 66 [Test]
66 public void TestDeleteSceneObject() 67 public void TestDeleteSceneObject()
67 { 68 {
68 TestScene scene = SceneTestUtils.SetupScene(); 69 TestScene scene = SceneSetupHelpers.SetupScene();
69 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 70 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
70 scene.DeleteSceneObject(part.ParentGroup, false); 71 scene.DeleteSceneObject(part.ParentGroup, false);
71 72
72 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 73 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
@@ -81,15 +82,15 @@ namespace OpenSim.Region.Environment.Scenes.Tests
81 { 82 {
82 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 83 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
83 84
84 TestScene scene = SceneTestUtils.SetupScene(); 85 TestScene scene = SceneSetupHelpers.SetupScene();
85 86
86 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 87 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
87 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 88 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
88 sogd.Enabled = false; 89 sogd.Enabled = false;
89 90
90 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 91 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
91 92
92 IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); 93 IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
93 scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); 94 scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero);
94 95
95 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 96 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
@@ -105,10 +106,10 @@ namespace OpenSim.Region.Environment.Scenes.Tests
105 { 106 {
106 bool debugtest = false; 107 bool debugtest = false;
107 108
108 Scene scene = SceneTestUtils.SetupScene(); 109 Scene scene = SceneSetupHelpers.SetupScene();
109 SceneObjectPart part1 = SceneTestUtils.AddSceneObject(scene); 110 SceneObjectPart part1 = SceneSetupHelpers.AddSceneObject(scene);
110 SceneObjectGroup grp1 = part1.ParentGroup; 111 SceneObjectGroup grp1 = part1.ParentGroup;
111 SceneObjectPart part2 = SceneTestUtils.AddSceneObject(scene); 112 SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
112 SceneObjectGroup grp2 = part2.ParentGroup; 113 SceneObjectGroup grp2 = part2.ParentGroup;
113 114
114 115
@@ -178,14 +179,14 @@ namespace OpenSim.Region.Environment.Scenes.Tests
178 { 179 {
179 bool debugtest = false; 180 bool debugtest = false;
180 181
181 Scene scene = SceneTestUtils.SetupScene(); 182 Scene scene = SceneSetupHelpers.SetupScene();
182 SceneObjectPart part1 = SceneTestUtils.AddSceneObject(scene); 183 SceneObjectPart part1 = SceneSetupHelpers.AddSceneObject(scene);
183 SceneObjectGroup grp1 = part1.ParentGroup; 184 SceneObjectGroup grp1 = part1.ParentGroup;
184 SceneObjectPart part2 = SceneTestUtils.AddSceneObject(scene); 185 SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
185 SceneObjectGroup grp2 = part2.ParentGroup; 186 SceneObjectGroup grp2 = part2.ParentGroup;
186 SceneObjectPart part3 = SceneTestUtils.AddSceneObject(scene); 187 SceneObjectPart part3 = SceneSetupHelpers.AddSceneObject(scene);
187 SceneObjectGroup grp3 = part3.ParentGroup; 188 SceneObjectGroup grp3 = part3.ParentGroup;
188 SceneObjectPart part4 = SceneTestUtils.AddSceneObject(scene); 189 SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene);
189 SceneObjectGroup grp4 = part4.ParentGroup; 190 SceneObjectGroup grp4 = part4.ParentGroup;
190 191
191 192
@@ -310,21 +311,21 @@ namespace OpenSim.Region.Environment.Scenes.Tests
310 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 311 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
311 string myObjectName = "Fred"; 312 string myObjectName = "Fred";
312 313
313 TestScene scene = SceneTestUtils.SetupScene(); 314 TestScene scene = SceneSetupHelpers.SetupScene();
314 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene, myObjectName); 315 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName);
315 316
316 Assert.That( 317 Assert.That(
317 scene.CommsManager.UserAdminService.AddUser( 318 scene.CommsManager.UserAdminService.AddUser(
318 "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), 319 "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId),
319 Is.EqualTo(agentId)); 320 Is.EqualTo(agentId));
320 321
321 IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); 322 IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
322 323
323 CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId); 324 CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(agentId);
324 Assert.That(userInfo, Is.Not.Null); 325 Assert.That(userInfo, Is.Not.Null);
325 Assert.That(userInfo.RootFolder, Is.Not.Null); 326 Assert.That(userInfo.RootFolder, Is.Not.Null);
326 327
327 SceneTestUtils.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); 328 SceneSetupHelpers.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client);
328 329
329 // Check that we now have the taken part in our inventory 330 // Check that we now have the taken part in our inventory
330 Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name)); 331 Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name));