From c4b45449ee571d919836caaf57ab63ff10110335 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 11 Dec 2008 17:23:55 +0000 Subject: [PATCH] * test: Add simple user profile test that checks for non-existing users --- .../Cache/UserProfileCacheService.cs | 6 +++++- .../Cache/UserProfileCacheServiceTests.cs | 18 +++++++++++++++--- prebuild.xml | 5 +++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 958ef4e0b6..0cbb717627 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -54,7 +54,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// The root library folder. /// - public readonly LibraryRootFolder LibraryRoot; + public readonly InventoryFolderImpl LibraryRoot; /// /// Constructor @@ -70,6 +70,10 @@ namespace OpenSim.Framework.Communications.Cache /// /// A new user has moved into a region in this instance so retrieve their profile from the user service. /// + /// + /// It isn't strictly necessary to make this call since user data can be lazily requested later on. However, + /// it might be helpful in order to avoid an initial response delay later on + /// /// public void AddNewUser(UUID userID) { diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs index 0d239aab72..03f4586c41 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs @@ -27,6 +27,11 @@ using System; using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework.Communications.Cache; +using OpenSim.Region.Communications.Local; +using OpenSim.Tests.Infra.Mock; namespace OpenSim.Framework.Communications.Tests { @@ -37,12 +42,19 @@ namespace OpenSim.Framework.Communications.Tests public class UserProfileCacheServiceTests { /// - /// Test folder moving. Doesn't do what is says on the tin yet + /// Test user details get. /// [Test] - public void TestMoveFolder() + public void TestGetUserDetails() { - // Temporarily empty + UUID nonExistingUserId = UUID.Parse("00000000-0000-0000-0000-000000000001"); + + CommunicationsManager commsManager = new TestCommunicationsManager(); + ((LocalUserServices)commsManager.UserService).AddPlugin(new TestUserDataPlugin()); + ((LocalInventoryService)commsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin()); + + CachedUserInfo nonExistingUserInfo = commsManager.UserProfileCacheService.GetUserDetails(nonExistingUserId); + Assert.That(nonExistingUserInfo, Is.Null, "Non existing user info unexpectedly exists!"); } } } diff --git a/prebuild.xml b/prebuild.xml index 904ea60282..de9955ed04 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2387,6 +2387,7 @@ + @@ -2613,7 +2614,11 @@ + + + +