* test: Extend take object test to finally check that the object made it into user inventory and that it was removed from the scene
parent
c9a5215d6d
commit
5f9ccd486f
|
@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CommunicationsManager
|
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<UUID, string[]> m_nameRequestCache = new Dictionary<UUID, string[]>();
|
protected Dictionary<UUID, string[]> m_nameRequestCache = new Dictionary<UUID, string[]>();
|
||||||
|
|
||||||
|
|
|
@ -105,17 +105,18 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeleteSceneObjectAsyncToUserInventory()
|
public void TestDeleteSceneObjectAsyncToUserInventory()
|
||||||
{
|
{
|
||||||
log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
||||||
|
string myObjectName = "Fred";
|
||||||
|
|
||||||
TestScene scene = SceneTestUtils.SetupScene();
|
TestScene scene = SceneTestUtils.SetupScene();
|
||||||
SceneObjectPart part = SceneTestUtils.AddSceneObject(scene);
|
SceneObjectPart part = SceneTestUtils.AddSceneObject(scene, myObjectName);
|
||||||
|
|
||||||
((LocalUserServices)scene.CommsManager.UserService).AddPlugin(new TestUserDataPlugin());
|
((LocalUserServices)scene.CommsManager.UserService).AddPlugin(new TestUserDataPlugin());
|
||||||
((LocalInventoryService)scene.CommsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin());
|
((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, Is.Not.Null);
|
||||||
Assert.That(userInfo.RootFolder, 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -118,10 +118,25 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static SceneObjectPart AddSceneObject(Scene scene)
|
public static SceneObjectPart AddSceneObject(Scene scene)
|
||||||
|
{
|
||||||
|
return AddSceneObject(scene, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a test object
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static SceneObjectPart AddSceneObject(Scene scene, string name)
|
||||||
{
|
{
|
||||||
SceneObjectGroup sceneObject = new SceneObjectGroup();
|
SceneObjectGroup sceneObject = new SceneObjectGroup();
|
||||||
SceneObjectPart part
|
SceneObjectPart part
|
||||||
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
|
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
|
||||||
|
|
||||||
|
if (name != null)
|
||||||
|
part.Name = name;
|
||||||
|
|
||||||
//part.UpdatePrimFlags(false, false, true);
|
//part.UpdatePrimFlags(false, false, true);
|
||||||
part.ObjectFlags |= (uint)PrimFlags.Phantom;
|
part.ObjectFlags |= (uint)PrimFlags.Phantom;
|
||||||
sceneObject.SetRootPart(part);
|
sceneObject.SetRootPart(part);
|
||||||
|
|
Loading…
Reference in New Issue