From c4b45449ee571d919836caaf57ab63ff10110335 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 11 Dec 2008 17:23:55 +0000
Subject: * test: Add simple user profile test that checks for non-existing
 users

---
 .../Communications/Cache/UserProfileCacheService.cs    |  6 +++++-
 .../Tests/Cache/UserProfileCacheServiceTests.cs        | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 4 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 958ef4e..0cbb717 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Framework.Communications.Cache
         /// <summary>
         /// The root library folder.
         /// </summary>
-        public readonly LibraryRootFolder LibraryRoot;
+        public readonly InventoryFolderImpl LibraryRoot;
 
         /// <summary>
         /// Constructor
@@ -70,6 +70,10 @@ namespace OpenSim.Framework.Communications.Cache
         /// <summary>
         /// A new user has moved into a region in this instance so retrieve their profile from the user service.
         /// </summary>
+        /// 
+        /// 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
+        /// 
         /// <param name="userID"></param>
         public void AddNewUser(UUID userID)
         {
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index 0d239aa..03f4586 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
     {        
         /// <summary>
-        /// Test folder moving.  Doesn't do what is says on the tin yet
+        /// Test user details get.
         /// </summary>
         [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!");
         }  
     }
 }
-- 
cgit v1.1