diff options
author | Justin Clark-Casey (justincc) | 2009-11-12 19:33:38 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-11-12 19:33:38 +0000 |
commit | d95df603dfc8e6a033649be669c6b54071ccb7d4 (patch) | |
tree | 16a4a0b6b7b9803f44ec6d6c443415015e92aaac | |
parent | refactor: extract another test asset helper method (diff) | |
download | opensim-SC_OLD-d95df603dfc8e6a033649be669c6b54071ccb7d4.zip opensim-SC_OLD-d95df603dfc8e6a033649be669c6b54071ccb7d4.tar.gz opensim-SC_OLD-d95df603dfc8e6a033649be669c6b54071ccb7d4.tar.bz2 opensim-SC_OLD-d95df603dfc8e6a033649be669c6b54071ccb7d4.tar.xz |
move fake user service to a separate mock user service class
delete asset cache tests shell
-rw-r--r-- | OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs | 159 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockUserService.cs | 123 |
2 files changed, 123 insertions, 159 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs deleted file mode 100644 index caaebd7..0000000 --- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Threading; | ||
31 | using NUnit.Framework; | ||
32 | using NUnit.Framework.SyntaxHelpers; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Communications.Cache; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | using OpenSim.Tests.Common.Mock; | ||
38 | |||
39 | namespace OpenSim.Framework.Communications.Tests | ||
40 | { | ||
41 | /// <summary> | ||
42 | /// Asset cache tests | ||
43 | /// </summary> | ||
44 | [TestFixture] | ||
45 | public class AssetCacheTests | ||
46 | { | ||
47 | private class FakeUserService : IUserService | ||
48 | { | ||
49 | public void AddTemporaryUserProfile(UserProfileData userProfile) | ||
50 | { | ||
51 | throw new NotImplementedException(); | ||
52 | } | ||
53 | |||
54 | public UserProfileData GetUserProfile(string firstName, string lastName) | ||
55 | { | ||
56 | throw new NotImplementedException(); | ||
57 | } | ||
58 | |||
59 | public UserProfileData GetUserProfile(UUID userId) | ||
60 | { | ||
61 | throw new NotImplementedException(); | ||
62 | } | ||
63 | |||
64 | public UserProfileData GetUserProfile(Uri uri) | ||
65 | { | ||
66 | UserProfileData userProfile = new UserProfileData(); | ||
67 | |||
68 | // userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret)); | ||
69 | |||
70 | return userProfile; | ||
71 | } | ||
72 | |||
73 | public Uri GetUserUri(UserProfileData userProfile) | ||
74 | { | ||
75 | throw new NotImplementedException(); | ||
76 | } | ||
77 | |||
78 | public UserAgentData GetAgentByUUID(UUID userId) | ||
79 | { | ||
80 | throw new NotImplementedException(); | ||
81 | } | ||
82 | |||
83 | public void ClearUserAgent(UUID avatarID) | ||
84 | { | ||
85 | throw new NotImplementedException(); | ||
86 | } | ||
87 | |||
88 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID QueryID, string Query) | ||
89 | { | ||
90 | throw new NotImplementedException(); | ||
91 | } | ||
92 | |||
93 | public UserProfileData SetupMasterUser(string firstName, string lastName) | ||
94 | { | ||
95 | throw new NotImplementedException(); | ||
96 | } | ||
97 | |||
98 | public UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
99 | { | ||
100 | throw new NotImplementedException(); | ||
101 | } | ||
102 | |||
103 | public UserProfileData SetupMasterUser(UUID userId) | ||
104 | { | ||
105 | throw new NotImplementedException(); | ||
106 | } | ||
107 | |||
108 | public bool UpdateUserProfile(UserProfileData data) | ||
109 | { | ||
110 | throw new NotImplementedException(); | ||
111 | } | ||
112 | |||
113 | public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) | ||
114 | { | ||
115 | throw new NotImplementedException(); | ||
116 | } | ||
117 | |||
118 | public void RemoveUserFriend(UUID friendlistowner, UUID friend) | ||
119 | { | ||
120 | throw new NotImplementedException(); | ||
121 | } | ||
122 | |||
123 | public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) | ||
124 | { | ||
125 | throw new NotImplementedException(); | ||
126 | } | ||
127 | |||
128 | public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) | ||
129 | { | ||
130 | throw new NotImplementedException(); | ||
131 | } | ||
132 | |||
133 | public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) | ||
134 | { | ||
135 | throw new NotImplementedException(); | ||
136 | } | ||
137 | |||
138 | public List<FriendListItem> GetUserFriendList(UUID friendlistowner) | ||
139 | { | ||
140 | throw new NotImplementedException(); | ||
141 | } | ||
142 | |||
143 | public bool VerifySession(UUID userID, UUID sessionID) | ||
144 | { | ||
145 | return true; | ||
146 | } | ||
147 | |||
148 | public void SetInventoryService(IInventoryService inv) | ||
149 | { | ||
150 | throw new NotImplementedException(); | ||
151 | } | ||
152 | |||
153 | public virtual bool AuthenticateUserByPassword(UUID userID, string password) | ||
154 | { | ||
155 | throw new NotImplementedException(); | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | } | ||
diff --git a/OpenSim/Tests/Common/Mock/MockUserService.cs b/OpenSim/Tests/Common/Mock/MockUserService.cs new file mode 100644 index 0000000..1e27fb7 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockUserService.cs | |||
@@ -0,0 +1,123 @@ | |||
1 | |||
2 | using System; | ||
3 | using System.Collections.Generic; | ||
4 | using OpenMetaverse; | ||
5 | using OpenSim.Framework; | ||
6 | using OpenSim.Framework.Communications; | ||
7 | using OpenSim.Framework.Communications.Cache; | ||
8 | using OpenSim.Services.Interfaces; | ||
9 | |||
10 | namespace OpenSim.Tests.Common | ||
11 | { | ||
12 | public class MockUserService : IUserService | ||
13 | { | ||
14 | public void AddTemporaryUserProfile(UserProfileData userProfile) | ||
15 | { | ||
16 | throw new NotImplementedException(); | ||
17 | } | ||
18 | |||
19 | public UserProfileData GetUserProfile(string firstName, string lastName) | ||
20 | { | ||
21 | throw new NotImplementedException(); | ||
22 | } | ||
23 | |||
24 | public UserProfileData GetUserProfile(UUID userId) | ||
25 | { | ||
26 | throw new NotImplementedException(); | ||
27 | } | ||
28 | |||
29 | public UserProfileData GetUserProfile(Uri uri) | ||
30 | { | ||
31 | UserProfileData userProfile = new UserProfileData(); | ||
32 | |||
33 | // userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret)); | ||
34 | |||
35 | return userProfile; | ||
36 | } | ||
37 | |||
38 | public Uri GetUserUri(UserProfileData userProfile) | ||
39 | { | ||
40 | throw new NotImplementedException(); | ||
41 | } | ||
42 | |||
43 | public UserAgentData GetAgentByUUID(UUID userId) | ||
44 | { | ||
45 | throw new NotImplementedException(); | ||
46 | } | ||
47 | |||
48 | public void ClearUserAgent(UUID avatarID) | ||
49 | { | ||
50 | throw new NotImplementedException(); | ||
51 | } | ||
52 | |||
53 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID QueryID, string Query) | ||
54 | { | ||
55 | throw new NotImplementedException(); | ||
56 | } | ||
57 | |||
58 | public UserProfileData SetupMasterUser(string firstName, string lastName) | ||
59 | { | ||
60 | throw new NotImplementedException(); | ||
61 | } | ||
62 | |||
63 | public UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
64 | { | ||
65 | throw new NotImplementedException(); | ||
66 | } | ||
67 | |||
68 | public UserProfileData SetupMasterUser(UUID userId) | ||
69 | { | ||
70 | throw new NotImplementedException(); | ||
71 | } | ||
72 | |||
73 | public bool UpdateUserProfile(UserProfileData data) | ||
74 | { | ||
75 | throw new NotImplementedException(); | ||
76 | } | ||
77 | |||
78 | public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) | ||
79 | { | ||
80 | throw new NotImplementedException(); | ||
81 | } | ||
82 | |||
83 | public void RemoveUserFriend(UUID friendlistowner, UUID friend) | ||
84 | { | ||
85 | throw new NotImplementedException(); | ||
86 | } | ||
87 | |||
88 | public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) | ||
89 | { | ||
90 | throw new NotImplementedException(); | ||
91 | } | ||
92 | |||
93 | public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) | ||
94 | { | ||
95 | throw new NotImplementedException(); | ||
96 | } | ||
97 | |||
98 | public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) | ||
99 | { | ||
100 | throw new NotImplementedException(); | ||
101 | } | ||
102 | |||
103 | public List<FriendListItem> GetUserFriendList(UUID friendlistowner) | ||
104 | { | ||
105 | throw new NotImplementedException(); | ||
106 | } | ||
107 | |||
108 | public bool VerifySession(UUID userID, UUID sessionID) | ||
109 | { | ||
110 | return true; | ||
111 | } | ||
112 | |||
113 | public void SetInventoryService(IInventoryService inv) | ||
114 | { | ||
115 | throw new NotImplementedException(); | ||
116 | } | ||
117 | |||
118 | public virtual bool AuthenticateUserByPassword(UUID userID, string password) | ||
119 | { | ||
120 | throw new NotImplementedException(); | ||
121 | } | ||
122 | } | ||
123 | } | ||