diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 72c01bd5f6..b4af991d4b 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications /// public class CommunicationsManager { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Dictionary m_nameRequestCache = new Dictionary(); diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs index 500512ee58..ba231ca9ee 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 } /// - /// Test deleting an object asynchronously to user inventory. Doesn't yet do what it says on the tin. + /// Test deleting an object asynchronously to user inventory. /// [Test] public void TestDeleteSceneObjectAsyncToUserInventory() { - log4net.Config.XmlConfigurator.Configure(); + //log4net.Config.XmlConfigurator.Configure(); UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); + string myObjectName = "Fred"; TestScene scene = SceneTestUtils.SetupScene(); - SceneObjectPart part = SceneTestUtils.AddSceneObject(scene); + SceneObjectPart part = SceneTestUtils.AddSceneObject(scene, myObjectName); ((LocalUserServices)scene.CommsManager.UserService).AddPlugin(new TestUserDataPlugin()); ((LocalInventoryService)scene.CommsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin()); @@ -131,11 +132,16 @@ namespace OpenSim.Region.Environment.Scenes.Tests Assert.That(userInfo, Is.Not.Null); Assert.That(userInfo.RootFolder, Is.Not.Null); - SceneTestUtils.DeleteSceneObjectAsync(scene, part, DeRezAction.TakeCopy, userInfo.RootFolder.ID, client); + SceneTestUtils.DeleteSceneObjectAsync(scene, part, DeRezAction.Take, userInfo.RootFolder.ID, client); - // TODO: test that the object actually made it successfully into inventory + // Check that we now have the taken part in our inventory + Assert.That(myObjectName, Is.EqualTo(userInfo.RootFolder.FindItemByPath(myObjectName).Name)); - log4net.LogManager.Shutdown(); + // Check that the taken part has actually disappeared + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart, Is.Null); + + //log4net.LogManager.Shutdown(); } } } \ 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 b169d9a7fb..985c8a3ba0 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 return client; } + + /// + /// Add a test object + /// + /// + /// + public static SceneObjectPart AddSceneObject(Scene scene) + { + return AddSceneObject(scene, null); + } /// /// Add a test object /// /// + /// /// - public static SceneObjectPart AddSceneObject(Scene scene) + public static SceneObjectPart AddSceneObject(Scene scene, string name) { SceneObjectGroup sceneObject = new SceneObjectGroup(); SceneObjectPart part = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + + if (name != null) + part.Name = name; + //part.UpdatePrimFlags(false, false, true); part.ObjectFlags |= (uint)PrimFlags.Phantom; sceneObject.SetRootPart(part);