From c13a99dc5cc82efac5497dab27dcb6b0d9865cea Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 25 Oct 2012 03:26:12 +0100 Subject: Fix script error messages not showing up in viewer 3 and associated viewers. Viewer 3 will discard such a message if the chat message owner does not match the avatar. We were filling the ownerID with the primID, so this never matched, hence viewer 3 did not see any script error messages. This commit fills the ownerID in with the prim ownerID so the script owner will receive script error messages. This does not affect viewer 1 and associated viewers which continue to process script errors as normal. --- OpenSim/Tests/Common/Mock/TestClient.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index bb8b935..dde37ab 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -528,13 +528,9 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, - UUID fromAgentID, byte source, byte audible) - { - } - - public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName, - UUID fromAgentID, byte source, byte audible) + public virtual void SendChatMessage( + string message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, UUID ownerID, byte source, byte audible) { } -- cgit v1.1 From 75c880a6f3631a527b532773a8a493309a96028e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Nov 2012 00:59:18 +0000 Subject: Update parent inventory folder version numbers when folders are moved/created/deleted to match version numbers cached by viewers. This is done in the way that one would expect (e.g. moving a folder increments version number on both source and destination parent folders). This should hopefully improve viewer reuse of its cached inventory information. Currently MySQL only but will be implement for SQLite/MSSQL if there are no issues. --- OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index bca5979..f9bf768 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -125,6 +125,7 @@ namespace OpenSim.Tests.Common.Mock } public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } + public bool MoveFolder(string id, string newParent) { throw new NotImplementedException(); } public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); } public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); } } -- cgit v1.1 From 26a94610fc88846aeab8e6e2ac09ebcf85a89122 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 10 Nov 2012 10:21:37 -0800 Subject: Fix Unit tests -- the module contract was not being honored in the set up of scenes. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index fc49169..6d67b67 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -385,18 +385,18 @@ namespace OpenSim.Tests.Common foreach (IRegionModuleBase module in newModules) { - if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise(); - } - - foreach (IRegionModuleBase module in newModules) - { foreach (Scene scene in scenes) { module.AddRegion(scene); scene.AddRegionModule(module.Name, module); } } - + + foreach (IRegionModuleBase module in newModules) + { + if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise(); + } + // RegionLoaded is fired after all modules have been appropriately added to all scenes foreach (IRegionModuleBase module in newModules) foreach (Scene scene in scenes) -- cgit v1.1 From 562c585bc6fb1e659ab395089cf497a390f03b33 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 10 Nov 2012 17:34:42 -0800 Subject: One more module converted: GodsModule. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 6d67b67..f9c1ac2 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -141,9 +141,9 @@ namespace OpenSim.Tests.Common TestScene testScene = new TestScene( regInfo, m_acm, scs, m_simDataService, m_estateDataService, null, false, configSource, null); - IRegionModule godsModule = new GodsModule(); - godsModule.Initialise(testScene, new IniConfigSource()); - testScene.AddModule(godsModule.Name, godsModule); + INonSharedRegionModule godsModule = new GodsModule(); + godsModule.Initialise(new IniConfigSource()); + godsModule.AddRegion(testScene); // Add scene to services m_assetService.AddRegion(testScene); -- cgit v1.1 From db418bff2bb6b2676c996e77b260b0977e886f5d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 11 Nov 2012 19:39:21 -0800 Subject: Fix issues with the DynamicTextureModule and corresponding unit tests. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index f9c1ac2..db0a7fc 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -385,6 +385,11 @@ namespace OpenSim.Tests.Common foreach (IRegionModuleBase module in newModules) { + if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise(); + } + + foreach (IRegionModuleBase module in newModules) + { foreach (Scene scene in scenes) { module.AddRegion(scene); @@ -392,11 +397,6 @@ namespace OpenSim.Tests.Common } } - foreach (IRegionModuleBase module in newModules) - { - if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise(); - } - // RegionLoaded is fired after all modules have been appropriately added to all scenes foreach (IRegionModuleBase module in newModules) foreach (Scene scene in scenes) -- cgit v1.1 From e41374dd014721a01b8850d1dcf5f486a50f3b44 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 12 Nov 2012 22:25:35 +0000 Subject: Remove IRegionModule support from the test setup helper --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index db0a7fc..c424439 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -359,28 +359,10 @@ namespace OpenSim.Tests.Common List newModules = new List(); foreach (object module in modules) { -// Console.WriteLine("MODULE RAW {0}", module); - if (module is IRegionModule) - { - IRegionModule m = (IRegionModule)module; - - foreach (Scene scene in scenes) - { - m.Initialise(scene, config); - scene.AddModule(m.Name, m); - } - - m.PostInitialise(); - } - else if (module is IRegionModuleBase) - { - // for the new system, everything has to be initialised first, - // shared modules have to be post-initialised, then all get an AddRegion with the scene - IRegionModuleBase m = (IRegionModuleBase)module; -// Console.WriteLine("MODULE {0}", m.Name); - m.Initialise(config); - newModules.Add(m); - } + IRegionModuleBase m = (IRegionModuleBase)module; +// Console.WriteLine("MODULE {0}", m.Name); + m.Initialise(config); + newModules.Add(m); } foreach (IRegionModuleBase module in newModules) @@ -709,4 +691,4 @@ namespace OpenSim.Tests.Common return sog; } } -} \ No newline at end of file +} -- cgit v1.1 From 8c130bcaf5a60fa042d8df38ba1d1e1cb328d768 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 12 Nov 2012 22:50:28 +0000 Subject: Remove the old style module loader and all references to it --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index c424439..939fc33 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -139,7 +139,7 @@ namespace OpenSim.Tests.Common SceneCommunicationService scs = new SceneCommunicationService(); TestScene testScene = new TestScene( - regInfo, m_acm, scs, m_simDataService, m_estateDataService, null, false, configSource, null); + regInfo, m_acm, scs, m_simDataService, m_estateDataService, false, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index eea68c3..d4b5648 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -41,9 +41,9 @@ namespace OpenSim.Tests.Common.Mock public TestScene( RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, - ModuleLoader moduleLoader, bool dumpAssetsToFile, + bool dumpAssetsToFile, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, + : base(regInfo, authen, sceneGridService, simDataService, estateDataService, dumpAssetsToFile, config, simulatorVersion) { } @@ -73,4 +73,4 @@ namespace OpenSim.Tests.Common.Mock get { return m_asyncSceneObjectDeleter; } } } -} \ No newline at end of file +} -- cgit v1.1 From 2fd36653b98c4c69645f2e4d6dea02bbe9f1260d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 13 Nov 2012 04:34:03 +0000 Subject: minor: Add some explanative method doc to SceneHelpers.SetupSceneModules() --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 939fc33..ea3e348 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -350,6 +350,10 @@ namespace OpenSim.Tests.Common /// /// /// If called directly, then all the modules must be shared modules. + /// + /// We are emulating here the normal calls made to setup region modules + /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()). + /// TODO: Need to reuse normal runtime module code. /// /// /// -- cgit v1.1 From 82690e138448ebac6456ab03dcca4b0a8a1cc57a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 24 Nov 2012 02:43:31 +0000 Subject: Fix bug where loading an OAR with a deeded parcel would always set the parcel owner ID to the estate owner even if the group UUID was present. Aims to address http://opensimulator.org/mantis/view.php?id=6355 As part of this work, an incomplete IXGroupsData was added which currently only allows store/fetch/delete of group records (i.e. no membership data etc) This is subject to change and currently only an in-memory storage implementation exists for regression test purposes. --- .../Common/Mock/MockGroupsServicesConnector.cs | 77 +++++++++++++++++++++- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 25 +------ 2 files changed, 76 insertions(+), 26 deletions(-) (limited to 'OpenSim/Tests/Common') diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 6fb9df1..3035cea 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -26,12 +26,15 @@ */ using System; +using System.Collections; using System.Collections.Generic; using System.Reflection; using log4net; using Mono.Addins; using Nini.Config; using OpenMetaverse; +using OpenSim.Data; +using OpenSim.Data.Null; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -44,6 +47,8 @@ namespace OpenSim.Tests.Common.Mock { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + IXGroupData m_data = new NullXGroupData(null, null); + public string Name { get { return "MockGroupsServicesConnector"; } @@ -84,7 +89,33 @@ namespace OpenSim.Tests.Common.Mock int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID) { - return UUID.Zero; + XGroup group = new XGroup() + { + groupID = UUID.Random(), + ownerRoleID = UUID.Random(), + name = name, + charter = charter, + showInList = showInList, + insigniaID = insigniaID, + membershipFee = membershipFee, + openEnrollment = openEnrollment, + allowPublish = allowPublish, + maturePublish = maturePublish, + founderID = founderID, + everyonePowers = (ulong)XmlRpcGroupsServicesConnectorModule.DefaultEveryonePowers, + ownersPowers = (ulong)XmlRpcGroupsServicesConnectorModule.DefaultOwnerPowers + }; + + if (m_data.StoreGroup(group)) + { + m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: Created group {0} {1}", group.name, group.groupID); + return group.groupID; + } + else + { + m_log.ErrorFormat("[MOCK GROUPS SERVICES CONNECTOR]: Failed to create group {0}", name); + return UUID.Zero; + } } public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, @@ -107,9 +138,49 @@ namespace OpenSim.Tests.Common.Mock { } - public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName) + public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { - return null; + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", + groupID, groupName); + + XGroup[] groups; + string field, val; + + if (groupID != UUID.Zero) + { + field = "groupID"; + val = groupID.ToString(); + } + else + { + field = "name"; + val = groupName; + } + + groups = m_data.GetGroups(field, val); + + if (groups.Length == 0) + return null; + + XGroup xg = groups[0]; + + GroupRecord gr = new GroupRecord() + { + GroupID = xg.groupID, + GroupName = xg.name, + AllowPublish = xg.allowPublish, + MaturePublish = xg.maturePublish, + Charter = xg.charter, + FounderID = xg.founderID, + // FIXME: group picture storage location unknown + MembershipFee = xg.membershipFee, + OpenEnrollment = xg.openEnrollment, + OwnerRoleID = xg.ownerRoleID, + ShowInList = xg.showInList + }; + + return gr; } public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID) diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index f9bf768..ccbdf81 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -33,10 +33,11 @@ using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; +using OpenSim.Data.Null; namespace OpenSim.Tests.Common.Mock { - public class TestXInventoryDataPlugin : IXInventoryData + public class TestXInventoryDataPlugin : NullGenericDataHandler, IXInventoryData { private Dictionary m_allFolders = new Dictionary(); private Dictionary m_allItems = new Dictionary(); @@ -58,28 +59,6 @@ namespace OpenSim.Tests.Common.Mock return origFolders.Select(f => f.Clone()).ToArray(); } - private List Get(string[] fields, string[] vals, List inputEntities) - { - List entities = inputEntities; - - for (int i = 0; i < fields.Length; i++) - { - entities - = entities.Where( - e => - { - FieldInfo fi = typeof(T).GetField(fields[i]); - if (fi == null) - throw new NotImplementedException(string.Format("No field {0} for val {1}", fields[i], vals[i])); - - return fi.GetValue(e).ToString() == vals[i]; - } - ).ToList(); - } - - return entities; - } - public bool StoreFolder(XInventoryFolder folder) { m_allFolders[folder.folderID] = folder.Clone(); -- cgit v1.1