diff options
author | Diva Canto | 2012-03-21 11:22:39 -0700 |
---|---|---|
committer | Diva Canto | 2012-03-21 11:22:39 -0700 |
commit | 5170cd75775eb85922783fa8afe4f8025c054189 (patch) | |
tree | 53cc94bfe18b893ceb21cb36bf107e76cff1568d /OpenSim/Tests | |
parent | HG Friends: reroute the status notifications to the HGFriends service, so tha... (diff) | |
download | opensim-SC-5170cd75775eb85922783fa8afe4f8025c054189.zip opensim-SC-5170cd75775eb85922783fa8afe4f8025c054189.tar.gz opensim-SC-5170cd75775eb85922783fa8afe4f8025c054189.tar.bz2 opensim-SC-5170cd75775eb85922783fa8afe4f8025c054189.tar.xz |
Updated the UserAccountsClient a little bit, plus some more sanity checks on the service connector.
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs | 66 |
1 files changed, 45 insertions, 21 deletions
diff --git a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs index 56195b1..1e0a35b 100644 --- a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs +++ b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs | |||
@@ -62,25 +62,39 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
62 | string last = "Clueless"; | 62 | string last = "Clueless"; |
63 | string email = "foo@bar.com"; | 63 | string email = "foo@bar.com"; |
64 | 64 | ||
65 | UserAccount account = new UserAccount(user1); | 65 | //UserAccount account = new UserAccount(user1); |
66 | account.FirstName = first; | 66 | //account.ScopeID = UUID.Zero; |
67 | account.LastName = last; | 67 | //account.FirstName = first; |
68 | account.Email = email; | 68 | //account.LastName = last; |
69 | account.ServiceURLs = new Dictionary<string, object>(); | 69 | //account.Email = email; |
70 | account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); | 70 | //account.ServiceURLs = new Dictionary<string, object>(); |
71 | account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); | 71 | //account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); |
72 | 72 | //account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); | |
73 | bool success = m_Connector.StoreUserAccount(account); | ||
74 | if (success) | ||
75 | m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); | ||
76 | else | ||
77 | m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); | ||
78 | 73 | ||
79 | System.Console.WriteLine("\n"); | 74 | //bool success = m_Connector.StoreUserAccount(account); |
75 | //if (success) | ||
76 | // m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); | ||
77 | //else | ||
78 | // m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); | ||
80 | 79 | ||
81 | account = m_Connector.GetUserAccount(UUID.Zero, user1); | 80 | //System.Console.WriteLine("\n"); |
81 | |||
82 | //account = m_Connector.GetUserAccount(UUID.Zero, user1); | ||
83 | //if (account == null) | ||
84 | // m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); | ||
85 | //else | ||
86 | //{ | ||
87 | // m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
88 | // account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
89 | // foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
90 | // m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
91 | //} | ||
92 | |||
93 | //System.Console.WriteLine("\n"); | ||
94 | |||
95 | UserAccount account = m_Connector.GetUserAccount(UUID.Zero, first, last); | ||
82 | if (account == null) | 96 | if (account == null) |
83 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); | 97 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name "); |
84 | else | 98 | else |
85 | { | 99 | { |
86 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | 100 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", |
@@ -90,10 +104,9 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
90 | } | 104 | } |
91 | 105 | ||
92 | System.Console.WriteLine("\n"); | 106 | System.Console.WriteLine("\n"); |
93 | 107 | account = m_Connector.GetUserAccount(UUID.Zero, email); | |
94 | account = m_Connector.GetUserAccount(UUID.Zero, first, last); | ||
95 | if (account == null) | 108 | if (account == null) |
96 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name for {0}", user1); | 109 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email"); |
97 | else | 110 | else |
98 | { | 111 | { |
99 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | 112 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", |
@@ -103,9 +116,9 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
103 | } | 116 | } |
104 | 117 | ||
105 | System.Console.WriteLine("\n"); | 118 | System.Console.WriteLine("\n"); |
106 | account = m_Connector.GetUserAccount(UUID.Zero, email); | 119 | account = m_Connector.GetUserAccount(UUID.Zero, user1); |
107 | if (account == null) | 120 | if (account == null) |
108 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email for {0}", user1); | 121 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); |
109 | else | 122 | else |
110 | { | 123 | { |
111 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | 124 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", |
@@ -114,6 +127,17 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
114 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | 127 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); |
115 | } | 128 | } |
116 | 129 | ||
130 | System.Console.WriteLine("\n"); | ||
131 | account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); | ||
132 | if (account == null) | ||
133 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve account 'DoesNot Exist'"); | ||
134 | else | ||
135 | { | ||
136 | m_log.InfoFormat("[USER CLIENT]: Account 'DoesNot Exist' retrieved correctly. REALLY??? userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
137 | account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
138 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
139 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
140 | } | ||
117 | } | 141 | } |
118 | 142 | ||
119 | } | 143 | } |