diff options
author | Justin Clarke Casey | 2008-11-28 20:58:12 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-28 20:58:12 +0000 |
commit | 5f9ccd486f9f8317cce3badcb62d646766c5642c (patch) | |
tree | 6c6b9e227834c249fdf793b7a5488fe38ed0ebec | |
parent | * Fixes Location == Location, and Location != Location (diff) | |
download | opensim-SC_OLD-5f9ccd486f9f8317cce3badcb62d646766c5642c.zip opensim-SC_OLD-5f9ccd486f9f8317cce3badcb62d646766c5642c.tar.gz opensim-SC_OLD-5f9ccd486f9f8317cce3badcb62d646766c5642c.tar.bz2 opensim-SC_OLD-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
3 files changed, 29 insertions, 8 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 72c01bd..b4af991 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications | |||
40 | /// </summary> | 40 | /// </summary> |
41 | public class CommunicationsManager | 41 | public class CommunicationsManager |
42 | { | 42 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | protected Dictionary<UUID, string[]> m_nameRequestCache = new Dictionary<UUID, string[]>(); | 45 | protected Dictionary<UUID, string[]> m_nameRequestCache = new Dictionary<UUID, string[]>(); |
46 | 46 | ||
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); |