diff options
* Added some more experimental code; nothing wired in so far.
Diffstat (limited to 'OpenSim/Framework/Communications/Tests/Cache')
-rw-r--r-- | OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs | 98 |
1 files changed, 95 insertions, 3 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs index 70a398e..3779f55 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs | |||
@@ -25,6 +25,8 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
28 | using System.Threading; | 30 | using System.Threading; |
29 | using NUnit.Framework; | 31 | using NUnit.Framework; |
30 | using NUnit.Framework.SyntaxHelpers; | 32 | using NUnit.Framework.SyntaxHelpers; |
@@ -85,15 +87,105 @@ namespace OpenSim.Framework.Communications.Tests | |||
85 | } | 87 | } |
86 | } | 88 | } |
87 | 89 | ||
90 | private class FakeUserService : IUserService | ||
91 | { | ||
92 | public UserProfileData GetUserProfile(string firstName, string lastName) | ||
93 | { | ||
94 | throw new NotImplementedException(); | ||
95 | } | ||
96 | |||
97 | public UserProfileData GetUserProfile(UUID userId) | ||
98 | { | ||
99 | throw new NotImplementedException(); | ||
100 | } | ||
101 | |||
102 | public UserProfileData GetUserProfile(Uri uri) | ||
103 | { | ||
104 | UserProfileData userProfile = new UserProfileData(); | ||
105 | |||
106 | userProfile.ID = new UUID( Util.GetHashGuid( uri.ToString(), AssetCache.AssetInfo.Secret )); | ||
107 | |||
108 | return userProfile; | ||
109 | } | ||
110 | |||
111 | public UserAgentData GetAgentByUUID(UUID userId) | ||
112 | { | ||
113 | throw new NotImplementedException(); | ||
114 | } | ||
115 | |||
116 | public void ClearUserAgent(UUID avatarID) | ||
117 | { | ||
118 | throw new NotImplementedException(); | ||
119 | } | ||
120 | |||
121 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID QueryID, string Query) | ||
122 | { | ||
123 | throw new NotImplementedException(); | ||
124 | } | ||
125 | |||
126 | public UserProfileData SetupMasterUser(string firstName, string lastName) | ||
127 | { | ||
128 | throw new NotImplementedException(); | ||
129 | } | ||
130 | |||
131 | public UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
132 | { | ||
133 | throw new NotImplementedException(); | ||
134 | } | ||
135 | |||
136 | public UserProfileData SetupMasterUser(UUID userId) | ||
137 | { | ||
138 | throw new NotImplementedException(); | ||
139 | } | ||
140 | |||
141 | public bool UpdateUserProfile(UserProfileData data) | ||
142 | { | ||
143 | throw new NotImplementedException(); | ||
144 | } | ||
145 | |||
146 | public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) | ||
147 | { | ||
148 | throw new NotImplementedException(); | ||
149 | } | ||
150 | |||
151 | public void RemoveUserFriend(UUID friendlistowner, UUID friend) | ||
152 | { | ||
153 | throw new NotImplementedException(); | ||
154 | } | ||
155 | |||
156 | public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) | ||
157 | { | ||
158 | throw new NotImplementedException(); | ||
159 | } | ||
160 | |||
161 | public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) | ||
162 | { | ||
163 | throw new NotImplementedException(); | ||
164 | } | ||
165 | |||
166 | public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) | ||
167 | { | ||
168 | throw new NotImplementedException(); | ||
169 | } | ||
170 | |||
171 | public List<FriendListItem> GetUserFriendList(UUID friendlistowner) | ||
172 | { | ||
173 | throw new NotImplementedException(); | ||
174 | } | ||
175 | } | ||
176 | |||
88 | [Test] | 177 | [Test] |
89 | public void ProcessAssetDataTest() | 178 | public void TestProcessAssetData() |
90 | { | 179 | { |
91 | string url = "http://host/dir/"; | 180 | string url = "http://host/dir/"; |
92 | string data = " creator_url " + url + " "; | 181 | string creatorData = " creator_url " + url + " "; |
182 | string ownerData = " owner_url " + url + " "; | ||
93 | 183 | ||
94 | AssetCache assetCache = new AssetCache(); | 184 | AssetCache assetCache = new AssetCache(); |
185 | FakeUserService fakeUserService = new FakeUserService(); | ||
95 | 186 | ||
96 | Assert.AreEqual(" creator_id "+Util.GetHashGuid( url, AssetCache.AssetInfo.Secret )+" ", assetCache.ProcessAssetDataString( data )); | 187 | Assert.AreEqual(" creator_id " + Util.GetHashGuid(url, AssetCache.AssetInfo.Secret) + " ", assetCache.ProcessAssetDataString(creatorData, fakeUserService)); |
188 | Assert.AreEqual(" owner_id " + Util.GetHashGuid(url, AssetCache.AssetInfo.Secret) + " ", assetCache.ProcessAssetDataString(ownerData, fakeUserService)); | ||
97 | } | 189 | } |
98 | } | 190 | } |
99 | } | 191 | } |