* test: Add simple user profile test that checks for non-existing users

0.6.1-post-fixes
Justin Clarke Casey 2008-12-11 17:23:55 +00:00
parent e02aaaf9db
commit c4b45449ee
3 changed files with 25 additions and 4 deletions

View File

@ -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)
{

View File

@ -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!");
}
}
}

View File

@ -2387,6 +2387,7 @@
</Files>
</Project>
<!-- Test assemblies -->
<Project name="OpenSim.Tests.Infra.Mock" path="OpenSim/Tests/Infra/Mock" type="Library">
<Configuration name="Debug">
<Options>
@ -2613,7 +2614,11 @@
<Reference name="System"/>
<Reference name="log4net.dll"/>
<Reference name="nunit.framework.dll" />
<Reference name="OpenMetaverse.dll"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Region.Communications.Local"/>
<Reference name="OpenSim.Tests.Infra.Mock"/>
<Files>
<Match pattern="*.cs" recurse="true"/>