aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r--OpenSim/Tests/Common/Mock/TestInventoryService.cs15
-rw-r--r--OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs42
2 files changed, 51 insertions, 6 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs
index cf1a3a9..0c19164 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs
+++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs
@@ -43,6 +43,21 @@ namespace OpenSim.Tests.Common.Mock
43 return folders; 43 return folders;
44 } 44 }
45 45
46 public InventoryFolderBase GetRootFolder(UUID userID)
47 {
48 return new InventoryFolderBase();
49 }
50
51 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
52 {
53 return null;
54 }
55
56 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
57 {
58 return null;
59 }
60
46 /// <summary> 61 /// <summary>
47 /// Returns a list of all the active gestures in a user's inventory. 62 /// Returns a list of all the active gestures in a user's inventory.
48 /// </summary> 63 /// </summary>
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
index fc41166..f146a15 100644
--- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
@@ -41,28 +41,58 @@ namespace OpenSim.Tests.Common.Setup
41 /// Create a test user with a standard inventory 41 /// Create a test user with a standard inventory
42 /// </summary> 42 /// </summary>
43 /// <param name="commsManager"></param> 43 /// <param name="commsManager"></param>
44 /// <param name="callback">
45 /// Callback to invoke when inventory has been loaded. This is required because
46 /// loading may be asynchronous, even on standalone
47 /// </param>
44 /// <returns></returns> 48 /// <returns></returns>
45 public static CachedUserInfo CreateUserWithInventory(CommunicationsManager commsManager) 49 public static CachedUserInfo CreateUserWithInventory(
50 CommunicationsManager commsManager, OnInventoryReceivedDelegate callback)
46 { 51 {
47 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); 52 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099");
48 return CreateUserWithInventory(commsManager, userId); 53 return CreateUserWithInventory(commsManager, userId, callback);
49 } 54 }
50 55
51 /// <summary> 56 /// <summary>
52 /// Create a test user with a standard inventory 57 /// Create a test user with a standard inventory
53 /// </summary> 58 /// </summary>
54 /// <param name="commsManager"></param> 59 /// <param name="commsManager"></param>
55 /// <param name="userId">Explicit user id to use for user creation</param> 60 /// <param name="userId">User ID</param>
61 /// <param name="callback">
62 /// Callback to invoke when inventory has been loaded. This is required because
63 /// loading may be asynchronous, even on standalone
64 /// </param>
56 /// <returns></returns> 65 /// <returns></returns>
57 public static CachedUserInfo CreateUserWithInventory(CommunicationsManager commsManager, UUID userId) 66 public static CachedUserInfo CreateUserWithInventory(
67 CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback)
68 {
69 return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback);
70 }
71
72 /// <summary>
73 /// Create a test user with a standard inventory
74 /// </summary>
75 /// <param name="commsManager"></param>
76 /// <param name="firstName">First name of user</param>
77 /// <param name="lastName">Last name of user</param>
78 /// <param name="userId">User ID</param>
79 /// <param name="callback">
80 /// Callback to invoke when inventory has been loaded. This is required because
81 /// loading may be asynchronous, even on standalone
82 /// </param>
83 /// <returns></returns>
84 public static CachedUserInfo CreateUserWithInventory(
85 CommunicationsManager commsManager, string firstName, string lastName,
86 UUID userId, OnInventoryReceivedDelegate callback)
58 { 87 {
59 LocalUserServices lus = (LocalUserServices)commsManager.UserService; 88 LocalUserServices lus = (LocalUserServices)commsManager.UserService;
60 lus.AddUser("Bill", "Bailey", "troll", "bill@bailey.com", 1000, 1000, userId); 89 lus.AddUser(firstName, lastName, "troll", "bill@bailey.com", 1000, 1000, userId);
61 90
62 CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); 91 CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
92 userInfo.OnInventoryReceived += callback;
63 userInfo.FetchInventory(); 93 userInfo.FetchInventory();
64 94
65 return userInfo; 95 return userInfo;
66 } 96 }
67 } 97 }
68} 98}