aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs')
-rw-r--r--OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs173
1 files changed, 94 insertions, 79 deletions
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
index cd61fa6..e6a7818 100644
--- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
@@ -27,7 +27,8 @@
27 27
28using OpenMetaverse; 28using OpenMetaverse;
29using OpenSim.Framework.Communications; 29using OpenSim.Framework.Communications;
30 30using OpenSim.Region.Framework.Scenes;
31using OpenSim.Services.Interfaces;
31 32
32namespace OpenSim.Tests.Common.Setup 33namespace OpenSim.Tests.Common.Setup
33{ 34{
@@ -36,85 +37,99 @@ namespace OpenSim.Tests.Common.Setup
36 /// </summary> 37 /// </summary>
37 public static class UserProfileTestUtils 38 public static class UserProfileTestUtils
38 { 39 {
39 // REFACTORING PROBLEM 40// /// <summary>
40 // This needs to be rewritten 41// /// Create a test user with a standard inventory
42// /// </summary>
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>
48// /// <returns></returns>
49// public static CachedUserInfo CreateUserWithInventory(
50// CommunicationsManager commsManager, OnInventoryReceivedDelegate callback)
51// {
52// UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099");
53// return CreateUserWithInventory(commsManager, userId, callback);
54// }
55//
56// /// <summary>
57// /// Create a test user with a standard inventory
58// /// </summary>
59// /// <param name="commsManager"></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>
65// /// <returns></returns>
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)
87// {
88// return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
89// }
90//
91// /// <summary>
92// /// Create a test user with a standard inventory
93// /// </summary>
94// /// <param name="commsManager"></param>
95// /// <param name="firstName">First name of user</param>
96// /// <param name="lastName">Last name of user</param>
97// /// <param name="password">Password</param>
98// /// <param name="userId">User ID</param>
99// /// <param name="callback">
100// /// Callback to invoke when inventory has been loaded. This is required because
101// /// loading may be asynchronous, even on standalone
102// /// </param>
103// /// <returns></returns>
104// public static CachedUserInfo CreateUserWithInventory(
105// CommunicationsManager commsManager, string firstName, string lastName, string password,
106// UUID userId, OnInventoryReceivedDelegate callback)
107// {
108// LocalUserServices lus = (LocalUserServices)commsManager.UserService;
109// lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId);
110//
111// CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
112// userInfo.OnInventoryReceived += callback;
113// userInfo.FetchInventory();
114//
115// return userInfo;
116// }
41 117
42 ///// <summary> 118 public static UserAccount CreateUserWithInventory(Scene scene)
43 ///// Create a test user with a standard inventory 119 {
44 ///// </summary> 120 return CreateUserWithInventory(
45 ///// <param name="commsManager"></param> 121 scene, "Bill", "Bailey", UUID.Parse("00000000-0000-0000-0000-000000000099"), "troll");
46 ///// <param name="callback"> 122 }
47 ///// Callback to invoke when inventory has been loaded. This is required because
48 ///// loading may be asynchronous, even on standalone
49 ///// </param>
50 ///// <returns></returns>
51 //public static CachedUserInfo CreateUserWithInventory(
52 // CommunicationsManager commsManager, OnInventoryReceivedDelegate callback)
53 //{
54 // UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099");
55 // return CreateUserWithInventory(commsManager, userId, callback);
56 //}
57
58 ///// <summary>
59 ///// Create a test user with a standard inventory
60 ///// </summary>
61 ///// <param name="commsManager"></param>
62 ///// <param name="userId">User ID</param>
63 ///// <param name="callback">
64 ///// Callback to invoke when inventory has been loaded. This is required because
65 ///// loading may be asynchronous, even on standalone
66 ///// </param>
67 ///// <returns></returns>
68 //public static CachedUserInfo CreateUserWithInventory(
69 // CommunicationsManager commsManager, UUID userId, OnInventoryReceivedDelegate callback)
70 //{
71 // return CreateUserWithInventory(commsManager, "Bill", "Bailey", userId, callback);
72 //}
73 123
74 ///// <summary> 124 public static UserAccount CreateUserWithInventory(
75 ///// Create a test user with a standard inventory 125 Scene scene, string firstName, string lastName, UUID userId, string pw)
76 ///// </summary> 126 {
77 ///// <param name="commsManager"></param> 127 UserAccount ua = new UserAccount(userId) { FirstName = firstName, LastName = lastName };
78 ///// <param name="firstName">First name of user</param> 128 scene.UserAccountService.StoreUserAccount(ua);
79 ///// <param name="lastName">Last name of user</param> 129 scene.InventoryService.CreateUserInventory(ua.PrincipalID);
80 ///// <param name="userId">User ID</param> 130 scene.AuthenticationService.SetPassword(ua.PrincipalID, pw);
81 ///// <param name="callback">
82 ///// Callback to invoke when inventory has been loaded. This is required because
83 ///// loading may be asynchronous, even on standalone
84 ///// </param>
85 ///// <returns></returns>
86 //public static CachedUserInfo CreateUserWithInventory(
87 // CommunicationsManager commsManager, string firstName, string lastName,
88 // UUID userId, OnInventoryReceivedDelegate callback)
89 //{
90 // return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
91 //}
92 131
93 ///// <summary> 132 return ua;
94 ///// Create a test user with a standard inventory 133 }
95 ///// </summary>
96 ///// <param name="commsManager"></param>
97 ///// <param name="firstName">First name of user</param>
98 ///// <param name="lastName">Last name of user</param>
99 ///// <param name="password">Password</param>
100 ///// <param name="userId">User ID</param>
101 ///// <param name="callback">
102 ///// Callback to invoke when inventory has been loaded. This is required because
103 ///// loading may be asynchronous, even on standalone
104 ///// </param>
105 ///// <returns></returns>
106 //public static CachedUserInfo CreateUserWithInventory(
107 // CommunicationsManager commsManager, string firstName, string lastName, string password,
108 // UUID userId, OnInventoryReceivedDelegate callback)
109 //{
110 // LocalUserServices lus = (LocalUserServices)commsManager.UserService;
111 // lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId);
112
113 // CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
114 // userInfo.OnInventoryReceived += callback;
115 // userInfo.FetchInventory();
116
117 // return userInfo;
118 //}
119 } 134 }
120} 135} \ No newline at end of file