diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-11 20:32:05 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-11 20:32:05 -0400 |
commit | 2e9fc9a22b9718bb96934ed3b51ac0767f9ca4f3 (patch) | |
tree | b8a0cc747dd73da553d8d3504d3c842d9283be73 /OpenSim/Tests/Common/Setup | |
parent | Try something to help the tests complete. (diff) | |
parent | Fixes a race condition in EQ processing that was making EQs pop up again upon... (diff) | |
download | opensim-SC_OLD-2e9fc9a22b9718bb96934ed3b51ac0767f9ca4f3.zip opensim-SC_OLD-2e9fc9a22b9718bb96934ed3b51ac0767f9ca4f3.tar.gz opensim-SC_OLD-2e9fc9a22b9718bb96934ed3b51ac0767f9ca4f3.tar.bz2 opensim-SC_OLD-2e9fc9a22b9718bb96934ed3b51ac0767f9ca4f3.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Tests/Common/Setup')
-rw-r--r-- | OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 42 |
1 files changed, 36 insertions, 6 deletions
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 | } |