diff options
Diffstat (limited to 'OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs')
-rw-r--r-- | OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 150 |
1 files changed, 76 insertions, 74 deletions
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index cb76bc1..cd61fa6 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | |||
@@ -27,8 +27,7 @@ | |||
27 | 27 | ||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | using OpenSim.Framework.Communications; | 29 | using OpenSim.Framework.Communications; |
30 | using OpenSim.Framework.Communications.Cache; | 30 | |
31 | using OpenSim.Region.Communications.Local; | ||
32 | 31 | ||
33 | namespace OpenSim.Tests.Common.Setup | 32 | namespace OpenSim.Tests.Common.Setup |
34 | { | 33 | { |
@@ -37,82 +36,85 @@ namespace OpenSim.Tests.Common.Setup | |||
37 | /// </summary> | 36 | /// </summary> |
38 | public static class UserProfileTestUtils | 37 | public static class UserProfileTestUtils |
39 | { | 38 | { |
40 | /// <summary> | 39 | // REFACTORING PROBLEM |
41 | /// Create a test user with a standard inventory | 40 | // This needs to be rewritten |
42 | /// </summary> | 41 | |
43 | /// <param name="commsManager"></param> | 42 | ///// <summary> |
44 | /// <param name="callback"> | 43 | ///// Create a test user with a standard inventory |
45 | /// Callback to invoke when inventory has been loaded. This is required because | 44 | ///// </summary> |
46 | /// loading may be asynchronous, even on standalone | 45 | ///// <param name="commsManager"></param> |
47 | /// </param> | 46 | ///// <param name="callback"> |
48 | /// <returns></returns> | 47 | ///// Callback to invoke when inventory has been loaded. This is required because |
49 | public static CachedUserInfo CreateUserWithInventory( | 48 | ///// loading may be asynchronous, even on standalone |
50 | CommunicationsManager commsManager, OnInventoryReceivedDelegate callback) | 49 | ///// </param> |
51 | { | 50 | ///// <returns></returns> |
52 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); | 51 | //public static CachedUserInfo CreateUserWithInventory( |
53 | return CreateUserWithInventory(commsManager, userId, callback); | 52 | // CommunicationsManager commsManager, OnInventoryReceivedDelegate callback) |
54 | } | 53 | //{ |
54 | // UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); | ||
55 | // return CreateUserWithInventory(commsManager, userId, callback); | ||
56 | //} | ||
55 | 57 | ||
56 | /// <summary> | 58 | ///// <summary> |
57 | /// Create a test user with a standard inventory | 59 | ///// Create a test user with a standard inventory |
58 | /// </summary> | 60 | ///// </summary> |
59 | /// <param name="commsManager"></param> | 61 | ///// <param name="commsManager"></param> |
60 | /// <param name="userId">User ID</param> | 62 | ///// <param name="userId">User ID</param> |
61 | /// <param name="callback"> | 63 | ///// <param name="callback"> |
62 | /// Callback to invoke when inventory has been loaded. This is required because | 64 | ///// Callback to invoke when inventory has been loaded. This is required because |
63 | /// loading may be asynchronous, even on standalone | 65 | ///// loading may be asynchronous, even on standalone |
64 | /// </param> | 66 | ///// </param> |
65 | /// <returns></returns> | 67 | ///// <returns></returns> |
66 | public static CachedUserInfo CreateUserWithInventory( | 68 | //public static CachedUserInfo CreateUserWithInventory( |
67 | CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback) | 69 | // CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback) |
68 | { | 70 | //{ |
69 | return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback); | 71 | // return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback); |
70 | } | 72 | //} |
71 | 73 | ||
72 | /// <summary> | 74 | ///// <summary> |
73 | /// Create a test user with a standard inventory | 75 | ///// Create a test user with a standard inventory |
74 | /// </summary> | 76 | ///// </summary> |
75 | /// <param name="commsManager"></param> | 77 | ///// <param name="commsManager"></param> |
76 | /// <param name="firstName">First name of user</param> | 78 | ///// <param name="firstName">First name of user</param> |
77 | /// <param name="lastName">Last name of user</param> | 79 | ///// <param name="lastName">Last name of user</param> |
78 | /// <param name="userId">User ID</param> | 80 | ///// <param name="userId">User ID</param> |
79 | /// <param name="callback"> | 81 | ///// <param name="callback"> |
80 | /// Callback to invoke when inventory has been loaded. This is required because | 82 | ///// Callback to invoke when inventory has been loaded. This is required because |
81 | /// loading may be asynchronous, even on standalone | 83 | ///// loading may be asynchronous, even on standalone |
82 | /// </param> | 84 | ///// </param> |
83 | /// <returns></returns> | 85 | ///// <returns></returns> |
84 | public static CachedUserInfo CreateUserWithInventory( | 86 | //public static CachedUserInfo CreateUserWithInventory( |
85 | CommunicationsManager commsManager, string firstName, string lastName, | 87 | // CommunicationsManager commsManager, string firstName, string lastName, |
86 | UUID userId, OnInventoryReceivedDelegate callback) | 88 | // UUID userId, OnInventoryReceivedDelegate callback) |
87 | { | 89 | //{ |
88 | return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback); | 90 | // return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback); |
89 | } | 91 | //} |
90 | 92 | ||
91 | /// <summary> | 93 | ///// <summary> |
92 | /// Create a test user with a standard inventory | 94 | ///// Create a test user with a standard inventory |
93 | /// </summary> | 95 | ///// </summary> |
94 | /// <param name="commsManager"></param> | 96 | ///// <param name="commsManager"></param> |
95 | /// <param name="firstName">First name of user</param> | 97 | ///// <param name="firstName">First name of user</param> |
96 | /// <param name="lastName">Last name of user</param> | 98 | ///// <param name="lastName">Last name of user</param> |
97 | /// <param name="password">Password</param> | 99 | ///// <param name="password">Password</param> |
98 | /// <param name="userId">User ID</param> | 100 | ///// <param name="userId">User ID</param> |
99 | /// <param name="callback"> | 101 | ///// <param name="callback"> |
100 | /// Callback to invoke when inventory has been loaded. This is required because | 102 | ///// Callback to invoke when inventory has been loaded. This is required because |
101 | /// loading may be asynchronous, even on standalone | 103 | ///// loading may be asynchronous, even on standalone |
102 | /// </param> | 104 | ///// </param> |
103 | /// <returns></returns> | 105 | ///// <returns></returns> |
104 | public static CachedUserInfo CreateUserWithInventory( | 106 | //public static CachedUserInfo CreateUserWithInventory( |
105 | CommunicationsManager commsManager, string firstName, string lastName, string password, | 107 | // CommunicationsManager commsManager, string firstName, string lastName, string password, |
106 | UUID userId, OnInventoryReceivedDelegate callback) | 108 | // UUID userId, OnInventoryReceivedDelegate callback) |
107 | { | 109 | //{ |
108 | LocalUserServices lus = (LocalUserServices)commsManager.UserService; | 110 | // LocalUserServices lus = (LocalUserServices)commsManager.UserService; |
109 | lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId); | 111 | // lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId); |
110 | 112 | ||
111 | CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); | 113 | // CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); |
112 | userInfo.OnInventoryReceived += callback; | 114 | // userInfo.OnInventoryReceived += callback; |
113 | userInfo.FetchInventory(); | 115 | // userInfo.FetchInventory(); |
114 | 116 | ||
115 | return userInfo; | 117 | // return userInfo; |
116 | } | 118 | //} |
117 | } | 119 | } |
118 | } | 120 | } |