From c620e4c8228d275cfe9659d55ca9ec0c2d7c1b1a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 22:25:01 +0000 Subject: add infrastructure for groups module tests --- .../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 54 +++++++++++++++++++++ prebuild.xml | 56 ++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs new file mode 100644 index 0000000..f9a736f --- /dev/null +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Reflection; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests +{ + /// + /// Basic groups module tests + /// + [TestFixture] + public class GroupsModuleTests + { + [Test] + public void TestBasic() + { + TestHelper.InMethod(); + } + } +} \ No newline at end of file diff --git a/prebuild.xml b/prebuild.xml index 9f2ef43..044770a 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2974,6 +2974,62 @@ + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1 From 42c9c30e4c3102d1f34e28353ddec23c854c5d35 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 22:57:36 +0000 Subject: Add mock group services connector and use this in tests --- .../XmlRpcGroups/IGroupsServicesConnector.cs | 4 +- .../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 11 + .../Common/Mock/MockGroupsServicesConnector.cs | 236 +++++++++++++++++++++ prebuild.xml | 2 + 4 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs 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 @@ using System; using System.Collections.Generic; - using OpenMetaverse; - using OpenSim.Framework; namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { - interface IGroupsServicesConnector + public interface IGroupsServicesConnector { UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID); 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 @@ using System; using System.Reflection; +using Nini.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; @@ -49,6 +50,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests public void TestBasic() { TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Groups"); + config.Set("Enabled", true); + config.Set("Module", "GroupsModule"); + config.Set("DebugEnabled", true); + SceneSetupHelpers.SetupSceneModules( + scene, configSource, new object[] { new MockGroupsServicesConnector() }); } } } \ 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 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; + +namespace OpenSim.Tests.Common.Mock +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector + { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public string Name + { + get { return "MockGroupsServicesConnector"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource config) + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + scene.RegisterModuleInterface(this); + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + } + + public void PostInitialise() + { + } + + public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, + int membershipFee, bool openEnrollment, bool allowPublish, + bool maturePublish, UUID founderID) + { + return UUID.Zero; + } + + public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, + UUID insigniaID, int membershipFee, bool openEnrollment, + bool allowPublish, bool maturePublish) + { + } + + public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + string title, ulong powers) + { + } + + public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID) + { + } + + public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + string title, ulong powers) + { + } + + public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName) + { + return null; + } + + public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID) + { + return default(GroupProfileData); + } + + public void SetAgentActiveGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + } + + public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile) + { + } + + public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID) + { + } + + public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID) + { + return null; + } + + public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID) + { + } + + public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + } + + public void AddAgentToGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public List FindGroups(UUID requestingAgentID, string search) + { + return null; + } + + public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + return null; + } + + public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID AgentID) + { + return null; + } + + public List GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID) + { + return null; + } + + public List GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + return null; + } + + public List GetGroupRoles(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public List GetGroupMembers(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public List GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public List GetGroupNotices(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) + { + return null; + } + + public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) + { + } + + public void ResetAgentGroupChatSessions(UUID agentID) + { + } + + public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID) + { + return false; + } + + public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) + { + return false; + } + + public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID) + { + } + + public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID) + { + } + } +} \ No newline at end of file diff --git a/prebuild.xml b/prebuild.xml index 044770a..b9ed299 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2733,6 +2733,7 @@ + @@ -2747,6 +2748,7 @@ + -- cgit v1.1 From 81bccd6d132956e2de9e5ad473f87931df76cde8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:36:34 +0000 Subject: Start implementing a test for 'share with group' object functionality. Not yet complete. While implementing this, a bug was fixed in scene setup helpers where module RegionLoaded() was called immediately after AddRegion() instead of waiting for all AddRegions() to complete. Also, XmlRpcGroupsModule non-message functionality will now work without a message transfer module (as indicated in the comments but with a contradictory implementation) --- .../Scenes/Tests/SceneObjectUserGroupTests.cs | 87 ++++++++++++++++++++++ .../Avatar/XmlRpcGroups/GroupsModule.cs | 6 +- .../Common/Mock/MockGroupsServicesConnector.cs | 5 +- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 5 +- prebuild.xml | 1 + 5 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs new file mode 100644 index 0000000..bceacda --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -0,0 +1,87 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.Avatar.InstantMessage; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + [TestFixture] + public class SceneObjectUserGroupTests + { + /// + /// Test share with group object functionality + /// + /// This test is not yet fully implemented + [Test] + public void TestShareWithGroup() + { + TestHelper.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + + IConfig startupConfig = configSource.AddConfig("Startup"); + startupConfig.Set("serverside_object_permissions", true); + + IConfig groupsConfig = configSource.AddConfig("Groups"); + groupsConfig.Set("Enabled", true); + groupsConfig.Set("Module", "GroupsModule"); + groupsConfig.Set("DebugEnabled", true); + + SceneSetupHelpers.SetupSceneModules( + scene, configSource, new object[] + { new PermissionsModule(), + new GroupsModule(), + new MockGroupsServicesConnector() }); + + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + IGroupsModule groupsModule = scene.RequestModuleInterface(); + + groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index ccf5289..4aab87f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -163,9 +163,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_msgTransferModule == null) { m_groupsEnabled = false; - m_log.Error("[GROUPS]: Could not get MessageTransferModule"); - Close(); - return; + m_log.Warn("[GROUPS]: Could not get MessageTransferModule"); } } @@ -1299,7 +1297,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is local, delivering directly", localClient.Name); localClient.SendInstantMessage(msg); } - else + else if (m_msgTransferModule != null) { if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is not local, delivering via TransferModule", msgTo); m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Message Sent: {0}", success?"Succeeded":"Failed"); }); diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index aa48754..6fb9df1 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string Name { @@ -64,6 +64,7 @@ namespace OpenSim.Tests.Common.Mock public void AddRegion(Scene scene) { + m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: Adding to region {0}", scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); } @@ -174,7 +175,7 @@ namespace OpenSim.Tests.Common.Mock public List GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID) { - return null; + return new List(); } public List GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID) diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 9d7733e..8b16496 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -424,9 +424,12 @@ namespace OpenSim.Tests.Common.Setup foreach (IRegionModuleBase module in newModules) { module.AddRegion(scene); - module.RegionLoaded(scene); scene.AddRegionModule(module.Name, module); } + + // RegionLoaded is fired after all modules have been appropriately added to all scenes + foreach (IRegionModuleBase module in newModules) + module.RegionLoaded(scene); scene.SetModuleInterfaces(); } diff --git a/prebuild.xml b/prebuild.xml index b9ed299..e408ccd 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -3060,6 +3060,7 @@ + -- cgit v1.1 From 92727ad596a46990d76aad2cf0c75083df2f9c4a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:41:36 +0000 Subject: minor: disable debug logging for previous test --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index bceacda..c78038f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestShareWithGroup() { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); -- cgit v1.1 From 3643be1c974971fcfab8a1dff2e4a7acb9ec07e1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:46:02 +0000 Subject: Rename SceneObjectUserTests to SceneObjectDeRezTests to better reflect its contents --- .../Scenes/Tests/SceneObjectDeRezTests.cs | 129 +++++++++++++++++++++ .../Framework/Scenes/Tests/SceneObjectUserTests.cs | 129 --------------------- 2 files changed, 129 insertions(+), 129 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs delete mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs new file mode 100644 index 0000000..b3b99f4 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -0,0 +1,129 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Tests manipulation of scene objects by users. + /// + /// + /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. + /// FIXME: These tests are very incomplete - they only test for a few conditions. + [TestFixture] + public class SceneObjectUserTests + { + /// + /// Test deleting an object from a scene. + /// + [Test] + public void TestDeRezSceneObject() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectPart part + = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + part.Name = "obj1"; + scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); + localIds.Add(part.LocalId); + + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + sogd.InventoryDeQueueAndDelete(); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart, Is.Null); + } + + /// + /// Test deleting an object from a scene where the deleter is not the owner + /// + /// + /// This test assumes that the deleter is not a god. + [Test] + public void TestDeRezSceneObjectNotOwner() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectPart part + = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + part.Name = "obj1"; + scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); + localIds.Add(part.LocalId); + + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + sogd.InventoryDeQueueAndDelete(); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs deleted file mode 100644 index b3b99f4..0000000 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Reflection; -using Nini.Config; -using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Region.CoreModules.World.Permissions; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; -using OpenSim.Tests.Common.Setup; - -namespace OpenSim.Region.Framework.Scenes.Tests -{ - /// - /// Tests manipulation of scene objects by users. - /// - /// - /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. - /// FIXME: These tests are very incomplete - they only test for a few conditions. - [TestFixture] - public class SceneObjectUserTests - { - /// - /// Test deleting an object from a scene. - /// - [Test] - public void TestDeRezSceneObject() - { - TestHelper.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); - - TestScene scene = SceneSetupHelpers.SetupScene(); - IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Startup"); - config.Set("serverside_object_permissions", true); - SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); - TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); - - // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. - AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; - - SceneObjectPart part - = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); - part.Name = "obj1"; - scene.AddNewSceneObject(new SceneObjectGroup(part), false); - List localIds = new List(); - localIds.Add(part.LocalId); - - scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); - sogd.InventoryDeQueueAndDelete(); - - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); - Assert.That(retrievedPart, Is.Null); - } - - /// - /// Test deleting an object from a scene where the deleter is not the owner - /// - /// - /// This test assumes that the deleter is not a god. - [Test] - public void TestDeRezSceneObjectNotOwner() - { - TestHelper.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); - UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); - - TestScene scene = SceneSetupHelpers.SetupScene(); - IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Startup"); - config.Set("serverside_object_permissions", true); - SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); - TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); - - // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. - AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; - - SceneObjectPart part - = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); - part.Name = "obj1"; - scene.AddNewSceneObject(new SceneObjectGroup(part), false); - List localIds = new List(); - localIds.Add(part.LocalId); - - scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); - sogd.InventoryDeQueueAndDelete(); - - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); - Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); - } - } -} \ No newline at end of file -- cgit v1.1 From 5f8c6604896fc6398aee9308483b8ca886370c0a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:58:39 +0000 Subject: add new optionalmodules test dll to panda test run (and nant test command) --- .nant/local.include | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.nant/local.include b/.nant/local.include index 97c0c0f..03dc1b9 100644 --- a/.nant/local.include +++ b/.nant/local.include @@ -128,6 +128,11 @@ + + + + + @@ -201,6 +206,17 @@ + + + + + + + + + + + @@ -298,6 +314,11 @@ + + + + + @@ -314,6 +335,7 @@ + @@ -338,6 +360,7 @@ + -- cgit v1.1