aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-28 20:58:12 +0000
committerJustin Clarke Casey2008-11-28 20:58:12 +0000
commit5f9ccd486f9f8317cce3badcb62d646766c5642c (patch)
tree6c6b9e227834c249fdf793b7a5488fe38ed0ebec /OpenSim/Region/Environment/Scenes
parent* Fixes Location == Location, and Location != Location (diff)
downloadopensim-SC-5f9ccd486f9f8317cce3badcb62d646766c5642c.zip
opensim-SC-5f9ccd486f9f8317cce3badcb62d646766c5642c.tar.gz
opensim-SC-5f9ccd486f9f8317cce3badcb62d646766c5642c.tar.bz2
opensim-SC-5f9ccd486f9f8317cce3badcb62d646766c5642c.tar.xz
* test: Extend take object test to finally check that the object made it into user inventory and that it was removed from the scene
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs17
2 files changed, 28 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index 500512e..ba231ca 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -105,17 +105,18 @@ namespace OpenSim.Region.Environment.Scenes.Tests
105 } 105 }
106 106
107 /// <summary> 107 /// <summary>
108 /// Test deleting an object asynchronously to user inventory. Doesn't yet do what it says on the tin. 108 /// Test deleting an object asynchronously to user inventory.
109 /// </summary> 109 /// </summary>
110 [Test] 110 [Test]
111 public void TestDeleteSceneObjectAsyncToUserInventory() 111 public void TestDeleteSceneObjectAsyncToUserInventory()
112 { 112 {
113 log4net.Config.XmlConfigurator.Configure(); 113 //log4net.Config.XmlConfigurator.Configure();
114 114
115 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 115 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
116 string myObjectName = "Fred";
116 117
117 TestScene scene = SceneTestUtils.SetupScene(); 118 TestScene scene = SceneTestUtils.SetupScene();
118 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); 119 SceneObjectPart part = SceneTestUtils.AddSceneObject(scene, myObjectName);
119 120
120 ((LocalUserServices)scene.CommsManager.UserService).AddPlugin(new TestUserDataPlugin()); 121 ((LocalUserServices)scene.CommsManager.UserService).AddPlugin(new TestUserDataPlugin());
121 ((LocalInventoryService)scene.CommsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin()); 122 ((LocalInventoryService)scene.CommsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin());
@@ -131,11 +132,16 @@ namespace OpenSim.Region.Environment.Scenes.Tests
131 Assert.That(userInfo, Is.Not.Null); 132 Assert.That(userInfo, Is.Not.Null);
132 Assert.That(userInfo.RootFolder, Is.Not.Null); 133 Assert.That(userInfo.RootFolder, Is.Not.Null);
133 134
134 SceneTestUtils.DeleteSceneObjectAsync(scene, part, DeRezAction.TakeCopy, userInfo.RootFolder.ID, client); 135 SceneTestUtils.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client);
136
137 // Check that we now have the taken part in our inventory
138 Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name));
135 139
136 // TODO: test that the object actually made it successfully into inventory 140 // Check that the taken part has actually disappeared
141 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
142 Assert.That(retrievedPart, Is.Null);
137 143
138 log4net.LogManager.Shutdown(); 144 //log4net.LogManager.Shutdown();
139 } 145 }
140 } 146 }
141} \ No newline at end of file 147} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
index b169d9a..985c8a3 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs
@@ -111,17 +111,32 @@ namespace OpenSim.Region.Environment.Scenes.Tests
111 111
112 return client; 112 return client;
113 } 113 }
114
115 /// <summary>
116 /// Add a test object
117 /// </summary>
118 /// <param name="scene"></param>
119 /// <returns></returns>
120 public static SceneObjectPart AddSceneObject(Scene scene)
121 {
122 return AddSceneObject(scene, null);
123 }
114 124
115 /// <summary> 125 /// <summary>
116 /// Add a test object 126 /// Add a test object
117 /// </summary> 127 /// </summary>
118 /// <param name="scene"></param> 128 /// <param name="scene"></param>
129 /// <param name="name"></param>
119 /// <returns></returns> 130 /// <returns></returns>
120 public static SceneObjectPart AddSceneObject(Scene scene) 131 public static SceneObjectPart AddSceneObject(Scene scene, string name)
121 { 132 {
122 SceneObjectGroup sceneObject = new SceneObjectGroup(); 133 SceneObjectGroup sceneObject = new SceneObjectGroup();
123 SceneObjectPart part 134 SceneObjectPart part
124 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); 135 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
136
137 if (name != null)
138 part.Name = name;
139
125 //part.UpdatePrimFlags(false, false, true); 140 //part.UpdatePrimFlags(false, false, true);
126 part.ObjectFlags |= (uint)PrimFlags.Phantom; 141 part.ObjectFlags |= (uint)PrimFlags.Phantom;
127 sceneObject.SetRootPart(part); 142 sceneObject.SetRootPart(part);