diff options
author | Justin Clarke Casey | 2008-12-11 17:23:55 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-12-11 17:23:55 +0000 |
commit | c4b45449ee571d919836caaf57ab63ff10110335 (patch) | |
tree | 212e018b0705e60b13bcd343cba7f88fa6e28efa | |
parent | * minor: Move mock test classes into mock namespace (diff) | |
download | opensim-SC_OLD-c4b45449ee571d919836caaf57ab63ff10110335.zip opensim-SC_OLD-c4b45449ee571d919836caaf57ab63ff10110335.tar.gz opensim-SC_OLD-c4b45449ee571d919836caaf57ab63ff10110335.tar.bz2 opensim-SC_OLD-c4b45449ee571d919836caaf57ab63ff10110335.tar.xz |
* test: Add simple user profile test that checks for non-existing users
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs | 18 | ||||
-rw-r--r-- | 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 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 | |||
54 | /// <summary> | 54 | /// <summary> |
55 | /// The root library folder. | 55 | /// The root library folder. |
56 | /// </summary> | 56 | /// </summary> |
57 | public readonly LibraryRootFolder LibraryRoot; | 57 | public readonly InventoryFolderImpl LibraryRoot; |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Constructor | 60 | /// Constructor |
@@ -70,6 +70,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
70 | /// <summary> | 70 | /// <summary> |
71 | /// A new user has moved into a region in this instance so retrieve their profile from the user service. | 71 | /// A new user has moved into a region in this instance so retrieve their profile from the user service. |
72 | /// </summary> | 72 | /// </summary> |
73 | /// | ||
74 | /// It isn't strictly necessary to make this call since user data can be lazily requested later on. However, | ||
75 | /// it might be helpful in order to avoid an initial response delay later on | ||
76 | /// | ||
73 | /// <param name="userID"></param> | 77 | /// <param name="userID"></param> |
74 | public void AddNewUser(UUID userID) | 78 | public void AddNewUser(UUID userID) |
75 | { | 79 | { |
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 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using NUnit.Framework; | 29 | using NUnit.Framework; |
30 | using NUnit.Framework.SyntaxHelpers; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework.Communications.Cache; | ||
33 | using OpenSim.Region.Communications.Local; | ||
34 | using OpenSim.Tests.Infra.Mock; | ||
30 | 35 | ||
31 | namespace OpenSim.Framework.Communications.Tests | 36 | namespace OpenSim.Framework.Communications.Tests |
32 | { | 37 | { |
@@ -37,12 +42,19 @@ namespace OpenSim.Framework.Communications.Tests | |||
37 | public class UserProfileCacheServiceTests | 42 | public class UserProfileCacheServiceTests |
38 | { | 43 | { |
39 | /// <summary> | 44 | /// <summary> |
40 | /// Test folder moving. Doesn't do what is says on the tin yet | 45 | /// Test user details get. |
41 | /// </summary> | 46 | /// </summary> |
42 | [Test] | 47 | [Test] |
43 | public void TestMoveFolder() | 48 | public void TestGetUserDetails() |
44 | { | 49 | { |
45 | // Temporarily empty | 50 | UUID nonExistingUserId = UUID.Parse("00000000-0000-0000-0000-000000000001"); |
51 | |||
52 | CommunicationsManager commsManager = new TestCommunicationsManager(); | ||
53 | ((LocalUserServices)commsManager.UserService).AddPlugin(new TestUserDataPlugin()); | ||
54 | ((LocalInventoryService)commsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin()); | ||
55 | |||
56 | CachedUserInfo nonExistingUserInfo = commsManager.UserProfileCacheService.GetUserDetails(nonExistingUserId); | ||
57 | Assert.That(nonExistingUserInfo, Is.Null, "Non existing user info unexpectedly exists!"); | ||
46 | } | 58 | } |
47 | } | 59 | } |
48 | } | 60 | } |
diff --git a/prebuild.xml b/prebuild.xml index 904ea60..de9955e 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -2387,6 +2387,7 @@ | |||
2387 | </Files> | 2387 | </Files> |
2388 | </Project> | 2388 | </Project> |
2389 | 2389 | ||
2390 | <!-- Test assemblies --> | ||
2390 | <Project name="OpenSim.Tests.Infra.Mock" path="OpenSim/Tests/Infra/Mock" type="Library"> | 2391 | <Project name="OpenSim.Tests.Infra.Mock" path="OpenSim/Tests/Infra/Mock" type="Library"> |
2391 | <Configuration name="Debug"> | 2392 | <Configuration name="Debug"> |
2392 | <Options> | 2393 | <Options> |
@@ -2613,7 +2614,11 @@ | |||
2613 | <Reference name="System"/> | 2614 | <Reference name="System"/> |
2614 | <Reference name="log4net.dll"/> | 2615 | <Reference name="log4net.dll"/> |
2615 | <Reference name="nunit.framework.dll" /> | 2616 | <Reference name="nunit.framework.dll" /> |
2617 | <Reference name="OpenMetaverse.dll"/> | ||
2618 | <Reference name="OpenMetaverseTypes.dll"/> | ||
2616 | <Reference name="OpenSim.Framework.Communications"/> | 2619 | <Reference name="OpenSim.Framework.Communications"/> |
2620 | <Reference name="OpenSim.Region.Communications.Local"/> | ||
2621 | <Reference name="OpenSim.Tests.Infra.Mock"/> | ||
2617 | 2622 | ||
2618 | <Files> | 2623 | <Files> |
2619 | <Match pattern="*.cs" recurse="true"/> | 2624 | <Match pattern="*.cs" recurse="true"/> |