diff options
author | Justin Clark-Casey (justincc) | 2010-12-14 22:57:36 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-12-14 22:57:36 +0000 |
commit | 42c9c30e4c3102d1f34e28353ddec23c854c5d35 (patch) | |
tree | 5331ee271d58e6a95e88b7b0e5ed07ceac25d1dd /OpenSim | |
parent | add infrastructure for groups module tests (diff) | |
download | opensim-SC-42c9c30e4c3102d1f34e28353ddec23c854c5d35.zip opensim-SC-42c9c30e4c3102d1f34e28353ddec23c854c5d35.tar.gz opensim-SC-42c9c30e4c3102d1f34e28353ddec23c854c5d35.tar.bz2 opensim-SC-42c9c30e4c3102d1f34e28353ddec23c854c5d35.tar.xz |
Add mock group services connector and use this in tests
Diffstat (limited to 'OpenSim')
3 files changed, 248 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index a046e09..5c779de 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs | |||
@@ -27,14 +27,12 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | |||
31 | using OpenMetaverse; | 30 | using OpenMetaverse; |
32 | |||
33 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
34 | 32 | ||
35 | namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | 33 | namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups |
36 | { | 34 | { |
37 | interface IGroupsServicesConnector | 35 | public interface IGroupsServicesConnector |
38 | { | 36 | { |
39 | UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID); | 37 | UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID); |
40 | void UpdateGroup(UUID RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); | 38 | void UpdateGroup(UUID RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs index f9a736f..bc55b04 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using Nini.Config; | ||
30 | using NUnit.Framework; | 31 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | 32 | using NUnit.Framework.SyntaxHelpers; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
@@ -49,6 +50,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests | |||
49 | public void TestBasic() | 50 | public void TestBasic() |
50 | { | 51 | { |
51 | TestHelper.InMethod(); | 52 | TestHelper.InMethod(); |
53 | // log4net.Config.XmlConfigurator.Configure(); | ||
54 | |||
55 | TestScene scene = SceneSetupHelpers.SetupScene(); | ||
56 | IConfigSource configSource = new IniConfigSource(); | ||
57 | IConfig config = configSource.AddConfig("Groups"); | ||
58 | config.Set("Enabled", true); | ||
59 | config.Set("Module", "GroupsModule"); | ||
60 | config.Set("DebugEnabled", true); | ||
61 | SceneSetupHelpers.SetupSceneModules( | ||
62 | scene, configSource, new object[] { new MockGroupsServicesConnector() }); | ||
52 | } | 63 | } |
53 | } | 64 | } |
54 | } \ No newline at end of file | 65 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs new file mode 100644 index 0000000..aa48754 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | |||
@@ -0,0 +1,236 @@ | |||
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.Reflection; | ||
31 | using log4net; | ||
32 | using Mono.Addins; | ||
33 | using Nini.Config; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; | ||
39 | |||
40 | namespace OpenSim.Tests.Common.Mock | ||
41 | { | ||
42 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
43 | public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector | ||
44 | { | ||
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
47 | public string Name | ||
48 | { | ||
49 | get { return "MockGroupsServicesConnector"; } | ||
50 | } | ||
51 | |||
52 | public Type ReplaceableInterface | ||
53 | { | ||
54 | get { return null; } | ||
55 | } | ||
56 | |||
57 | public void Initialise(IConfigSource config) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | public void Close() | ||
62 | { | ||
63 | } | ||
64 | |||
65 | public void AddRegion(Scene scene) | ||
66 | { | ||
67 | scene.RegisterModuleInterface<IGroupsServicesConnector>(this); | ||
68 | } | ||
69 | |||
70 | public void RemoveRegion(Scene scene) | ||
71 | { | ||
72 | } | ||
73 | |||
74 | public void RegionLoaded(Scene scene) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void PostInitialise() | ||
79 | { | ||
80 | } | ||
81 | |||
82 | public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, | ||
83 | int membershipFee, bool openEnrollment, bool allowPublish, | ||
84 | bool maturePublish, UUID founderID) | ||
85 | { | ||
86 | return UUID.Zero; | ||
87 | } | ||
88 | |||
89 | public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, | ||
90 | UUID insigniaID, int membershipFee, bool openEnrollment, | ||
91 | bool allowPublish, bool maturePublish) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, | ||
96 | string title, ulong powers) | ||
97 | { | ||
98 | } | ||
99 | |||
100 | public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, | ||
105 | string title, ulong powers) | ||
106 | { | ||
107 | } | ||
108 | |||
109 | public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName) | ||
110 | { | ||
111 | return null; | ||
112 | } | ||
113 | |||
114 | public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID) | ||
115 | { | ||
116 | return default(GroupProfileData); | ||
117 | } | ||
118 | |||
119 | public void SetAgentActiveGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) | ||
124 | { | ||
125 | } | ||
126 | |||
127 | public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile) | ||
128 | { | ||
129 | } | ||
130 | |||
131 | public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID) | ||
132 | { | ||
133 | } | ||
134 | |||
135 | public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID) | ||
136 | { | ||
137 | return null; | ||
138 | } | ||
139 | |||
140 | public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID) | ||
141 | { | ||
142 | } | ||
143 | |||
144 | public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) | ||
145 | { | ||
146 | } | ||
147 | |||
148 | public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) | ||
149 | { | ||
150 | } | ||
151 | |||
152 | public void AddAgentToGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) | ||
153 | { | ||
154 | } | ||
155 | |||
156 | public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) | ||
157 | { | ||
158 | } | ||
159 | |||
160 | public List<DirGroupsReplyData> FindGroups(UUID requestingAgentID, string search) | ||
161 | { | ||
162 | return null; | ||
163 | } | ||
164 | |||
165 | public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID AgentID, UUID GroupID) | ||
166 | { | ||
167 | return null; | ||
168 | } | ||
169 | |||
170 | public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID AgentID) | ||
171 | { | ||
172 | return null; | ||
173 | } | ||
174 | |||
175 | public List<GroupMembershipData> GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID) | ||
176 | { | ||
177 | return null; | ||
178 | } | ||
179 | |||
180 | public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID) | ||
181 | { | ||
182 | return null; | ||
183 | } | ||
184 | |||
185 | public List<GroupRolesData> GetGroupRoles(UUID requestingAgentID, UUID GroupID) | ||
186 | { | ||
187 | return null; | ||
188 | } | ||
189 | |||
190 | public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID) | ||
191 | { | ||
192 | return null; | ||
193 | } | ||
194 | |||
195 | public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID) | ||
196 | { | ||
197 | return null; | ||
198 | } | ||
199 | |||
200 | public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID) | ||
201 | { | ||
202 | return null; | ||
203 | } | ||
204 | |||
205 | public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) | ||
206 | { | ||
207 | return null; | ||
208 | } | ||
209 | |||
210 | public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) | ||
211 | { | ||
212 | } | ||
213 | |||
214 | public void ResetAgentGroupChatSessions(UUID agentID) | ||
215 | { | ||
216 | } | ||
217 | |||
218 | public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID) | ||
219 | { | ||
220 | return false; | ||
221 | } | ||
222 | |||
223 | public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) | ||
224 | { | ||
225 | return false; | ||
226 | } | ||
227 | |||
228 | public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID) | ||
229 | { | ||
230 | } | ||
231 | |||
232 | public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID) | ||
233 | { | ||
234 | } | ||
235 | } | ||
236 | } \ No newline at end of file | ||