From 1531035b14367cfa44986e4a733524391d58af93 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 12 Dec 2008 20:04:58 +0000
Subject: * Actually properly enable the purge folders test and correct some
problems
---
.../Tests/Cache/UserProfileCacheServiceTests.cs | 5 +++++
.../Environment/Scenes/Tests/SceneObjectTests.cs | 4 +---
.../Tests/Common/Mock/TestInventoryDataPlugin.cs | 21 +++++++++++++++++++--
3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index 2196d25..0914bfb 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -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
///
/// Test purging an inventory folder
///
+ [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);
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index b073fd1..62a828e 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -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);
}
}
}
\ No newline at end of file
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
index 52b469b..808c212 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs
@@ -87,7 +87,19 @@ namespace OpenSim.Tests.Common.Mock
return folder;
}
- public List getInventoryFolders(UUID parentID) { return null; }
+ public List getInventoryFolders(UUID parentID)
+ {
+ List folders = new List();
+
+ 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 fetchActiveGestures(UUID avatarID) { return null; }
}
}
--
cgit v1.1