* Actually properly enable the purge folders test and correct some problems

0.6.1-post-fixes
Justin Clarke Casey 2008-12-12 20:04:58 +00:00
parent 185ad8edcb
commit 1531035b14
3 changed files with 25 additions and 5 deletions

View File

@ -26,6 +26,7 @@
*/
using System;
using log4net;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenMetaverse;
@ -161,8 +162,11 @@ namespace OpenSim.Framework.Communications.Tests
/// <summary>
/// Test purging an inventory folder
/// </summary>
[Test]
public void TestPurgeFolder()
{
//log4net.Config.XmlConfigurator.Configure();
IUserDataPlugin userDataPlugin = new TestUserDataPlugin();
IInventoryDataPlugin inventoryDataPlugin = new TestInventoryDataPlugin();
@ -174,6 +178,7 @@ namespace OpenSim.Framework.Communications.Tests
InventoryFolderImpl rootFolder = userInfo.RootFolder;
userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
Assert.That(inventoryDataPlugin.getInventoryFolder(folder1Id), Is.Not.Null);
// Test purge
userInfo.PurgeFolder(rootFolder.ID);

View File

@ -135,9 +135,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
// Check that the taken part has actually disappeared
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Null);
//log4net.LogManager.Shutdown();
Assert.That(retrievedPart, Is.Null);
}
}
}

View File

@ -87,7 +87,19 @@ namespace OpenSim.Tests.Common.Mock
return folder;
}
public List<InventoryFolderBase> getInventoryFolders(UUID parentID) { return null; }
public List<InventoryFolderBase> getInventoryFolders(UUID parentID)
{
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
foreach (InventoryFolderBase folder in m_folders.Values)
{
if (folder.ParentID == parentID)
folders.Add(folder);
}
return folders;
}
public InventoryItemBase getInventoryItem(UUID item) { return null; }
public InventoryFolderBase getInventoryFolder(UUID folderId)
@ -118,7 +130,12 @@ namespace OpenSim.Tests.Common.Mock
m_folders[folder.ID] = folder;
}
public void deleteInventoryFolder(UUID folder) {}
public void deleteInventoryFolder(UUID folderId)
{
if (m_folders.ContainsKey(folderId))
m_folders.Remove(folderId);
}
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; }
}
}