From bec39938491a2be01805627018c07430d0df4710 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 11 Dec 2008 18:07:23 +0000 Subject: * Fold mock classes into existing OpenSim/Tests/Common assembly rather than sprouting another one --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 53 ++ OpenSim/Tests/Common/Mock/TestClient.cs | 953 +++++++++++++++++++++ .../Tests/Common/Mock/TestCommunicationsManager.cs | 50 ++ .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 118 +++ OpenSim/Tests/Common/Mock/TestLandChannel.cs | 52 ++ OpenSim/Tests/Common/Mock/TestScene.cs | 56 ++ OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 123 +++ 7 files changed, 1405 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs create mode 100644 OpenSim/Tests/Common/Mock/TestClient.cs create mode 100644 OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs create mode 100644 OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs create mode 100644 OpenSim/Tests/Common/Mock/TestLandChannel.cs create mode 100644 OpenSim/Tests/Common/Mock/TestScene.cs create mode 100644 OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs new file mode 100644 index 0000000..f44339a --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -0,0 +1,53 @@ +/* + * 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 OpenSim 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 OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; + +namespace OpenSim.Tests.Common.Mock +{ + /// + /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the + /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit + /// tests are single threaded. + /// + public class TestAssetDataPlugin : IAssetProviderPlugin + { + public string Version { get { return "0"; } } + public string Name { get { return "TestAssetDataPlugin"; } } + + public void Initialise() {} + public void Dispose() {} + + public AssetBase FetchAsset(UUID uuid) { return null; } + public void CreateAsset(AssetBase asset) {} + public void UpdateAsset(AssetBase asset) {} + public bool ExistsAsset(UUID uuid) { return false; } + public void Initialise(string connect) {} + } +} diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs new file mode 100644 index 0000000..9b44ac4 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -0,0 +1,953 @@ +/* + * 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 OpenSim 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.Net; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.Environment.Scenes; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestClient : IClientAPI + { + private Scene m_scene; + +// disable warning: public events, part of the public API +#pragma warning disable 67 + + public event Action OnLogout; + public event ObjectPermissions OnObjectPermissions; + + public event MoneyTransferRequest OnMoneyTransferRequest; + public event ParcelBuy OnParcelBuy; + public event Action OnConnectionClosed; + + public event ImprovedInstantMessage OnInstantMessage; + public event ChatMessage OnChatFromClient; + public event TextureRequest OnRequestTexture; + public event RezObject OnRezObject; + public event ModifyTerrain OnModifyTerrain; + public event BakeTerrain OnBakeTerrain; + public event SetAppearance OnSetAppearance; + public event AvatarNowWearing OnAvatarNowWearing; + public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event UUIDNameRequest OnDetachAttachmentIntoInv; + public event ObjectAttach OnObjectAttach; + public event ObjectDeselect OnObjectDetach; + public event ObjectDrop OnObjectDrop; + public event StartAnim OnStartAnim; + public event StopAnim OnStopAnim; + public event LinkObjects OnLinkObjects; + public event DelinkObjects OnDelinkObjects; + public event RequestMapBlocks OnRequestMapBlocks; + public event RequestMapName OnMapNameRequest; + public event TeleportLocationRequest OnTeleportLocationRequest; + public event TeleportLandmarkRequest OnTeleportLandmarkRequest; + public event DisconnectUser OnDisconnectUser; + public event RequestAvatarProperties OnRequestAvatarProperties; + public event SetAlwaysRun OnSetAlwaysRun; + + public event DeRezObject OnDeRezObject; + public event Action OnRegionHandShakeReply; + public event GenericCall2 OnRequestWearables; + public event GenericCall2 OnCompleteMovementToRegion; + public event UpdateAgent OnAgentUpdate; + public event AgentRequestSit OnAgentRequestSit; + public event AgentSit OnAgentSit; + public event AvatarPickerRequest OnAvatarPickerRequest; + public event Action OnRequestAvatarsData; + public event AddNewPrim OnAddPrim; + public event RequestGodlikePowers OnRequestGodlikePowers; + public event GodKickUser OnGodKickUser; + public event ObjectDuplicate OnObjectDuplicate; + public event GrabObject OnGrabObject; + public event ObjectSelect OnDeGrabObject; + public event MoveObject OnGrabUpdate; + public event ViewerEffectEventHandler OnViewerEffect; + + public event FetchInventory OnAgentDataUpdateRequest; + public event FetchInventory OnUserInfoRequest; + public event TeleportLocationRequest OnSetStartLocationRequest; + + public event UpdateShape OnUpdatePrimShape; + public event ObjectExtraParams OnUpdateExtraParams; + public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; + public event ObjectSelect OnObjectSelect; + public event GenericCall7 OnObjectDescription; + public event GenericCall7 OnObjectName; + public event GenericCall7 OnObjectClickAction; + public event GenericCall7 OnObjectMaterial; + public event UpdatePrimFlags OnUpdatePrimFlags; + public event UpdatePrimTexture OnUpdatePrimTexture; + public event UpdateVector OnUpdatePrimGroupPosition; + public event UpdateVector OnUpdatePrimSinglePosition; + public event UpdatePrimRotation OnUpdatePrimGroupRotation; + public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; + public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; + public event UpdateVector OnUpdatePrimScale; + public event UpdateVector OnUpdatePrimGroupScale; + public event StatusChange OnChildAgentStatus; + public event GenericCall2 OnStopMovement; + public event Action OnRemoveAvatar; + + public event CreateNewInventoryItem OnCreateNewInventoryItem; + public event CreateInventoryFolder OnCreateNewInventoryFolder; + public event UpdateInventoryFolder OnUpdateInventoryFolder; + public event MoveInventoryFolder OnMoveInventoryFolder; + public event RemoveInventoryFolder OnRemoveInventoryFolder; + public event RemoveInventoryItem OnRemoveInventoryItem; + public event FetchInventoryDescendents OnFetchInventoryDescendents; + public event PurgeInventoryDescendents OnPurgeInventoryDescendents; + public event FetchInventory OnFetchInventory; + public event RequestTaskInventory OnRequestTaskInventory; + public event UpdateInventoryItem OnUpdateInventoryItem; + public event CopyInventoryItem OnCopyInventoryItem; + public event MoveInventoryItem OnMoveInventoryItem; + public event UDPAssetUploadRequest OnAssetUploadRequest; + public event RequestTerrain OnRequestTerrain; + public event RequestTerrain OnUploadTerrain; + public event XferReceive OnXferReceive; + public event RequestXfer OnRequestXfer; + public event ConfirmXfer OnConfirmXfer; + public event AbortXfer OnAbortXfer; + public event RezScript OnRezScript; + public event UpdateTaskInventory OnUpdateTaskInventory; + public event MoveTaskInventory OnMoveTaskItem; + public event RemoveTaskInventory OnRemoveTaskItem; + public event RequestAsset OnRequestAsset; + public event GenericMessage OnGenericMessage; + public event UUIDNameRequest OnNameFromUUIDRequest; + public event UUIDNameRequest OnUUIDGroupNameRequest; + + public event ParcelPropertiesRequest OnParcelPropertiesRequest; + public event ParcelDivideRequest OnParcelDivideRequest; + public event ParcelJoinRequest OnParcelJoinRequest; + public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; + public event ParcelAbandonRequest OnParcelAbandonRequest; + public event ParcelGodForceOwner OnParcelGodForceOwner; + public event ParcelReclaim OnParcelReclaim; + public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; + public event ParcelAccessListRequest OnParcelAccessListRequest; + public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; + public event ParcelSelectObjects OnParcelSelectObjects; + public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; + public event ObjectDeselect OnObjectDeselect; + public event RegionInfoRequest OnRegionInfoRequest; + public event EstateCovenantRequest OnEstateCovenantRequest; + public event EstateChangeInfo OnEstateChangeInfo; + + public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; + + public event FriendActionDelegate OnApproveFriendRequest; + public event FriendActionDelegate OnDenyFriendRequest; + public event FriendshipTermination OnTerminateFriendship; + + public event EconomyDataRequest OnEconomyDataRequest; + public event MoneyBalanceRequest OnMoneyBalanceRequest; + public event UpdateAvatarProperties OnUpdateAvatarProperties; + + public event ObjectIncludeInSearch OnObjectIncludeInSearch; + public event UUIDNameRequest OnTeleportHomeRequest; + + public event ScriptAnswer OnScriptAnswer; + public event RequestPayPrice OnRequestPayPrice; + public event ObjectSaleInfo OnObjectSaleInfo; + public event ObjectBuy OnObjectBuy; + public event BuyObjectInventory OnBuyObjectInventory; + public event AgentSit OnUndo; + + public event ForceReleaseControls OnForceReleaseControls; + + public event GodLandStatRequest OnLandStatRequest; + public event RequestObjectPropertiesFamily OnObjectGroupRequest; + + public event DetailedEstateDataRequest OnDetailedEstateDataRequest; + public event SetEstateFlagsRequest OnSetEstateFlagsRequest; + public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; + public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture; + public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights; + public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest; + public event SetRegionTerrainSettings OnSetRegionTerrainSettings; + public event EstateRestartSimRequest OnEstateRestartSimRequest; + public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; + public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; + public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest; + public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; + public event EstateDebugRegionRequest OnEstateDebugRegionRequest; + public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; + public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; + public event ScriptReset OnScriptReset; + public event GetScriptRunning OnGetScriptRunning; + public event SetScriptRunning OnSetScriptRunning; + public event UpdateVector OnAutoPilotGo; + + public event TerrainUnacked OnUnackedTerrain; + + public event RegionHandleRequest OnRegionHandleRequest; + public event ParcelInfoRequest OnParcelInfoRequest; + + public event ActivateGesture OnActivateGesture; + public event DeactivateGesture OnDeactivateGesture; + public event ObjectOwner OnObjectOwner; + + public event DirPlacesQuery OnDirPlacesQuery; + public event DirFindQuery OnDirFindQuery; + public event DirLandQuery OnDirLandQuery; + public event DirPopularQuery OnDirPopularQuery; + public event DirClassifiedQuery OnDirClassifiedQuery; + public event EventInfoRequest OnEventInfoRequest; + public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime; + + public event MapItemRequest OnMapItemRequest; + + public event OfferCallingCard OnOfferCallingCard; + public event AcceptCallingCard OnAcceptCallingCard; + public event DeclineCallingCard OnDeclineCallingCard; + + public event SoundTrigger OnSoundTrigger; + +#pragma warning restore 67 + + /// + /// This agent's UUID + /// + private UUID myID; + + private Vector3 startPos = new Vector3(128, 128, 2); + + public virtual Vector3 StartPos + { + get { return startPos; } + set { } + } + + public virtual UUID AgentId + { + get { return myID; } + } + + public UUID SessionId + { + get { return UUID.Zero; } + } + + public UUID SecureSessionId + { + get { return UUID.Zero; } + } + + public virtual string FirstName + { + get { return m_firstName; } + } + private string m_firstName; + + public virtual string LastName + { + get { return m_lastName; } + } + private string m_lastName; + + public virtual String Name + { + get { return FirstName + " " + LastName; } + } + + public bool IsActive + { + get { return true; } + set { } + } + + public UUID ActiveGroupId + { + get { return UUID.Zero; } + } + + public string ActiveGroupName + { + get { return String.Empty; } + } + + public ulong ActiveGroupPowers + { + get { return 0; } + } + + public bool IsGroupMember(UUID groupID) + { + return false; + } + + public ulong GetGroupPowers(UUID groupID) + { + return 0; + } + + public virtual int NextAnimationSequenceNumber + { + get { return 1; } + } + + public IScene Scene + { + get { return m_scene; } + } + + public bool SendLogoutPacketWhenClosing + { + set { } + } + + /// + /// Constructor + /// + /// + public TestClient(AgentCircuitData agentData) + { + myID = agentData.AgentID; + m_firstName = agentData.firstname; + m_lastName = agentData.lastname; + } + + public virtual void ActivateGesture(UUID assetId, UUID gestureId) + { + } + + public virtual void SendWearables(AvatarWearable[] wearables, int serial) + { + } + + public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) + { + } + + public virtual void Kick(string message) + { + } + + public virtual void SendStartPingCheck(byte seq) + { + } + + public virtual void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List Data) + { + } + + public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) + { + + } + + public virtual void SendKillObject(ulong regionHandle, uint localID) + { + } + + public virtual void SetChildAgentThrottle(byte[] throttle) + { + } + public byte[] GetThrottlesPacked(float multiplier) + { + return new byte[0]; + } + + + public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) + { + } + + 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 void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp) + { + + } + + public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket) + { + + } + + public void SendGenericMessage(string method, List message) + { + + } + + public virtual void SendLayerData(float[] map) + { + } + + public virtual void SendLayerData(int px, int py, float[] map) + { + } + public virtual void SendLayerData(int px, int py, float[] map, bool track) + { + } + + public virtual void SendWindData(Vector2[] windSpeeds) { } + + public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) + { + } + + public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) + { + } + + public virtual AgentCircuitData RequestClientInfo() + { + return new AgentCircuitData(); + } + + public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, + IPEndPoint newRegionExternalEndPoint, string capsURL) + { + } + + public virtual void SendMapBlock(List mapBlocks, uint flag) + { + } + + public virtual void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags) + { + } + + public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL) + { + } + + public virtual void SendTeleportFailed(string reason) + { + } + + public virtual void SendTeleportLocationStart() + { + } + + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) + { + } + + public virtual void SendPayPrice(UUID objectID, int[] payPrice) + { + } + + public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, + uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) + { + } + + public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, + Vector3 position, Vector3 velocity, Quaternion rotation) + { + } + + public virtual void SendCoarseLocationUpdate(List CoarseLocations) + { + } + + public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) + { + } + + public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string msg, UUID textureID, int ch, string[] buttonlabels) + { + } + + public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, + PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, + Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, + UUID objectID, UUID ownerID, string text, byte[] color, + uint parentID, + byte[] particleSystem, byte clickAction, byte material) + { + } + public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, + PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, + Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, + UUID objectID, UUID ownerID, string text, byte[] color, + uint parentID, + byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation, + bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) + { + } + public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, + Vector3 position, Quaternion rotation, Vector3 velocity, + Vector3 rotationalvelocity, byte state, UUID AssetId, + UUID ownerID, int attachPoint) + { + } + + public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, + List items, + List folders, + bool fetchFolders, + bool fetchItems) + { + } + + public virtual void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) + { + } + + public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) + { + } + + public virtual void SendRemoveInventoryItem(UUID itemID) + { + } + + /// IClientAPI.SendBulkUpdateInventory(InventoryItemBase) + public virtual void SendBulkUpdateInventory(InventoryItemBase item) + { + } + + public void SendBulkUpdateInventory(InventoryFolderBase folderBase) + {} + + public UUID GetDefaultAnimation(string name) + { + return UUID.Zero; + } + + public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) + { + } + + public virtual void SendTaskInventory(UUID taskID, short serial, byte[] fileName) + { + } + + public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) + { + } + + public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, + int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, + int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, + int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent) + { + } + + public virtual void SendNameReply(UUID profileId, string firstname, string lastname) + { + } + + public virtual void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID) + { + } + + public virtual void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain, + byte flags) + { + } + + public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain) + { + } + + public void SendAttachedSoundGainChange(UUID objectID, float gain) + { + + } + + public void SendAlertMessage(string message) + { + } + + public void SendAgentAlertMessage(string message, bool modal) + { + } + + public void SendSystemAlertMessage(string message) + { + } + + public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, + string url) + { + } + + public virtual void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) + { + if (OnRegionHandShakeReply != null) + { + OnRegionHandShakeReply(this); + } + + if (OnCompleteMovementToRegion != null) + { + OnCompleteMovementToRegion(); + } + } + public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) + { + } + + public void SendConfirmXfer(ulong xferID, uint PacketID) + { + } + + public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName) + { + } + + public void SendInitiateDownload(string simFileName, string clientFileName) + { + } + + public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) + { + } + + public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) + { + } + + public void SendImageNotFound(UUID imageid) + { + } + + public void SendShutdownConnectionNotice() + { + } + + public void SendSimStats(SimStats stats) + { + } + + public void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID, + uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, + uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category, + UUID LastOwnerID, string ObjectName, string Description) + { + } + + public void SendObjectPropertiesReply(UUID ItemID, ulong CreationDate, UUID CreatorUUID, UUID FolderUUID, UUID FromTaskUUID, + UUID GroupUUID, short InventorySerial, UUID LastOwnerUUID, UUID ObjectUUID, + UUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, + string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, + uint BaseMask, byte saleType, int salePrice) + { + } + + public void SendAgentOffline(UUID[] agentIDs) + { + + } + + public void SendAgentOnline(UUID[] agentIDs) + { + + } + + public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, + Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) + { + } + + public void SendAdminResponse(UUID Token, uint AdminLevel) + { + + } + + public void SendGroupMembership(GroupMembershipData[] GroupMembership) + { + + } + + public bool AddMoney(int debit) + { + return false; + } + + public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) + { + } + + public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) + { + } + + public void SendViewerTime(int phase) + { + } + + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, + string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, + UUID partnerID) + { + } + + public void SetDebugPacketLevel(int newDebug) + { + } + + public void InPacket(object NewPack) + { + } + + public void ProcessInPacket(Packet NewPack) + { + } + + public void Close(bool ShutdownCircuit) + { + } + + public void Stop() + { + } + + private uint m_circuitCode; + + public uint CircuitCode + { + get { return m_circuitCode; } + set { m_circuitCode = value; } + } + + public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message) + { + + } + public void SendLogoutPacket() + { + } + + public void Terminate() + { + } + + public ClientInfo GetClientInfo() + { + return null; + } + + public void SetClientInfo(ClientInfo info) + { + } + + public void SendScriptQuestion(UUID objectID, string taskName, string ownerName, UUID itemID, int question) + { + } + public void SendHealth(float health) + { + } + + public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) + { + } + + public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID) + { + } + + public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) + { + } + + public void SendEstateCovenantInformation(UUID covenant) + { + } + + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + { + } + + public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) + { + } + + public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) + { + } + + public void SendForceClientSelectObjects(List objectIDs) + { + } + + public void SendLandObjectOwners(Dictionary ownersAndCount) + { + } + + public void SendLandParcelOverlay(byte[] data, int sequence_id) + { + } + + public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) + { + } + + public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType, + string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) + { + } + + public void SendGroupNameReply(UUID groupLLUID, string GroupName) + { + } + + public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia) + { + } + + public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running) + { + } + + public void SendAsset(AssetRequestToClient req) + { + } + + public void SendTexture(AssetBase TextureAsset) + { + + } + + public void SendSetFollowCamProperties (UUID objectID, SortedDictionary parameters) + { + } + + public void SendClearFollowCamProperties (UUID objectID) + { + } + + public void SendRegionHandle (UUID regoinID, ulong handle) + { + } + + public void SendParcelInfo (RegionInfo info, LandData land, UUID parcelID, uint x, uint y) + { + } + + public void SetClientOption(string option, string value) + { + } + + public string GetClientOption(string option) + { + return string.Empty; + } + + public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt) + { + } + + public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data) + { + } + + public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data) + { + } + + public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data) + { + } + + public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data) + { + } + + public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data) + { + } + + public void SendDirLandReply(UUID queryID, DirLandReplyData[] data) + { + } + + public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data) + { + } + + public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags) + { + } + + public void KillEndDone() + { + } + + public void SendEventInfoReply (EventData info) + { + } + + public void SendOfferCallingCard (UUID destID, UUID transactionID) + { + } + + public void SendAcceptCallingCard (UUID transactionID) + { + } + + public void SendDeclineCallingCard (UUID transactionID) + { + } + + public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data) + { + } + + public void SendJoinGroupReply(UUID groupID, bool success) + { + } + + public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool succss) + { + } + + public void SendLeaveGroupReply(UUID groupID, bool success) + { + } + + public void SendTerminateFriend(UUID exFriendID) + { + } + + public bool AddGenericPacketHandler(string MethodName, GenericMessage handler) + { + //throw new NotImplementedException(); + return false; + } + + } +} diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs new file mode 100644 index 0000000..a6a025b --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -0,0 +1,50 @@ +/* + * 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 OpenSim 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 OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Communications.Cache; +using OpenSim.Framework.Servers; +using OpenSim.Region.Communications.Local; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestCommunicationsManager : CommunicationsManager + { + public TestCommunicationsManager() + : base(null, null, null, false, null) + { + LocalInventoryService lis = new LocalInventoryService(); + m_interServiceInventoryService = lis; + AddInventoryService(lis); + + LocalUserServices lus = new LocalUserServices(991, 992, lis); + m_userService = lus; + m_userAdminService = lus; + } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs new file mode 100644 index 0000000..9e2116a --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -0,0 +1,118 @@ +/* + * 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 OpenSim 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 OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common.Mock +{ + /// + /// In memory inventory data plugin for test purposes. Could be another dll when properly filled out and when the + /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit + /// tests are single threaded. + /// + public class TestInventoryDataPlugin : IInventoryDataPlugin + { + /// + /// Known inventory folders + /// + private Dictionary m_folders = new Dictionary(); + + /// + /// User root folders + /// + private Dictionary m_rootFolders = new Dictionary(); + + public string Version { get { return "0"; } } + public string Name { get { return "TestInventoryDataPlugin"; } } + + public void Initialise() {} + public void Initialise(string connect) {} + public void Dispose() {} + + public List getFolderHierarchy(UUID parentID) + { + List folders = new List(); + + foreach (InventoryFolderBase folder in m_folders.Values) + { + if (folder.ParentID == parentID) + { + folders.AddRange(getFolderHierarchy(folder.ID)); + folders.Add(folder); + } + } + + return folders; + } + + public List getInventoryInFolder(UUID folderID) + { + return new List(); + } + + public List getUserRootFolders(UUID user) { return null; } + + public InventoryFolderBase getUserRootFolder(UUID user) + { + InventoryFolderBase folder = null; + m_rootFolders.TryGetValue(user, out folder); + + return folder; + } + + public List getInventoryFolders(UUID parentID) { return null; } + public InventoryItemBase getInventoryItem(UUID item) { return null; } + + public InventoryFolderBase getInventoryFolder(UUID folderId) + { + InventoryFolderBase folder = null; + m_folders.TryGetValue(folderId, out folder); + + return folder; + } + + public void addInventoryItem(InventoryItemBase item) {} + public void updateInventoryItem(InventoryItemBase item) {} + public void deleteInventoryItem(UUID item) {} + + public void addInventoryFolder(InventoryFolderBase folder) + { + m_folders[folder.ID] = folder; + + if (folder.ParentID == UUID.Zero) + m_rootFolders[folder.Owner] = folder; + } + + public void updateInventoryFolder(InventoryFolderBase folder) {} + public void moveInventoryFolder(InventoryFolderBase folder) {} + public void deleteInventoryFolder(UUID folder) {} + public List fetchActiveGestures(UUID avatarID) { return null; } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs new file mode 100644 index 0000000..5e9b9ff --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -0,0 +1,52 @@ +/* + * 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 OpenSim 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.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Environment.Interfaces; + +namespace OpenSim.Tests.Common.Mock +{ + /// + /// Land channel for test purposes + /// + public class TestLandChannel : ILandChannel + { + public List ParcelsNearPoint(Vector3 position) { return null; } + public List AllParcels() { return null; } + public ILandObject GetLandObject(int x, int y) { return null; } + public ILandObject GetLandObject(float x, float y) { return null; } + public bool IsLandPrimCountTainted() { return false; } + public bool IsForcefulBansAllowed() { return false; } + public void UpdateLandObject(int localID, LandData data) {} + public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) {} + public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) {} + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) {} + public void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime) {} + } +} diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs new file mode 100644 index 0000000..6b176a1 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -0,0 +1,56 @@ +/* + * 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 OpenSim 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 Nini.Config; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Communications.Cache; +using OpenSim.Framework.Servers; +using OpenSim.Region.Environment; +using OpenSim.Region.Environment.Scenes; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestScene : Scene + { + public TestScene( + RegionInfo regInfo, AgentCircuitManager authen, + CommunicationsManager commsMan, SceneCommunicationService sceneGridService, + AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, + ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, + bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) + : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, moduleLoader, + dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) + { + } + + public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter + { + get { return m_asyncSceneObjectDeleter; } + } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs new file mode 100644 index 0000000..a5e2a37 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -0,0 +1,123 @@ +/* + * 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 OpenSim 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 OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common.Mock +{ + /// + /// In memory user data provider. Might be quite useful as a proper user data plugin, though getting mono addins + /// to load any plugins when running unit tests has proven impossible so far. Currently no locking since unit + /// tests are single threaded. + /// + public class TestUserDataPlugin : IUserDataPlugin + { + public string Version { get { return "0"; } } + public string Name { get { return "TestUserDataPlugin"; } } + + /// + /// User profiles keyed by name + /// + private Dictionary m_userProfilesByName = new Dictionary(); + + /// + /// User profiles keyed by uuid + /// + private Dictionary m_userProfilesByUuid = new Dictionary(); + + public void Initialise() {} + public void Dispose() {} + + public void AddNewUserProfile(UserProfileData user) + { + UpdateUserProfile(user); + } + + public UserProfileData GetUserByUUID(UUID user) + { + UserProfileData userProfile = null; + m_userProfilesByUuid.TryGetValue(user, out userProfile); + + return userProfile; + } + + public UserProfileData GetUserByName(string fname, string lname) + { + UserProfileData userProfile = null; + m_userProfilesByName.TryGetValue(fname + " " + lname, out userProfile); + + return userProfile; + } + + public bool UpdateUserProfile(UserProfileData user) + { + m_userProfilesByUuid[user.ID] = user; + m_userProfilesByName[user.FirstName + " " + user.SurName] = user; + + return true; + } + + public List GeneratePickerResults(UUID queryID, string query) { return null; } + + public UserAgentData GetAgentByUUID(UUID user) { return null; } + + public UserAgentData GetAgentByName(string name) { return null; } + + public UserAgentData GetAgentByName(string fname, string lname) { return null; } + + public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {} + + public void AddNewUserAgent(UserAgentData agent) {} + + public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) {} + + public void RemoveUserFriend(UUID friendlistowner, UUID friend) {} + + public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) {} + + public List GetUserFriendList(UUID friendlistowner) { return null; } + + public Dictionary GetFriendRegionInfos(List uuids) { return null; } + + public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; } + + public bool InventoryTransferRequest(UUID from, UUID to, UUID inventory) { return false; } + + public void Initialise(string connect) { return; } + + public AvatarAppearance GetUserAppearance(UUID user) { return null; } + + public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) {} + + public void ResetAttachments(UUID userID) {} + + public void LogoutUsers(UUID regionID) {} + } +} \ No newline at end of file -- cgit v1.1 From 7bbab121589a6e42e7744ffad37b35e62775b2f9 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 12 Dec 2008 19:24:45 +0000 Subject: * Add user info move inventory folder test --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 9e2116a..52b469b 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -111,7 +111,13 @@ namespace OpenSim.Tests.Common.Mock } public void updateInventoryFolder(InventoryFolderBase folder) {} - public void moveInventoryFolder(InventoryFolderBase folder) {} + + public void moveInventoryFolder(InventoryFolderBase folder) + { + // Simple replace + m_folders[folder.ID] = folder; + } + public void deleteInventoryFolder(UUID folder) {} public List fetchActiveGestures(UUID avatarID) { return null; } } -- cgit v1.1 From 1531035b14367cfa44986e4a733524391d58af93 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 12 Dec 2008 20:04:58 +0000 Subject: * Actually properly enable the purge folders test and correct some problems --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 52b469b..808c212 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -87,7 +87,19 @@ namespace OpenSim.Tests.Common.Mock return folder; } - public List getInventoryFolders(UUID parentID) { return null; } + public List getInventoryFolders(UUID parentID) + { + List folders = new List(); + + foreach (InventoryFolderBase folder in m_folders.Values) + { + if (folder.ParentID == parentID) + folders.Add(folder); + } + + return folders; + } + public InventoryItemBase getInventoryItem(UUID item) { return null; } public InventoryFolderBase getInventoryFolder(UUID folderId) @@ -118,7 +130,12 @@ namespace OpenSim.Tests.Common.Mock m_folders[folder.ID] = folder; } - public void deleteInventoryFolder(UUID folder) {} + public void deleteInventoryFolder(UUID folderId) + { + if (m_folders.ContainsKey(folderId)) + m_folders.Remove(folderId); + } + public List fetchActiveGestures(UUID avatarID) { return null; } } } -- cgit v1.1 From b1f018aa2600281cc379128f17c3c141b478f39d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 12 Dec 2008 20:43:42 +0000 Subject: * Create update folder test * Correct small logic elidation --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 808c212..8e19aec 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -122,12 +122,15 @@ namespace OpenSim.Tests.Common.Mock m_rootFolders[folder.Owner] = folder; } - public void updateInventoryFolder(InventoryFolderBase folder) {} + public void updateInventoryFolder(InventoryFolderBase folder) + { + m_folders[folder.ID] = folder; + } public void moveInventoryFolder(InventoryFolderBase folder) { // Simple replace - m_folders[folder.ID] = folder; + updateInventoryFolder(folder); } public void deleteInventoryFolder(UUID folderId) -- cgit v1.1 From 008e1fe8df1862a8a3a8edfaf39d4cd9f57ad52b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 14 Dec 2008 05:49:07 +0000 Subject: Plumb the TP-Sending packets --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9b44ac4..1bcf829 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -233,6 +233,9 @@ namespace OpenSim.Tests.Common.Mock public event SoundTrigger OnSoundTrigger; + public event StartLure OnStartLure; + public event TeleportLureRequest OnTeleportLureRequest; + #pragma warning restore 67 /// -- cgit v1.1 From 119104e35bc02e15a1ce08175ca6408fb8e9f7be Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 21 Dec 2008 00:11:54 +0000 Subject: * Re-implement packet tracking in IClientAPI so we can see what's going on in the client network in the simstats manager. This makes packets in per second, packets out per second, and unacked bytes work again in the simulator stats section. --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1bcf829..70a2d11 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -235,6 +235,7 @@ namespace OpenSim.Tests.Common.Mock public event StartLure OnStartLure; public event TeleportLureRequest OnTeleportLureRequest; + public event NetworkStats OnNetworkStatsUpdate; #pragma warning restore 67 -- cgit v1.1 From fc053a6af8cf2f9dc158d8bc3d3ff5597d50b69f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 23 Dec 2008 18:16:30 +0000 Subject: Plumb in the 4 missing classified events and the 3 packet methods --- OpenSim/Tests/Common/Mock/TestClient.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 70a2d11..e7cdee9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -237,6 +237,11 @@ namespace OpenSim.Tests.Common.Mock public event TeleportLureRequest OnTeleportLureRequest; public event NetworkStats OnNetworkStatsUpdate; + public event ClassifiedInfoRequest OnClassifiedInfoRequest; + public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; + public event ClassifiedDelete OnClassifiedDelete; + public event ClassifiedDelete OnClassifiedGodDelete; + #pragma warning restore 67 /// @@ -953,5 +958,13 @@ namespace OpenSim.Tests.Common.Mock return false; } + public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name) + { + } + + public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price) + { + } + } } -- cgit v1.1 From 318de200bd398d41b246126f541cd10ac7785b77 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 23 Dec 2008 23:41:46 +0000 Subject: Plumb in EventNotification* and EventGodDelete --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index e7cdee9..cb26366 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -242,6 +242,10 @@ namespace OpenSim.Tests.Common.Mock public event ClassifiedDelete OnClassifiedDelete; public event ClassifiedDelete OnClassifiedGodDelete; + public event EventNotificationAddRequest OnEventNotificationAddRequest; + public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; + public event EventGodDelete OnEventGodDelete; + #pragma warning restore 67 /// -- cgit v1.1 From 23844a9073e28fb8c74424812603027586bdb4df Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Dec 2008 20:28:13 +0000 Subject: Plumb the profile reply packets for picks, classifieds and notes --- OpenSim/Tests/Common/Mock/TestClient.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index cb26366..fe93d6b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -970,5 +970,22 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendAgentDropGroup(UUID groupID) + { + } + + public void SendAvatarNotesReply(UUID targetID, string text) + { + } + + public void SendAvatarPicksReply(UUID targetID, Dictionary picks) + { + } + + public void SendAvatarClassifiedReply(UUID targetID, Dictionary classifieds) + { + } + + } } -- cgit v1.1 From 7beb8a5abb801c285d16a5b1e4d8538d0381c671 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 3 Jan 2009 20:45:33 +0000 Subject: Plumb the remaining dwell packets --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index fe93d6b..83bd9d9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -246,6 +246,8 @@ namespace OpenSim.Tests.Common.Mock public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; public event EventGodDelete OnEventGodDelete; + public event ParcelDwellRequest OnParcelDwellRequest; + #pragma warning restore 67 /// @@ -986,6 +988,8 @@ namespace OpenSim.Tests.Common.Mock { } - + public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) + { + } } } -- cgit v1.1 From 0b8d22ab544910a2b9b89b4bee2926a90b0da63f Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 5 Jan 2009 16:30:35 +0000 Subject: * Check in login service tests beachhead --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index a6a025b..472645c 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -36,7 +36,12 @@ namespace OpenSim.Tests.Common.Mock public class TestCommunicationsManager : CommunicationsManager { public TestCommunicationsManager() - : base(null, null, null, false, null) + : this(null) + { + } + + public TestCommunicationsManager(NetworkServersInfo serversInfo) + : base(serversInfo, null, null, false, null) { LocalInventoryService lis = new LocalInventoryService(); m_interServiceInventoryService = lis; @@ -44,7 +49,7 @@ namespace OpenSim.Tests.Common.Mock LocalUserServices lus = new LocalUserServices(991, 992, lis); m_userService = lus; - m_userAdminService = lus; + m_userAdminService = lus; } } } -- cgit v1.1 From 04ffcce7ea4fd303cd05e31aa8ece999c17f45b0 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 5 Jan 2009 17:38:39 +0000 Subject: * Extend stub to test the successful login of a user on the local login service * Test does not do authentication --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 5 ++++- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 472645c..204ebd7 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -49,7 +49,10 @@ namespace OpenSim.Tests.Common.Mock LocalUserServices lus = new LocalUserServices(991, 992, lis); m_userService = lus; - m_userAdminService = lus; + m_userAdminService = lus; + + LocalBackEndServices gs = new LocalBackEndServices(); + m_gridService = gs; } } } diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index a5e2a37..6be7b3d 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -102,7 +102,10 @@ namespace OpenSim.Tests.Common.Mock public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) {} - public List GetUserFriendList(UUID friendlistowner) { return null; } + public List GetUserFriendList(UUID friendlistowner) + { + return new List(); + } public Dictionary GetFriendRegionInfos(List uuids) { return null; } -- cgit v1.1 From 0b07c9762b4c70b6d234b70fb9e591c770dc1bf1 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 5 Jan 2009 18:00:53 +0000 Subject: * Simplify test code by always setting up mock 'in memory' user and inventory data plugins for every TestCommunicationsManager * imo the gain in simplcity of test code outweighs the very small cost of setting up some stuff that some tests will never use --- .../Tests/Common/Mock/TestCommunicationsManager.cs | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 204ebd7..c234429 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -35,6 +35,18 @@ namespace OpenSim.Tests.Common.Mock { public class TestCommunicationsManager : CommunicationsManager { + public IUserDataPlugin UserDataPlugin + { + get { return m_userDataPlugin; } + } + private IUserDataPlugin m_userDataPlugin; + + public IInventoryDataPlugin InventoryDataPlugin + { + get { return m_inventoryDataPlugin; } + } + private IInventoryDataPlugin m_inventoryDataPlugin; + public TestCommunicationsManager() : this(null) { @@ -43,16 +55,21 @@ namespace OpenSim.Tests.Common.Mock public TestCommunicationsManager(NetworkServersInfo serversInfo) : base(serversInfo, null, null, false, null) { + m_userDataPlugin = new TestUserDataPlugin(); + m_inventoryDataPlugin = new TestInventoryDataPlugin(); + LocalInventoryService lis = new LocalInventoryService(); + lis.AddPlugin(m_inventoryDataPlugin); m_interServiceInventoryService = lis; - AddInventoryService(lis); + AddInventoryService(lis); LocalUserServices lus = new LocalUserServices(991, 992, lis); + lus.AddPlugin(m_userDataPlugin); m_userService = lus; - m_userAdminService = lus; + m_userAdminService = lus; LocalBackEndServices gs = new LocalBackEndServices(); - m_gridService = gs; + m_gridService = gs; } } } -- cgit v1.1 From b6ee2f15bacda2a2c22785923b1e41639db5a6db Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 6 Jan 2009 15:09:52 +0000 Subject: * refactor: Remove the need to separately pass in the http listener to the scene - this is always available via CommsManager --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestScene.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index c234429..738bc15 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -53,8 +53,8 @@ namespace OpenSim.Tests.Common.Mock } public TestCommunicationsManager(NetworkServersInfo serversInfo) - : base(serversInfo, null, null, false, null) - { + : base(serversInfo, new BaseHttpServer(666), null, false, null) + { m_userDataPlugin = new TestUserDataPlugin(); m_inventoryDataPlugin = new TestInventoryDataPlugin(); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 6b176a1..04b3e74 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock public TestScene( RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, - AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, + AssetCache assetCach, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, moduleLoader, + : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } -- cgit v1.1 From 7c7ea57c5c2bf01280e2df03cedc999aa5e7be87 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 9 Jan 2009 02:59:56 +0000 Subject: Finish dwell sending, adding the forgotten method body. Add UserInfo and a dummy reply to enable Hippo Viewer users to disable IM logging (option was greyed out in OpenSim before) --- OpenSim/Tests/Common/Mock/TestClient.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 83bd9d9..b5d6f6b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -93,7 +93,6 @@ namespace OpenSim.Tests.Common.Mock public event ViewerEffectEventHandler OnViewerEffect; public event FetchInventory OnAgentDataUpdateRequest; - public event FetchInventory OnUserInfoRequest; public event TeleportLocationRequest OnSetStartLocationRequest; public event UpdateShape OnUpdatePrimShape; @@ -248,6 +247,9 @@ namespace OpenSim.Tests.Common.Mock public event ParcelDwellRequest OnParcelDwellRequest; + public event UserInfoRequest OnUserInfoRequest; + public event UpdateUserInfo OnUpdateUserInfo; + #pragma warning restore 67 /// @@ -991,5 +993,9 @@ namespace OpenSim.Tests.Common.Mock public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) { } + + public void SendUserInfoReply(bool imViaEmail, bool visible, string email) + { + } } } -- cgit v1.1 From d770bea2912e9fe02644183dce424193fe87ab7d Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 12 Jan 2009 15:33:56 +0000 Subject: Enhanced LoginServiceTests to test for authentication and response Expanded TestUserDataPlugin to cover new methods From: Arthur Rodrigo S Valadares --- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 134 +++++++++++++++++++----- 1 file changed, 108 insertions(+), 26 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index 6be7b3d..8dccacc 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -38,7 +38,7 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestUserDataPlugin : IUserDataPlugin - { + { public string Version { get { return "0"; } } public string Name { get { return "TestUserDataPlugin"; } } @@ -49,64 +49,146 @@ namespace OpenSim.Tests.Common.Mock /// /// User profiles keyed by uuid - /// + /// private Dictionary m_userProfilesByUuid = new Dictionary(); + /// + /// User profiles and their agents + /// + private Dictionary m_agentByProfileUuid = new Dictionary(); + + /// + /// Friends list by uuid + /// + private Dictionary> m_friendsListByUuid = new Dictionary>(); + public void Initialise() {} public void Dispose() {} - - public void AddNewUserProfile(UserProfileData user) + + public void AddNewUserProfile(UserProfileData user) { UpdateUserProfile(user); } - - public UserProfileData GetUserByUUID(UUID user) + + public UserProfileData GetUserByUUID(UUID user) { UserProfileData userProfile = null; m_userProfilesByUuid.TryGetValue(user, out userProfile); - - return userProfile; + + return userProfile; } - public UserProfileData GetUserByName(string fname, string lname) - { + public UserProfileData GetUserByName(string fname, string lname) + { UserProfileData userProfile = null; m_userProfilesByName.TryGetValue(fname + " " + lname, out userProfile); - + return userProfile; - } + } - public bool UpdateUserProfile(UserProfileData user) - { + public bool UpdateUserProfile(UserProfileData user) + { m_userProfilesByUuid[user.ID] = user; m_userProfilesByName[user.FirstName + " " + user.SurName] = user; - + return true; } public List GeneratePickerResults(UUID queryID, string query) { return null; } - public UserAgentData GetAgentByUUID(UUID user) { return null; } + public UserAgentData GetAgentByUUID(UUID user) + { + UserAgentData userAgent = null; + m_agentByProfileUuid.TryGetValue(user, out userAgent); - public UserAgentData GetAgentByName(string name) { return null; } + return userAgent; + } - public UserAgentData GetAgentByName(string fname, string lname) { return null; } + public UserAgentData GetAgentByName(string name) + { + UserProfileData userProfile = null; + m_userProfilesByName.TryGetValue(name, out userProfile); + UserAgentData userAgent = null; + m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent); + + return userAgent; + } + + public UserAgentData GetAgentByName(string fname, string lname) + { + UserProfileData userProfile = GetUserByName(fname,lname); + UserAgentData userAgent = null; + m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent); + + return userAgent; + } public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {} - public void AddNewUserAgent(UserAgentData agent) {} + public void AddNewUserAgent(UserAgentData agent) + { + m_agentByProfileUuid[agent.ProfileID] = agent; + } + public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) + { + FriendListItem newfriend = new FriendListItem(); + newfriend.FriendPerms = perms; + newfriend.Friend = friend; + newfriend.FriendListOwner = friendlistowner; + + if (!m_friendsListByUuid.ContainsKey(friendlistowner)) + { + List friendslist = new List(); + m_friendsListByUuid[friendlistowner] = friendslist; + + } + m_friendsListByUuid[friendlistowner].Add(newfriend); + } - public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) {} - - public void RemoveUserFriend(UUID friendlistowner, UUID friend) {} + public void RemoveUserFriend(UUID friendlistowner, UUID friend) + { + if (m_friendsListByUuid.ContainsKey(friendlistowner)) + { + List friendslist = m_friendsListByUuid[friendlistowner]; + foreach (FriendListItem frienditem in friendslist) + { + if (frienditem.Friend == friend) + { + friendslist.Remove(frienditem); + break; + } + } + } + } - public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) {} + public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) + { + if (m_friendsListByUuid.ContainsKey(friendlistowner)) + { + List friendslist = m_friendsListByUuid[friendlistowner]; + foreach (FriendListItem frienditem in friendslist) + { + if (frienditem.Friend == friend) + { + frienditem.FriendPerms = perms; + break; + } + } + } + } - public List GetUserFriendList(UUID friendlistowner) + public List GetUserFriendList(UUID friendlistowner) { - return new List(); + if (m_friendsListByUuid.ContainsKey(friendlistowner)) + { + return m_friendsListByUuid[friendlistowner]; + } + else + return new List(); + + } - + public Dictionary GetFriendRegionInfos(List uuids) { return null; } public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; } -- cgit v1.1 From d4d2c1959481d6d5e04a646c0b34f954b1bc727d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 12 Jan 2009 18:45:03 +0000 Subject: * Extend PacketHandlerTest to fire in a packet. * Can't test result yet since the Client thread handles it with unpredictable timing --- OpenSim/Tests/Common/Mock/TestClient.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b5d6f6b..41c2eb6 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -343,6 +343,14 @@ namespace OpenSim.Tests.Common.Mock set { } } + private uint m_circuitCode; + + public uint CircuitCode + { + get { return m_circuitCode; } + set { m_circuitCode = value; } + } + /// /// Constructor /// @@ -753,14 +761,6 @@ namespace OpenSim.Tests.Common.Mock { } - private uint m_circuitCode; - - public uint CircuitCode - { - get { return m_circuitCode; } - set { m_circuitCode = value; } - } - public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message) { -- cgit v1.1 From ade107f04f42f448d0a7b34ae552cf54c3bf4f7e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 12 Jan 2009 19:37:56 +0000 Subject: * Separate starting a client thread into a separate Start() method (which matches the existing Stop() and Restart() methods) --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 41c2eb6..a9ee837 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -757,6 +757,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void Start() + { + } + public void Stop() { } -- cgit v1.1 From 9dff38ca1427e73dbf297f095a1e4c63eb994020 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 13 Jan 2009 19:55:07 +0000 Subject: * Extended TextureSenderTests and modified TestClient.cs with new methods From: Arthur Rodrigo S Valadares --- OpenSim/Tests/Common/Mock/TestClient.cs | 60 ++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 19 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a9ee837..428f599 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -39,6 +39,10 @@ namespace OpenSim.Tests.Common.Mock { private Scene m_scene; + // Mock testing variables + public List sentdatapkt = new List(); + public List sentpktpkt = new List(); + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -215,7 +219,7 @@ namespace OpenSim.Tests.Common.Mock public event ActivateGesture OnActivateGesture; public event DeactivateGesture OnDeactivateGesture; public event ObjectOwner OnObjectOwner; - + public event DirPlacesQuery OnDirPlacesQuery; public event DirFindQuery OnDirFindQuery; public event DirLandQuery OnDirLandQuery; @@ -229,7 +233,7 @@ namespace OpenSim.Tests.Common.Mock public event OfferCallingCard OnOfferCallingCard; public event AcceptCallingCard OnAcceptCallingCard; public event DeclineCallingCard OnDeclineCallingCard; - + public event SoundTrigger OnSoundTrigger; public event StartLure OnStartLure; @@ -284,7 +288,7 @@ namespace OpenSim.Tests.Common.Mock { get { return m_firstName; } } - private string m_firstName; + private string m_firstName; public virtual string LastName { @@ -359,7 +363,7 @@ namespace OpenSim.Tests.Common.Mock { myID = agentData.AgentID; m_firstName = agentData.firstname; - m_lastName = agentData.lastname; + m_lastName = agentData.lastname; } public virtual void ActivateGesture(UUID assetId, UUID gestureId) @@ -420,12 +424,12 @@ namespace OpenSim.Tests.Common.Mock public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp) { - + } public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket) { - + } public void SendGenericMessage(string method, List message) @@ -563,7 +567,7 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendBulkUpdateInventory(InventoryItemBase item) { } - + public void SendBulkUpdateInventory(InventoryFolderBase folderBase) {} @@ -590,7 +594,7 @@ namespace OpenSim.Tests.Common.Mock int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent) { } - + public virtual void SendNameReply(UUID profileId, string firstname, string lastname) { } @@ -660,16 +664,34 @@ namespace OpenSim.Tests.Common.Mock public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) { + ImageDataPacket im = new ImageDataPacket(); + im.Header.Reliable = false; + im.ImageID.Packets = numParts; + im.ImageID.ID = ImageUUID; + + if (ImageSize > 0) + im.ImageID.Size = ImageSize; + + im.ImageData.Data = ImageData; + im.ImageID.Codec = imageCodec; + im.Header.Zerocoded = true; + sentdatapkt.Add(im); } - + public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) { + ImagePacketPacket im = new ImagePacketPacket(); + im.Header.Reliable = false; + im.ImageID.Packet = partNumber; + im.ImageID.ID = imageUuid; + im.ImageData.Data = imageData; + sentpktpkt.Add(im); } - + public void SendImageNotFound(UUID imageid) { } - + public void SendShutdownConnectionNotice() { } @@ -726,10 +748,10 @@ namespace OpenSim.Tests.Common.Mock public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) { } - + public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) { - } + } public void SendViewerTime(int phase) { @@ -804,11 +826,11 @@ namespace OpenSim.Tests.Common.Mock public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) { } - + public void SendEstateCovenantInformation(UUID covenant) { } - + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) { } @@ -816,19 +838,19 @@ namespace OpenSim.Tests.Common.Mock public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { } - + public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) { } - + public void SendForceClientSelectObjects(List objectIDs) { } - + public void SendLandObjectOwners(Dictionary ownersAndCount) { } - + public void SendLandParcelOverlay(byte[] data, int sequence_id) { } -- cgit v1.1 From 093adb2113d748f28554393cc8a6fe53502126dc Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 15 Jan 2009 21:27:55 +0000 Subject: * Add new unit test for simple teleport in a standalone. * Does not yet check results. --- OpenSim/Tests/Common/Mock/TestClient.cs | 11 +++++++++++ OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 428f599..5b3b27b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -365,6 +365,17 @@ namespace OpenSim.Tests.Common.Mock m_firstName = agentData.firstname; m_lastName = agentData.lastname; } + + /// + /// Attempt a teleport to the given region. + /// + /// + /// + /// + public void Teleport(ulong regionHandle, Vector3 position, Vector3 lookAt) + { + OnTeleportLocationRequest(this, regionHandle, position, lookAt, 16); + } public virtual void ActivateGesture(UUID assetId, UUID gestureId) { diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 738bc15..1663ac1 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -69,7 +69,8 @@ namespace OpenSim.Tests.Common.Mock m_userAdminService = lus; LocalBackEndServices gs = new LocalBackEndServices(); - m_gridService = gs; + m_gridService = gs; + m_interRegion = gs; } } } -- cgit v1.1 From eca6442bae4093019bd221e87413c74c77c4ff5d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 16 Jan 2009 21:56:13 +0000 Subject: * Rig up enough infrastructure to actually perform a successful 'standalone' teleport unit test with checks that the scene presence disappeared from sceneA and appeared in sceneB * However, I'm not convinced that the actual process in the test completely reflects reality, and a lot of stuff had to be rigged up (which should get resolved over time) --- OpenSim/Tests/Common/Mock/TestClient.cs | 79 +++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 18 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5b3b27b..6254272 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -28,6 +28,8 @@ using System; using System.Collections.Generic; using System.Net; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; @@ -37,11 +39,18 @@ namespace OpenSim.Tests.Common.Mock { public class TestClient : IClientAPI { - private Scene m_scene; - + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // Mock testing variables public List sentdatapkt = new List(); public List sentpktpkt = new List(); + + // TODO: This is a really nasty (and temporary) means of telling the test client which scene to invoke setup + // methods on when a teleport is requested + public Scene TeleportTargetScene; + private TestClient TeleportSceneClient; + + private IScene m_scene; // disable warning: public events, part of the public API #pragma warning disable 67 @@ -259,7 +268,7 @@ namespace OpenSim.Tests.Common.Mock /// /// This agent's UUID /// - private UUID myID; + private UUID m_agentId; private Vector3 startPos = new Vector3(128, 128, 2); @@ -271,7 +280,7 @@ namespace OpenSim.Tests.Common.Mock public virtual UUID AgentId { - get { return myID; } + get { return m_agentId; } } public UUID SessionId @@ -359,11 +368,14 @@ namespace OpenSim.Tests.Common.Mock /// Constructor /// /// - public TestClient(AgentCircuitData agentData) + /// + public TestClient(AgentCircuitData agentData, IScene scene) { - myID = agentData.AgentID; + m_agentId = agentData.AgentID; m_firstName = agentData.firstname; m_lastName = agentData.lastname; + m_circuitCode = agentData.circuitcode; + m_scene = scene; } /// @@ -376,6 +388,11 @@ namespace OpenSim.Tests.Common.Mock { OnTeleportLocationRequest(this, regionHandle, position, lookAt, 16); } + + public void CompleteMovement() + { + OnCompleteMovementToRegion(); + } public virtual void ActivateGesture(UUID assetId, UUID gestureId) { @@ -465,14 +482,48 @@ namespace OpenSim.Tests.Common.Mock { } + public virtual AgentCircuitData RequestClientInfo() + { + AgentCircuitData agentData = new AgentCircuitData(); + agentData.AgentID = AgentId; + agentData.SessionID = UUID.Zero; + agentData.SecureSessionID = UUID.Zero; + agentData.circuitcode = m_circuitCode; + agentData.child = false; + agentData.firstname = m_firstName; + agentData.lastname = m_lastName; + agentData.CapsPath = m_scene.GetCapsPath(m_agentId); + agentData.ChildrenCapSeeds = new Dictionary(m_scene.GetChildrenSeeds(m_agentId)); + + return agentData; + } + public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) { + m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour"); + + // In response to this message, we are going to make a teleport to the scene we've previous been told + // about by test code (this needs to be improved). + AgentCircuitData newAgent = RequestClientInfo(); + + // Stage 2: add the new client as a child agent to the scene + TeleportSceneClient = new TestClient(newAgent, TeleportTargetScene); + TeleportTargetScene.AddNewClient(TeleportSceneClient); + } + + public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL) + { + m_log.DebugFormat("[TEST CLIENT]: Received SendRegionTeleport"); + + TeleportSceneClient.CompleteMovement(); + //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); } - public virtual AgentCircuitData RequestClientInfo() + public virtual void SendTeleportFailed(string reason) { - return new AgentCircuitData(); - } + m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); + } public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL) @@ -487,15 +538,6 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, - uint locationID, uint flags, string capsURL) - { - } - - public virtual void SendTeleportFailed(string reason) - { - } - public virtual void SendTeleportLocationStart() { } @@ -788,6 +830,7 @@ namespace OpenSim.Tests.Common.Mock public void Close(bool ShutdownCircuit) { + m_scene.RemoveClient(AgentId); } public void Start() -- cgit v1.1 From 37fa6775488ab237a4537d49b92a8d52b0497b98 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 21 Jan 2009 21:14:17 +0000 Subject: * refactor: Extract caps related code from scene and put into a region module * No functional changes in this revision --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6254272..62350b9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -33,6 +33,7 @@ using log4net; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; +using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; namespace OpenSim.Tests.Common.Mock @@ -492,8 +493,10 @@ namespace OpenSim.Tests.Common.Mock agentData.child = false; agentData.firstname = m_firstName; agentData.lastname = m_lastName; - agentData.CapsPath = m_scene.GetCapsPath(m_agentId); - agentData.ChildrenCapSeeds = new Dictionary(m_scene.GetChildrenSeeds(m_agentId)); + + ICapabilitiesModule capsModule = m_scene.RequestModuleInterface(); + agentData.CapsPath = capsModule.GetCapsPath(m_agentId); + agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); return agentData; } -- cgit v1.1 From 884009ed33eab204588cc3978a46abff1098b832 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 22 Jan 2009 19:46:31 +0000 Subject: * Add some caps seed capability path checking to the simple non neighbours standalone region teleport test --- OpenSim/Tests/Common/Mock/TestClient.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 62350b9..f899375 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -270,6 +270,11 @@ namespace OpenSim.Tests.Common.Mock /// This agent's UUID /// private UUID m_agentId; + + /// + /// The last caps seed url that this client was given. + /// + public string CapsSeedUrl; private Vector3 startPos = new Vector3(128, 128, 2); @@ -377,6 +382,7 @@ namespace OpenSim.Tests.Common.Mock m_lastName = agentData.lastname; m_circuitCode = agentData.circuitcode; m_scene = scene; + CapsSeedUrl = agentData.CapsPath; } /// @@ -496,7 +502,7 @@ namespace OpenSim.Tests.Common.Mock ICapabilitiesModule capsModule = m_scene.RequestModuleInterface(); agentData.CapsPath = capsModule.GetCapsPath(m_agentId); - agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); + agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); return agentData; } @@ -519,6 +525,8 @@ namespace OpenSim.Tests.Common.Mock { m_log.DebugFormat("[TEST CLIENT]: Received SendRegionTeleport"); + CapsSeedUrl = capsURL; + TeleportSceneClient.CompleteMovement(); //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); } -- cgit v1.1 From f8e45e8e981bfd87f3765d7452046515e11a9345 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 05:20:03 +0000 Subject: Rename IAssetProviderPlugin to IAssetDataPlugin aligning with the other data plugins. --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index f44339a..ebece27 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -36,7 +36,7 @@ namespace OpenSim.Tests.Common.Mock /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit /// tests are single threaded. /// - public class TestAssetDataPlugin : IAssetProviderPlugin + public class TestAssetDataPlugin : IAssetDataPlugin { public string Version { get { return "0"; } } public string Name { get { return "TestAssetDataPlugin"; } } -- cgit v1.1 From e12b0a249674bbe4b1980c74f13d8f09cc2e4432 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 05:20:16 +0000 Subject: - move IAssetDataPlugin from OpenSim/Framework/IAssetProvider.cs to OpenSim/Data/IAssetData.cs - remove some trailing whitespace --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index ebece27..fc84eac 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -27,7 +27,7 @@ using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Framework.Communications; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { @@ -35,7 +35,7 @@ namespace OpenSim.Tests.Common.Mock /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit /// tests are single threaded. - /// + /// public class TestAssetDataPlugin : IAssetDataPlugin { public string Version { get { return "0"; } } @@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common.Mock public void Initialise() {} public void Dispose() {} - + public AssetBase FetchAsset(UUID uuid) { return null; } public void CreateAsset(AssetBase asset) {} public void UpdateAsset(AssetBase asset) {} -- cgit v1.1 From 9377c6f2b28c75a093fa554d64e0d63e6bdf2fa5 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 05:20:26 +0000 Subject: - move OpenSim/Framework/IInventoryData.cs to OpenSim/Data/IInventoryData.cs - trim trailing whitespace --- .../Tests/Common/Mock/TestCommunicationsManager.cs | 23 ++++---- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 69 +++++++++++----------- 2 files changed, 47 insertions(+), 45 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 1663ac1..566d8d2 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -30,6 +30,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Region.Communications.Local; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { @@ -40,36 +41,36 @@ namespace OpenSim.Tests.Common.Mock get { return m_userDataPlugin; } } private IUserDataPlugin m_userDataPlugin; - + public IInventoryDataPlugin InventoryDataPlugin { get { return m_inventoryDataPlugin; } } private IInventoryDataPlugin m_inventoryDataPlugin; - + public TestCommunicationsManager() : this(null) - { + { } - + public TestCommunicationsManager(NetworkServersInfo serversInfo) : base(serversInfo, new BaseHttpServer(666), null, false, null) - { + { m_userDataPlugin = new TestUserDataPlugin(); m_inventoryDataPlugin = new TestInventoryDataPlugin(); - + LocalInventoryService lis = new LocalInventoryService(); lis.AddPlugin(m_inventoryDataPlugin); m_interServiceInventoryService = lis; - AddInventoryService(lis); - + AddInventoryService(lis); + LocalUserServices lus = new LocalUserServices(991, 992, lis); lus.AddPlugin(m_userDataPlugin); m_userService = lus; - m_userAdminService = lus; - + m_userAdminService = lus; + LocalBackEndServices gs = new LocalBackEndServices(); - m_gridService = gs; + m_gridService = gs; m_interRegion = gs; } } diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 8e19aec..59d923c 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { @@ -43,12 +44,12 @@ namespace OpenSim.Tests.Common.Mock /// Known inventory folders /// private Dictionary m_folders = new Dictionary(); - + /// /// User root folders /// private Dictionary m_rootFolders = new Dictionary(); - + public string Version { get { return "0"; } } public string Name { get { return "TestInventoryDataPlugin"; } } @@ -56,10 +57,10 @@ namespace OpenSim.Tests.Common.Mock public void Initialise(string connect) {} public void Dispose() {} - public List getFolderHierarchy(UUID parentID) + public List getFolderHierarchy(UUID parentID) { List folders = new List(); - + foreach (InventoryFolderBase folder in m_folders.Values) { if (folder.ParentID == parentID) @@ -68,77 +69,77 @@ namespace OpenSim.Tests.Common.Mock folders.Add(folder); } } - + return folders; } - - public List getInventoryInFolder(UUID folderID) - { - return new List(); + + public List getInventoryInFolder(UUID folderID) + { + return new List(); } - + public List getUserRootFolders(UUID user) { return null; } - - public InventoryFolderBase getUserRootFolder(UUID user) - { + + public InventoryFolderBase getUserRootFolder(UUID user) + { InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); - + return folder; } - - public List getInventoryFolders(UUID parentID) + + public List getInventoryFolders(UUID parentID) { List folders = new List(); - + foreach (InventoryFolderBase folder in m_folders.Values) { if (folder.ParentID == parentID) folders.Add(folder); } - + return folders; } - + public InventoryItemBase getInventoryItem(UUID item) { return null; } - - public InventoryFolderBase getInventoryFolder(UUID folderId) + + public InventoryFolderBase getInventoryFolder(UUID folderId) { InventoryFolderBase folder = null; m_folders.TryGetValue(folderId, out folder); - + return folder; } - + public void addInventoryItem(InventoryItemBase item) {} public void updateInventoryItem(InventoryItemBase item) {} public void deleteInventoryItem(UUID item) {} - - public void addInventoryFolder(InventoryFolderBase folder) + + public void addInventoryFolder(InventoryFolderBase folder) { m_folders[folder.ID] = folder; - + if (folder.ParentID == UUID.Zero) m_rootFolders[folder.Owner] = folder; } - + public void updateInventoryFolder(InventoryFolderBase folder) { m_folders[folder.ID] = folder; } - - public void moveInventoryFolder(InventoryFolderBase folder) + + public void moveInventoryFolder(InventoryFolderBase folder) { // Simple replace - updateInventoryFolder(folder); + updateInventoryFolder(folder); } - - public void deleteInventoryFolder(UUID folderId) + + public void deleteInventoryFolder(UUID folderId) { if (m_folders.ContainsKey(folderId)) m_folders.Remove(folderId); } - - public List fetchActiveGestures(UUID avatarID) { return null; } + + public List fetchActiveGestures(UUID avatarID) { return null; } } } -- cgit v1.1 From d3eae4073e75d1482467eee54230df141bdbb568 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 05:20:35 +0000 Subject: - move OpenSim/Framework/IUserData.cs to OpenSim/Data/IUserData.cs - trim trailing whitespace --- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index 8dccacc..73e8a09 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { @@ -205,4 +206,4 @@ namespace OpenSim.Tests.Common.Mock public void LogoutUsers(UUID regionID) {} } -} \ No newline at end of file +} -- cgit v1.1 From 9b66108081a8c8cf79faaa6c541554091c40850e Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 6 Feb 2009 16:55:34 +0000 Subject: This changeset is the step 1 of 2 in refactoring OpenSim.Region.Environment into a "framework" part and a modules only part. This first changeset refactors OpenSim.Region.Environment.Scenes, OpenSim.Region.Environment.Interfaces, and OpenSim.Region.Interfaces into OpenSim.Region.Framework.{Interfaces,Scenes} leaving only region modules in OpenSim.Region.Environment. The next step will be to move region modules up from OpenSim.Region.Environment.Modules to OpenSim.Region.CoreModules and then sort out which modules are really core modules and which should move out to forge. I've been very careful to NOT BREAK anything. i hope i've succeeded. as this is the work of a whole week i hope i managed to keep track with the applied patches of the last week --- could any of you that did check in stuff have a look at whether it survived? thx! --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f899375..5f02524 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -33,8 +33,8 @@ using log4net; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; -using OpenSim.Region.Environment.Interfaces; -using OpenSim.Region.Environment.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; namespace OpenSim.Tests.Common.Mock { diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 5e9b9ff..761ef44 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -28,7 +28,7 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Tests.Common.Mock { diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 04b3e74..00920c8 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -30,8 +30,8 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; -using OpenSim.Region.Environment; -using OpenSim.Region.Environment.Scenes; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Scenes; namespace OpenSim.Tests.Common.Mock { -- cgit v1.1 From 8088802c218d7eb4a47018b5b3bb70e7463a03b1 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 9 Feb 2009 21:47:55 +0000 Subject: From Alan Webb These changes replace all direct references to the AssetCache with IAssetCache. There is no change to functionality. Everything works as before. This is laying the groundwork for making it possible to register alternative asset caching mechanisms without disrupting other parts of OpenSim or their dependencies upon AssetCache functionality. --- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 00920c8..122e51c 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -40,7 +40,7 @@ namespace OpenSim.Tests.Common.Mock public TestScene( RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, - AssetCache assetCach, StorageManager storeManager, + IAssetCache assetCach, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, moduleLoader, -- cgit v1.1 From 8645c7482d39ccc9d72cb4cfc7c68b651b3824d3 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 11 Feb 2009 19:57:45 +0000 Subject: * Change SendBulkUpdateInventory from two methods to one which accepts an InventoryNode --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5f02524..2463b3b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -627,14 +627,10 @@ namespace OpenSim.Tests.Common.Mock { } - /// IClientAPI.SendBulkUpdateInventory(InventoryItemBase) - public virtual void SendBulkUpdateInventory(InventoryItemBase item) + public virtual void SendBulkUpdateInventory(InventoryNodeBase node) { } - public void SendBulkUpdateInventory(InventoryFolderBase folderBase) - {} - public UUID GetDefaultAnimation(string name) { return UUID.Zero; -- cgit v1.1 From ec07e1aad6fb3d28fcf4a3eca0becf4e0e209965 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 16 Feb 2009 18:33:05 +0000 Subject: * Iniital inventory archive test code. Doesn't actually do any testing yet --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 566d8d2..9b92421 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -59,6 +59,10 @@ namespace OpenSim.Tests.Common.Mock m_userDataPlugin = new TestUserDataPlugin(); m_inventoryDataPlugin = new TestInventoryDataPlugin(); + SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); + IAssetCache ac = new AssetCache(assetService); + m_assetCache = ac; + LocalInventoryService lis = new LocalInventoryService(); lis.AddPlugin(m_inventoryDataPlugin); m_interServiceInventoryService = lis; -- cgit v1.1 From 93837807ffb24e5811368063b9231a9d8b018d9d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 16 Feb 2009 19:15:16 +0000 Subject: * refactor: remove AssetCache field hanging off Scene * This is always available at Scene.CommsManager.AssetCache --- OpenSim/Tests/Common/Mock/TestScene.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 122e51c..12cce9d 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -39,11 +39,10 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - CommunicationsManager commsMan, SceneCommunicationService sceneGridService, - IAssetCache assetCach, StorageManager storeManager, + CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, moduleLoader, + : base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } -- cgit v1.1 From 31307849342c36c133b5cb8039296116c5456136 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 17 Feb 2009 04:16:42 +0000 Subject: Re-add the objectID field to the anim pack, that was deemed unneccessary and dropped nonths ago, because it is required to get smooth region crossings with AO running. Without it, in some corner cases, anims will continue to run in an unstoppable state. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2463b3b..373ee13 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -443,7 +443,7 @@ namespace OpenSim.Tests.Common.Mock } - public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) + public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) { } -- cgit v1.1 From 863556f2cc545c56599aab9d28373aa4ed83288d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 19 Feb 2009 03:09:56 +0000 Subject: Thank you, Snowdrop, for a patch that makes the callback ID parameter usable. Applied with formatting changes, please don't introduce K&R style indentations into OpenSim Fixes Mantis #3190 --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 373ee13..ee4aaa8 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -619,7 +619,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) + public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackID) { } -- cgit v1.1 From b5502ef3c322e787640a8a9b3cb474b2f8abaaaa Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 19 Feb 2009 18:40:32 +0000 Subject: * Extracted IAssetData and moved it to OpenSim.Framework to prepare to get rid of ugly CoreModules dependency on AssetServer.exe * And yes, the IAssetDataPlugin is misnomed, which became apparent on extracting it. --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index fc84eac..94604d2 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -27,7 +27,6 @@ using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { -- cgit v1.1 From b99d9bdeb1d5177a3dfff1d402d374fbd079ebaa Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 19 Feb 2009 19:32:53 +0000 Subject: * Reverted the AssetServer fix, apparently something was dependent on IAssetDataPlugin being in OpenSim.Data --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index 94604d2..fc84eac 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -27,6 +27,7 @@ using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { -- cgit v1.1 From 33330297d603a66cc157baa21c81328edc893e51 Mon Sep 17 00:00:00 2001 From: diva Date: Fri, 20 Feb 2009 03:39:50 +0000 Subject: THE BIG ANTI-REMOTING SCHLEP -- StartRemoting is no more. Sims in older versions will have a hard time communicating with sims on this release and later, especially if they haven't transitioned to RESTComms at all. There's still some cleanup to do on assorted data structures, but the main functional change here is that sims no longer listen on remoting ports. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 9b92421..38a3033 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -75,7 +75,6 @@ namespace OpenSim.Tests.Common.Mock LocalBackEndServices gs = new LocalBackEndServices(); m_gridService = gs; - m_interRegion = gs; } } } -- cgit v1.1 From ed2de7ac821544751280b1310a49c2f4ba70b4c3 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 26 Feb 2009 20:11:55 +0000 Subject: Plumb in the RetrieveInstantMessages event that is sent by the viewer when it is ready to receive offline IM --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ee4aaa8..16c55ae 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -264,6 +264,8 @@ namespace OpenSim.Tests.Common.Mock public event UserInfoRequest OnUserInfoRequest; public event UpdateUserInfo OnUpdateUserInfo; + public event RetrieveInstantMessages OnRetrieveInstantMessages; + #pragma warning restore 67 /// -- cgit v1.1 From 57ab79e3312d9856a3534a1e2343b45c6cf74ac6 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 26 Feb 2009 21:29:16 +0000 Subject: * Update ScenePresenceTests to reflect current REST communication workflow. * Fixed an issue with AssetCache where it would break unit tests randomly. From: Arthur Rodrigo S Valadares --- OpenSim/Tests/Common/Mock/TestClient.cs | 58 +++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 16c55ae..0635aab 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Net; using System.Reflection; +using System.Threading; using log4net; using OpenMetaverse; using OpenMetaverse.Packets; @@ -41,16 +42,17 @@ namespace OpenSim.Tests.Common.Mock public class TestClient : IClientAPI { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + // Mock testing variables public List sentdatapkt = new List(); public List sentpktpkt = new List(); - + EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); + // TODO: This is a really nasty (and temporary) means of telling the test client which scene to invoke setup // methods on when a teleport is requested - public Scene TeleportTargetScene; + public Scene TeleportTargetScene; private TestClient TeleportSceneClient; - + private IScene m_scene; // disable warning: public events, part of the public API @@ -272,7 +274,7 @@ namespace OpenSim.Tests.Common.Mock /// This agent's UUID /// private UUID m_agentId; - + /// /// The last caps seed url that this client was given. /// @@ -363,15 +365,15 @@ namespace OpenSim.Tests.Common.Mock { set { } } - + private uint m_circuitCode; public uint CircuitCode { get { return m_circuitCode; } set { m_circuitCode = value; } - } - + } + /// /// Constructor /// @@ -386,7 +388,7 @@ namespace OpenSim.Tests.Common.Mock m_scene = scene; CapsSeedUrl = agentData.CapsPath; } - + /// /// Attempt a teleport to the given region. /// @@ -395,9 +397,9 @@ namespace OpenSim.Tests.Common.Mock /// public void Teleport(ulong regionHandle, Vector3 position, Vector3 lookAt) { - OnTeleportLocationRequest(this, regionHandle, position, lookAt, 16); + OnTeleportLocationRequest(this, regionHandle, position, lookAt, 16); } - + public void CompleteMovement() { OnCompleteMovementToRegion(); @@ -501,46 +503,52 @@ namespace OpenSim.Tests.Common.Mock agentData.child = false; agentData.firstname = m_firstName; agentData.lastname = m_lastName; - + ICapabilitiesModule capsModule = m_scene.RequestModuleInterface(); agentData.CapsPath = capsModule.GetCapsPath(m_agentId); agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); - + return agentData; } - + public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) { m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour"); - + // In response to this message, we are going to make a teleport to the scene we've previous been told // about by test code (this needs to be improved). - AgentCircuitData newAgent = RequestClientInfo(); - + AgentCircuitData newAgent = RequestClientInfo(); + // Stage 2: add the new client as a child agent to the scene TeleportSceneClient = new TestClient(newAgent, TeleportTargetScene); - TeleportTargetScene.AddNewClient(TeleportSceneClient); + TeleportTargetScene.AddNewClient(TeleportSceneClient); } - + public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL) - { + { m_log.DebugFormat("[TEST CLIENT]: Received SendRegionTeleport"); - + CapsSeedUrl = capsURL; - + TeleportSceneClient.CompleteMovement(); - //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); + //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); } public virtual void SendTeleportFailed(string reason) { m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); - } + } public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL) { + // This is supposed to send a packet to the client telling it's ready to start region crossing. + // Instead I will just signal I'm ready, mimicking the communication behavior. + // It's ugly, but avoids needless communication setup. This is used in ScenePresenceTests.cs. + // Arthur V. + + wh.Set(); } public virtual void SendMapBlock(List mapBlocks, uint flag) @@ -845,7 +853,7 @@ namespace OpenSim.Tests.Common.Mock public void Start() { } - + public void Stop() { } -- cgit v1.1 From a2f07ecd2e248966957a8ea70d772276359b02e8 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Mon, 9 Mar 2009 07:29:34 +0000 Subject: Implemented FetchAssetMetadataSet in DB backends. This method fetches metadata for a subset of the entries in the assets database. This functionality is used in the ForEach calls in the asset storage providers in AssetInventoryServer. With this implemented, frontends such as the BrowseFrontend should now work. - MySQL: implemented, sanity tested - SQLite: implemented, sanity tested - MSSQL: implemented, not tested - NHibernate: not implemented --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index fc84eac..d6bce5b 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; @@ -48,6 +49,7 @@ namespace OpenSim.Tests.Common.Mock public void CreateAsset(AssetBase asset) {} public void UpdateAsset(AssetBase asset) {} public bool ExistsAsset(UUID uuid) { return false; } + public List FetchAssetMetadataSet(int start, int count) { return new List(count); } public void Initialise(string connect) {} } } -- cgit v1.1 From ae759f2d060bc53cc0b372d5584fcd4ffdd963b4 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 9 Mar 2009 19:40:32 +0000 Subject: * Add basic asset cache get test --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 37 +++++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index d6bce5b..80b9ae3 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -38,18 +38,39 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestAssetDataPlugin : IAssetDataPlugin - { + { public string Version { get { return "0"; } } public string Name { get { return "TestAssetDataPlugin"; } } + + protected Dictionary Assets = new Dictionary(); public void Initialise() {} + public void Initialise(string connect) {} public void Dispose() {} - public AssetBase FetchAsset(UUID uuid) { return null; } - public void CreateAsset(AssetBase asset) {} - public void UpdateAsset(AssetBase asset) {} - public bool ExistsAsset(UUID uuid) { return false; } - public List FetchAssetMetadataSet(int start, int count) { return new List(count); } - public void Initialise(string connect) {} + public AssetBase FetchAsset(UUID uuid) + { + if (ExistsAsset(uuid)) + return Assets[uuid]; + else + return null; + } + + public void CreateAsset(AssetBase asset) + { + Assets[asset.FullID] = asset; + } + + public void UpdateAsset(AssetBase asset) + { + CreateAsset(asset); + } + + public bool ExistsAsset(UUID uuid) + { + return Assets.ContainsKey(uuid); + } + + public List FetchAssetMetadataSet(int start, int count) { return new List(count); } } -} +} \ No newline at end of file -- cgit v1.1 From 1121a214b9258487dae0d84dad1a0b495d2f80bd Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 21 Mar 2009 17:46:58 +0000 Subject: Add a QueryItem method to the inventory subsystem. Currently implemented for MySQL only, stubs for the others. This allows updating the cache with a single item from the database. --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 59d923c..69b0917 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -115,6 +115,11 @@ namespace OpenSim.Tests.Common.Mock public void updateInventoryItem(InventoryItemBase item) {} public void deleteInventoryItem(UUID item) {} + public InventoryItemBase queryInventoryItem(UUID item) + { + return null; + } + public void addInventoryFolder(InventoryFolderBase folder) { m_folders[folder.ID] = folder; -- cgit v1.1 From 412112acbafa6e1f111b12007fd3a81728d0b2f5 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 23 Mar 2009 00:11:34 +0000 Subject: Committing partial work on passing folders across instances. This may crash. --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 69b0917..efe0101 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -120,6 +120,11 @@ namespace OpenSim.Tests.Common.Mock return null; } + public InventoryFolderBase queryInventoryFolder(UUID folderID) + { + return null; + } + public void addInventoryFolder(InventoryFolderBase folder) { m_folders[folder.ID] = folder; -- cgit v1.1 From 37e81c7d54db5b775550db9455bcd9cdce046bc7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 27 Mar 2009 18:51:45 +0000 Subject: Remove a hardcoded flow/dependency on the money module from LLCLientView --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0635aab..926d138 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1094,5 +1094,9 @@ namespace OpenSim.Tests.Common.Mock public void SendUserInfoReply(bool imViaEmail, bool visible, string email) { } + + public void SendCreateGroupReply(UUID groupID, bool success, string message) + { + } } } -- cgit v1.1 From cbef90fec6ebdbc4280b684425479a18cfca01d0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 27 Mar 2009 22:47:41 +0000 Subject: Add the events needed for profiles. Fixes Mantis #3324 --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 926d138..b4b0bea 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -268,6 +268,11 @@ namespace OpenSim.Tests.Common.Mock public event RetrieveInstantMessages OnRetrieveInstantMessages; + public event PickDelete OnPickDelete; + public event PickGodDelete OnPickGodDelete; + public event PickInfoUpdate OnPickInfoUpdate; + public event AvatarNotesUpdate OnAvatarNotesUpdate; + #pragma warning restore 67 /// -- cgit v1.1 From f5812b3702f38d4535f042303eef4bd37f8a448c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 28 Mar 2009 01:40:33 +0000 Subject: * Adds AgentUUIDs into the CourseLocationUpdate to improve compatibility with LibOMV based clients. * Modifies the IClientAPI! So client stacks will need to be modified! --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b4b0bea..fac0185 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -586,7 +586,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendCoarseLocationUpdate(List CoarseLocations) + public virtual void SendCoarseLocationUpdate(List users, List CoarseLocations) { } -- cgit v1.1 From 4f6c4378dad0f4122bdab9270fd7aaf3c60beb39 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 28 Mar 2009 04:21:44 +0000 Subject: Add mute list request event and dummy response --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index fac0185..f96057c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -273,6 +273,8 @@ namespace OpenSim.Tests.Common.Mock public event PickInfoUpdate OnPickInfoUpdate; public event AvatarNotesUpdate OnAvatarNotesUpdate; + public event MuteListRequest OnMuteListRequest; + #pragma warning restore 67 /// @@ -1103,5 +1105,9 @@ namespace OpenSim.Tests.Common.Mock public void SendCreateGroupReply(UUID groupID, bool success, string message) { } + + public void SendUseCachedMuteList() + { + } } } -- cgit v1.1 From 404bfdc9a6828638b7b4f7851602e3fe77044025 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 29 Mar 2009 00:48:34 +0000 Subject: Finish the offline IM module (still needs a server). Add rudimentary support for the mute list (no functionality yet, but allows the RetrieveInstantMessages event to fire now). --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f96057c..b2c1423 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1109,5 +1109,9 @@ namespace OpenSim.Tests.Common.Mock public void SendUseCachedMuteList() { } + + public void SendMuteListUpdate(string filename) + { + } } } -- cgit v1.1 From c483206fd7ecd67ac4fc8c4e4b71f65dfd3de6c4 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 29 Mar 2009 05:42:27 +0000 Subject: Change the client API to use GridInstantMessage for the "last mile" of IM sending. With this change, all methods that handle IM now use GridInstantMessage rather than individual parameters. --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b2c1423..780fa4e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -468,12 +468,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp) - { - - } - - public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, UUID transactionID, bool fromGroup, byte[] binaryBucket) + public void SendInstantMessage(GridInstantMessage im) { } -- cgit v1.1 From f88d755f9679b7b8e1880c76a452bc7344f9cb30 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 30 Mar 2009 11:51:34 +0000 Subject: Add PickInfoReply packet. Fixes Mantis #3324 --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 780fa4e..b47e48d 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1108,5 +1108,9 @@ namespace OpenSim.Tests.Common.Mock public void SendMuteListUpdate(string filename) { } + + public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled) + { + } } } -- cgit v1.1 From 8136cf4075216d09738b8707258581e6db755759 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 4 Apr 2009 15:43:02 +0000 Subject: Thanks jonc, for a patch that adds rendering of classic clouds. First part of Mantis #964, the necessary clouds image will follow separately. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b47e48d..33f080f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -491,6 +491,8 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendWindData(Vector2[] windSpeeds) { } + public virtual void SendCloudData(float[] cloudCover) { } + public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { } -- cgit v1.1 From 9e51c2db95fd43aa18e66d359c15349bdc9ad8f0 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 6 Apr 2009 07:17:23 +0000 Subject: * Implements World.Parcels[] array for MRM scripting. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 761ef44..4165641 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -39,7 +39,8 @@ namespace OpenSim.Tests.Common.Mock { public List ParcelsNearPoint(Vector3 position) { return null; } public List AllParcels() { return null; } - public ILandObject GetLandObject(int x, int y) { return null; } + public ILandObject GetLandObject(int x, int y) { return null; } + public ILandObject GetLandObject(int localID) { return null; } public ILandObject GetLandObject(float x, float y) { return null; } public bool IsLandPrimCountTainted() { return false; } public bool IsForcefulBansAllowed() { return false; } -- cgit v1.1 From ed6165ab9cb0726ab4d41265b097faf1d12d15b4 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 7 Apr 2009 17:46:23 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=3227 * Implement "Add To Outfit" * Thanks FredoChaplin --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 33f080f..e82c26d 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -74,6 +74,7 @@ namespace OpenSim.Tests.Common.Mock public event SetAppearance OnSetAppearance; public event AvatarNowWearing OnAvatarNowWearing; public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; + public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; public event UUIDNameRequest OnDetachAttachmentIntoInv; public event ObjectAttach OnObjectAttach; public event ObjectDeselect OnObjectDetach; -- cgit v1.1 From 8e6c20b27fdb95b9008614eb36678508407a4d19 Mon Sep 17 00:00:00 2001 From: nlin Date: Fri, 10 Apr 2009 06:39:52 +0000 Subject: Handle ObjectSpin* packets to spin physical prims on Ctrl+Shift+Drag Addresses Mantis #3381 The current implementation works as expected if the object has no rotation or only rotation around the Z axis; you can spin the object left or right (around the world Z axis). It works a little unexpectedly if the object has a non-Z-axis rotation; in this case the body is spun about its local Z axis, not the world Z-axis. (But SL also behaves oddly with a spin on an arbitrarily rotated object.) --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index e82c26d..4647349 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -107,6 +107,9 @@ namespace OpenSim.Tests.Common.Mock public event GrabObject OnGrabObject; public event ObjectSelect OnDeGrabObject; public event MoveObject OnGrabUpdate; + public event SpinStart OnSpinStart; + public event SpinObject OnSpinUpdate; + public event SpinStop OnSpinStop; public event ViewerEffectEventHandler OnViewerEffect; public event FetchInventory OnAgentDataUpdateRequest; -- cgit v1.1 From a0417f57913735a032270cb8ce89f7a3744f4da9 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 14 Apr 2009 03:44:27 +0000 Subject: Thank you, Fly-Man, for a patch that adds the stub to handle the avatar interests update. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4647349..0f75d70 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -279,6 +279,8 @@ namespace OpenSim.Tests.Common.Mock public event MuteListRequest OnMuteListRequest; + public event AvatarInterestUpdate OnAvatarInterestUpdate; + #pragma warning restore 67 /// -- cgit v1.1 From ad2bd740574b7695a74bb65a63c4bb884cafdf7d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 14 Apr 2009 16:36:32 +0000 Subject: * refactor: rename AssetCache.Initialize() to AssetCache.Reset() to avoid having Initialise() and Initialize() in the same class - very difficult to read. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 38a3033..8416fb6 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -59,9 +59,8 @@ namespace OpenSim.Tests.Common.Mock m_userDataPlugin = new TestUserDataPlugin(); m_inventoryDataPlugin = new TestInventoryDataPlugin(); - SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); - IAssetCache ac = new AssetCache(assetService); - m_assetCache = ac; + SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); + m_assetCache = new AssetCache(assetService); LocalInventoryService lis = new LocalInventoryService(); lis.AddPlugin(m_inventoryDataPlugin); -- cgit v1.1 From 1894157dd3608a15c3336efc2d58eee0de092610 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 14 Apr 2009 17:15:09 +0000 Subject: * Explicitly start the asset server thread so that unit tests can run single rather than multi-threaded (which may be behind the occasional test freezes) --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 8416fb6..3b39d36 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -61,6 +61,7 @@ namespace OpenSim.Tests.Common.Mock SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); m_assetCache = new AssetCache(assetService); + m_assetCache.AssetServer.Start(); LocalInventoryService lis = new LocalInventoryService(); lis.AddPlugin(m_inventoryDataPlugin); -- cgit v1.1 From d0744f8eca6adc2b6ae257f581792bd8eae16ea2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 14 Apr 2009 18:49:45 +0000 Subject: * Make archiver tests pump the asset server manually instead of starting the normal runtime thread * This may eliminate the occasional archive test freezes, since they appeared to occur when somehow the asset server didn't pick up on the presence of a request in the asset quque --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 3b39d36..93891c0 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -60,8 +60,7 @@ namespace OpenSim.Tests.Common.Mock m_inventoryDataPlugin = new TestInventoryDataPlugin(); SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); - m_assetCache = new AssetCache(assetService); - m_assetCache.AssetServer.Start(); + m_assetCache = new AssetCache(assetService); LocalInventoryService lis = new LocalInventoryService(); lis.AddPlugin(m_inventoryDataPlugin); @@ -76,5 +75,13 @@ namespace OpenSim.Tests.Common.Mock LocalBackEndServices gs = new LocalBackEndServices(); m_gridService = gs; } + + /// + /// Start services that take care of business using their own threads. + /// + public void StartServices() + { + m_assetCache.AssetServer.Start(); + } } } -- cgit v1.1 From fa9b9126ee85fd1124634dae41c8ac58ba4fe70f Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 15 Apr 2009 17:40:04 +0000 Subject: * Resolve unit test failure introduced in r9148 (probably) * Have the test scene always return success for session id authentication for now --- OpenSim/Tests/Common/Mock/TestScene.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 12cce9d..0be98a2 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -46,6 +46,19 @@ namespace OpenSim.Tests.Common.Mock dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } + + /// + /// Temporarily override session authentication for tests (namely teleport). + /// + /// + /// TODO: This needs to be mocked out properly. + /// + /// + /// + public override bool AuthenticateUser(AgentCircuitData agent) + { + return true; + } public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { -- cgit v1.1 From 7306b73f02231687577425cb2e905c51bfbfdfc1 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 15 Apr 2009 21:07:09 +0000 Subject: Commit the group deeding support, thank you, mcortez --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0f75d70..15e92da 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -177,6 +177,7 @@ namespace OpenSim.Tests.Common.Mock public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; public event ParcelSelectObjects OnParcelSelectObjects; public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; + public event ParcelDeedToGroup OnParcelDeedToGroup; public event ObjectDeselect OnObjectDeselect; public event RegionInfoRequest OnRegionInfoRequest; public event EstateCovenantRequest OnEstateCovenantRequest; -- cgit v1.1 From ac96722c1d6b8c6466fcd924a2d92d50853de042 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 16 Apr 2009 00:46:24 +0000 Subject: Fix build break and change some groups interfaces --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 15e92da..ff2e3ca 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -929,7 +929,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendLandObjectOwners(Dictionary ownersAndCount) + public void SendLandObjectOwners(LandData land, Dictionary ownersAndCount) { } -- cgit v1.1 From 4b85cbf0b6f31880655f07e68eb041247dedf870 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 16 Apr 2009 01:01:40 +0000 Subject: Correctly flag group owned prims in the land prim list --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ff2e3ca..1efc3fd 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -929,7 +929,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendLandObjectOwners(LandData land, Dictionary ownersAndCount) + public void SendLandObjectOwners(LandData land, List groups, Dictionary ownersAndCount) { } -- cgit v1.1 From d91330ea35a7344af0a3a79e1dac7dee69daee22 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 20 Apr 2009 20:43:48 +0000 Subject: Add PlacesQuery packet --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1efc3fd..a593fe4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -282,6 +282,8 @@ namespace OpenSim.Tests.Common.Mock public event AvatarInterestUpdate OnAvatarInterestUpdate; + public event PlacesQuery OnPlacesQuery; + #pragma warning restore 67 /// -- cgit v1.1 From 2c81e41c8a884ece643f3079349b033d03b6b774 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 22 Apr 2009 18:15:43 +0000 Subject: * Fission OGS1UserServices into user service and OGS1 user data plugin components * Make OGS1UserServices inherit from UserManagerBase * This allows grid mode regions to use the same user data plugin infrastructure as grid servers and standalone OpenSims --- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index 73e8a09..58996e2 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -86,6 +86,8 @@ namespace OpenSim.Tests.Common.Mock return userProfile; } + + public UserProfileData GetUserByUri(Uri uri) { return null; } public bool UpdateUserProfile(UserProfileData user) { -- cgit v1.1 From 342126b7b9ca386f9160daecb51ecc14487a5f9f Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 22 Apr 2009 22:19:43 +0000 Subject: * Resolve http://opensimulator.org/mantis/view.php?id=3509 by putting some service initialization into CommsManager * What is really needed is a plugin and interface request system as being done for region modules --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 93891c0..4ade40d 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -67,7 +67,7 @@ namespace OpenSim.Tests.Common.Mock m_interServiceInventoryService = lis; AddInventoryService(lis); - LocalUserServices lus = new LocalUserServices(991, 992, lis); + LocalUserServices lus = new LocalUserServices(991, 992, this); lus.AddPlugin(m_userDataPlugin); m_userService = lus; m_userAdminService = lus; -- cgit v1.1 From ef9d140022b57b175f41602731ec73775bdf2d9c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 23 Apr 2009 18:24:39 +0000 Subject: * Add user data plugin to store temporary profiles (which are distinct from cached) * Plugin not yet used * Existing functionality should not be affected in any way --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 4ade40d..9d28fc7 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -55,19 +55,19 @@ namespace OpenSim.Tests.Common.Mock public TestCommunicationsManager(NetworkServersInfo serversInfo) : base(serversInfo, new BaseHttpServer(666), null, false, null) - { - m_userDataPlugin = new TestUserDataPlugin(); - m_inventoryDataPlugin = new TestInventoryDataPlugin(); - + { SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); m_assetCache = new AssetCache(assetService); LocalInventoryService lis = new LocalInventoryService(); + m_inventoryDataPlugin = new TestInventoryDataPlugin(); lis.AddPlugin(m_inventoryDataPlugin); m_interServiceInventoryService = lis; AddInventoryService(lis); LocalUserServices lus = new LocalUserServices(991, 992, this); + lus.AddPlugin(new TemporaryUserProfilePlugin()); + m_userDataPlugin = new TestUserDataPlugin(); lus.AddPlugin(m_userDataPlugin); m_userService = lus; m_userAdminService = lus; -- cgit v1.1 From 0d51c22620315f125ddbd3fe501eb93f318038d8 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 23 Apr 2009 18:57:39 +0000 Subject: * Allow interested user data plugins to store temporary user profiles * Database and the OGS1 plugins are not interested and hence ignore these calls --- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index 58996e2..f376bf0 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -65,6 +65,11 @@ namespace OpenSim.Tests.Common.Mock public void Initialise() {} public void Dispose() {} + + public void AddTemporaryUserProfile(UserProfileData userProfile) + { + // Not interested + } public void AddNewUserProfile(UserProfileData user) { -- cgit v1.1 From 334738fca96498f31842f42db974bc46da35d94a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 30 Apr 2009 11:58:23 +0000 Subject: Thank you, mpallari, for a patch that increses efficiency by combining avatar updates into a single packet. Applied with changes. Fixes Mantis #3136 --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a593fe4..39520e7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -590,7 +590,7 @@ namespace OpenSim.Tests.Common.Mock } public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, - Vector3 position, Vector3 velocity, Quaternion rotation) + Vector3 position, Vector3 velocity, Quaternion rotation, UUID agentid) { } -- cgit v1.1 From 36dd346a91a4dab41e7acb5edc1a8b62f32757bc Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 4 May 2009 14:25:19 +0000 Subject: Add a method to flush the prim update buffers once a frame, since the timer appear to be too slow to be useful, or fail too fire. I may remove the timers as a consequence if this. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 39520e7..256d6fd 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -630,6 +630,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void FlushPrimUpdates() + { + } + public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, -- cgit v1.1 From acfb5051cd328ab21aba5bfc2878ce84d496a7f1 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 4 May 2009 20:15:39 +0000 Subject: Intermediate commit. WILL NOT COMPILE! --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 9d28fc7..44efb8c 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -29,6 +29,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Communications.Local; using OpenSim.Data; -- cgit v1.1 From 1352a198386ef9e18c5c8b52bb6032f3264432f4 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 6 May 2009 20:02:49 +0000 Subject: refactoring Scene.NewUserConnection() to be simpler and clearer. --- OpenSim/Tests/Common/Mock/TestScene.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 0be98a2..670ba61 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications; @@ -55,8 +56,9 @@ namespace OpenSim.Tests.Common.Mock /// /// /// - public override bool AuthenticateUser(AgentCircuitData agent) + public override bool AuthenticateUser(AgentCircuitData agent, out string reason) { + reason = String.Empty; return true; } -- cgit v1.1 From 1b7d0a6c93eb4a056d39b9cc708283086f8e8bf8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 12 May 2009 14:59:11 +0000 Subject: Paving the way for syncing group permissions across a grid --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 256d6fd..f607284 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1116,6 +1116,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void RefreshGroupMembership() + { + } + public void SendUseCachedMuteList() { } -- cgit v1.1 From 40e95cab02b125a6c9ec7e90cab94c94b201f021 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 13 May 2009 17:11:53 +0000 Subject: * Added some more tests to the GetAssetStreamHandlers --- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 34 +++++++++ OpenSim/Tests/Common/Mock/TestAssetCache.cs | 92 ++++++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 27 +------ OpenSim/Tests/Common/Mock/TestAssetService.cs | 78 ++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 13 ++++ 5 files changed, 218 insertions(+), 26 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/BaseAssetRepository.cs create mode 100644 OpenSim/Tests/Common/Mock/TestAssetCache.cs create mode 100644 OpenSim/Tests/Common/Mock/TestAssetService.cs create mode 100644 OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs new file mode 100644 index 0000000..acfe4fe --- /dev/null +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common.Mock +{ + public class BaseAssetRepository + { + protected Dictionary Assets = new Dictionary(); + + public AssetBase FetchAsset(UUID uuid) + { + if (ExistsAsset(uuid)) + return Assets[uuid]; + else + return null; + } + + public void CreateAsset(AssetBase asset) + { + Assets[asset.FullID] = asset; + } + + public void UpdateAsset(AssetBase asset) + { + CreateAsset(asset); + } + + public bool ExistsAsset(UUID uuid) + { + return Assets.ContainsKey(uuid); + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestAssetCache.cs b/OpenSim/Tests/Common/Mock/TestAssetCache.cs new file mode 100644 index 0000000..d621763 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestAssetCache.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestAssetCache : BaseAssetRepository, IAssetCache + { + public void AssetReceived(AssetBase asset, bool IsTexture) + { + throw new NotImplementedException(); + } + + public void AssetNotFound(UUID assetID, bool IsTexture) + { + throw new NotImplementedException(); + } + + public void Dispose() + { + throw new NotImplementedException(); + } + + public string Version + { + get { throw new NotImplementedException(); } + } + + public string Name + { + get { throw new NotImplementedException(); } + } + + public void Initialise() + { + throw new NotImplementedException(); + } + + public IAssetServer AssetServer + { + get { throw new NotImplementedException(); } + } + + public void Initialise(ConfigSettings cs, IAssetServer server) + { + throw new NotImplementedException(); + } + + public void ShowState() + { + throw new NotImplementedException(); + } + + public void Clear() + { + throw new NotImplementedException(); + } + + public bool TryGetCachedAsset(UUID assetID, out AssetBase asset) + { + throw new NotImplementedException(); + } + + public void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture) + { + throw new NotImplementedException(); + } + + public AssetBase GetAsset(UUID assetID, bool isTexture) + { + return FetchAsset(assetID); + } + + public void AddAsset(AssetBase asset) + { + CreateAsset( asset ); + } + + public void ExpireAsset(UUID assetID) + { + throw new NotImplementedException(); + } + + public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest) + { + throw new NotImplementedException(); + } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index 80b9ae3..b639cc9 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -37,40 +37,15 @@ namespace OpenSim.Tests.Common.Mock /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit /// tests are single threaded. /// - public class TestAssetDataPlugin : IAssetDataPlugin + public class TestAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin { public string Version { get { return "0"; } } public string Name { get { return "TestAssetDataPlugin"; } } - - protected Dictionary Assets = new Dictionary(); public void Initialise() {} public void Initialise(string connect) {} public void Dispose() {} - public AssetBase FetchAsset(UUID uuid) - { - if (ExistsAsset(uuid)) - return Assets[uuid]; - else - return null; - } - - public void CreateAsset(AssetBase asset) - { - Assets[asset.FullID] = asset; - } - - public void UpdateAsset(AssetBase asset) - { - CreateAsset(asset); - } - - public bool ExistsAsset(UUID uuid) - { - return Assets.ContainsKey(uuid); - } - public List FetchAssetMetadataSet(int start, int count) { return new List(count); } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs new file mode 100644 index 0000000..23a1137 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -0,0 +1,78 @@ +/* + * 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 OpenSim 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 OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Data; +using OpenSim.Services.Interfaces; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestAssetService : IAssetService + { + private readonly Dictionary Assets = new Dictionary(); + + public AssetBase Get(string id) + { + return Assets[ id ]; + } + + public AssetMetadata GetMetadata(string id) + { + throw new System.NotImplementedException(); + } + + public byte[] GetData(string id) + { + throw new System.NotImplementedException(); + } + + public bool Get(string id, object sender, AssetRetrieved handler) + { + throw new NotImplementedException(); + } + + public string Store(AssetBase asset) + { + Assets[asset.ID] = asset; + + return asset.ID; + } + + public bool UpdateContent(string id, byte[] data) + { + throw new System.NotImplementedException(); + } + + public bool Delete(string id) + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs new file mode 100644 index 0000000..d9c96f4 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Servers.HttpServer; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestOSHttpResponse : OSHttpResponse + { + public override int StatusCode { get; set; } + public override string ContentType { get; set; } + } +} -- cgit v1.1 From c6e2fc947b72e30113e439579e8b9a52fb81e203 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 14 May 2009 08:12:23 +0000 Subject: * Changed auto-properties to properties with backing field * This fixes mantis #3650 --- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index d9c96f4..9e097b8 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -7,7 +7,18 @@ namespace OpenSim.Tests.Common.Mock { public class TestOSHttpResponse : OSHttpResponse { - public override int StatusCode { get; set; } - public override string ContentType { get; set; } + private int m_statusCode; + public override int StatusCode + { + get { return m_statusCode; } + set { m_statusCode = value; } + } + + private string m_contentType; + public override string ContentType + { + get { return m_contentType; } + set { m_contentType = value; } + } } } -- cgit v1.1 From 99cf8e3f5ab73c6d25506678d78f847278865630 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 16 May 2009 16:01:25 +0000 Subject: Send the owner name, not the client name on SendDialog. This modifies IClientAPI.SendDialog slightly. Fixes Mantis #3661. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f607284..00f7bb1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -602,7 +602,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string msg, UUID textureID, int ch, string[] buttonlabels) + public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) { } -- cgit v1.1 From 5cfd84c92427658d88c4b36e1470744babd3d54d Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 17 May 2009 10:26:00 +0000 Subject: Update svn properties. --- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 66 ++++---- OpenSim/Tests/Common/Mock/TestAssetCache.cs | 184 +++++++++++------------ OpenSim/Tests/Common/Mock/TestAssetService.cs | 154 +++++++++---------- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 48 +++--- 4 files changed, 226 insertions(+), 226 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index acfe4fe..b284abc 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -1,34 +1,34 @@ -using System.Collections.Generic; -using OpenMetaverse; -using OpenSim.Framework; - -namespace OpenSim.Tests.Common.Mock -{ - public class BaseAssetRepository - { - protected Dictionary Assets = new Dictionary(); - - public AssetBase FetchAsset(UUID uuid) - { - if (ExistsAsset(uuid)) - return Assets[uuid]; - else - return null; - } - - public void CreateAsset(AssetBase asset) - { - Assets[asset.FullID] = asset; - } - - public void UpdateAsset(AssetBase asset) - { - CreateAsset(asset); - } - - public bool ExistsAsset(UUID uuid) - { - return Assets.ContainsKey(uuid); - } - } +using System.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common.Mock +{ + public class BaseAssetRepository + { + protected Dictionary Assets = new Dictionary(); + + public AssetBase FetchAsset(UUID uuid) + { + if (ExistsAsset(uuid)) + return Assets[uuid]; + else + return null; + } + + public void CreateAsset(AssetBase asset) + { + Assets[asset.FullID] = asset; + } + + public void UpdateAsset(AssetBase asset) + { + CreateAsset(asset); + } + + public bool ExistsAsset(UUID uuid) + { + return Assets.ContainsKey(uuid); + } + } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestAssetCache.cs b/OpenSim/Tests/Common/Mock/TestAssetCache.cs index d621763..a9949bb 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetCache.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetCache.cs @@ -1,92 +1,92 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenMetaverse; -using OpenMetaverse.Packets; -using OpenSim.Framework; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestAssetCache : BaseAssetRepository, IAssetCache - { - public void AssetReceived(AssetBase asset, bool IsTexture) - { - throw new NotImplementedException(); - } - - public void AssetNotFound(UUID assetID, bool IsTexture) - { - throw new NotImplementedException(); - } - - public void Dispose() - { - throw new NotImplementedException(); - } - - public string Version - { - get { throw new NotImplementedException(); } - } - - public string Name - { - get { throw new NotImplementedException(); } - } - - public void Initialise() - { - throw new NotImplementedException(); - } - - public IAssetServer AssetServer - { - get { throw new NotImplementedException(); } - } - - public void Initialise(ConfigSettings cs, IAssetServer server) - { - throw new NotImplementedException(); - } - - public void ShowState() - { - throw new NotImplementedException(); - } - - public void Clear() - { - throw new NotImplementedException(); - } - - public bool TryGetCachedAsset(UUID assetID, out AssetBase asset) - { - throw new NotImplementedException(); - } - - public void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture) - { - throw new NotImplementedException(); - } - - public AssetBase GetAsset(UUID assetID, bool isTexture) - { - return FetchAsset(assetID); - } - - public void AddAsset(AssetBase asset) - { - CreateAsset( asset ); - } - - public void ExpireAsset(UUID assetID) - { - throw new NotImplementedException(); - } - - public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest) - { - throw new NotImplementedException(); - } - } -} +using System; +using System.Collections.Generic; +using System.Text; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestAssetCache : BaseAssetRepository, IAssetCache + { + public void AssetReceived(AssetBase asset, bool IsTexture) + { + throw new NotImplementedException(); + } + + public void AssetNotFound(UUID assetID, bool IsTexture) + { + throw new NotImplementedException(); + } + + public void Dispose() + { + throw new NotImplementedException(); + } + + public string Version + { + get { throw new NotImplementedException(); } + } + + public string Name + { + get { throw new NotImplementedException(); } + } + + public void Initialise() + { + throw new NotImplementedException(); + } + + public IAssetServer AssetServer + { + get { throw new NotImplementedException(); } + } + + public void Initialise(ConfigSettings cs, IAssetServer server) + { + throw new NotImplementedException(); + } + + public void ShowState() + { + throw new NotImplementedException(); + } + + public void Clear() + { + throw new NotImplementedException(); + } + + public bool TryGetCachedAsset(UUID assetID, out AssetBase asset) + { + throw new NotImplementedException(); + } + + public void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture) + { + throw new NotImplementedException(); + } + + public AssetBase GetAsset(UUID assetID, bool isTexture) + { + return FetchAsset(assetID); + } + + public void AddAsset(AssetBase asset) + { + CreateAsset( asset ); + } + + public void ExpireAsset(UUID assetID) + { + throw new NotImplementedException(); + } + + public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest) + { + throw new NotImplementedException(); + } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 23a1137..91ea921 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -1,78 +1,78 @@ -/* - * 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 OpenSim 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 OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; -using OpenSim.Services.Interfaces; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestAssetService : IAssetService - { - private readonly Dictionary Assets = new Dictionary(); - - public AssetBase Get(string id) - { - return Assets[ id ]; - } - - public AssetMetadata GetMetadata(string id) - { - throw new System.NotImplementedException(); - } - - public byte[] GetData(string id) - { - throw new System.NotImplementedException(); - } - - public bool Get(string id, object sender, AssetRetrieved handler) - { - throw new NotImplementedException(); - } - - public string Store(AssetBase asset) - { - Assets[asset.ID] = asset; - - return asset.ID; - } - - public bool UpdateContent(string id, byte[] data) - { - throw new System.NotImplementedException(); - } - - public bool Delete(string id) - { - throw new System.NotImplementedException(); - } - } +/* + * 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 OpenSim 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 OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Data; +using OpenSim.Services.Interfaces; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestAssetService : IAssetService + { + private readonly Dictionary Assets = new Dictionary(); + + public AssetBase Get(string id) + { + return Assets[ id ]; + } + + public AssetMetadata GetMetadata(string id) + { + throw new System.NotImplementedException(); + } + + public byte[] GetData(string id) + { + throw new System.NotImplementedException(); + } + + public bool Get(string id, object sender, AssetRetrieved handler) + { + throw new NotImplementedException(); + } + + public string Store(AssetBase asset) + { + Assets[asset.ID] = asset; + + return asset.ID; + } + + public bool UpdateContent(string id, byte[] data) + { + throw new System.NotImplementedException(); + } + + public bool Delete(string id) + { + throw new System.NotImplementedException(); + } + } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index 9e097b8..59d4000 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -1,24 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Servers.HttpServer; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestOSHttpResponse : OSHttpResponse - { - private int m_statusCode; - public override int StatusCode - { - get { return m_statusCode; } - set { m_statusCode = value; } - } - - private string m_contentType; - public override string ContentType - { - get { return m_contentType; } - set { m_contentType = value; } - } - } -} +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework.Servers.HttpServer; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestOSHttpResponse : OSHttpResponse + { + private int m_statusCode; + public override int StatusCode + { + get { return m_statusCode; } + set { m_statusCode = value; } + } + + private string m_contentType; + public override string ContentType + { + get { return m_contentType; } + set { m_contentType = value; } + } + } +} -- cgit v1.1 From 23d902be42fd6d554a9098936d501609fc6e5315 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 18 May 2009 23:18:04 +0000 Subject: Remove the old asset cache and local services and the configurations for them --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 44efb8c..7589e3e 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -57,9 +57,6 @@ namespace OpenSim.Tests.Common.Mock public TestCommunicationsManager(NetworkServersInfo serversInfo) : base(serversInfo, new BaseHttpServer(666), null, false, null) { - SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); - m_assetCache = new AssetCache(assetService); - LocalInventoryService lis = new LocalInventoryService(); m_inventoryDataPlugin = new TestInventoryDataPlugin(); lis.AddPlugin(m_inventoryDataPlugin); @@ -76,13 +73,5 @@ namespace OpenSim.Tests.Common.Mock LocalBackEndServices gs = new LocalBackEndServices(); m_gridService = gs; } - - /// - /// Start services that take care of business using their own threads. - /// - public void StartServices() - { - m_assetCache.AssetServer.Start(); - } } } -- cgit v1.1 From e0bc5c5db2b88691c04b06be2fa73a75746126cb Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 20 May 2009 01:32:06 +0000 Subject: Add copyright headers, formatting cleanup. --- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 27 ++++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestAssetCache.cs | 29 +++++++++++++++++++++++- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 29 +++++++++++++++++++++++- 3 files changed, 83 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index b284abc..cfefd38 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -1,3 +1,30 @@ +/* + * 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.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; diff --git a/OpenSim/Tests/Common/Mock/TestAssetCache.cs b/OpenSim/Tests/Common/Mock/TestAssetCache.cs index a9949bb..66886d0 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetCache.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetCache.cs @@ -1,4 +1,31 @@ -using System; +/* + * 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.Text; using OpenMetaverse; diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index 59d4000..581985a 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -1,4 +1,31 @@ -using System; +/* + * 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.Text; using OpenSim.Framework.Servers.HttpServer; -- cgit v1.1 From 79299702579b314513652f23c2ec08b6bf687dcd Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 25 May 2009 10:40:09 +0000 Subject: letting TestClient implement IClientCore as well to fix test case failure due to new NAT code --- OpenSim/Tests/Common/Mock/TestClient.cs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 00f7bb1..a028abe 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -36,10 +36,11 @@ using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Framework.Client; namespace OpenSim.Tests.Common.Mock { - public class TestClient : IClientAPI + public class TestClient : IClientAPI, IClientCore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -1131,5 +1132,25 @@ namespace OpenSim.Tests.Common.Mock public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled) { } + + public bool TryGet(out T iface) + { + iface = default(T); + return false; + } + + public T Get() + { + return default(T); + } + + public void Disconnect(string reason) + { + } + + public void Disconnect() + { + } + } } -- cgit v1.1 From 840de6c036570d559ec6924cd8405d3f34a99fdd Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 1 Jun 2009 06:37:14 +0000 Subject: Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 2 +- OpenSim/Tests/Common/Mock/TestAssetService.cs | 2 +- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 +- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index b639cc9..8ab72dc 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 91ea921..d35e3ed 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a028abe..fdca410 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 7589e3e..eb83ee6 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index efe0101..31e8e8b 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 4165641..f7eda68 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 670ba61..3fc22ba 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs index f376bf0..5188cf6 100644 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs @@ -9,7 +9,7 @@ * * 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 OpenSim Project nor the + * * 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. * -- cgit v1.1 From a23d64dec1cbf88abc3c7e84664a683dee534e4a Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 10 Jun 2009 04:28:56 +0000 Subject: Formatting cleanup. --- OpenSim/Tests/Common/Mock/TestAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetCache.cs b/OpenSim/Tests/Common/Mock/TestAssetCache.cs index 66886d0..ebbea75 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetCache.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetCache.cs @@ -103,7 +103,7 @@ namespace OpenSim.Tests.Common.Mock public void AddAsset(AssetBase asset) { - CreateAsset( asset ); + CreateAsset(asset); } public void ExpireAsset(UUID assetID) -- cgit v1.1 From c13f3649d279bc6a55d8b1d268574577029f7c33 Mon Sep 17 00:00:00 2001 From: Arthur Valadares Date: Thu, 11 Jun 2009 18:27:12 +0000 Subject: * Reinstating UserProfileCacheServiceTests. One test still fails (TestUpdateFolder) --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 31e8e8b..442ff06 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -122,7 +122,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase queryInventoryFolder(UUID folderID) { - return null; + return getInventoryFolder(folderID); } public void addInventoryFolder(InventoryFolderBase folder) -- cgit v1.1 From 1adeb8ad7781beecbf1f23817eb9047e57f12027 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 19 Jun 2009 12:21:20 +0000 Subject: From: Chris Yeoh This patch ensures that the touch positions are set during touch_end events (currently only working for touch_start and touch events). --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index fdca410..64af13d 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -106,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock public event GodKickUser OnGodKickUser; public event ObjectDuplicate OnObjectDuplicate; public event GrabObject OnGrabObject; - public event ObjectSelect OnDeGrabObject; + public event DeGrabObject OnDeGrabObject; public event MoveObject OnGrabUpdate; public event SpinStart OnSpinStart; public event SpinObject OnSpinUpdate; -- cgit v1.1 From 3564271c2d4f769361e36e2a10acbeb3e5f56bdf Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 1 Jul 2009 15:47:52 +0000 Subject: Restore the functionality that was removed in r9928. This lets the load balancer plugin work again. Create a new method, GetClientEP, to retrieve only the EndPoint for script usage. Marked the purpose of the method in IClientAPI.cs with a warning. Also restored the corresponding SetClientInfo functionality. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 64af13d..c76d180 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -888,6 +888,11 @@ namespace OpenSim.Tests.Common.Mock { } + public EndPoint GetClientEP() + { + return null; + } + public ClientInfo GetClientInfo() { return null; -- cgit v1.1 From c310fb11f492419de60b4bf8e5bb234e4589b336 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 10 Jul 2009 02:22:26 +0000 Subject: Remove all references to HttpServer from CommsManager (all incarnations) Change all uses of the HttpServer properties to use the new singleton --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index eb83ee6..87751a4 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -55,7 +55,7 @@ namespace OpenSim.Tests.Common.Mock } public TestCommunicationsManager(NetworkServersInfo serversInfo) - : base(serversInfo, new BaseHttpServer(666), null, false, null) + : base(serversInfo, null) { LocalInventoryService lis = new LocalInventoryService(); m_inventoryDataPlugin = new TestInventoryDataPlugin(); -- cgit v1.1 From acea31518b00b02e2ba8b08106a76de0fbef29ab Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 17 Jul 2009 14:58:54 +0000 Subject: fixed the bug where changing the rotation of a selection of prims in a linkset, made each of those prims rotate around its own centre rather than around the geometric centre of the selection like they should do (and like the client expects). This involved adding a new OnUpdatePrimSingleRotationPosition event to IClientAPI so that we can get the changed position from the client. Btw adding new events to IClientAPI is really tedious where you have to copy the change across to at least 5 or 6 other files. [Note this doesn't fix the bug where any rotation changes to the root prim (but not the whole linkset) cause rotation errors on the child prims.] --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c76d180..21541e1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -130,6 +130,7 @@ namespace OpenSim.Tests.Common.Mock public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; public event UpdateVector OnUpdatePrimGroupScale; -- cgit v1.1 From 08819bcbea9012d67cc4cb44e4d7ec7e5837bac6 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 19 Jul 2009 02:32:02 +0000 Subject: * Created a way that the OpenSimulator scene can ask the physics scene to do a raycast test safely. * Test for prim obstructions between the avatar and camera. If there are obstructions, inform the client to move the camera closer. This makes it so that walls and objects don't obstruct your view while you're moving around. Try walking inside a hollowed tori. You'll see how much easier it is now because your camera automatically moves closer so you can still see. * Created a way to know if the user's camera is alt + cammed or just following the avatar. * Changes IClientAPI interface by adding SendCameraConstraint(Vector4 CameraConstraint) --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 21541e1..4b59b50 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -942,6 +942,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendCameraConstraint(Vector4 ConstraintPlane) + { + } + public void SendLandObjectOwners(LandData land, List groups, Dictionary ownersAndCount) { } -- cgit v1.1 From 1f7466e5c3136d0580a21b5f2f4d8f18fa9fc72f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 20:04:27 +0100 Subject: test item data storage impementation (unused as of yet) --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 45 +++++++++++++++------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 442ff06..1b14abb 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -39,12 +39,17 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestInventoryDataPlugin : IInventoryDataPlugin - { + { /// - /// Known inventory folders + /// Inventory folders /// private Dictionary m_folders = new Dictionary(); + //// + /// Inventory items + /// + private Dictionary m_items = new Dictionary(); + /// /// User root folders /// @@ -99,9 +104,7 @@ namespace OpenSim.Tests.Common.Mock } return folders; - } - - public InventoryItemBase getInventoryItem(UUID item) { return null; } + } public InventoryFolderBase getInventoryFolder(UUID folderId) { @@ -111,15 +114,6 @@ namespace OpenSim.Tests.Common.Mock return folder; } - public void addInventoryItem(InventoryItemBase item) {} - public void updateInventoryItem(InventoryItemBase item) {} - public void deleteInventoryItem(UUID item) {} - - public InventoryItemBase queryInventoryItem(UUID item) - { - return null; - } - public InventoryFolderBase queryInventoryFolder(UUID folderID) { return getInventoryFolder(folderID); @@ -150,6 +144,29 @@ namespace OpenSim.Tests.Common.Mock m_folders.Remove(folderId); } + public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; } + + public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } + + public void deleteInventoryItem(UUID itemId) + { + if (m_items.ContainsKey(itemId)) + m_items.Remove(itemId); + } + + public InventoryItemBase getInventoryItem(UUID itemId) + { + if (m_items.ContainsKey(itemId)) + return m_items[itemId]; + else + return null; + } + + public InventoryItemBase queryInventoryItem(UUID item) + { + return null; + } + public List fetchActiveGestures(UUID avatarID) { return null; } } } -- cgit v1.1 From 2b990a61bfa88e13d5ad19602e6acef751ea473c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 7 Aug 2009 20:31:48 -0400 Subject: This is the second part of the 'not crash on regionsize changes'. This lets you configure region sizes to be smaller without crashing the region. I remind you that regions are still square, must be a multiple of 4, and the Linden client doesn't like anything other then 256. If you set it bigger or smaller, the terrain doesn't load in the client, the map has issues, and god forbid you connect it to a grid that expects 256m regions. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4b59b50..bf4ddf0 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -298,7 +298,7 @@ namespace OpenSim.Tests.Common.Mock /// public string CapsSeedUrl; - private Vector3 startPos = new Vector3(128, 128, 2); + private Vector3 startPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 2); public virtual Vector3 StartPos { -- cgit v1.1 From a50904a68bdc215d4ccc312627d44c736a1bceb5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 10 Aug 2009 06:41:03 -0700 Subject: More clean up from asset cache legacy. None of these classes are used anymore. --- OpenSim/Tests/Common/Mock/TestAssetCache.cs | 119 ---------------------------- 1 file changed, 119 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestAssetCache.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetCache.cs b/OpenSim/Tests/Common/Mock/TestAssetCache.cs deleted file mode 100644 index ebbea75..0000000 --- a/OpenSim/Tests/Common/Mock/TestAssetCache.cs +++ /dev/null @@ -1,119 +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.Text; -using OpenMetaverse; -using OpenMetaverse.Packets; -using OpenSim.Framework; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestAssetCache : BaseAssetRepository, IAssetCache - { - public void AssetReceived(AssetBase asset, bool IsTexture) - { - throw new NotImplementedException(); - } - - public void AssetNotFound(UUID assetID, bool IsTexture) - { - throw new NotImplementedException(); - } - - public void Dispose() - { - throw new NotImplementedException(); - } - - public string Version - { - get { throw new NotImplementedException(); } - } - - public string Name - { - get { throw new NotImplementedException(); } - } - - public void Initialise() - { - throw new NotImplementedException(); - } - - public IAssetServer AssetServer - { - get { throw new NotImplementedException(); } - } - - public void Initialise(ConfigSettings cs, IAssetServer server) - { - throw new NotImplementedException(); - } - - public void ShowState() - { - throw new NotImplementedException(); - } - - public void Clear() - { - throw new NotImplementedException(); - } - - public bool TryGetCachedAsset(UUID assetID, out AssetBase asset) - { - throw new NotImplementedException(); - } - - public void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture) - { - throw new NotImplementedException(); - } - - public AssetBase GetAsset(UUID assetID, bool isTexture) - { - return FetchAsset(assetID); - } - - public void AddAsset(AssetBase asset) - { - CreateAsset(asset); - } - - public void ExpireAsset(UUID assetID) - { - throw new NotImplementedException(); - } - - public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest) - { - throw new NotImplementedException(); - } - } -} -- cgit v1.1 From 5d2a157e64f19a061a37d5458b34cc563ee288a1 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 10 Aug 2009 10:48:21 -0700 Subject: First pass at cleaning up old OGS1 and Local Inventory: removed everything-inventory in CommsManager, which wasn't actively used anymore. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 87751a4..d404344 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -57,11 +57,6 @@ namespace OpenSim.Tests.Common.Mock public TestCommunicationsManager(NetworkServersInfo serversInfo) : base(serversInfo, null) { - LocalInventoryService lis = new LocalInventoryService(); - m_inventoryDataPlugin = new TestInventoryDataPlugin(); - lis.AddPlugin(m_inventoryDataPlugin); - m_interServiceInventoryService = lis; - AddInventoryService(lis); LocalUserServices lus = new LocalUserServices(991, 992, this); lus.AddPlugin(new TemporaryUserProfilePlugin()); -- cgit v1.1 From 18aa2ea0c5ebd8d5131902ed9856e68f46e76e11 Mon Sep 17 00:00:00 2001 From: Arthur Valadares Date: Tue, 11 Aug 2009 12:07:54 -0300 Subject: * Improves SceneSetupHelper to allow the tester to choose a real or mock, inventory and asset, service modules. The boolean startServices was replaced with realServices string. If the string contains the word asset, it will start a real asset module, if it contains inventory, it starts a real inventory. Otherwise, it use mock (NullPlugin-like) objects, for tests that don't really need functionality. * SetupScene is now actually sharing the asset and inventory modules if the tester wishes to have multiple regions connected. To link regions, just start SetupScene with the same CommunicationManager for all scenes. SceneSetupHelper will hold a static reference to the modules and won't initialize them again, just run the scenes through the modules AddRegion, RegionLoaded and PostInitialize. * With the recent changes, both asset and inventory (and in the future, user) services should always be asked from the scene, not instantiated alone. The tests should reflect this new behavior and always start a scene. --- OpenSim/Tests/Common/Mock/TestAssetService.cs | 9 +- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 133 ++++++++++++++++++++++ 2 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/TestInventoryService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index d35e3ed..5f1184b 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -31,13 +31,18 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; using OpenSim.Services.Interfaces; +using Nini.Config; namespace OpenSim.Tests.Common.Mock { public class TestAssetService : IAssetService { - private readonly Dictionary Assets = new Dictionary(); - + private readonly Dictionary Assets = new Dictionary(); + + public TestAssetService(IConfigSource config) + { + } + public AssetBase Get(string id) { return Assets[ id ]; diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs new file mode 100644 index 0000000..cf1a3a9 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Framework; +using OpenMetaverse; +using OpenSim.Services.Interfaces; +using Nini.Config; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestInventoryService : IInventoryService + { + public TestInventoryService() + { + } + + public TestInventoryService(IConfigSource config) + { + } + + /// + /// + /// + /// + /// + public bool CreateUserInventory(UUID userId) + { + return false; + } + + /// + /// + /// + /// + /// + public List GetInventorySkeleton(UUID userId) + { + List folders = new List(); + InventoryFolderBase folder = new InventoryFolderBase(); + folder.ID = UUID.Random(); + folder.Owner = userId; + folders.Add(folder); + return folders; + } + + /// + /// Returns a list of all the active gestures in a user's inventory. + /// + /// + /// The of the user + /// + /// + /// A flat list of the gesture items. + /// + public List GetActiveGestures(UUID userId) + { + return null; + } + + public InventoryCollection GetUserInventory(UUID userID) + { + return null; + } + + public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback) + { + } + + public List GetFolderItems(UUID userID, UUID folderID) + { + return null; + } + + public bool AddFolder(InventoryFolderBase folder) + { + return false; + } + + public bool UpdateFolder(InventoryFolderBase folder) + { + return false; + } + + public bool MoveFolder(InventoryFolderBase folder) + { + return false; + } + + public bool PurgeFolder(InventoryFolderBase folder) + { + return false; + } + + public bool AddItem(InventoryItemBase item) + { + return false; + } + + public bool UpdateItem(InventoryItemBase item) + { + return false; + } + + public bool DeleteItem(InventoryItemBase item) + { + return false; + } + + public InventoryItemBase QueryItem(InventoryItemBase item) + { + return null; + } + + public InventoryFolderBase QueryFolder(InventoryFolderBase folder) + { + return null; + } + + public bool HasInventoryForUser(UUID userID) + { + return false; + } + + public InventoryFolderBase RequestRootFolder(UUID userID) + { + InventoryFolderBase root = new InventoryFolderBase(); + root.ID = UUID.Random(); + root.Owner = userID; + root.ParentID = UUID.Zero; + return root; + } + } +} -- cgit v1.1 From dae9a111aa826e1d5e3cc5d13b308cdcbedadfbc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 11 Aug 2009 13:16:53 -0700 Subject: Added new operations to mock inventory service in tests. --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index cf1a3a9..0c19164 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -43,6 +43,21 @@ namespace OpenSim.Tests.Common.Mock return folders; } + public InventoryFolderBase GetRootFolder(UUID userID) + { + return new InventoryFolderBase(); + } + + public InventoryCollection GetFolderContent(UUID userID, UUID folderID) + { + return null; + } + + public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) + { + return null; + } + /// /// Returns a list of all the active gestures in a user's inventory. /// -- cgit v1.1 From 50f29752f5888ac194a5146c475720c29ae3f172 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 13 Aug 2009 11:48:39 +0900 Subject: Formatting cleanup. Add copyright headers. --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index 0c19164..6635700 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -1,4 +1,31 @@ -using System; +/* + * 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.Text; using OpenSim.Framework; -- cgit v1.1 From 5246dc33dcfc51b7ebb19b269159df3991029350 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 Aug 2009 14:10:12 -0700 Subject: Renamed QueryItem/QueryFolder to GetItem/GetFolder. The word 'query' starting to get on my nerves. --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index 6635700..6576533 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -148,12 +148,12 @@ namespace OpenSim.Tests.Common.Mock return false; } - public InventoryItemBase QueryItem(InventoryItemBase item) + public InventoryItemBase GetItem(InventoryItemBase item) { return null; } - public InventoryFolderBase QueryFolder(InventoryFolderBase folder) + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; } -- cgit v1.1 From 034c9cf606373bfa9d3f8040cd787f789e0efbf2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 Aug 2009 17:34:15 -0700 Subject: Added GetAssetPermissions. Few last bugs nixed. This is ready for testing. --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index 6576533..ba9cbe9 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -171,5 +171,10 @@ namespace OpenSim.Tests.Common.Mock root.ParentID = UUID.Zero; return root; } + + public int GetAssetPermissions(UUID userID, UUID assetID) + { + return 1; + } } } -- cgit v1.1 From ff28ecee1b35ba24ec538d8ed018c764476c62b4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Aug 2009 20:07:13 +0100 Subject: Re-enable TestSaveIarV0_1() Implement more parts of TestAssetService --- OpenSim/Tests/Common/Mock/TestAssetService.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 5f1184b..81f123a 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -45,7 +45,13 @@ namespace OpenSim.Tests.Common.Mock public AssetBase Get(string id) { - return Assets[ id ]; + AssetBase asset; + if (Assets.ContainsKey(id)) + asset = Assets[id]; + else + asset = null; + + return asset; } public AssetMetadata GetMetadata(string id) @@ -59,8 +65,10 @@ namespace OpenSim.Tests.Common.Mock } public bool Get(string id, object sender, AssetRetrieved handler) - { - throw new NotImplementedException(); + { + handler(id, sender, Get(id)); + + return true; } public string Store(AssetBase asset) -- cgit v1.1 From a42569d89675430087d32332e168429d4185311c Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 16 Aug 2009 15:06:06 +0900 Subject: Thanks dmiles for a patch that adds PacketType.RequestMultipleObjects Packet Handler - ref mantis #4010 --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index bf4ddf0..fe31729 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -120,6 +120,7 @@ namespace OpenSim.Tests.Common.Mock public event ObjectExtraParams OnUpdateExtraParams; public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event ObjectSelect OnObjectSelect; + public event ObjectRequest OnObjectRequest; public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectClickAction; -- cgit v1.1 From c5af39239f7f2a1725d9c08bea80522de8835e0f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 19 Aug 2009 00:13:51 -0700 Subject: A better purge of trash folder. --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index ba9cbe9..f770f75 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -143,7 +143,7 @@ namespace OpenSim.Tests.Common.Mock return false; } - public bool DeleteItem(InventoryItemBase item) + public bool DeleteItems(UUID ownerID, List itemIDs) { return false; } -- cgit v1.1 From d519f1885f587409592cf92bc0f4ba8533a1866f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 19 Aug 2009 10:56:08 -0700 Subject: Added MoveItems, which is most useful upon viewer-delete inventory operation. Moving a batch of items is a 1-time operation. Made it async anyway, so that the viewer doesn't wait in case the DB layer is dumb (which is the case currently). --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index f770f75..ee22e5e 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -143,6 +143,11 @@ namespace OpenSim.Tests.Common.Mock return false; } + public bool MoveItems(UUID ownerID, List items) + { + return false; + } + public bool DeleteItems(UUID ownerID, List itemIDs) { return false; -- cgit v1.1 From b1853d9f265fb32cf51d65fdcf2d5b4741911f00 Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sun, 16 Aug 2009 23:25:12 -0500 Subject: Fixing a spot I missed in assets. Switching Grid to the new naming schema with Store/Get --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index 8ab72dc..3981fe9 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; @@ -46,6 +47,18 @@ namespace OpenSim.Tests.Common.Mock public void Initialise(string connect) {} public void Dispose() {} + private readonly List assets = new List(); + + public AssetBase GetAsset(UUID uuid) + { + return assets.Find(x=>x.FullID == uuid); + } + + public void StoreAsset(AssetBase asset) + { + assets.Add(asset); + } + public List FetchAssetMetadataSet(int start, int count) { return new List(count); } } } \ No newline at end of file -- cgit v1.1 From b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 22 Aug 2009 10:24:26 -0700 Subject: * Fixes mantis http://opensimulator.org/mantis/view.php?id=4044. Turns out folders were never being removed from trash when they were singled out for purging in trash. They were being removed when Trash was purged as a whole. That behavior is now fixed for the new InventoryService set. * Removed left-overs from AssetInventoryServer. --- OpenSim/Tests/Common/Mock/TestInventoryService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index ee22e5e..5a0ee7c 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -128,6 +128,11 @@ namespace OpenSim.Tests.Common.Mock return false; } + public bool DeleteFolders(UUID ownerID, List ids) + { + return false; + } + public bool PurgeFolder(InventoryFolderBase folder) { return false; -- cgit v1.1 From 7ff4c2e50b3df8ea82dc8a27f3b68657fe29226b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 Aug 2009 17:07:17 +0100 Subject: Pull out distinct cache system folders and drop cache methods in InventoryCache --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 1b14abb..ce116f2 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -27,6 +27,8 @@ using System; using System.Collections.Generic; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; @@ -39,7 +41,9 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestInventoryDataPlugin : IInventoryDataPlugin - { + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// /// Inventory folders /// @@ -87,6 +91,8 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase getUserRootFolder(UUID user) { + m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); + InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -124,7 +130,11 @@ namespace OpenSim.Tests.Common.Mock m_folders[folder.ID] = folder; if (folder.ParentID == UUID.Zero) + { + m_log.DebugFormat( + "[MOCK INV DB]: Adding root folder {0} {1} for {2}", folder.Name, folder.ID, folder.Owner); m_rootFolders[folder.Owner] = folder; + } } public void updateInventoryFolder(InventoryFolderBase folder) -- cgit v1.1 From 05756e1fb96aa47f9ff111dd04499934c7077731 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Wed, 2 Sep 2009 09:43:22 +0200 Subject: warnings safari. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index d404344..4313c96 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -43,11 +43,11 @@ namespace OpenSim.Tests.Common.Mock } private IUserDataPlugin m_userDataPlugin; - public IInventoryDataPlugin InventoryDataPlugin - { - get { return m_inventoryDataPlugin; } - } - private IInventoryDataPlugin m_inventoryDataPlugin; + // public IInventoryDataPlugin InventoryDataPlugin + // { + // get { return m_inventoryDataPlugin; } + // } + // private IInventoryDataPlugin m_inventoryDataPlugin; public TestCommunicationsManager() : this(null) -- cgit v1.1 From 304c78bbbbc9a176d70d2967a3f703f2e545565c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sun, 6 Sep 2009 19:30:03 +0100 Subject: Temporarily re-enable save iar test by manually insert the item into the old cache during the test --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index ce116f2..a444d91 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -154,7 +154,13 @@ namespace OpenSim.Tests.Common.Mock m_folders.Remove(folderId); } - public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; } + public void addInventoryItem(InventoryItemBase item) + { + m_log.DebugFormat( + "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); + + m_items[item.ID] = item; + } public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } -- cgit v1.1 From 881051c8ccef7b49031d0f9a087390336ecc53b5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sun, 6 Sep 2009 21:14:42 +0100 Subject: Convert iar write request to use inventory service requests rather than cache --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index a444d91..daef38b 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -84,7 +84,17 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryInFolder(UUID folderID) { - return new List(); + m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); + + List items = new List(); + + foreach (InventoryItemBase item in m_items.Values) + { + if (item.Folder == folderID) + items.Add(item); + } + + return items; } public List getUserRootFolders(UUID user) { return null; } -- cgit v1.1 From 68e40a87cafcab580ab484956f187068c098e84e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 21:29:54 -0700 Subject: Poof! on LocalBackend. CommsManager.GridServices deleted. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 4313c96..de73663 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -65,8 +65,6 @@ namespace OpenSim.Tests.Common.Mock m_userService = lus; m_userAdminService = lus; - LocalBackEndServices gs = new LocalBackEndServices(); - m_gridService = gs; } } } -- cgit v1.1 From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 01:00:09 +0900 Subject: Formatting cleanup. --- OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestAssetService.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 +- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 6 +++--- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestScene.cs | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index 3981fe9..20ea18f 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -39,7 +39,7 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin - { + { public string Version { get { return "0"; } } public string Name { get { return "TestAssetDataPlugin"; } } @@ -59,6 +59,6 @@ namespace OpenSim.Tests.Common.Mock assets.Add(asset); } - public List FetchAssetMetadataSet(int start, int count) { return new List(count); } + public List FetchAssetMetadataSet(int start, int count) { return new List(count); } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 81f123a..317ec06 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -49,7 +49,7 @@ namespace OpenSim.Tests.Common.Mock if (Assets.ContainsKey(id)) asset = Assets[id]; else - asset = null; + asset = null; return asset; } @@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Mock } public bool Get(string id, object sender, AssetRetrieved handler) - { + { handler(id, sender, Get(id)); return true; diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index de73663..013462e 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock public TestCommunicationsManager(NetworkServersInfo serversInfo) : base(serversInfo, null) - { + { LocalUserServices lus = new LocalUserServices(991, 992, this); lus.AddPlugin(new TemporaryUserProfilePlugin()); diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index daef38b..0c7ebca 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -52,7 +52,7 @@ namespace OpenSim.Tests.Common.Mock //// /// Inventory items /// - private Dictionary m_items = new Dictionary(); + private Dictionary m_items = new Dictionary(); /// /// User root folders @@ -120,7 +120,7 @@ namespace OpenSim.Tests.Common.Mock } return folders; - } + } public InventoryFolderBase getInventoryFolder(UUID folderId) { @@ -191,7 +191,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryItemBase queryInventoryItem(UUID item) { return null; - } + } public List fetchActiveGestures(UUID avatarID) { return null; } } diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index f7eda68..01b5203 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -31,7 +31,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Tests.Common.Mock -{ +{ /// /// Land channel for test purposes /// @@ -40,7 +40,7 @@ namespace OpenSim.Tests.Common.Mock public List ParcelsNearPoint(Vector3 position) { return null; } public List AllParcels() { return null; } public ILandObject GetLandObject(int x, int y) { return null; } - public ILandObject GetLandObject(int localID) { return null; } + public ILandObject GetLandObject(int localID) { return null; } public ILandObject GetLandObject(float x, float y) { return null; } public bool IsLandPrimCountTainted() { return false; } public bool IsForcefulBansAllowed() { return false; } diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 3fc22ba..22cfa2c 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -35,9 +35,9 @@ using OpenSim.Region.Framework; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Tests.Common.Mock -{ +{ public class TestScene : Scene - { + { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, @@ -60,7 +60,7 @@ namespace OpenSim.Tests.Common.Mock { reason = String.Empty; return true; - } + } public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { -- cgit v1.1 From 400abed271b7d59b8038326fccfe76c28d7d1051 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Sep 2009 21:23:00 +0100 Subject: Add RebakeAvatarTexturesPacket to the client view --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index fe31729..2b54890 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1163,5 +1163,9 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendRebakeAvatarTextures(UUID textureID) + { + } + } } -- cgit v1.1 From 3c271bf2229bc58969ca7d15b7082815f6b4c1f0 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Fri, 2 Oct 2009 11:26:45 +0200 Subject: fixing TestLandChannel to let it return empty List() (as does the real LandChannel), percolating to SceneSetupHelpers. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 46 +++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 01b5203..ed30827 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -29,6 +29,8 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.CoreModules.World.Land; namespace OpenSim.Tests.Common.Mock { @@ -37,11 +39,45 @@ namespace OpenSim.Tests.Common.Mock /// public class TestLandChannel : ILandChannel { - public List ParcelsNearPoint(Vector3 position) { return null; } - public List AllParcels() { return null; } - public ILandObject GetLandObject(int x, int y) { return null; } - public ILandObject GetLandObject(int localID) { return null; } - public ILandObject GetLandObject(float x, float y) { return null; } + private Scene m_scene; + + public TestLandChannel(Scene scene) + { + m_scene = scene; + } + + public List ParcelsNearPoint(Vector3 position) + { + return new List(); + } + + public List AllParcels() + { + return new List(); + } + + protected ILandObject GetNoLand() + { + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); + obj.LandData.Name = "NO LAND"; + return obj; + } + + public ILandObject GetLandObject(int x, int y) + { + return GetNoLand(); + } + + public ILandObject GetLandObject(int localID) + { + return GetNoLand(); + } + + public ILandObject GetLandObject(float x, float y) + { + return GetNoLand(); + } + public bool IsLandPrimCountTainted() { return false; } public bool IsForcefulBansAllowed() { return false; } public void UpdateLandObject(int localID, LandData data) {} -- cgit v1.1 From 23a334b9f54a1ef5df3b503c165e7b76b746a2b1 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 13 Oct 2009 14:50:03 -0700 Subject: * Rewrote ClientManager to remove Lindenisms from OpenSim core, improve performance by removing locks, and replace LLUDPClientCollection * Removed the confusing (and LL-specific) shutdowncircuit parameter from IClientAPI.Close() * Updated the LLUDP code to only use ClientManager instead of trying to synchronize ClientManager and m_clients * Remove clients asynchronously since it is a very slow operation (including a 2000ms sleep) --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2b54890..ad90817 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -865,7 +865,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void Close(bool ShutdownCircuit) + public void Close() { m_scene.RemoveClient(AgentId); } -- cgit v1.1 From dc11643c007adf7a640ec4fbabe25995352aaa18 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 13 Oct 2009 17:33:45 -0700 Subject: * Consolidated adding / removing ClientManager IClientAPIs to two places in Scene * Added some missing implementations of IClientAPI.RemoteEndPoint * Added a ClientManager.Remove(UUID) overload * Removed a reference to a missing project from prebuild.xml --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ad90817..5c838c5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -393,6 +393,11 @@ namespace OpenSim.Tests.Common.Mock set { m_circuitCode = value; } } + public IPEndPoint RemoteEndPoint + { + get { return new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode); } + } + /// /// Constructor /// -- cgit v1.1 From 4b75353cbf50de3cae4c48ec90b55f30c1612c92 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 15 Oct 2009 16:35:27 -0700 Subject: Object update prioritization by Jim Greensky of Intel Labs, part one. This implements a simple distance prioritizer based on initial agent positions. Re-prioritizing and more advanced priority algorithms will follow soon --- OpenSim/Tests/Common/Mock/TestClient.cs | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5c838c5..21606e2 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -592,13 +592,11 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, - uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) + public virtual void SendAvatarData(SendAvatarData data) { } - public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, - Vector3 position, Vector3 velocity, Quaternion rotation, UUID agentid) + public virtual void SendAvatarTerseUpdate(SendAvatarTerseData data) { } @@ -614,27 +612,11 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, - PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, - Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, - UUID objectID, UUID ownerID, string text, byte[] color, - uint parentID, - byte[] particleSystem, byte clickAction, byte material) + public virtual void SendPrimitiveToClient(SendPrimitiveData data) { } - public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, - PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, - Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, - UUID objectID, UUID ownerID, string text, byte[] color, - uint parentID, - byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation, - bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) - { - } - public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, - Vector3 position, Quaternion rotation, Vector3 velocity, - Vector3 rotationalvelocity, byte state, UUID AssetId, - UUID ownerID, int attachPoint) + + public virtual void SendPrimTerseUpdate(SendPrimitiveTerseData data) { } -- cgit v1.1 From fdb2a75ad357668b860fc5055e0630ef75a3ad20 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 17 Oct 2009 18:01:22 -0700 Subject: Committing the second part of Jim Greensky @ Intel Lab's patch, re-prioritizing updates --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 21606e2..0f642b9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -620,6 +620,10 @@ namespace OpenSim.Tests.Common.Mock { } + public virtual void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler) + { + } + public void FlushPrimUpdates() { } -- cgit v1.1 From 0d29614ca129a044f6fad01f5600c52a922b702c Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 19 Oct 2009 08:58:03 +0900 Subject: Formatting cleanup. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index ed30827..be28c27 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -46,14 +46,14 @@ namespace OpenSim.Tests.Common.Mock m_scene = scene; } - public List ParcelsNearPoint(Vector3 position) - { - return new List(); + public List ParcelsNearPoint(Vector3 position) + { + return new List(); } - public List AllParcels() - { - return new List(); + public List AllParcels() + { + return new List(); } protected ILandObject GetNoLand() @@ -63,18 +63,18 @@ namespace OpenSim.Tests.Common.Mock return obj; } - public ILandObject GetLandObject(int x, int y) - { + public ILandObject GetLandObject(int x, int y) + { return GetNoLand(); } - public ILandObject GetLandObject(int localID) - { + public ILandObject GetLandObject(int localID) + { return GetNoLand(); } - public ILandObject GetLandObject(float x, float y) - { + public ILandObject GetLandObject(float x, float y) + { return GetNoLand(); } -- cgit v1.1 From c72f78215bb3435ee2bbb507746c23eccec4dd34 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 4 Nov 2009 01:56:19 +0000 Subject: Backport the fixes to WebFetchInventoryDescendents to the UDP InventoryDescendents packet. Testing has shown that UDP inventory now works flawlessly and, unlike CAPS inventory, doesn't download the entire agent inventory on start. Neither does it incessantly re-request folder NULL_KEY. Therefore, I have disabled CAPS inventory. --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0f642b9..9ec9311 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -631,6 +631,7 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, + int version, bool fetchFolders, bool fetchItems) { -- cgit v1.1 From 83b4b4440b7becb405840bc69d665e260fdecea0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 5 Nov 2009 02:09:07 +0000 Subject: Patch by revolution, thank you. Mantis #1789 . Implement friends permissions. Applied with major changes. Core functionality commented pending review for possible rights escalation. No user functionality yet. --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9ec9311..27025d9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -191,6 +191,7 @@ namespace OpenSim.Tests.Common.Mock public event FriendActionDelegate OnApproveFriendRequest; public event FriendActionDelegate OnDenyFriendRequest; public event FriendshipTermination OnTerminateFriendship; + public event GrantUserFriendRights OnGrantUserRights; public event EconomyDataRequest OnEconomyDataRequest; public event MoneyBalanceRequest OnMoneyBalanceRequest; -- cgit v1.1 From 00102e73a657e8a30b323ef68e7cba073c369197 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 11 Nov 2009 18:46:04 +0000 Subject: Add basic new uuid gatherer tests to check behaviour when the gather seed is a missing asset --- OpenSim/Tests/Common/Mock/TestAssetService.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 317ec06..ff75d86 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -39,9 +39,14 @@ namespace OpenSim.Tests.Common.Mock { private readonly Dictionary Assets = new Dictionary(); - public TestAssetService(IConfigSource config) - { - } + public TestAssetService() {} + + /// + /// This constructor is required if the asset service is being created reflectively (which is the case in some + /// tests). + /// + /// + public TestAssetService(IConfigSource config) {} public AssetBase Get(string id) { -- cgit v1.1 From bb92ba97c6952c60f5bdd50b1c6599894bfef501 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Nov 2009 18:26:22 +0000 Subject: Stop iar save failing on corrupt assets Not ideal since one will still have to watch out for big 'corrupt asset' messages in the log, but better than an outright fail --- OpenSim/Tests/Common/Mock/TestAssetService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index ff75d86..a537b97 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -27,6 +27,8 @@ using System; using System.Collections.Generic; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; @@ -37,6 +39,8 @@ namespace OpenSim.Tests.Common.Mock { public class TestAssetService : IAssetService { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private readonly Dictionary Assets = new Dictionary(); public TestAssetService() {} @@ -50,6 +54,8 @@ namespace OpenSim.Tests.Common.Mock public AssetBase Get(string id) { + m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); + AssetBase asset; if (Assets.ContainsKey(id)) asset = Assets[id]; @@ -78,6 +84,8 @@ namespace OpenSim.Tests.Common.Mock public string Store(AssetBase asset) { + m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); + Assets[asset.ID] = asset; return asset.ID; -- cgit v1.1 From 2f092d271e80dbc7af47671fbb946de75b6110a9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Nov 2009 18:44:03 +0000 Subject: Rename test services to mock services, since this is a more accurate description remove duplicate mock inventory service --- OpenSim/Tests/Common/Mock/MockAssetService.cs | 104 ++++++++++++ OpenSim/Tests/Common/Mock/MockInventoryService.cs | 190 ++++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestAssetService.cs | 104 ------------ OpenSim/Tests/Common/Mock/TestInventoryService.cs | 190 ---------------------- 4 files changed, 294 insertions(+), 294 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/MockAssetService.cs create mode 100644 OpenSim/Tests/Common/Mock/MockInventoryService.cs delete mode 100644 OpenSim/Tests/Common/Mock/TestAssetService.cs delete mode 100644 OpenSim/Tests/Common/Mock/TestInventoryService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs new file mode 100644 index 0000000..cb38043 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs @@ -0,0 +1,104 @@ +/* + * 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 OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Data; +using OpenSim.Services.Interfaces; +using Nini.Config; + +namespace OpenSim.Tests.Common.Mock +{ + public class MockAssetService : IAssetService + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private readonly Dictionary Assets = new Dictionary(); + + public MockAssetService() {} + + /// + /// This constructor is required if the asset service is being created reflectively (which is the case in some + /// tests). + /// + /// + public MockAssetService(IConfigSource config) {} + + public AssetBase Get(string id) + { + m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); + + AssetBase asset; + if (Assets.ContainsKey(id)) + asset = Assets[id]; + else + asset = null; + + return asset; + } + + public AssetMetadata GetMetadata(string id) + { + throw new System.NotImplementedException(); + } + + public byte[] GetData(string id) + { + throw new System.NotImplementedException(); + } + + public bool Get(string id, object sender, AssetRetrieved handler) + { + handler(id, sender, Get(id)); + + return true; + } + + public string Store(AssetBase asset) + { + m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); + + Assets[asset.ID] = asset; + + return asset.ID; + } + + public bool UpdateContent(string id, byte[] data) + { + throw new System.NotImplementedException(); + } + + public bool Delete(string id) + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs new file mode 100644 index 0000000..1ea4bc1 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs @@ -0,0 +1,190 @@ +/* + * 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.Text; +using OpenSim.Framework; +using OpenMetaverse; +using OpenSim.Services.Interfaces; +using Nini.Config; + +namespace OpenSim.Tests.Common.Mock +{ + public class MockInventoryService : IInventoryService + { + public MockInventoryService() + { + } + + public MockInventoryService(IConfigSource config) + { + } + + /// + /// + /// + /// + /// + public bool CreateUserInventory(UUID userId) + { + return false; + } + + /// + /// + /// + /// + /// + public List GetInventorySkeleton(UUID userId) + { + List folders = new List(); + InventoryFolderBase folder = new InventoryFolderBase(); + folder.ID = UUID.Random(); + folder.Owner = userId; + folders.Add(folder); + return folders; + } + + public InventoryFolderBase GetRootFolder(UUID userID) + { + return new InventoryFolderBase(); + } + + public InventoryCollection GetFolderContent(UUID userID, UUID folderID) + { + return null; + } + + public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) + { + return null; + } + + /// + /// Returns a list of all the active gestures in a user's inventory. + /// + /// + /// The of the user + /// + /// + /// A flat list of the gesture items. + /// + public List GetActiveGestures(UUID userId) + { + return null; + } + + public InventoryCollection GetUserInventory(UUID userID) + { + return null; + } + + public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback) + { + } + + public List GetFolderItems(UUID userID, UUID folderID) + { + return null; + } + + public bool AddFolder(InventoryFolderBase folder) + { + return false; + } + + public bool UpdateFolder(InventoryFolderBase folder) + { + return false; + } + + public bool MoveFolder(InventoryFolderBase folder) + { + return false; + } + + public bool DeleteFolders(UUID ownerID, List ids) + { + return false; + } + + public bool PurgeFolder(InventoryFolderBase folder) + { + return false; + } + + public bool AddItem(InventoryItemBase item) + { + return false; + } + + public bool UpdateItem(InventoryItemBase item) + { + return false; + } + + public bool MoveItems(UUID ownerID, List items) + { + return false; + } + + public bool DeleteItems(UUID ownerID, List itemIDs) + { + return false; + } + + public InventoryItemBase GetItem(InventoryItemBase item) + { + return null; + } + + public InventoryFolderBase GetFolder(InventoryFolderBase folder) + { + return null; + } + + public bool HasInventoryForUser(UUID userID) + { + return false; + } + + public InventoryFolderBase RequestRootFolder(UUID userID) + { + InventoryFolderBase root = new InventoryFolderBase(); + root.ID = UUID.Random(); + root.Owner = userID; + root.ParentID = UUID.Zero; + return root; + } + + public int GetAssetPermissions(UUID userID, UUID assetID) + { + return 1; + } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs deleted file mode 100644 index a537b97..0000000 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ /dev/null @@ -1,104 +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 log4net; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; -using OpenSim.Services.Interfaces; -using Nini.Config; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestAssetService : IAssetService - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private readonly Dictionary Assets = new Dictionary(); - - public TestAssetService() {} - - /// - /// This constructor is required if the asset service is being created reflectively (which is the case in some - /// tests). - /// - /// - public TestAssetService(IConfigSource config) {} - - public AssetBase Get(string id) - { - m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); - - AssetBase asset; - if (Assets.ContainsKey(id)) - asset = Assets[id]; - else - asset = null; - - return asset; - } - - public AssetMetadata GetMetadata(string id) - { - throw new System.NotImplementedException(); - } - - public byte[] GetData(string id) - { - throw new System.NotImplementedException(); - } - - public bool Get(string id, object sender, AssetRetrieved handler) - { - handler(id, sender, Get(id)); - - return true; - } - - public string Store(AssetBase asset) - { - m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); - - Assets[asset.ID] = asset; - - return asset.ID; - } - - public bool UpdateContent(string id, byte[] data) - { - throw new System.NotImplementedException(); - } - - public bool Delete(string id) - { - throw new System.NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs deleted file mode 100644 index 5a0ee7c..0000000 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ /dev/null @@ -1,190 +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.Text; -using OpenSim.Framework; -using OpenMetaverse; -using OpenSim.Services.Interfaces; -using Nini.Config; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestInventoryService : IInventoryService - { - public TestInventoryService() - { - } - - public TestInventoryService(IConfigSource config) - { - } - - /// - /// - /// - /// - /// - public bool CreateUserInventory(UUID userId) - { - return false; - } - - /// - /// - /// - /// - /// - public List GetInventorySkeleton(UUID userId) - { - List folders = new List(); - InventoryFolderBase folder = new InventoryFolderBase(); - folder.ID = UUID.Random(); - folder.Owner = userId; - folders.Add(folder); - return folders; - } - - public InventoryFolderBase GetRootFolder(UUID userID) - { - return new InventoryFolderBase(); - } - - public InventoryCollection GetFolderContent(UUID userID, UUID folderID) - { - return null; - } - - public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - { - return null; - } - - /// - /// Returns a list of all the active gestures in a user's inventory. - /// - /// - /// The of the user - /// - /// - /// A flat list of the gesture items. - /// - public List GetActiveGestures(UUID userId) - { - return null; - } - - public InventoryCollection GetUserInventory(UUID userID) - { - return null; - } - - public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback) - { - } - - public List GetFolderItems(UUID userID, UUID folderID) - { - return null; - } - - public bool AddFolder(InventoryFolderBase folder) - { - return false; - } - - public bool UpdateFolder(InventoryFolderBase folder) - { - return false; - } - - public bool MoveFolder(InventoryFolderBase folder) - { - return false; - } - - public bool DeleteFolders(UUID ownerID, List ids) - { - return false; - } - - public bool PurgeFolder(InventoryFolderBase folder) - { - return false; - } - - public bool AddItem(InventoryItemBase item) - { - return false; - } - - public bool UpdateItem(InventoryItemBase item) - { - return false; - } - - public bool MoveItems(UUID ownerID, List items) - { - return false; - } - - public bool DeleteItems(UUID ownerID, List itemIDs) - { - return false; - } - - public InventoryItemBase GetItem(InventoryItemBase item) - { - return null; - } - - public InventoryFolderBase GetFolder(InventoryFolderBase folder) - { - return null; - } - - public bool HasInventoryForUser(UUID userID) - { - return false; - } - - public InventoryFolderBase RequestRootFolder(UUID userID) - { - InventoryFolderBase root = new InventoryFolderBase(); - root.ID = UUID.Random(); - root.Owner = userID; - root.ParentID = UUID.Zero; - return root; - } - - public int GetAssetPermissions(UUID userID, UUID assetID) - { - return 1; - } - } -} -- cgit v1.1 From d95df603dfc8e6a033649be669c6b54071ccb7d4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Nov 2009 19:33:38 +0000 Subject: move fake user service to a separate mock user service class delete asset cache tests shell --- OpenSim/Tests/Common/Mock/MockUserService.cs | 123 +++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/MockUserService.cs (limited to 'OpenSim/Tests/Common/Mock') 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 @@ + +using System; +using System.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Communications.Cache; +using OpenSim.Services.Interfaces; + +namespace OpenSim.Tests.Common +{ + public class MockUserService : IUserService + { + public void AddTemporaryUserProfile(UserProfileData userProfile) + { + throw new NotImplementedException(); + } + + public UserProfileData GetUserProfile(string firstName, string lastName) + { + throw new NotImplementedException(); + } + + public UserProfileData GetUserProfile(UUID userId) + { + throw new NotImplementedException(); + } + + public UserProfileData GetUserProfile(Uri uri) + { + UserProfileData userProfile = new UserProfileData(); + +// userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret)); + + return userProfile; + } + + public Uri GetUserUri(UserProfileData userProfile) + { + throw new NotImplementedException(); + } + + public UserAgentData GetAgentByUUID(UUID userId) + { + throw new NotImplementedException(); + } + + public void ClearUserAgent(UUID avatarID) + { + throw new NotImplementedException(); + } + + public List GenerateAgentPickerRequestResponse(UUID QueryID, string Query) + { + throw new NotImplementedException(); + } + + public UserProfileData SetupMasterUser(string firstName, string lastName) + { + throw new NotImplementedException(); + } + + public UserProfileData SetupMasterUser(string firstName, string lastName, string password) + { + throw new NotImplementedException(); + } + + public UserProfileData SetupMasterUser(UUID userId) + { + throw new NotImplementedException(); + } + + public bool UpdateUserProfile(UserProfileData data) + { + throw new NotImplementedException(); + } + + public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) + { + throw new NotImplementedException(); + } + + public void RemoveUserFriend(UUID friendlistowner, UUID friend) + { + throw new NotImplementedException(); + } + + public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) + { + throw new NotImplementedException(); + } + + public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) + { + throw new NotImplementedException(); + } + + public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) + { + throw new NotImplementedException(); + } + + public List GetUserFriendList(UUID friendlistowner) + { + throw new NotImplementedException(); + } + + public bool VerifySession(UUID userID, UUID sessionID) + { + return true; + } + + public void SetInventoryService(IInventoryService inv) + { + throw new NotImplementedException(); + } + + public virtual bool AuthenticateUserByPassword(UUID userID, string password) + { + throw new NotImplementedException(); + } + } +} -- cgit v1.1 From b130b364032ea7cebd615dd6f60627fc69616662 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Nov 2009 16:05:15 +0000 Subject: minor: add forgotton copyright header --- OpenSim/Tests/Common/Mock/MockUserService.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockUserService.cs b/OpenSim/Tests/Common/Mock/MockUserService.cs index 1e27fb7..62c41c7 100644 --- a/OpenSim/Tests/Common/Mock/MockUserService.cs +++ b/OpenSim/Tests/Common/Mock/MockUserService.cs @@ -1,3 +1,29 @@ +/* + * 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; -- cgit v1.1 From 9f5c2acd128828d220bf7e47bd4fe13d7a2a910b Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 23 Nov 2009 11:26:06 +0900 Subject: Formatting cleanup. --- OpenSim/Tests/Common/Mock/MockUserService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockUserService.cs b/OpenSim/Tests/Common/Mock/MockUserService.cs index 62c41c7..396ef25 100644 --- a/OpenSim/Tests/Common/Mock/MockUserService.cs +++ b/OpenSim/Tests/Common/Mock/MockUserService.cs @@ -34,7 +34,7 @@ using OpenSim.Framework.Communications.Cache; using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common -{ +{ public class MockUserService : IUserService { public void AddTemporaryUserProfile(UserProfileData userProfile) -- cgit v1.1 From 3e4000b9d9c69a032af5ebf76cddb1726aea1994 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Nov 2009 19:56:06 +0000 Subject: Rename TestAssetDataPlugin to MockAssetDataPlugin --- OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | 64 ++++++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs | 64 ------------------------ 2 files changed, 64 insertions(+), 64 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs delete mode 100644 OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs new file mode 100644 index 0000000..cc1dfbf --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs @@ -0,0 +1,64 @@ +/* + * 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 OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Data; + +namespace OpenSim.Tests.Common.Mock +{ + /// + /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the + /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit + /// tests are single threaded. + /// + public class MockAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin + { + public string Version { get { return "0"; } } + public string Name { get { return "MockAssetDataPlugin"; } } + + public void Initialise() {} + public void Initialise(string connect) {} + public void Dispose() {} + + private readonly List assets = new List(); + + public AssetBase GetAsset(UUID uuid) + { + return assets.Find(x=>x.FullID == uuid); + } + + public void StoreAsset(AssetBase asset) + { + assets.Add(asset); + } + + public List FetchAssetMetadataSet(int start, int count) { return new List(count); } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs deleted file mode 100644 index 20ea18f..0000000 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ /dev/null @@ -1,64 +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 OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - /// - /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the - /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit - /// tests are single threaded. - /// - public class TestAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin - { - public string Version { get { return "0"; } } - public string Name { get { return "TestAssetDataPlugin"; } } - - public void Initialise() {} - public void Initialise(string connect) {} - public void Dispose() {} - - private readonly List assets = new List(); - - public AssetBase GetAsset(UUID uuid) - { - return assets.Find(x=>x.FullID == uuid); - } - - public void StoreAsset(AssetBase asset) - { - assets.Add(asset); - } - - public List FetchAssetMetadataSet(int start, int count) { return new List(count); } - } -} \ No newline at end of file -- cgit v1.1 From 88b3b98811e70709536bb41410ec88509e0460a5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 26 Dec 2009 04:12:51 +0000 Subject: Add AvatarInterestsReply --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 27025d9..6265ab7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1159,6 +1159,9 @@ namespace OpenSim.Tests.Common.Mock public void SendRebakeAvatarTextures(UUID textureID) { } - + + public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) + { + } } } -- cgit v1.1 From 234d4e11059fb2e1fc9dbe879054bd84e95b502b Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 30 Dec 2009 21:45:10 -0600 Subject: Adds tons of packets. Applied with change: Changed spelling to Summary (from Summery) Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6265ab7..8da9209 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -287,6 +287,26 @@ namespace OpenSim.Tests.Common.Mock public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; #pragma warning restore 67 @@ -1163,5 +1183,17 @@ namespace OpenSim.Tests.Common.Mock public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } -- cgit v1.1 From 70d5b1c34cf2eb6621f383169fdee03966850762 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 4 Jan 2010 06:10:45 +0900 Subject: Formatting cleanup. Add copyright headers. --- OpenSim/Tests/Common/Mock/TestClient.cs | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8da9209..1a22bdc 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -289,24 +289,24 @@ namespace OpenSim.Tests.Common.Mock public event PlacesQuery OnPlacesQuery; public event FindAgentUpdate OnFindAgentEvent; - public event TrackAgentUpdate OnTrackAgentEvent; - public event NewUserReport OnUserReportEvent; - public event SaveStateHandler OnSaveStateEvent; - public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; - public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; - public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; - public event FreezeUserUpdate OnParcelFreezeUserEvent; - public event EjectUserUpdate OnParcelEjectUserEvent; - public event ParcelBuyPass OnParcelBuyPass; - public event ParcelGodMark OnParcelGodMark; - public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; - public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; - public event SimWideDeletesDelegate OnSimWideDeletes; - public event SendPostcard OnSendPostcard; - public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; - public event MuteListEntryRemove OnRemoveMuteListEntryEvent; - public event GodlikeMessage onGodlikeMessageEvent; - public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; #pragma warning restore 67 -- cgit v1.1 From b67470af9106da24ed67db75cfe4787e58759385 Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 6 Jan 2010 19:52:10 -0600 Subject: Fixes the newly added packets as per Melanie's request. Provisionally applied to fix the naming. Signatures are still subject to change. Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1a22bdc..b78433f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -288,25 +288,25 @@ namespace OpenSim.Tests.Common.Mock public event PlacesQuery OnPlacesQuery; - public event FindAgentUpdate OnFindAgentEvent; - public event TrackAgentUpdate OnTrackAgentEvent; - public event NewUserReport OnUserReportEvent; - public event SaveStateHandler OnSaveStateEvent; + public event FindAgentUpdate OnFindAgent; + public event TrackAgentUpdate OnTrackAgent; + public event NewUserReport OnUserReport; + public event SaveStateHandler OnSaveState; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; - public event FreezeUserUpdate OnParcelFreezeUserEvent; - public event EjectUserUpdate OnParcelEjectUserEvent; + public event FreezeUserUpdate OnParcelFreezeUser; + public event EjectUserUpdate OnParcelEjectUser; public event ParcelBuyPass OnParcelBuyPass; public event ParcelGodMark OnParcelGodMark; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event SimWideDeletesDelegate OnSimWideDeletes; public event SendPostcard OnSendPostcard; - public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; - public event MuteListEntryRemove OnRemoveMuteListEntryEvent; - public event GodlikeMessage onGodlikeMessageEvent; - public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; + public event MuteListEntryUpdate OnUpdateMuteListEntry; + public event MuteListEntryRemove OnRemoveMuteListEntry; + public event GodlikeMessage onGodlikeMessage; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; #pragma warning restore 67 -- cgit v1.1 From c76c80a28aabeb1cb0556ea2ebd89f6241bb7026 Mon Sep 17 00:00:00 2001 From: Revolution Date: Fri, 8 Jan 2010 12:44:26 -0600 Subject: Adds IClientAPI voids for GroupProposals. Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b78433f..93cab0e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1194,6 +1194,14 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } -- cgit v1.1 From 063f106cbbc2a805dc210fe16c30741ab24876cb Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 9 Jan 2010 14:17:44 +0000 Subject: Add functionality to estate "Allowed Users" and "Allowed Groups". Allowed users will be honored now, while allowed groups will not. This requires additional groups module integration work --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 93cab0e..8b79502 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -924,7 +924,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) + public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) { } -- cgit v1.1 From 0c2946031bccf75c28968b6adcde5cce5bc45c13 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 19:42:36 -0800 Subject: CommunicationsManager is practically empty. Only NetworkServersInfo is there. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 013462e..fccc282 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -62,8 +62,6 @@ namespace OpenSim.Tests.Common.Mock lus.AddPlugin(new TemporaryUserProfilePlugin()); m_userDataPlugin = new TestUserDataPlugin(); lus.AddPlugin(m_userDataPlugin); - m_userService = lus; - m_userAdminService = lus; } } -- cgit v1.1 From cddd48aeeaee98d14fd4ae887cdf32abc6110c40 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 21:00:03 -0800 Subject: Some more unnecessary things deleted in Framework.Communications. --- OpenSim/Tests/Common/Mock/MockUserService.cs | 149 --------------------- .../Tests/Common/Mock/TestCommunicationsManager.cs | 5 - 2 files changed, 154 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/MockUserService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockUserService.cs b/OpenSim/Tests/Common/Mock/MockUserService.cs deleted file mode 100644 index 396ef25..0000000 --- a/OpenSim/Tests/Common/Mock/MockUserService.cs +++ /dev/null @@ -1,149 +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 OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; -using OpenSim.Services.Interfaces; - -namespace OpenSim.Tests.Common -{ - public class MockUserService : IUserService - { - public void AddTemporaryUserProfile(UserProfileData userProfile) - { - throw new NotImplementedException(); - } - - public UserProfileData GetUserProfile(string firstName, string lastName) - { - throw new NotImplementedException(); - } - - public UserProfileData GetUserProfile(UUID userId) - { - throw new NotImplementedException(); - } - - public UserProfileData GetUserProfile(Uri uri) - { - UserProfileData userProfile = new UserProfileData(); - -// userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret)); - - return userProfile; - } - - public Uri GetUserUri(UserProfileData userProfile) - { - throw new NotImplementedException(); - } - - public UserAgentData GetAgentByUUID(UUID userId) - { - throw new NotImplementedException(); - } - - public void ClearUserAgent(UUID avatarID) - { - throw new NotImplementedException(); - } - - public List GenerateAgentPickerRequestResponse(UUID QueryID, string Query) - { - throw new NotImplementedException(); - } - - public UserProfileData SetupMasterUser(string firstName, string lastName) - { - throw new NotImplementedException(); - } - - public UserProfileData SetupMasterUser(string firstName, string lastName, string password) - { - throw new NotImplementedException(); - } - - public UserProfileData SetupMasterUser(UUID userId) - { - throw new NotImplementedException(); - } - - public bool UpdateUserProfile(UserProfileData data) - { - throw new NotImplementedException(); - } - - public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) - { - throw new NotImplementedException(); - } - - public void RemoveUserFriend(UUID friendlistowner, UUID friend) - { - throw new NotImplementedException(); - } - - public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) - { - throw new NotImplementedException(); - } - - public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) - { - throw new NotImplementedException(); - } - - public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz) - { - throw new NotImplementedException(); - } - - public List GetUserFriendList(UUID friendlistowner) - { - throw new NotImplementedException(); - } - - public bool VerifySession(UUID userID, UUID sessionID) - { - return true; - } - - public void SetInventoryService(IInventoryService inv) - { - throw new NotImplementedException(); - } - - public virtual bool AuthenticateUserByPassword(UUID userID, string password) - { - throw new NotImplementedException(); - } - } -} diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index fccc282..d4cdcd6 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -58,11 +58,6 @@ namespace OpenSim.Tests.Common.Mock : base(serversInfo, null) { - LocalUserServices lus = new LocalUserServices(991, 992, this); - lus.AddPlugin(new TemporaryUserProfilePlugin()); - m_userDataPlugin = new TestUserDataPlugin(); - lus.AddPlugin(m_userDataPlugin); - } } } -- cgit v1.1 From 751e70af788bf27fa0401c25d899f73186c8eafa Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 21:37:36 -0800 Subject: NetworkServersInfo removed from CommsManager. --- OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index d4cdcd6..8e193c1 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -30,7 +30,6 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Region.Communications.Local; using OpenSim.Data; namespace OpenSim.Tests.Common.Mock -- cgit v1.1 From 001d3695683d9511446d194feeb763c437170028 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:45:47 -0800 Subject: CommunicationsManager deleted. --- .../Tests/Common/Mock/TestCommunicationsManager.cs | 62 ---------------------- OpenSim/Tests/Common/Mock/TestScene.cs | 4 +- 2 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs deleted file mode 100644 index 8e193c1..0000000 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ /dev/null @@ -1,62 +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 OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Servers; -using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestCommunicationsManager : CommunicationsManager - { - public IUserDataPlugin UserDataPlugin - { - get { return m_userDataPlugin; } - } - private IUserDataPlugin m_userDataPlugin; - - // public IInventoryDataPlugin InventoryDataPlugin - // { - // get { return m_inventoryDataPlugin; } - // } - // private IInventoryDataPlugin m_inventoryDataPlugin; - - public TestCommunicationsManager() - : this(null) - { - } - - public TestCommunicationsManager(NetworkServersInfo serversInfo) - : base(serversInfo, null) - { - - } - } -} diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 22cfa2c..bf3825b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, + SceneCommunicationService sceneGridService, StorageManager storeManager, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader, + : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } -- cgit v1.1 From c5ea783526611a968400a1936e4c6764ee1c7013 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:51:33 -0800 Subject: OpenSim/Framework/Communications/Cache deleted. LibraryRootFolder deleted. --- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index bf3825b..85031f7 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -29,7 +29,7 @@ using System; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Scenes; -- cgit v1.1 From 04e29c1bacbc1e2df980ae15896a847ce7535da2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 16 Jan 2010 21:42:44 -0800 Subject: Beginning of rewriting HG. Compiles, and runs, but HG functions not restored yet. --- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 85031f7..076cb7a 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock /// /// /// - public override bool AuthenticateUser(AgentCircuitData agent, out string reason) + public override bool VerifyUserPresence(AgentCircuitData agent, out string reason) { reason = String.Empty; return true; -- cgit v1.1 From 027ad495677ddaa3b05b268d167faa514954085e Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 26 Jan 2010 12:23:06 -0500 Subject: * Fix Endlines in Mock/TestClient.cs --- OpenSim/Tests/Common/Mock/TestClient.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8b79502..b5eaf43 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1194,14 +1194,14 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } -- cgit v1.1 From 5001f61c08fea2ebfcb2590be69073d04d129d70 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 29 Jan 2010 18:59:41 -0800 Subject: * HGGridConnector is no longer necessary. * Handle logout properly. This needed an addition to IClientAPI, because of how the logout packet is currently being handled -- the agent is being removed from the scene before the different event handlers are executed, which is broken. --- OpenSim/Tests/Common/Mock/TestClient.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8b79502..0e32950 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -365,7 +365,11 @@ namespace OpenSim.Tests.Common.Mock get { return true; } set { } } - + public bool IsLoggingOut + { + get { return false; } + set { } + } public UUID ActiveGroupId { get { return UUID.Zero; } @@ -1194,14 +1198,14 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } -- cgit v1.1 From 9821c4f566e11c75c8d87721777480c5b2e2bd4e Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 15:41:57 -0600 Subject: Revolution is on the roll again! :) Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b5eaf43..7dab6a1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -206,6 +206,8 @@ namespace OpenSim.Tests.Common.Mock public event ObjectBuy OnObjectBuy; public event BuyObjectInventory OnBuyObjectInventory; public event AgentSit OnUndo; + public event AgentSit OnRedo; + public event LandUndo OnLandUndo; public event ForceReleaseControls OnForceReleaseControls; -- cgit v1.1 From bb171717ceaef37b022a135209c2e0bf031d21f9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 21 Feb 2010 15:38:52 -0800 Subject: Deleted obsolete files in the Data layer. Compiles. --- OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs | 216 ------------------------ 1 file changed, 216 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs deleted file mode 100644 index 5188cf6..0000000 --- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs +++ /dev/null @@ -1,216 +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 OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - /// - /// In memory user data provider. Might be quite useful as a proper user data plugin, though getting mono addins - /// to load any plugins when running unit tests has proven impossible so far. Currently no locking since unit - /// tests are single threaded. - /// - public class TestUserDataPlugin : IUserDataPlugin - { - public string Version { get { return "0"; } } - public string Name { get { return "TestUserDataPlugin"; } } - - /// - /// User profiles keyed by name - /// - private Dictionary m_userProfilesByName = new Dictionary(); - - /// - /// User profiles keyed by uuid - /// - private Dictionary m_userProfilesByUuid = new Dictionary(); - - /// - /// User profiles and their agents - /// - private Dictionary m_agentByProfileUuid = new Dictionary(); - - /// - /// Friends list by uuid - /// - private Dictionary> m_friendsListByUuid = new Dictionary>(); - - public void Initialise() {} - public void Dispose() {} - - public void AddTemporaryUserProfile(UserProfileData userProfile) - { - // Not interested - } - - public void AddNewUserProfile(UserProfileData user) - { - UpdateUserProfile(user); - } - - public UserProfileData GetUserByUUID(UUID user) - { - UserProfileData userProfile = null; - m_userProfilesByUuid.TryGetValue(user, out userProfile); - - return userProfile; - } - - public UserProfileData GetUserByName(string fname, string lname) - { - UserProfileData userProfile = null; - m_userProfilesByName.TryGetValue(fname + " " + lname, out userProfile); - - return userProfile; - } - - public UserProfileData GetUserByUri(Uri uri) { return null; } - - public bool UpdateUserProfile(UserProfileData user) - { - m_userProfilesByUuid[user.ID] = user; - m_userProfilesByName[user.FirstName + " " + user.SurName] = user; - - return true; - } - - public List GeneratePickerResults(UUID queryID, string query) { return null; } - - public UserAgentData GetAgentByUUID(UUID user) - { - UserAgentData userAgent = null; - m_agentByProfileUuid.TryGetValue(user, out userAgent); - - return userAgent; - } - - public UserAgentData GetAgentByName(string name) - { - UserProfileData userProfile = null; - m_userProfilesByName.TryGetValue(name, out userProfile); - UserAgentData userAgent = null; - m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent); - - return userAgent; - } - - public UserAgentData GetAgentByName(string fname, string lname) - { - UserProfileData userProfile = GetUserByName(fname,lname); - UserAgentData userAgent = null; - m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent); - - return userAgent; - } - - public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {} - - public void AddNewUserAgent(UserAgentData agent) - { - m_agentByProfileUuid[agent.ProfileID] = agent; - } - public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) - { - FriendListItem newfriend = new FriendListItem(); - newfriend.FriendPerms = perms; - newfriend.Friend = friend; - newfriend.FriendListOwner = friendlistowner; - - if (!m_friendsListByUuid.ContainsKey(friendlistowner)) - { - List friendslist = new List(); - m_friendsListByUuid[friendlistowner] = friendslist; - - } - m_friendsListByUuid[friendlistowner].Add(newfriend); - } - - public void RemoveUserFriend(UUID friendlistowner, UUID friend) - { - if (m_friendsListByUuid.ContainsKey(friendlistowner)) - { - List friendslist = m_friendsListByUuid[friendlistowner]; - foreach (FriendListItem frienditem in friendslist) - { - if (frienditem.Friend == friend) - { - friendslist.Remove(frienditem); - break; - } - } - } - } - - public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) - { - if (m_friendsListByUuid.ContainsKey(friendlistowner)) - { - List friendslist = m_friendsListByUuid[friendlistowner]; - foreach (FriendListItem frienditem in friendslist) - { - if (frienditem.Friend == friend) - { - frienditem.FriendPerms = perms; - break; - } - } - } - } - - public List GetUserFriendList(UUID friendlistowner) - { - if (m_friendsListByUuid.ContainsKey(friendlistowner)) - { - return m_friendsListByUuid[friendlistowner]; - } - else - return new List(); - - - } - - public Dictionary GetFriendRegionInfos(List uuids) { return null; } - - public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; } - - public bool InventoryTransferRequest(UUID from, UUID to, UUID inventory) { return false; } - - public void Initialise(string connect) { return; } - - public AvatarAppearance GetUserAppearance(UUID user) { return null; } - - public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) {} - - public void ResetAttachments(UUID userID) {} - - public void LogoutUsers(UUID regionID) {} - } -} -- cgit v1.1 From 5c5966545d14de43500b95109e8ce81058ebe2c3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 28 Feb 2010 12:07:38 -0800 Subject: Initial Online friends notification seems to be working reliably now. All this needs more testing, but everything is there. --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 873b3ac..803b352 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -95,7 +95,7 @@ namespace OpenSim.Tests.Common.Mock public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; public event GenericCall2 OnRequestWearables; - public event GenericCall2 OnCompleteMovementToRegion; + public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; @@ -453,7 +453,7 @@ namespace OpenSim.Tests.Common.Mock public void CompleteMovement() { - OnCompleteMovementToRegion(); + OnCompleteMovementToRegion(this); } public virtual void ActivateGesture(UUID assetId, UUID gestureId) @@ -752,7 +752,7 @@ namespace OpenSim.Tests.Common.Mock if (OnCompleteMovementToRegion != null) { - OnCompleteMovementToRegion(); + OnCompleteMovementToRegion(this); } } public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) -- cgit v1.1 From 44e7224b86dbcd369ce2569328e3b00fc3b209ab Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 28 Feb 2010 22:47:31 +0000 Subject: Add missing ChangeUserRights packet sender --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 803b352..c424183 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1209,5 +1209,9 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) { } + + public void SendChangeUserRights(UUID friendID, int rights) + { + } } } -- cgit v1.1 From 86c621fdc77fadb898cf53578e83746cd8f8711b Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 28 Feb 2010 22:56:31 +0000 Subject: Change the signature of SendChangeUserRights, because we have to send this to both parties --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c424183..6403c1b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1210,7 +1210,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendChangeUserRights(UUID friendID, int rights) + public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) { } } -- cgit v1.1 From 2dcf73dd93f2bc8993c2f534ef5ee8c72e24d0f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 6 Mar 2010 14:13:12 -0600 Subject: - supporting llTextBox Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6403c1b..7b46e95 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1213,5 +1213,9 @@ namespace OpenSim.Tests.Common.Mock public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) { } + + public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) + { + } } } -- cgit v1.1 From 98f91a252cade093894511110157d7fcd7e4487e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Mar 2010 01:19:45 -0600 Subject: - parcel blocking, region crossing blocking, teleport blocking Signed-off-by: Melanie --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 7b46e95..5fff279 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -96,6 +96,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnRegionHandShakeReply; public event GenericCall2 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; + public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; -- cgit v1.1 From f2de50bb14bd8215ea98c79c79aabe1e6b4f2780 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 12 Mar 2010 19:31:14 +0000 Subject: Fix tests broken in 88771aeed3d45e60a18aa9a810eeb37b8e5def12 Adds MockUserAccountService and connects it up Stops services being carried over between tests since this leads to hard to find bugs Improves information and error reporting when loading plugins --- .../Tests/Common/Mock/MockUserAccountService.cs | 45 ++++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestScene.cs | 4 +- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/MockUserAccountService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs new file mode 100644 index 0000000..f5d758a --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs @@ -0,0 +1,45 @@ +/* + * 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.Collections.Generic; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Services.Interfaces; + +namespace OpenSim.Tests.Common.Mock +{ + public class MockUserAccountService : IUserAccountService + { + public MockUserAccountService(IConfigSource config) {} + + public UserAccount GetUserAccount(UUID scopeID, UUID userID) { return new UserAccount(); } + public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName) { return new UserAccount(); } + public UserAccount GetUserAccount(UUID scopeID, string Email) { return new UserAccount(); } + public List GetUserAccounts(UUID scopeID, string query) { return new List(); } + public bool StoreUserAccount(UserAccount data) { return true; } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 076cb7a..01f2c14 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -65,6 +65,6 @@ namespace OpenSim.Tests.Common.Mock public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { get { return m_asyncSceneObjectDeleter; } - } + } } -} +} \ No newline at end of file -- cgit v1.1 From aad17e751383069b799c6a78a3ac4e0ca1020a4d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 12 Mar 2010 20:29:17 +0000 Subject: Simplify database setup and remove migration problems by moving all sqlite config-include settings to a separate file for standalone Update information in StandaloneCommon.ini.example to reflect this Remove ISharedRegionModule interfaces from all SimianGrid connector classes temporarily since this stopped standalone from working (due to absence of AssetURI settings, etc.). Solution here may be to create separate region module connectors as done by local/grid/hypergrid so that loading can be controlled via include files Or otherwise work out how to stop these modules from being loaded for all OpenSim invocations --- OpenSim/Tests/Common/Mock/MockUserAccountService.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs index f5d758a..0769c7a 100644 --- a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs +++ b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs @@ -34,6 +34,7 @@ namespace OpenSim.Tests.Common.Mock { public class MockUserAccountService : IUserAccountService { + public MockUserAccountService(IConfigSource config) {} public UserAccount GetUserAccount(UUID scopeID, UUID userID) { return new UserAccount(); } -- cgit v1.1 From ec637e2b8c089efc16bbb9faae0a1e3cf939db41 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 31 Mar 2010 04:20:20 +0100 Subject: Committing the LightShare code, which was developed by TomMeta of Meta7. This allows scripts to set WindLight parameters for clients connecting to a region. Currently, this is only supported by the Meta7 viewer. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5fff279..f015db2 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -518,7 +518,7 @@ namespace OpenSim.Tests.Common.Mock } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, List message) { } -- cgit v1.1 From 3f6c4c150e3910e79ee3dc94f9304c16265512c0 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 8 Apr 2010 12:31:44 -0700 Subject: * Adds IAssetService.GetCached() to allow asset fetching from the local cache only * Adds GetTextureModule that implements the "GetTexture" capability, aka HTTP texture fetching. This is a significantly optimized path that does not require any server-side JPEG2000 decoding, texture priority queue, or UDP file transfer * Sanity check for null reference in LLClientView.RefreshGroupMembership() --- OpenSim/Tests/Common/Mock/MockAssetService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs index cb38043..4118308 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetService.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs @@ -65,6 +65,11 @@ namespace OpenSim.Tests.Common.Mock return asset; } + public AssetBase GetCached(string id) + { + return Get(id); + } + public AssetMetadata GetMetadata(string id) { throw new System.NotImplementedException(); -- cgit v1.1 From 3d0860ae616749518a40c6f6088d2644d589daf9 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 12 Apr 2010 17:10:51 -0700 Subject: thanks lkalif for Mantis #4676 - a patch that adds support for inventory links Signed-off-by: dahlia --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f015db2..b07a072 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -141,6 +141,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnRemoveAvatar; public event CreateNewInventoryItem OnCreateNewInventoryItem; + public event LinkInventoryItem OnLinkInventoryItem; public event CreateInventoryFolder OnCreateNewInventoryFolder; public event UpdateInventoryFolder OnUpdateInventoryFolder; public event MoveInventoryFolder OnMoveInventoryFolder; -- cgit v1.1 From 60357d3778c95a47481f790803b7af39c70cde9c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 9 May 2010 17:56:52 +0100 Subject: Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler. --- OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index cc1dfbf..4a15cf2 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs @@ -60,5 +60,10 @@ namespace OpenSim.Tests.Common.Mock } public List FetchAssetMetadataSet(int start, int count) { return new List(count); } + + public bool Delete(string id) + { + return false; + } } -} \ No newline at end of file +} -- cgit v1.1 From bf5c81d77e492cd6df5517ecab32cd64168b01c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2010 15:59:48 -0700 Subject: * Initial commit of the slimupdates2 rewrite. This pass maintains the original behavior of avatar update sending and has a simplified set of IClientAPI methods for sending avatar/prim updates --- OpenSim/Tests/Common/Mock/TestClient.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b07a072..edb7642 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -621,14 +621,6 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendAvatarData(SendAvatarData data) - { - } - - public virtual void SendAvatarTerseUpdate(SendAvatarTerseData data) - { - } - public virtual void SendCoarseLocationUpdate(List users, List CoarseLocations) { } @@ -641,15 +633,15 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendPrimitiveToClient(SendPrimitiveData data) + public void SendAvatarDataImmediate(ISceneEntity avatar) { } - public virtual void SendPrimTerseUpdate(SendPrimitiveTerseData data) + public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { } - public virtual void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler) + public void ReprioritizeUpdates(UpdatePriorityHandler handler) { } -- cgit v1.1 From 4c740e1717f8071d48e34c584728fddcf05afdb2 Mon Sep 17 00:00:00 2001 From: OpenSim Master Date: Thu, 29 Apr 2010 11:57:30 -0700 Subject: Implements three new OSSL functions for parcel management: osParcelJoin joins parcels in an area, osParcelSubdivide splits parcels in an area, osParcelSetDetails sets parcel name, description, owner and group owner. Join and Subdivide methods in LandChannel are exposed. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index be28c27..159764c 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -85,5 +85,9 @@ namespace OpenSim.Tests.Common.Mock public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) {} public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) {} public void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime) {} + + public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} + public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} + } } -- cgit v1.1 From 93ef65c69055157e0b7d51e544abe5a1035f40f0 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 21 May 2010 13:55:36 -0700 Subject: * Moving all of the prioritization/reprioritization code into a new file Prioritizer.cs * Simplified the interest management code to make it easier to add new policies. Prioritization and reprioritization share code paths now * Improved the distance and front back policies to always give your avatar the highest priority --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index edb7642..6b0efe9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -641,7 +641,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void ReprioritizeUpdates(UpdatePriorityHandler handler) + public void ReprioritizeUpdates() { } -- cgit v1.1 From 4e45718833f72b9149aed6d503e967b8916e5d08 Mon Sep 17 00:00:00 2001 From: Mikko Pallari Date: Thu, 15 Apr 2010 08:23:51 +0300 Subject: Added overload of SendGenericMessage to LLClientView with string list as parameter. Now modules themselfs don't necessarily need to convert strings to byte arrays. Added this as it was removed in LightShare patch. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6b0efe9..94d9d72 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -519,6 +519,11 @@ namespace OpenSim.Tests.Common.Mock } + public void SendGenericMessage(string method, List message) + { + + } + public void SendGenericMessage(string method, List message) { -- cgit v1.1 From df2bcf7b6b0f558078cab12e48904b8b61766c58 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 4 Jun 2010 20:56:24 +0100 Subject: remove pointless mock user account service since the real one can now be easily configured for test purposes --- .../Tests/Common/Mock/MockUserAccountService.cs | 46 ---------------------- 1 file changed, 46 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/MockUserAccountService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs deleted file mode 100644 index 0769c7a..0000000 --- a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs +++ /dev/null @@ -1,46 +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.Collections.Generic; -using Nini.Config; -using OpenMetaverse; -using OpenSim.Services.Interfaces; - -namespace OpenSim.Tests.Common.Mock -{ - public class MockUserAccountService : IUserAccountService - { - - public MockUserAccountService(IConfigSource config) {} - - public UserAccount GetUserAccount(UUID scopeID, UUID userID) { return new UserAccount(); } - public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName) { return new UserAccount(); } - public UserAccount GetUserAccount(UUID scopeID, string Email) { return new UserAccount(); } - public List GetUserAccounts(UUID scopeID, string query) { return new List(); } - public bool StoreUserAccount(UserAccount data) { return true; } - } -} \ No newline at end of file -- cgit v1.1 From c8ed9724437d9bf1972d4ef3e2b10dd9fa3e7e70 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 12 Jun 2010 01:25:25 +0100 Subject: Move "StopFlying()" into LLSpace. Try to reinstate the carefully crafted packet we used to send before slimupdates and explicitly send it --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 94d9d72..496cfb8 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1216,5 +1216,9 @@ namespace OpenSim.Tests.Common.Mock public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) { } + + public void StopFlying(ISceneEntity presence) + { + } } } -- cgit v1.1 From 71c8bbaf2c768167e377e86ae7137a86c0bb36d0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Jun 2010 17:37:28 +0100 Subject: Fix problem where iar load would duplicate huge number of folders This was http://opensimulator.org/mantis/view.php?id=4770 Extend unit tests to check for this scenario too --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 0c7ebca..fecb73f 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -84,7 +84,7 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryInFolder(UUID folderID) { - m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); +// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); List items = new List(); @@ -101,7 +101,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase getUserRootFolder(UUID user) { - m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); +// m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -141,8 +141,8 @@ namespace OpenSim.Tests.Common.Mock if (folder.ParentID == UUID.Zero) { - m_log.DebugFormat( - "[MOCK INV DB]: Adding root folder {0} {1} for {2}", folder.Name, folder.ID, folder.Owner); +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding root folder {0} {1} for {2}", folder.Name, folder.ID, folder.Owner); m_rootFolders[folder.Owner] = folder; } } @@ -166,8 +166,8 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryItem(InventoryItemBase item) { - m_log.DebugFormat( - "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); m_items[item.ID] = item; } -- cgit v1.1 From e1ea82b329b9346ccacb1edd25a0e2b44f07e8c8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 14 Jul 2010 19:51:12 +0100 Subject: Major attachments cleanup. Remove unused AttachObject ClientView method Clean up use of AttachObject throughout, reduce number of overloads and number of parameters --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 496cfb8..999cf5e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -630,10 +630,6 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) - { - } - public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) { } -- cgit v1.1 From feba3164af384371ecb21b21edba1f7045e1939c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:19:32 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index fecb73f..7c4f689 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock /// public class TestInventoryDataPlugin : IInventoryDataPlugin { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Inventory folders -- cgit v1.1 From 77de28965ae5fc6de3c60a28ce7d4e59643a2a70 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 11:33:59 -0700 Subject: Work on TeleportStart: renamed method from TeleportLocationStart to TeleportStart, and now sending this upon all teleports, not just some, and in the right place (EntityTransferModule). --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 999cf5e..0dee374 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -614,7 +614,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) { } -- cgit v1.1 From a8b80ef800e78d9fa321bc2388b4d8336f454b1d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 11:39:46 -0700 Subject: Added SendTeleportProgress to IClientAPI. Ya know what that means... 8 files affected. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0dee374..e46f9b7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -618,6 +618,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendTeleportProgress(uint flags, string message) + { + } + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { } -- cgit v1.1 From 289c21099cf3ce0a2e3392436541b67d0961d8e8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 24 Aug 2010 16:50:31 +0100 Subject: Add automated test at the opensim 'api' level to check that a given item goes to the correct directory Also removes some mono compiler warnings --- OpenSim/Tests/Common/Mock/MockInventoryService.cs | 12 +++------ .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 31 ++++++++++++++++++---- 2 files changed, 30 insertions(+), 13 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs index 1ea4bc1..4ac1078 100644 --- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs @@ -37,13 +37,9 @@ namespace OpenSim.Tests.Common.Mock { public class MockInventoryService : IInventoryService { - public MockInventoryService() - { - } + public MockInventoryService() {} - public MockInventoryService(IConfigSource config) - { - } + public MockInventoryService(IConfigSource config) {} /// /// @@ -140,7 +136,7 @@ namespace OpenSim.Tests.Common.Mock public bool AddItem(InventoryItemBase item) { - return false; + return true; } public bool UpdateItem(InventoryItemBase item) @@ -187,4 +183,4 @@ namespace OpenSim.Tests.Common.Mock return 1; } } -} +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 7c4f689..ed0b1a6 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock /// public class TestInventoryDataPlugin : IInventoryDataPlugin { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Inventory folders @@ -84,14 +84,19 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryInFolder(UUID folderID) { -// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); + InventoryFolderBase folder = m_folders[folderID]; + + m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); List items = new List(); foreach (InventoryItemBase item in m_items.Values) { if (item.Folder == folderID) + { + m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); items.Add(item); + } } return items; @@ -101,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase getUserRootFolder(UUID user) { -// m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); + m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -111,12 +116,22 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryFolders(UUID parentID) { + InventoryFolderBase parentFolder = m_folders[parentID]; + + m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); + List folders = new List(); foreach (InventoryFolderBase folder in m_folders.Values) { if (folder.ParentID == parentID) + { + m_log.DebugFormat( + "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", + folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); + folders.Add(folder); + } } return folders; @@ -137,6 +152,10 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryFolder(InventoryFolderBase folder) { + m_log.DebugFormat( + "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", + folder.Name, folder.ID, (AssetType)folder.Type); + m_folders[folder.ID] = folder; if (folder.ParentID == UUID.Zero) @@ -166,8 +185,10 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryItem(InventoryItemBase item) { -// m_log.DebugFormat( -// "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); + InventoryFolderBase folder = m_folders[item.Folder]; + + m_log.DebugFormat( + "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); m_items[item.ID] = item; } -- cgit v1.1 From 86937d0a0f5572b002cdb6efc499c234b2a9bd1b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Aug 2010 23:22:49 +0100 Subject: allow inventory path specified in "load iar" to start with a / (e.g. /Objects is now valid where it wasn't before) --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index ed0b1a6..b70b47d 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -86,7 +86,7 @@ namespace OpenSim.Tests.Common.Mock { InventoryFolderBase folder = m_folders[folderID]; - m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); +// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); List items = new List(); @@ -94,7 +94,7 @@ namespace OpenSim.Tests.Common.Mock { if (item.Folder == folderID) { - m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); +// m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); items.Add(item); } } @@ -106,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock public InventoryFolderBase getUserRootFolder(UUID user) { - m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); +// m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -118,7 +118,7 @@ namespace OpenSim.Tests.Common.Mock { InventoryFolderBase parentFolder = m_folders[parentID]; - m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); +// m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); List folders = new List(); @@ -126,9 +126,9 @@ namespace OpenSim.Tests.Common.Mock { if (folder.ParentID == parentID) { - m_log.DebugFormat( - "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", - folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); +// m_log.DebugFormat( +// "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", +// folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); folders.Add(folder); } @@ -152,9 +152,9 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryFolder(InventoryFolderBase folder) { - m_log.DebugFormat( - "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", - folder.Name, folder.ID, (AssetType)folder.Type); +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", +// folder.Name, folder.ID, (AssetType)folder.Type); m_folders[folder.ID] = folder; @@ -187,8 +187,8 @@ namespace OpenSim.Tests.Common.Mock { InventoryFolderBase folder = m_folders[item.Folder]; - m_log.DebugFormat( - "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); m_items[item.ID] = item; } -- cgit v1.1 From 953b7f491798e97b7b36808e716975b22d80114b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 6 Sep 2010 23:00:24 +0100 Subject: Add test to check persistence of newly added pre-linked objects Added a MockRegionDataPlugin to do in-memory persistence for tests since adding this to OpenSim.Data.Null.NullDataStore doesn't seem appropriate NullDataStore can do nothing because OpenSim only ever retrieve region objects from the database on startup. Adding an in-memory store here would be unecessary overhead. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 149 ++++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestScene.cs | 8 +- 2 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs new file mode 100644 index 0000000..1c139c5 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -0,0 +1,149 @@ +/* + * 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.Reflection; +using System.Collections.Generic; +using log4net; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Data.Null +{ + /// + /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that + /// tests can check correct persistence. + /// + public class NullDataStore : IRegionDataStore + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected Dictionary m_regionSettings = new Dictionary(); + protected Dictionary m_sceneObjects = new Dictionary(); + protected Dictionary> m_primItems + = new Dictionary>(); + protected Dictionary m_terrains = new Dictionary(); + protected Dictionary m_landData = new Dictionary(); + + public void Initialise(string dbfile) + { + return; + } + + public void Dispose() + { + } + + public void StoreRegionSettings(RegionSettings rs) + { + m_regionSettings[rs.RegionUUID] = rs; + } + + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) + { + //This connector doesn't support the windlight module yet + //Return default LL windlight settings + return new RegionLightShareData(); + } + + public void StoreRegionWindlightSettings(RegionLightShareData wl) + { + //This connector doesn't support the windlight module yet + } + + public RegionSettings LoadRegionSettings(UUID regionUUID) + { + RegionSettings rs = null; + m_regionSettings.TryGetValue(regionUUID, out rs); + return rs; + } + + public void StoreObject(SceneObjectGroup obj, UUID regionUUID) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Storing object {0} {1} in {2}", obj.Name, obj.UUID, regionUUID); + m_sceneObjects[obj.UUID] = obj; + } + + public void RemoveObject(UUID obj, UUID regionUUID) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Removing object {0} from {1}", obj, regionUUID); + + if (m_sceneObjects.ContainsKey(obj)) + m_sceneObjects.Remove(obj); + } + + // see IRegionDatastore + public void StorePrimInventory(UUID primID, ICollection items) + { + m_primItems[primID] = items; + } + + public List LoadObjects(UUID regionUUID) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Loading objects from {0}", regionUUID); + + return new List(m_sceneObjects.Values); + } + + public void StoreTerrain(double[,] ter, UUID regionID) + { + m_terrains[regionID] = ter; + } + + public double[,] LoadTerrain(UUID regionID) + { + if (m_terrains.ContainsKey(regionID)) + return m_terrains[regionID]; + else + return null; + } + + public void RemoveLandObject(UUID globalID) + { + if (m_landData.ContainsKey(globalID)) + m_landData.Remove(globalID); + } + + public void StoreLandObject(ILandObject land) + { + m_landData[land.LandData.GlobalID] = land.LandData; + } + + public List LoadLandObjects(UUID regionUUID) + { + return new List(m_landData.Values); + } + + public void Shutdown() + { + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 01f2c14..615e519 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -29,7 +29,6 @@ using System; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications; - using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Scenes; @@ -49,6 +48,11 @@ namespace OpenSim.Tests.Common.Mock } /// + /// Allow retrieval for test check purposes + /// + public StorageManager StorageManager { get { return m_storageManager; } } + + /// /// Temporarily override session authentication for tests (namely teleport). /// /// -- cgit v1.1 From 11f4a65f42dea66091cb08423479fa6ae46c98aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Sep 2010 00:34:06 +0100 Subject: Fix deletion persistence when freshly delinked prims are removed Previously, Scene.Inventory.DeRezObjects() forced the persistence of prims before deletion. This is necessary so that freshly delinked prims can be deleted (otherwise they remain as parts of their old group and reappear on server restart). However, DeRezObjects() deleted to user inventory, which is required by llDie() or direct region module unlink and deletion. Therefore, forced persistence has been pushed down into Scene.UnlinkSceneObject() to be more general, this is still on the DeRezObjects() path. Uncommented TestDelinkPersistence() since this now passes. Tests required considerable elaboration of MockRegionDataPlugin to reflect underlying storing of parts. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 80 ++++++++++++++++++---- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- 2 files changed, 68 insertions(+), 14 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 1c139c5..2a055cc 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -44,7 +44,7 @@ namespace OpenSim.Data.Null private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Dictionary m_regionSettings = new Dictionary(); - protected Dictionary m_sceneObjects = new Dictionary(); + protected Dictionary m_sceneObjectParts = new Dictionary(); protected Dictionary> m_primItems = new Dictionary>(); protected Dictionary m_terrains = new Dictionary(); @@ -85,18 +85,33 @@ namespace OpenSim.Data.Null public void StoreObject(SceneObjectGroup obj, UUID regionUUID) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Storing object {0} {1} in {2}", obj.Name, obj.UUID, regionUUID); - m_sceneObjects[obj.UUID] = obj; + // We can't simply store groups here because on delinking, OpenSim will not update the original group + // directly. Rather, the newly delinked parts will be updated to be in their own scene object group + // Therefore, we need to store parts rather than groups. + foreach (SceneObjectPart prim in obj.Children.Values) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", + prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); + + m_sceneObjectParts[prim.UUID] = prim; + } } public void RemoveObject(UUID obj, UUID regionUUID) - { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Removing object {0} from {1}", obj, regionUUID); - - if (m_sceneObjects.ContainsKey(obj)) - m_sceneObjects.Remove(obj); + { + // All parts belonging to the object with the uuid are removed. + List parts = new List(m_sceneObjectParts.Values); + foreach (SceneObjectPart part in parts) + { + if (part.ParentGroup.UUID == obj) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", + part.Name, part.UUID, obj, regionUUID); + m_sceneObjectParts.Remove(part.UUID); + } + } } // see IRegionDatastore @@ -107,10 +122,49 @@ namespace OpenSim.Data.Null public List LoadObjects(UUID regionUUID) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Loading objects from {0}", regionUUID); + Dictionary objects = new Dictionary(); + + // Create all of the SOGs from the root prims first + foreach (SceneObjectPart prim in m_sceneObjectParts.Values) + { + if (prim.IsRoot) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); + objects[prim.UUID] = new SceneObjectGroup(prim); + } + } + + // Add all of the children objects to the SOGs + foreach (SceneObjectPart prim in m_sceneObjectParts.Values) + { + SceneObjectGroup sog; + if (prim.UUID != prim.ParentUUID) + { + if (objects.TryGetValue(prim.ParentUUID, out sog)) + { + int originalLinkNum = prim.LinkNum; + + sog.AddPart(prim); + + // SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum. + // We override that here + if (originalLinkNum != 0) + prim.LinkNum = originalLinkNum; + } + else + { + m_log.WarnFormat( + "[MOCK REGION DATA PLUGIN]: Database contains an orphan child prim {0} {1} in region {2} pointing to missing parent {3}. This prim will not be loaded.", + prim.Name, prim.UUID, regionUUID, prim.ParentUUID); + } + } + } + + // TODO: Load items. This is assymetric - we store items as a separate method but don't retrieve them that + // way! - return new List(m_sceneObjects.Values); + return new List(objects.Values); } public void StoreTerrain(double[,] ter, UUID regionID) diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index b70b47d..b47ad5d 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock /// public class TestInventoryDataPlugin : IInventoryDataPlugin { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Inventory folders -- cgit v1.1 From 109b51758398d24a96a16900e8feb24361aee29d Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 11 Sep 2010 20:43:06 -0700 Subject: Fixed the naming mess around data connectors for simulation data --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 2a055cc..e95d26a 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data.Null /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that /// tests can check correct persistence. /// - public class NullDataStore : IRegionDataStore + public class NullDataStore : ISimulationDataStore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -- cgit v1.1 From e2544584ad57a30def4f6b13eeaafe90eb81fe9e Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sat, 11 Sep 2010 22:02:34 -0700 Subject: Changed all string references of "IRegionDataStore" to "ISimulationDataStore" --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index e95d26a..315d405 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -114,7 +114,6 @@ namespace OpenSim.Data.Null } } - // see IRegionDatastore public void StorePrimInventory(UUID primID, ICollection items) { m_primItems[primID] = items; -- cgit v1.1 From f1f0bc23f4501ba99035283d3407ddad2b21b785 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 12 Sep 2010 13:43:49 -0400 Subject: Formatting cleanup. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 6 +++--- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 315d405..f453a4b 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -99,7 +99,7 @@ namespace OpenSim.Data.Null } public void RemoveObject(UUID obj, UUID regionUUID) - { + { // All parts belonging to the object with the uuid are removed. List parts = new List(m_sceneObjectParts.Values); foreach (SceneObjectPart part in parts) @@ -108,7 +108,7 @@ namespace OpenSim.Data.Null { m_log.DebugFormat( "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", - part.Name, part.UUID, obj, regionUUID); + part.Name, part.UUID, obj, regionUUID); m_sceneObjectParts.Remove(part.UUID); } } @@ -129,7 +129,7 @@ namespace OpenSim.Data.Null if (prim.IsRoot) { m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); + "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); objects[prim.UUID] = new SceneObjectGroup(prim); } } diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 615e519..13f364b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -69,6 +69,6 @@ namespace OpenSim.Tests.Common.Mock public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { get { return m_asyncSceneObjectDeleter; } - } + } } } \ No newline at end of file -- cgit v1.1 From 0db1ed0b5a6f5bd104c6008f142d173c84263ce5 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 12 Sep 2010 14:20:26 -0700 Subject: * Added ISimulationDataService and IEstateDataService * Removed StorageManager * CONFIG CHANGE: There are no more database settings in OpenSim.ini. Check the config-include configuration files for region store and estate store database settings --- OpenSim/Tests/Common/Mock/TestScene.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 615e519..4511228 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -31,6 +31,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Servers; using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Tests.Common.Mock @@ -39,20 +40,15 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - SceneCommunicationService sceneGridService, StorageManager storeManager, + SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, + : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } /// - /// Allow retrieval for test check purposes - /// - public StorageManager StorageManager { get { return m_storageManager; } } - - /// /// Temporarily override session authentication for tests (namely teleport). /// /// -- cgit v1.1 From 18a9ac6b39b91865c33eeffa1ef8ff3e8a847c1b Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 12 Sep 2010 15:04:51 -0700 Subject: Fix unit test SceneSetupHelpers to load the mock simulation data store --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 75 +++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index f453a4b..de6e815 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -35,6 +35,81 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Data.Null { + public class NullDataService : ISimulationDataService + { + private NullDataStore m_store; + + public NullDataService() + { + m_store = new NullDataStore(); + } + + public void StoreObject(SceneObjectGroup obj, UUID regionUUID) + { + m_store.StoreObject(obj, regionUUID); + } + + public void RemoveObject(UUID uuid, UUID regionUUID) + { + m_store.RemoveObject(uuid, regionUUID); + } + + public void StorePrimInventory(UUID primID, ICollection items) + { + m_store.StorePrimInventory(primID, items); + } + + public List LoadObjects(UUID regionUUID) + { + return m_store.LoadObjects(regionUUID); + } + + public void StoreTerrain(double[,] terrain, UUID regionID) + { + m_store.StoreTerrain(terrain, regionID); + } + + public double[,] LoadTerrain(UUID regionID) + { + return m_store.LoadTerrain(regionID); + } + + public void StoreLandObject(ILandObject Parcel) + { + m_store.StoreLandObject(Parcel); + } + + public void RemoveLandObject(UUID globalID) + { + m_store.RemoveLandObject(globalID); + } + + public List LoadLandObjects(UUID regionUUID) + { + return m_store.LoadLandObjects(regionUUID); + } + + public void StoreRegionSettings(RegionSettings rs) + { + m_store.StoreRegionSettings(rs); + } + + public RegionSettings LoadRegionSettings(UUID regionUUID) + { + return m_store.LoadRegionSettings(regionUUID); + } + + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) + { + return m_store.LoadRegionWindlightSettings(regionUUID); + } + + public void StoreRegionWindlightSettings(RegionLightShareData wl) + { + m_store.StoreRegionWindlightSettings(wl); + } + } + /// /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that /// tests can check correct persistence. -- cgit v1.1 From d52b2b9ee7c189651f9d7c04ddf3df9aa833b7ff Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 16 Sep 2010 20:46:24 +0100 Subject: minor: remove some mono compiler warnings --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index b47ad5d..fc44358 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -84,7 +84,7 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryInFolder(UUID folderID) { - InventoryFolderBase folder = m_folders[folderID]; +// InventoryFolderBase folder = m_folders[folderID]; // m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); @@ -116,7 +116,7 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryFolders(UUID parentID) { - InventoryFolderBase parentFolder = m_folders[parentID]; +// InventoryFolderBase parentFolder = m_folders[parentID]; // m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); @@ -185,7 +185,7 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryItem(InventoryItemBase item) { - InventoryFolderBase folder = m_folders[item.Folder]; +// InventoryFolderBase folder = m_folders[item.Folder]; // m_log.DebugFormat( // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); -- cgit v1.1 From 860b2a502f797e5822c6705d4639f370f3ac5861 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 16 Sep 2010 17:30:46 -0700 Subject: Changed SceneObjectGroup to store parts with the fast and thread-safe MapAndArray collection --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index de6e815..2e5020b 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -163,7 +163,7 @@ namespace OpenSim.Data.Null // We can't simply store groups here because on delinking, OpenSim will not update the original group // directly. Rather, the newly delinked parts will be updated to be in their own scene object group // Therefore, we need to store parts rather than groups. - foreach (SceneObjectPart prim in obj.Children.Values) + foreach (SceneObjectPart prim in obj.Parts) { m_log.DebugFormat( "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", -- cgit v1.1 From b1c8d0588829dfa76f89460eeb8406d9c4fc479f Mon Sep 17 00:00:00 2001 From: Master ScienceSim Date: Wed, 20 Oct 2010 16:17:54 -0700 Subject: Major refactoring of appearance handling. AvatarService -- add two new methods, GetAppearance and SetAppearance to get around the lossy encoding in AvatarData. Preseve the old functions to avoid changing the behavior for ROBUST services. AvatarAppearance -- major refactor, moved the various encoding methods used by AgentCircuitData, ClientAgentUpdate and ScenePresence into one location. Changed initialization. AvatarAttachments -- added a class specifically to handle attachments in preparation for additional functionality that will be needed for viewer 2. AvatarFactory -- removed a number of unused or methods duplicated in other locations. Moved in all appearance event handling from ScenePresence. Required a change to IClientAPI that propogated throughout all the IClientAPI implementations. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index e46f9b7..b2c8b35 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -94,7 +94,7 @@ namespace OpenSim.Tests.Common.Mock public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; -- cgit v1.1 From 6c3b7617b0356f093ef2730f1c517d6228997984 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 3 Nov 2010 02:31:43 +0000 Subject: Add lsClearWindlightScene() to the lightshare module to remove WL settings from a region and allow normal day cycles to be reestablished --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 2e5020b..2ea36da 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -104,6 +104,10 @@ namespace OpenSim.Data.Null return m_store.LoadRegionWindlightSettings(regionUUID); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } + public void StoreRegionWindlightSettings(RegionLightShareData wl) { m_store.StoreRegionWindlightSettings(wl); @@ -146,6 +150,10 @@ namespace OpenSim.Data.Null return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } + public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet @@ -274,4 +282,4 @@ namespace OpenSim.Data.Null { } } -} \ No newline at end of file +} -- 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 --- .../Common/Mock/MockGroupsServicesConnector.cs | 236 +++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs (limited to 'OpenSim/Tests/Common/Mock') 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 -- 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) --- OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') 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) -- cgit v1.1 From 25ecd62b1feed16d12d6f5e5ef00bddf7dbf0547 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 21 Dec 2010 19:15:44 -0500 Subject: * Adds AbortXfer to the ClientAPI mix * Adds an item that checks to see if the top request has been there for longer then 30 seconds without an update and sends an AbortXfer if it encounters one. This allows the client to cancel the Xfer on it's side so you can re-select the prim and get the inventory when it fails the first time. * Some interesting locking... Using NewFiles to lock the rest of them. We'll see how that goes. * The goal of this is to ensure that Xfers are restartable when they fail. The client will not do that on it's own. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b2c8b35..3f3845c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -696,6 +696,11 @@ namespace OpenSim.Tests.Common.Mock { } + public virtual void SendAbortXferPacket(ulong xferID) + { + + } + public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, -- cgit v1.1 From a32f80b9e3a84852558150c3b30722b6755a1ff0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 30 Dec 2010 00:31:59 +0100 Subject: Implement SendPlacesReply --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 3f3845c..dc0d4de 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1225,5 +1225,9 @@ namespace OpenSim.Tests.Common.Mock public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } -- cgit v1.1 From 5a26dc2743f176cc5f5fad0ae93aa8187a399f13 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 27 Jan 2011 18:48:48 +0000 Subject: Fix OAR parcel loading so that old parcels are replaced by the new instead of merged. The --merge switch will still merge the old and new land parcelling. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 159764c..366af67 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -55,6 +55,11 @@ namespace OpenSim.Tests.Common.Mock { return new List(); } + + public void Clear() + { + // Intentionally blank since we don't save any parcel data in the test channel + } protected ILandObject GetNoLand() { -- cgit v1.1 From be3685b1a2ef8ebab25739fc5a5d632ed7359728 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 27 Jan 2011 20:29:06 +0000 Subject: When an oar is loaded, do not create a default parcel before loading the parcels from the OAR. The region spanning parcel shouldn't exist in this situation. If it does, when the land data is loaded it is repersisted with a local ID which comes after the ones loaded via the oar, which obliterates the oar loaded one. Resaving the data we just loaded from the database is somewhat odd in itself (though this makes sense from the way that OAR loading was already using the same event). --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 366af67..c3134b3 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock return new List(); } - public void Clear() + public void Clear(bool setupDefaultParcel) { // Intentionally blank since we don't save any parcel data in the test channel } -- cgit v1.1 From 60fe3d48ee83f004861044c51537256c0c389478 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Feb 2011 23:50:54 +0000 Subject: Put some CapabilitiesModule null checks in Scene Stop tests setting up a capabilities module by default --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dc0d4de..ebe0a72 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -560,8 +560,11 @@ namespace OpenSim.Tests.Common.Mock agentData.lastname = m_lastName; ICapabilitiesModule capsModule = m_scene.RequestModuleInterface(); - agentData.CapsPath = capsModule.GetCapsPath(m_agentId); - agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); + if (capsModule != null) + { + agentData.CapsPath = capsModule.GetCapsPath(m_agentId); + agentData.ChildrenCapSeeds = new Dictionary(capsModule.GetChildrenSeeds(m_agentId)); + } return agentData; } -- cgit v1.1 From 6ae04448f73afdca791ea185fdc0e9c062dea87b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Mar 2011 23:05:51 +0000 Subject: Start using IPrimCounts populated by PrimCountModule instead of LandData counts populated by LandManagementModule. In order to pass ILandObject into IClientAPI.SendLandProperties(), had to push ILandObject and IPrimCounts into OpenSim.Framework from OpenSim.Region.Framework.Interfaces, in order to avoid ci Counts are showing odd behaviour at the moment, this will be addressed shortly. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ebe0a72..d1dc17f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -957,7 +957,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) + public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { } -- cgit v1.1 From 69d014e1dcb0e05a4ec927a5501156627856bccb Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 12 Apr 2011 12:36:36 -0700 Subject: First pass at moving object property requests into a queue similar to the entity update queue. The number of property packets can become significant when selecting/deselecting large numbers of objects. This is experimental code. --- OpenSim/Tests/Common/Mock/TestClient.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d1dc17f..dca5626 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -816,18 +816,11 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID, - uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, - uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category, - UUID LastOwnerID, string ObjectName, string Description) + public void SendObjectPropertiesFamilyData(ISceneEntity Entity, uint RequestFlags) { } - public void SendObjectPropertiesReply(UUID ItemID, ulong CreationDate, UUID CreatorUUID, UUID FolderUUID, UUID FromTaskUUID, - UUID GroupUUID, short InventorySerial, UUID LastOwnerUUID, UUID ObjectUUID, - UUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, - string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, - uint BaseMask, byte saleType, int salePrice) + public void SendObjectPropertiesReply(ISceneEntity entity) { } -- cgit v1.1 From a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Apr 2011 00:42:06 +0100 Subject: Make all the objects in a coalescence reappears after being loaded from an IAR. This still doesn't work proprerly since some required textures/contained item assets might be missing. From pure code inspection, it looks like the uuid gatherer may get most asset uuids because the scene object serializer naively pulls non-root parts from all contained scene objects into one mega-object. However, root part uuids may well still be missing, and there may be other odd artifacts from this bug. It appears that storing the size of the coalescence and the offsets is redundant, since one can work out this information from the position data already in the scene object groups. --- OpenSim/Tests/Common/Mock/MockAssetService.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs index 4118308..9d7c5e2 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetService.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs @@ -54,13 +54,19 @@ namespace OpenSim.Tests.Common.Mock public AssetBase Get(string id) { - m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); +// m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); AssetBase asset; if (Assets.ContainsKey(id)) + { asset = Assets[id]; +// m_log.DebugFormat( +// "[MOCK ASSET SERVICE]: Got asset {0} {1}, bytes {2}", asset.Name, asset.ID, asset.Data.Length); + } else - asset = null; + { + asset = null; + } return asset; } @@ -77,7 +83,14 @@ namespace OpenSim.Tests.Common.Mock public byte[] GetData(string id) { - throw new System.NotImplementedException(); +// m_log.DebugFormat("[MOCK ASSET SERVICE]: Requesting data for asset {0}", id); + + AssetBase asset = Get(id); + + if (asset == null) + return null; + else + return asset.Data; } public bool Get(string id, object sender, AssetRetrieved handler) @@ -89,7 +102,8 @@ namespace OpenSim.Tests.Common.Mock public string Store(AssetBase asset) { - m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); +// m_log.DebugFormat( +// "[MOCK ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.ID, asset.Data.Length); Assets[asset.ID] = asset; -- cgit v1.1 From 79bd430e08b9e8612194d9b02504f8f4acd889f6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Apr 2011 01:10:26 +0100 Subject: Remove the mock inventory service for tests and just use the real one all the time with an in-memory data plugin --- OpenSim/Tests/Common/Mock/MockInventoryService.cs | 186 ---------------------- 1 file changed, 186 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/MockInventoryService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs deleted file mode 100644 index 4ac1078..0000000 --- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs +++ /dev/null @@ -1,186 +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.Text; -using OpenSim.Framework; -using OpenMetaverse; -using OpenSim.Services.Interfaces; -using Nini.Config; - -namespace OpenSim.Tests.Common.Mock -{ - public class MockInventoryService : IInventoryService - { - public MockInventoryService() {} - - public MockInventoryService(IConfigSource config) {} - - /// - /// - /// - /// - /// - public bool CreateUserInventory(UUID userId) - { - return false; - } - - /// - /// - /// - /// - /// - public List GetInventorySkeleton(UUID userId) - { - List folders = new List(); - InventoryFolderBase folder = new InventoryFolderBase(); - folder.ID = UUID.Random(); - folder.Owner = userId; - folders.Add(folder); - return folders; - } - - public InventoryFolderBase GetRootFolder(UUID userID) - { - return new InventoryFolderBase(); - } - - public InventoryCollection GetFolderContent(UUID userID, UUID folderID) - { - return null; - } - - public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) - { - return null; - } - - /// - /// Returns a list of all the active gestures in a user's inventory. - /// - /// - /// The of the user - /// - /// - /// A flat list of the gesture items. - /// - public List GetActiveGestures(UUID userId) - { - return null; - } - - public InventoryCollection GetUserInventory(UUID userID) - { - return null; - } - - public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback) - { - } - - public List GetFolderItems(UUID userID, UUID folderID) - { - return null; - } - - public bool AddFolder(InventoryFolderBase folder) - { - return false; - } - - public bool UpdateFolder(InventoryFolderBase folder) - { - return false; - } - - public bool MoveFolder(InventoryFolderBase folder) - { - return false; - } - - public bool DeleteFolders(UUID ownerID, List ids) - { - return false; - } - - public bool PurgeFolder(InventoryFolderBase folder) - { - return false; - } - - public bool AddItem(InventoryItemBase item) - { - return true; - } - - public bool UpdateItem(InventoryItemBase item) - { - return false; - } - - public bool MoveItems(UUID ownerID, List items) - { - return false; - } - - public bool DeleteItems(UUID ownerID, List itemIDs) - { - return false; - } - - public InventoryItemBase GetItem(InventoryItemBase item) - { - return null; - } - - public InventoryFolderBase GetFolder(InventoryFolderBase folder) - { - return null; - } - - public bool HasInventoryForUser(UUID userID) - { - return false; - } - - public InventoryFolderBase RequestRootFolder(UUID userID) - { - InventoryFolderBase root = new InventoryFolderBase(); - root.ID = UUID.Random(); - root.Owner = userID; - root.ParentID = UUID.Zero; - return root; - } - - public int GetAssetPermissions(UUID userID, UUID assetID) - { - return 1; - } - } -} \ No newline at end of file -- cgit v1.1 From 54e885581989ddfaf525753ede12c4d4d797cba0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Apr 2011 01:23:26 +0100 Subject: remove mock asset service for tests in favour of always using the real one --- OpenSim/Tests/Common/Mock/MockAssetService.cs | 123 -------------------------- 1 file changed, 123 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/MockAssetService.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs deleted file mode 100644 index 9d7c5e2..0000000 --- a/OpenSim/Tests/Common/Mock/MockAssetService.cs +++ /dev/null @@ -1,123 +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 log4net; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; -using OpenSim.Services.Interfaces; -using Nini.Config; - -namespace OpenSim.Tests.Common.Mock -{ - public class MockAssetService : IAssetService - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private readonly Dictionary Assets = new Dictionary(); - - public MockAssetService() {} - - /// - /// This constructor is required if the asset service is being created reflectively (which is the case in some - /// tests). - /// - /// - public MockAssetService(IConfigSource config) {} - - public AssetBase Get(string id) - { -// m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); - - AssetBase asset; - if (Assets.ContainsKey(id)) - { - asset = Assets[id]; -// m_log.DebugFormat( -// "[MOCK ASSET SERVICE]: Got asset {0} {1}, bytes {2}", asset.Name, asset.ID, asset.Data.Length); - } - else - { - asset = null; - } - - return asset; - } - - public AssetBase GetCached(string id) - { - return Get(id); - } - - public AssetMetadata GetMetadata(string id) - { - throw new System.NotImplementedException(); - } - - public byte[] GetData(string id) - { -// m_log.DebugFormat("[MOCK ASSET SERVICE]: Requesting data for asset {0}", id); - - AssetBase asset = Get(id); - - if (asset == null) - return null; - else - return asset.Data; - } - - public bool Get(string id, object sender, AssetRetrieved handler) - { - handler(id, sender, Get(id)); - - return true; - } - - public string Store(AssetBase asset) - { -// m_log.DebugFormat( -// "[MOCK ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.ID, asset.Data.Length); - - Assets[asset.ID] = asset; - - return asset.ID; - } - - public bool UpdateContent(string id, byte[] data) - { - throw new System.NotImplementedException(); - } - - public bool Delete(string id) - { - throw new System.NotImplementedException(); - } - } -} \ No newline at end of file -- cgit v1.1 From 64d868fb64329b1c961dc8f520c71789bc146609 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 12 May 2011 14:42:28 +0300 Subject: When loading an OAR that doesn't have parcels, create a default parcel --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index c3134b3..0e4dfb9 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -40,10 +40,12 @@ namespace OpenSim.Tests.Common.Mock public class TestLandChannel : ILandChannel { private Scene m_scene; + private List m_parcels; public TestLandChannel(Scene scene) { m_scene = scene; + m_parcels = new List(); } public List ParcelsNearPoint(Vector3 position) @@ -53,12 +55,19 @@ namespace OpenSim.Tests.Common.Mock public List AllParcels() { - return new List(); + return m_parcels; } public void Clear(bool setupDefaultParcel) { - // Intentionally blank since we don't save any parcel data in the test channel + m_parcels.Clear(); + + if (setupDefaultParcel) + { + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); + obj.LandData.Name = "Your Parcel"; + m_parcels.Add(obj); + } } protected ILandObject GetNoLand() -- cgit v1.1 From 8129e64e2acea6509d5c3a80425f6aa68baa037c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 31 May 2011 19:25:01 +0100 Subject: Fill in the new OwnerData field in the LLUDP ScriptDialog message. If we don't do this then viewer 2.8 crashes. Resolves http://opensimulator.org/mantis/view.php?id=5510 --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dca5626..bf91ab5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -637,7 +637,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) + public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) { } -- cgit v1.1 From 4cdc8806fbc0d0d9b0ff878b30a4491b347cf2dc Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 23 Jul 2011 11:39:32 +0100 Subject: Fix LLTextBox to work with the updated libOMV --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index bf91ab5..f548a9e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1214,7 +1214,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) + public void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId) { } -- cgit v1.1 From 2964467708871f5932c46ad04e002a5506dd7732 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 3 Aug 2011 22:11:05 +0100 Subject: get rid of vestigal move to parameters --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f548a9e..88043f3 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -234,7 +234,7 @@ namespace OpenSim.Tests.Common.Mock public event ScriptReset OnScriptReset; public event GetScriptRunning OnGetScriptRunning; public event SetScriptRunning OnSetScriptRunning; - public event UpdateVector OnAutoPilotGo; + public event Action OnAutoPilotGo; public event TerrainUnacked OnUnackedTerrain; -- cgit v1.1 From 92e96d394a1712ed16b0a7835dd2ccfde01f3fee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 9 Aug 2011 23:11:07 +0100 Subject: When an NPC is created, stop telling neighbouring regions to expect a child agent --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 88043f3..7ec6e10 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -95,7 +95,7 @@ namespace OpenSim.Tests.Common.Mock public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; public event GenericCall1 OnRequestWearables; - public event GenericCall1 OnCompleteMovementToRegion; + public event Action OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; @@ -455,7 +455,7 @@ namespace OpenSim.Tests.Common.Mock public void CompleteMovement() { - OnCompleteMovementToRegion(this); + OnCompleteMovementToRegion(this, true); } public virtual void ActivateGesture(UUID assetId, UUID gestureId) @@ -759,9 +759,10 @@ namespace OpenSim.Tests.Common.Mock if (OnCompleteMovementToRegion != null) { - OnCompleteMovementToRegion(this); + OnCompleteMovementToRegion(this, true); } } + public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) { } -- cgit v1.1 From 4cb8d6379ddb39cfb8b30a63475e154a00a78110 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 00:59:31 +0100 Subject: Stop trying to deregister caps or close child agents when an NPC is removed --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 7ec6e10..dd5f6fe 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -887,7 +887,7 @@ namespace OpenSim.Tests.Common.Mock public void Close() { - m_scene.RemoveClient(AgentId); + m_scene.RemoveClient(AgentId, true); } public void Start() -- cgit v1.1 From 5d6c9644faf6aeac38410af9cff97adfef88d7aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Aug 2011 01:47:37 +0100 Subject: early code to allow scripts to force npcs not to fly when moving to target this is to allow walking on prims. it will be up to the script writer to be sure that there is a continuous path. currently implemented in osNpcMoveToTarget(), but none of this is final. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dd5f6fe..7b64947 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -234,7 +234,7 @@ namespace OpenSim.Tests.Common.Mock public event ScriptReset OnScriptReset; public event GetScriptRunning OnGetScriptRunning; public event SetScriptRunning OnSetScriptRunning; - public event Action OnAutoPilotGo; + public event Action OnAutoPilotGo; public event TerrainUnacked OnUnackedTerrain; -- cgit v1.1 From c1a34cd8da293e63d3cba70b5271c9a297789db2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 18 Aug 2011 00:53:05 +0100 Subject: Don't try to save changed attachment states when an NPC with attachments is removed from the scene. This is done by introducing a PresenceType enum into ScenePresence which currently has two values, User and Npc. This seems better than a SaveAttachments flag in terms of code comprehension, though I'm still slightly uneasy about introducing these semantics to core objects --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 7b64947..b7cefeb 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -579,7 +579,7 @@ namespace OpenSim.Tests.Common.Mock // Stage 2: add the new client as a child agent to the scene TeleportSceneClient = new TestClient(newAgent, TeleportTargetScene); - TeleportTargetScene.AddNewClient(TeleportSceneClient); + TeleportTargetScene.AddNewClient(TeleportSceneClient, PresenceType.User); } public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, -- cgit v1.1 From 42790f021fd5d69ba10ac02d158681f3d299da80 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Sep 2011 00:47:23 +0100 Subject: Fix unit tests from RegionSettings commit --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 2ea36da..79bb9c2 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -163,6 +163,10 @@ namespace OpenSim.Data.Null { RegionSettings rs = null; m_regionSettings.TryGetValue(regionUUID, out rs); + + if (rs == null) + rs = new RegionSettings(); + return rs; } -- cgit v1.1 From d358125cac4e01194dae4b1f0bc9afc87e463f76 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Sep 2011 00:16:05 +0100 Subject: Reinstate option to land an npc when it reaches a target. This is moved into ScenePresence for now as a general facility --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b7cefeb..71f2bf4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -234,7 +234,7 @@ namespace OpenSim.Tests.Common.Mock public event ScriptReset OnScriptReset; public event GetScriptRunning OnGetScriptRunning; public event SetScriptRunning OnSetScriptRunning; - public event Action OnAutoPilotGo; + public event Action OnAutoPilotGo; public event TerrainUnacked OnUnackedTerrain; -- cgit v1.1 From aa19ccf65c9cd235e0ba941e9832c5240df4412c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Oct 2011 01:45:46 +0100 Subject: refactor: rename IClientAPI.SendPrimUpdate() to SendEntityUpdate() since it sends entity updates (including presence ones), not just prims. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 71f2bf4..f75a815 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -645,7 +645,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) + public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { } -- cgit v1.1 From 528cc8136e567b5bac583728fbb0235baaba2f02 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 15 Oct 2011 02:54:43 +0100 Subject: fetch physical_prim switch from [Startup] config from inside scene, as is done for most other scene config params --- OpenSim/Tests/Common/Mock/TestScene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 0e1433a..f0e65c5 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -41,10 +41,10 @@ namespace OpenSim.Tests.Common.Mock public TestScene( RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, - ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, + ModuleLoader moduleLoader, bool dumpAssetsToFile, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, - dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) + dumpAssetsToFile, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } -- cgit v1.1 From ddf54b5537f2701deeb615ef8e1eeef20b746ea1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 15 Oct 2011 03:03:05 +0100 Subject: move see_into_this_sim_from_neighbor [Startup] flag parsing into Scene with the others --- OpenSim/Tests/Common/Mock/TestScene.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index f0e65c5..07bcdce 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -42,18 +42,18 @@ namespace OpenSim.Tests.Common.Mock RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, ModuleLoader moduleLoader, bool dumpAssetsToFile, - bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) + IConfigSource config, string simulatorVersion) : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, - dumpAssetsToFile, SeeIntoRegionFromNeighbor, config, simulatorVersion) + dumpAssetsToFile, config, simulatorVersion) { } /// /// Temporarily override session authentication for tests (namely teleport). /// - /// + /// /// TODO: This needs to be mocked out properly. - /// + /// /// /// public override bool VerifyUserPresence(AgentCircuitData agent, out string reason) -- cgit v1.1 From 120114e96becc6fee1311300359dcefaf4013c0e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Oct 2011 20:50:29 +0100 Subject: refactor: Make IClientAPI.DebugPacketFormat a property rather than a setter without a getter --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f75a815..578e3ed 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -873,9 +873,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SetDebugPacketLevel(int newDebug) - { - } + public int DebugPacketLevel { get; set; } public void InPacket(object NewPack) { -- cgit v1.1 From c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Nov 2011 20:38:07 +0000 Subject: Convert SendKillObject to take a list of uint rather than sending one packet per prim. More to come as we change to make use of this. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 578e3ed..4636961 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -487,7 +487,7 @@ namespace OpenSim.Tests.Common.Mock } - public virtual void SendKillObject(ulong regionHandle, uint localID) + public virtual void SendKillObject(ulong regionHandle, List localID) { } -- cgit v1.1 From de895ee54a14f21ee0609e6a3636a31407495aa3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 14 Nov 2011 17:18:51 +0000 Subject: Add very simple FriendsModuleTests.TestNoFriends() --- OpenSim/Tests/Common/Mock/TestClient.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4636961..3ba9ed4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -56,6 +56,10 @@ namespace OpenSim.Tests.Common.Mock private IScene m_scene; + // Properties so that we can get at received data for test purposes + public List OfflineNotificationsReceived { get; private set; } + public List OnlineNotificationsReceived { get; private set; } + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -440,6 +444,9 @@ namespace OpenSim.Tests.Common.Mock m_circuitCode = agentData.circuitcode; m_scene = scene; CapsSeedUrl = agentData.CapsPath; + + OfflineNotificationsReceived = new List(); + OnlineNotificationsReceived = new List(); } /// @@ -827,12 +834,12 @@ namespace OpenSim.Tests.Common.Mock public void SendAgentOffline(UUID[] agentIDs) { - + OfflineNotificationsReceived.AddRange(agentIDs); } public void SendAgentOnline(UUID[] agentIDs) { - + OnlineNotificationsReceived.AddRange(agentIDs); } public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, -- cgit v1.1 From 89632f3ea8c355e5e860eb787aa21f90e79762d8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 14 Nov 2011 20:56:56 +0000 Subject: Add test for removing a friendship. --- OpenSim/Tests/Common/Mock/TestClient.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 3ba9ed4..b83ef9b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -57,8 +57,9 @@ namespace OpenSim.Tests.Common.Mock private IScene m_scene; // Properties so that we can get at received data for test purposes - public List OfflineNotificationsReceived { get; private set; } - public List OnlineNotificationsReceived { get; private set; } + public List ReceivedOfflineNotifications { get; private set; } + public List ReceivedOnlineNotifications { get; private set; } + public List ReceivedFriendshipTerminations { get; private set; } // disable warning: public events, part of the public API #pragma warning disable 67 @@ -445,8 +446,9 @@ namespace OpenSim.Tests.Common.Mock m_scene = scene; CapsSeedUrl = agentData.CapsPath; - OfflineNotificationsReceived = new List(); - OnlineNotificationsReceived = new List(); + ReceivedOfflineNotifications = new List(); + ReceivedOnlineNotifications = new List(); + ReceivedFriendshipTerminations = new List(); } /// @@ -834,12 +836,12 @@ namespace OpenSim.Tests.Common.Mock public void SendAgentOffline(UUID[] agentIDs) { - OfflineNotificationsReceived.AddRange(agentIDs); + ReceivedOfflineNotifications.AddRange(agentIDs); } public void SendAgentOnline(UUID[] agentIDs) { - OnlineNotificationsReceived.AddRange(agentIDs); + ReceivedOnlineNotifications.AddRange(agentIDs); } public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, @@ -1109,6 +1111,7 @@ namespace OpenSim.Tests.Common.Mock public void SendTerminateFriend(UUID exFriendID) { + ReceivedFriendshipTerminations.Add(exFriendID); } public bool AddGenericPacketHandler(string MethodName, GenericMessage handler) -- cgit v1.1 From 4567555c49cb560dd6f109bbfec42086af3de56f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 5 Dec 2011 20:44:20 +0000 Subject: Implement IOSHttpRequest and IOSHttpResponse http interfaces and use instead of OSHttpRequest/OSHttpResponse. This is required for the substitution of different HTTP servers or the newer HttpServer.dll without having to commit to a particular implementation. This is also required to write regression tests that involve the HTTP layer. If you need to recompile, all you need to do is replace OSHttpRequest/OSHttpResponse references with IOSHttpRequest/IOSHttpResponse. --- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 112 ++++++++++++++++++++---- 1 file changed, 97 insertions(+), 15 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index 581985a..e10fe82 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -27,25 +27,107 @@ using System; using System.Collections.Generic; +using System.IO; using System.Text; +using System.Web; using OpenSim.Framework.Servers.HttpServer; namespace OpenSim.Tests.Common.Mock { - public class TestOSHttpResponse : OSHttpResponse + public class TestOSHttpResponse : IOSHttpResponse { - private int m_statusCode; - public override int StatusCode - { - get { return m_statusCode; } - set { m_statusCode = value; } - } - - private string m_contentType; - public override string ContentType - { - get { return m_contentType; } - set { m_contentType = value; } - } + /// + /// Content type property. + /// + /// + /// Setting this property will also set IsContentTypeSet to + /// true. + /// + public string ContentType { get; set; } + + /// + /// Boolean property indicating whether the content type + /// property actively has been set. + /// + /// + /// IsContentTypeSet will go away together with .NET base. + /// + // public bool IsContentTypeSet + // { + // get { return _contentTypeSet; } + // } + // private bool _contentTypeSet; + + /// + /// Length of the body content; 0 if there is no body. + /// + public long ContentLength { get; set; } + + /// + /// Alias for ContentLength. + /// + public long ContentLength64 { get; set; } + + /// + /// Encoding of the body content. + /// + public Encoding ContentEncoding { get; set; } + + public bool KeepAlive { get; set; } + + /// + /// Get or set the keep alive timeout property (default is + /// 20). Setting this to 0 also disables KeepAlive. Setting + /// this to something else but 0 also enable KeepAlive. + /// + public int KeepAliveTimeout { get; set; } + + /// + /// Return the output stream feeding the body. + /// + /// + /// On its way out... + /// + public Stream OutputStream { get; private set; } + + public string ProtocolVersion { get; set; } + + /// + /// Return the output stream feeding the body. + /// + public Stream Body { get; private set; } + + /// + /// Set a redirct location. + /// + public string RedirectLocation { private get; set; } + + /// + /// Chunk transfers. + /// + public bool SendChunked { get; set; } + + /// + /// HTTP status code. + /// + public int StatusCode { get; set; } + + /// + /// HTTP status description. + /// + public string StatusDescription { get; set; } + + public bool ReuseContext { get; set; } + + /// + /// Add a header field and content to the response. + /// + /// string containing the header field + /// name + /// string containing the header field + /// value + public void AddHeader(string key, string value) { throw new NotImplementedException(); } + + public void Send() { } } -} +} \ No newline at end of file -- cgit v1.1 From 319507f5215f5705cbe80d0c468da15ffe778829 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 5 Dec 2011 21:04:17 +0000 Subject: Add test for not found response from GetTexture cap handler. Add OpenSim.Region.Capabilities.Handlers.Tests.dll into test suite --- OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs | 179 +++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs new file mode 100644 index 0000000..e769d30 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs @@ -0,0 +1,179 @@ +/* + * 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; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; +using System.Net; +using System.Text; +using System.Web; +using OpenSim.Framework.Servers.HttpServer; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestOSHttpRequest : IOSHttpRequest + { + public string[] AcceptTypes + { + get + { + throw new NotImplementedException (); + } + } + + public Encoding ContentEncoding + { + get + { + throw new NotImplementedException (); + } + } + + public long ContentLength + { + get + { + throw new NotImplementedException (); + } + } + + public long ContentLength64 + { + get + { + throw new NotImplementedException (); + } + } + + public string ContentType + { + get + { + throw new NotImplementedException (); + } + } + + public HttpCookieCollection Cookies + { + get + { + throw new NotImplementedException (); + } + } + + public bool HasEntityBody + { + get + { + throw new NotImplementedException (); + } + } + + public NameValueCollection Headers { get; set; } + + public string HttpMethod + { + get + { + throw new NotImplementedException (); + } + } + + public Stream InputStream + { + get + { + throw new NotImplementedException (); + } + } + + public bool IsSecured + { + get + { + throw new NotImplementedException (); + } + } + + public bool KeepAlive + { + get + { + throw new NotImplementedException (); + } + } + + public NameValueCollection QueryString + { + get + { + throw new NotImplementedException (); + } + } + + public Hashtable Query + { + get + { + throw new NotImplementedException (); + } + } + + public string RawUrl + { + get + { + throw new NotImplementedException (); + } + } + + public IPEndPoint RemoteIPEndPoint + { + get + { + throw new NotImplementedException (); + } + } + + public Uri Url { get; set; } + + public string UserAgent + { + get + { + throw new NotImplementedException (); + } + } + + public TestOSHttpRequest() + { + Headers = new NameValueCollection(); + } + } +} \ No newline at end of file -- cgit v1.1 From f61e54892f2284b6f89bacf3069467c05b2eea11 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 8 Dec 2011 18:34:23 +0000 Subject: On a new client circuit, send the initial reply ack to let the client know it's live before sending other data. This means that avatar/appearance data of other avatars and scene objects for a client will be sent after the ack rather than possibly before. This may stop some avatars appearing grey on login. This introduces a new OpenSim.Framework.ISceneAgent to accompany the existing OpenSim.Framework.ISceneObject and ISceneEntity This allows IClientAPI to handle this as it can't reference OpenSim.Region.Framework.Interfaces --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b83ef9b..4e17b04 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common.Mock public Scene TeleportTargetScene; private TestClient TeleportSceneClient; - private IScene m_scene; + private Scene m_scene; // Properties so that we can get at received data for test purposes public List ReceivedOfflineNotifications { get; private set; } @@ -324,6 +324,8 @@ namespace OpenSim.Tests.Common.Mock /// private UUID m_agentId; + public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } + /// /// The last caps seed url that this client was given. /// @@ -437,7 +439,7 @@ namespace OpenSim.Tests.Common.Mock /// /// /// - public TestClient(AgentCircuitData agentData, IScene scene) + public TestClient(AgentCircuitData agentData, Scene scene) { m_agentId = agentData.AgentID; m_firstName = agentData.firstname; @@ -899,6 +901,7 @@ namespace OpenSim.Tests.Common.Mock public void Start() { + throw new NotImplementedException(); } public void Stop() -- cgit v1.1 From 3a91085ac2364c80b53275886c8130a4b1f0e62f Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 10 Dec 2011 15:17:34 +0000 Subject: Implement handler for TeleportCancel inbound packet --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4e17b04..37b90e1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -93,6 +93,7 @@ namespace OpenSim.Tests.Common.Mock public event RequestMapName OnMapNameRequest; public event TeleportLocationRequest OnTeleportLocationRequest; public event TeleportLandmarkRequest OnTeleportLandmarkRequest; + public event TeleportCancel OnTeleportCancel; public event DisconnectUser OnDisconnectUser; public event RequestAvatarProperties OnRequestAvatarProperties; public event SetAlwaysRun OnSetAlwaysRun; -- cgit v1.1 From 9356963bd36e5c3b8c2b27bfcc2efa60ffbd02d6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Jan 2012 19:00:11 +0000 Subject: Add basic request and send image regression tests for LLImageManager --- OpenSim/Tests/Common/Mock/TestClient.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 37b90e1..2fc6572 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -44,9 +44,6 @@ namespace OpenSim.Tests.Common.Mock { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - // Mock testing variables - public List sentdatapkt = new List(); - public List sentpktpkt = new List(); EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); // TODO: This is a really nasty (and temporary) means of telling the test client which scene to invoke setup @@ -61,6 +58,9 @@ namespace OpenSim.Tests.Common.Mock public List ReceivedOnlineNotifications { get; private set; } public List ReceivedFriendshipTerminations { get; private set; } + public List SentImageDataPackets { get; private set; } + public List SentImagePacketPackets { get; private set; } + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -452,6 +452,9 @@ namespace OpenSim.Tests.Common.Mock ReceivedOfflineNotifications = new List(); ReceivedOnlineNotifications = new List(); ReceivedFriendshipTerminations = new List(); + + SentImageDataPackets = new List(); + SentImagePacketPackets = new List(); } /// @@ -804,7 +807,7 @@ namespace OpenSim.Tests.Common.Mock im.ImageData.Data = ImageData; im.ImageID.Codec = imageCodec; im.Header.Zerocoded = true; - sentdatapkt.Add(im); + SentImageDataPackets.Add(im); } public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) @@ -814,7 +817,7 @@ namespace OpenSim.Tests.Common.Mock im.ImageID.Packet = partNumber; im.ImageID.ID = imageUuid; im.ImageData.Data = imageData; - sentpktpkt.Add(im); + SentImagePacketPackets.Add(im); } public void SendImageNotFound(UUID imageid) -- cgit v1.1 From d38e2c0c91b684d54974865d3ac2fb88c3354c21 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Jan 2012 21:57:12 +0000 Subject: Add image not in database test for LLImageManager --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2fc6572..fad757a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -60,6 +60,7 @@ namespace OpenSim.Tests.Common.Mock public List SentImageDataPackets { get; private set; } public List SentImagePacketPackets { get; private set; } + public List SentImageNotInDatabasePackets { get; private set; } // disable warning: public events, part of the public API #pragma warning disable 67 @@ -455,6 +456,7 @@ namespace OpenSim.Tests.Common.Mock SentImageDataPackets = new List(); SentImagePacketPackets = new List(); + SentImageNotInDatabasePackets = new List(); } /// @@ -822,6 +824,10 @@ namespace OpenSim.Tests.Common.Mock public void SendImageNotFound(UUID imageid) { + ImageNotInDatabasePacket p = new ImageNotInDatabasePacket(); + p.ImageID.ID = imageid; + + SentImageNotInDatabasePackets.Add(p); } public void SendShutdownConnectionNotice() -- cgit v1.1 From b6f3de5028ab9a288f60b020a0dffda079dc550d Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 20 Jan 2012 23:50:37 -0500 Subject: Telehub Support: Support for viewer side of telehub management. Can manupulate Telehubs and SpawnPoints from the viewer estate managemnt tools. This is a work in progress and does not yet persist or affect teleport routing. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2fc6572..8a71dfd 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -193,6 +193,7 @@ namespace OpenSim.Tests.Common.Mock public event RegionInfoRequest OnRegionInfoRequest; public event EstateCovenantRequest OnEstateCovenantRequest; public event EstateChangeInfo OnEstateChangeInfo; + public event EstateManageTelehub OnEstateManageTelehub; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; @@ -945,6 +946,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List SpawnPoint) + { + } + public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) { } -- cgit v1.1 From 447a66d66005c5ec54a786d1d0a532738729251c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Feb 2012 23:40:56 +0000 Subject: Replace ParcelAccessEntry with a new struct, LandAccessEntry, which more accurately reflects the data sent by the viewer. Add times bans and the expiration of timed bans. Warning: Contains a Migration (and nuts) --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ab89fe0..4d3d257 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -980,7 +980,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) + public void SendLandAccessListData(List accessList, uint accessFlag, int localLandID) { } -- cgit v1.1 From 5c545d1d2e0a1862d063a1bdf80d2cd2fa311101 Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Fri, 3 Feb 2012 22:02:36 +0100 Subject: Fix: Covenant changed time not set http://opensimulator.org/mantis/view.php?id=5869 Signed-off-by: BlueWall --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4d3d257..14c1287 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -972,7 +972,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { } -- cgit v1.1 From c87751a822db328145963782f0f10adb23e32d39 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Feb 2012 23:03:53 +0000 Subject: Add start GC memory and end GC memory to object stress test printouts. This illustrates that references to Scene, SOG, etc. are not currently being released when a stress test ends (or at regression test end in general). This means even the current stress tests take much more memory than they need, a problem that will have to be addressed. --- OpenSim/Tests/Common/Mock/TestScene.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 07bcdce..328cd2b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -47,6 +47,11 @@ namespace OpenSim.Tests.Common.Mock dumpAssetsToFile, config, simulatorVersion) { } + + ~TestScene() + { + Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); + } /// /// Temporarily override session authentication for tests (namely teleport). -- cgit v1.1 From ebe5e1731d24e68ec7a8aa61a397f5febc1c2662 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 15 Feb 2012 01:45:25 +0000 Subject: In ObjectTortureTests, run garbage collector on Teardown and run scene loop update when scene objects have been deleted. At least on mono 2.6.4, running GC.Collect() is not guaranteed to force gc of all objects when run in the same method where those objects had references. Therefore, GC.Collect() is now being done in the per-script teardown of ObjectTortureTests. In addition, scene loop update is being run after garbage collection in order to clean out the viewer update list of scene objects in the SceneGraph. These measures mean that scene objects/parts are now garbage collected after a test run if deleted from the scene, resulting in a much better memory usage report (though probably still not very accurate). However, deletion takes a very long time - what's really needed is to find out now why the entire scene isn't being GC'd by this measure. This change hasn't yet been applied to the other stress tests. --- OpenSim/Tests/Common/Mock/TestScene.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 328cd2b..eea68c3 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock ~TestScene() { - Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); + //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); + Console.WriteLine("TestScene destructor called"); } /// -- cgit v1.1 From 6bdea15ecf6fdaaf705704dddf9199b882675963 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 7 Mar 2012 01:11:37 +0000 Subject: minor: make NPC tests run in a given order, comment out log lines in mock region data plugins, null out scene in script and npc torture tests, add other doc comments to torture tests --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 79bb9c2..295e868 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -177,9 +177,9 @@ namespace OpenSim.Data.Null // Therefore, we need to store parts rather than groups. foreach (SceneObjectPart prim in obj.Parts) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", - prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); +// m_log.DebugFormat( +// "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", +// prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); m_sceneObjectParts[prim.UUID] = prim; } @@ -193,9 +193,9 @@ namespace OpenSim.Data.Null { if (part.ParentGroup.UUID == obj) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", - part.Name, part.UUID, obj, regionUUID); +// m_log.DebugFormat( +// "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", +// part.Name, part.UUID, obj, regionUUID); m_sceneObjectParts.Remove(part.UUID); } } @@ -215,8 +215,8 @@ namespace OpenSim.Data.Null { if (prim.IsRoot) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); +// m_log.DebugFormat( +// "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); objects[prim.UUID] = new SceneObjectGroup(prim); } } @@ -240,9 +240,9 @@ namespace OpenSim.Data.Null } else { - m_log.WarnFormat( - "[MOCK REGION DATA PLUGIN]: Database contains an orphan child prim {0} {1} in region {2} pointing to missing parent {3}. This prim will not be loaded.", - prim.Name, prim.UUID, regionUUID, prim.ParentUUID); +// m_log.WarnFormat( +// "[MOCK REGION DATA PLUGIN]: Database contains an orphan child prim {0} {1} in region {2} pointing to missing parent {3}. This prim will not be loaded.", +// prim.Name, prim.UUID, regionUUID, prim.ParentUUID); } } } -- cgit v1.1 From c39fba8f9dbf2d003d16d1b7583b529a49a39aab Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 20 Mar 2012 23:19:11 +0000 Subject: minor: remove some mono compiler warnings --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 295e868..579d41c 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -120,7 +120,7 @@ namespace OpenSim.Data.Null /// public class NullDataStore : ISimulationDataStore { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Dictionary m_regionSettings = new Dictionary(); protected Dictionary m_sceneObjectParts = new Dictionary(); -- cgit v1.1 From 1a8769e6eff0eab750a528f27d127637edbd292b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 21 Mar 2012 23:57:39 +0000 Subject: Instead of loading default avatar animations in both SLUtil and AvatarAnimations, load just in AvatarAnimations instead. This lets us remove the dependency of OpenSim.Framework.dll on data/avataranimations.xml, which is not necessary for ROBUST. This commit also takes care of the odd situation where animations are stored and used internally with uppercase names (e.g. "STAND") but scripts refer to them with lowercase names (e.g. "sit"). --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 14c1287..455b51e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -700,11 +700,6 @@ namespace OpenSim.Tests.Common.Mock { } - public UUID GetDefaultAnimation(string name) - { - return UUID.Zero; - } - public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) { } -- cgit v1.1 From d9f7b8549b3cb9699eb8bd54242d31aac0f8241a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 28 Mar 2012 23:40:25 +0100 Subject: Simplify friends caching by only doing this for root agents - no functions require caching for child agents. This allows us to avoid unnecessary multiple calls to the friends service. All friends functions originate from the root agent and only go to other root agents in existing code. This also allows us to eliminate complex ref counting. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 455b51e..d6e7200 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -327,7 +327,7 @@ namespace OpenSim.Tests.Common.Mock /// private UUID m_agentId; - public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } + public ISceneAgent SceneAgent { get; set; } /// /// The last caps seed url that this client was given. -- cgit v1.1 From 93ac47f0d3968650bd7758ad0981e8e5d49b8138 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 29 Mar 2012 01:08:47 +0100 Subject: Revert "Simplify friends caching by only doing this for root agents - no functions require caching for child agents." We need to cache child agents so that friends object edit/delete permissions will work across boarders on regions hosted by different simulators. This reverts commit d9f7b8549b3cb9699eb8bd54242d31aac0f8241a. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d6e7200..455b51e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -327,7 +327,7 @@ namespace OpenSim.Tests.Common.Mock /// private UUID m_agentId; - public ISceneAgent SceneAgent { get; set; } + public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } /// /// The last caps seed url that this client was given. -- cgit v1.1 From 22a85b947a16074525343a56203211806ce16834 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 29 Mar 2012 01:26:30 +0100 Subject: Add back parts of reverted changes that were not concerned with child agent caching. This adds ScenePresence to IClientAPI.SceneAgent earlier on in the add client process so that its information is available to EventManager.OnNewClient() and OnClientLogin() Also add a code comment as to why we're caching friend information for child agents. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 455b51e..d6e7200 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -327,7 +327,7 @@ namespace OpenSim.Tests.Common.Mock /// private UUID m_agentId; - public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } } + public ISceneAgent SceneAgent { get; set; } /// /// The last caps seed url that this client was given. -- cgit v1.1 From 59157d9d63c0e038ca0a619bfae1be3ed6f77677 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 30 Mar 2012 00:40:19 +0100 Subject: Add simple login test with online friends. Add IFriendsModule.GrantRights() for granting rights via a module call. Rename IFriendsModule.GetFriendPerms() -> GetRightsGrantedByFriend() to be more self-documenting and consistent with friends module terminology. Add some method doc. --- OpenSim/Tests/Common/Mock/TestClient.cs | 36 +++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d6e7200..cb9840e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -347,15 +347,9 @@ namespace OpenSim.Tests.Common.Mock get { return m_agentId; } } - public UUID SessionId - { - get { return UUID.Zero; } - } + public UUID SessionId { get; set; } - public UUID SecureSessionId - { - get { return UUID.Zero; } - } + public UUID SecureSessionId { get; set; } public virtual string FirstName { @@ -379,11 +373,9 @@ namespace OpenSim.Tests.Common.Mock get { return true; } set { } } - public bool IsLoggingOut - { - get { return false; } - set { } - } + + public bool IsLoggingOut { get; set; } + public UUID ActiveGroupId { get { return UUID.Zero; } @@ -449,6 +441,8 @@ namespace OpenSim.Tests.Common.Mock m_lastName = agentData.lastname; m_circuitCode = agentData.circuitcode; m_scene = scene; + SessionId = agentData.SessionID; + SecureSessionId = agentData.SecureSessionID; CapsSeedUrl = agentData.CapsPath; ReceivedOfflineNotifications = new List(); @@ -900,8 +894,24 @@ namespace OpenSim.Tests.Common.Mock { } + /// + /// This is a TestClient only method to do shutdown tasks that are normally carried out by LLUDPServer.RemoveClient() + /// + public void Logout() + { + // We must set this here so that the presence is removed from the PresenceService by the PresenceDetector + IsLoggingOut = true; + + Close(); + } + public void Close() { + // Fire the callback for this connection closing + // This is necesary to get the presence detector to notice that a client has logged out. + if (OnConnectionClosed != null) + OnConnectionClosed(this); + m_scene.RemoveClient(AgentId, true); } -- cgit v1.1 From 07e62df5582e28675275b3f5143ec37e5697d283 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Apr 2012 00:58:54 +0100 Subject: Add regression test for teleporting an agent between separated regions on the same simulator. This involves a large amount of change in test scene setup code to allow test scenes to share shared modules SetupScene is now an instance method that requires an instantiation of SceneHelpers, though other SceneHelpers methods are still static May split these out into separate classes in the future. --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 0e4dfb9..4b4d52d 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -46,6 +46,14 @@ namespace OpenSim.Tests.Common.Mock { m_scene = scene; m_parcels = new List(); + SetupDefaultParcel(); + } + + private void SetupDefaultParcel() + { + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); + obj.LandData.Name = "Your Parcel"; + m_parcels.Add(obj); } public List ParcelsNearPoint(Vector3 position) @@ -63,11 +71,7 @@ namespace OpenSim.Tests.Common.Mock m_parcels.Clear(); if (setupDefaultParcel) - { - ILandObject obj = new LandObject(UUID.Zero, false, m_scene); - obj.LandData.Name = "Your Parcel"; - m_parcels.Add(obj); - } + SetupDefaultParcel(); } protected ILandObject GetNoLand() @@ -102,6 +106,5 @@ namespace OpenSim.Tests.Common.Mock public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} - } -} +} \ No newline at end of file -- cgit v1.1 From 9d2e1c67a8969e4769006c7347505b58a7827b3f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 1 May 2012 23:14:12 +0100 Subject: Add regression test for teleporting between neighbouring regions on the same simulator This adds a non-advertised wait_for_callback option in [EntityTransfer]. Default is always true. Teleport tests disable the wait for callback from the destination region in order to run within a single thread. --- OpenSim/Tests/Common/Mock/TestClient.cs | 39 ++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index cb9840e..36049a1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -46,12 +46,10 @@ namespace OpenSim.Tests.Common.Mock EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); - // TODO: This is a really nasty (and temporary) means of telling the test client which scene to invoke setup - // methods on when a teleport is requested - public Scene TeleportTargetScene; private TestClient TeleportSceneClient; private Scene m_scene; + private SceneManager m_sceneManager; // Properties so that we can get at received data for test purposes public List ReceivedOfflineNotifications { get; private set; } @@ -432,15 +430,29 @@ namespace OpenSim.Tests.Common.Mock /// /// Constructor /// + /// + /// Can be used for a test where there is only one region or where there are multiple regions that are not + /// neighbours and where no teleporting takes place. In other situations, the constructor that takes in a + /// scene manager should be used. + /// /// /// - public TestClient(AgentCircuitData agentData, Scene scene) + public TestClient(AgentCircuitData agentData, Scene scene) : this(agentData, scene, null) {} + + /// + /// Constructor + /// + /// + /// + /// + public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) { m_agentId = agentData.AgentID; m_firstName = agentData.firstname; m_lastName = agentData.lastname; m_circuitCode = agentData.circuitcode; m_scene = scene; + m_sceneManager = sceneManager; SessionId = agentData.SessionID; SecureSessionId = agentData.SecureSessionID; CapsSeedUrl = agentData.CapsPath; @@ -590,8 +602,16 @@ namespace OpenSim.Tests.Common.Mock AgentCircuitData newAgent = RequestClientInfo(); // Stage 2: add the new client as a child agent to the scene - TeleportSceneClient = new TestClient(newAgent, TeleportTargetScene); - TeleportTargetScene.AddNewClient(TeleportSceneClient, PresenceType.User); + uint x, y; + Utils.LongToUInts(neighbourHandle, out x, out y); + x /= Constants.RegionSize; + y /= Constants.RegionSize; + + Scene neighbourScene; + m_sceneManager.TryGetScene(x, y, out neighbourScene); + + TeleportSceneClient = new TestClient(newAgent, neighbourScene, m_sceneManager); + neighbourScene.AddNewClient(TeleportSceneClient, PresenceType.User); } public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, @@ -601,6 +621,13 @@ namespace OpenSim.Tests.Common.Mock CapsSeedUrl = capsURL; + // We don't do this here so that the source region can complete processing first in a single-threaded + // regression test scenario. The test itself will have to call CompleteTeleportClientSide() after a teleport + // CompleteTeleportClientSide(); + } + + public void CompleteTeleportClientSide() + { TeleportSceneClient.CompleteMovement(); //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); } -- cgit v1.1 From bc543c1797c629a8584dd2e74d3c5f7a67de96c9 Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Wed, 23 May 2012 21:06:25 +0200 Subject: Environment Module - allows Environment settings for Viewer3 warning: includes database region store migrations for mssql, mysql, sqlite enable/disable this module: Cap_EnvironmentSettings = "localhost" (for enable) Cap_EnvironmentSettings = "" (for disable) at ClientStack.LindenCaps section (OpenSimDefaults.ini file) or owerwrite in OpenSim.ini mantis: http://opensimulator.org/mantis/view.php?id=5860 Signed-off-by: BlueWall --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 35 ++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 579d41c..1845eb9 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -112,6 +112,21 @@ namespace OpenSim.Data.Null { m_store.StoreRegionWindlightSettings(wl); } + + public string LoadRegionEnvironmentSettings(UUID regionUUID) + { + return m_store.LoadRegionEnvironmentSettings(regionUUID); + } + + public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) + { + m_store.StoreRegionEnvironmentSettings(regionUUID, settings); + } + + public void RemoveRegionEnvironmentSettings(UUID regionUUID) + { + m_store.RemoveRegionEnvironmentSettings(regionUUID); + } } /// @@ -158,7 +173,25 @@ namespace OpenSim.Data.Null { //This connector doesn't support the windlight module yet } - + + #region Environment Settings + public string LoadRegionEnvironmentSettings(UUID regionUUID) + { + //This connector doesn't support the Environment module yet + return string.Empty; + } + + public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) + { + //This connector doesn't support the Environment module yet + } + + public void RemoveRegionEnvironmentSettings(UUID regionUUID) + { + //This connector doesn't support the Environment module yet + } + #endregion + public RegionSettings LoadRegionSettings(UUID regionUUID) { RegionSettings rs = null; -- cgit v1.1 From cf080a68d657e082dd61dacc24ffd17240154e90 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 13 Jun 2012 23:42:22 +0100 Subject: Remove long obsolete and unused IClientAPI.KillEndDone() --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 36049a1..376465c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1123,10 +1123,6 @@ namespace OpenSim.Tests.Common.Mock { } - public void KillEndDone() - { - } - public void SendEventInfoReply (EventData info) { } -- cgit v1.1 From 3b3d9967b18335c28ce2dfc269e47bac0ede075a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Jul 2012 23:29:57 +0100 Subject: Remove IClientAPI.GetClientEP() in favour of existing identical IClientAPI.RemoteEndpoint. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 376465c..89c4f11 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -963,11 +963,6 @@ namespace OpenSim.Tests.Common.Mock { } - public EndPoint GetClientEP() - { - return null; - } - public ClientInfo GetClientInfo() { return null; -- cgit v1.1 From dc82ad0f7abe5f09675dfc3768da2a0134503916 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Aug 2012 02:06:22 +0100 Subject: Add a skeleton for a name value storage associated with regions --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 1845eb9..ed29c39 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -127,6 +127,19 @@ namespace OpenSim.Data.Null { m_store.RemoveRegionEnvironmentSettings(regionUUID); } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } /// @@ -318,5 +331,18 @@ namespace OpenSim.Data.Null public void Shutdown() { } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } -- cgit v1.1 From bcbd450fe441e94d6c0f547055b4e95f75a5b0d0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 20 Aug 2012 20:24:54 +0100 Subject: Add --force flag to "kick user" console command to allow bypassing of recent race condition checks. This is to allow a second attempt to remove an avatar even if "show connections" shows them as already inactive (i.e. close has already been attempted once). You should only attempt --force if a normal kick fails. This is partly for diagnostics as we have seen some connections occasionally remain on lbsa plaza even if they are registered as inactive. This is not a permanent solution and may not work anyway - the ultimate solution is to stop this problem from happening in the first place. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 89c4f11..bb8b935 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -934,6 +934,11 @@ namespace OpenSim.Tests.Common.Mock public void Close() { + Close(false); + } + + public void Close(bool force) + { // Fire the callback for this connection closing // This is necesary to get the presence detector to notice that a client has logged out. if (OnConnectionClosed != null) -- cgit v1.1 From 7ea832d47c827ad9ef8eb0ce24702fbee585b1ee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 29 Aug 2012 02:01:43 +0100 Subject: Fix regression introduced in a0d178b2 (Sat Aug 25 02:00:17 2012) where folders with asset type of 'Folder' and 'Unknown' were accidentally treated as system folders. This prevented more than one additional ordinary folder from being created in the base "My Inventory" user folder. Added regression test for this case. Switched tests to use XInventoryService with mostly implemented TestXInventoryDataPlugin rather than InventoryService Disabled TestLoadIarV0_1SameNameCreator() since this has not been working for a very long time (ever since XInventoryService) started being used since it doesnt' preserve creator data in the same way as InventoryService did and so effectively lost the OSPAs. However, nobody noticed/complained about this issue and OSPAs have been superseded by HG like creator information via the --home save oar/iar switch. --- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 131 +++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs new file mode 100644 index 0000000..bca5979 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -0,0 +1,131 @@ +/* + * 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.Linq; +using System.Reflection; +using log4net; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Data; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestXInventoryDataPlugin : IXInventoryData + { + private Dictionary m_allFolders = new Dictionary(); + private Dictionary m_allItems = new Dictionary(); + + public TestXInventoryDataPlugin(string conn, string realm) {} + + public XInventoryItem[] GetItems(string[] fields, string[] vals) + { + List origItems = Get(fields, vals, m_allItems.Values.ToList()); + + return origItems.Select(i => i.Clone()).ToArray(); + } + + public XInventoryFolder[] GetFolders(string[] fields, string[] vals) + { + List origFolders + = Get(fields, vals, m_allFolders.Values.ToList()); + + 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(); + +// Console.WriteLine("Added folder {0} {1}", folder.folderName, folder.folderID); + + return true; + } + + public bool StoreItem(XInventoryItem item) + { + m_allItems[item.inventoryID] = item.Clone(); + +// Console.WriteLine("Added item {0} {1}, creator {2}, owner {3}", item.inventoryName, item.inventoryID, item.creatorID, item.avatarID); + + return true; + } + + public bool DeleteFolders(string field, string val) + { + return DeleteFolders(new string[] { field }, new string[] { val }); + } + + public bool DeleteFolders(string[] fields, string[] vals) + { + XInventoryFolder[] foldersToDelete = GetFolders(fields, vals); + Array.ForEach(foldersToDelete, f => m_allFolders.Remove(f.folderID)); + + return true; + } + + public bool DeleteItems(string field, string val) + { + return DeleteItems(new string[] { field }, new string[] { val }); + } + + public bool DeleteItems(string[] fields, string[] vals) + { + XInventoryItem[] itemsToDelete = GetItems(fields, vals); + Array.ForEach(itemsToDelete, i => m_allItems.Remove(i.inventoryID)); + + return true; + } + + public bool MoveItem(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(); } + } +} \ No newline at end of file -- cgit v1.1 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/Mock') 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/Mock') 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 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/Mock/TestScene.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') 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 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/Mock') 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 From f557d7e82821c931c6ca2faf97c668fa94cacfb0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Jan 2013 01:48:31 +0000 Subject: Add basic JsonCreateStore() regression test --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 214 ++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/MockScriptEngine.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs new file mode 100644 index 0000000..51f2712 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -0,0 +1,214 @@ +/* + * 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; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.ScriptEngine.Interfaces; +using OpenSim.Region.ScriptEngine.Shared; + +namespace OpenSim.Tests.Common +{ + public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine + { + private Scene m_scene; + + public void Initialise(IConfigSource source) + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + + m_scene.StackModuleInterface(this); + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + } + + public string Name { get { return "Mock Script Engine"; } } + public string ScriptEngineName { get { return Name; } } + + public Type ReplaceableInterface { get { return null; } } + + public event ScriptRemoved OnScriptRemoved; + public event ObjectRemoved OnObjectRemoved; + + public string GetXMLState (UUID itemID) + { + throw new System.NotImplementedException (); + } + + public bool SetXMLState(UUID itemID, string xml) + { + throw new System.NotImplementedException (); + } + + public bool PostScriptEvent(UUID itemID, string name, object[] args) + { + throw new System.NotImplementedException (); + } + + public bool PostObjectEvent(UUID itemID, string name, object[] args) + { + throw new System.NotImplementedException (); + } + + public void SuspendScript(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void ResumeScript(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public ArrayList GetScriptErrors(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public bool HasScript(UUID itemID, out bool running) + { + throw new System.NotImplementedException (); + } + + public bool GetScriptState(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void SaveAllState() + { + throw new System.NotImplementedException (); + } + + public void StartProcessing() + { + throw new System.NotImplementedException (); + } + + public float GetScriptExecutionTime(List itemIDs) + { + throw new System.NotImplementedException (); + } + + public Dictionary GetObjectScriptsExecutionTimes() + { + throw new System.NotImplementedException (); + } + + public IScriptWorkItem QueueEventHandler(object parms) + { + throw new System.NotImplementedException (); + } + + public bool PostScriptEvent(UUID itemID,EventParams parms) + { + throw new System.NotImplementedException (); + } + + public bool PostObjectEvent (uint localID, EventParams parms) + { + throw new System.NotImplementedException (); + } + + public DetectParams GetDetectParams(UUID item, int number) + { + throw new System.NotImplementedException (); + } + + public void SetMinEventDelay(UUID itemID, double delay) + { + throw new System.NotImplementedException (); + } + + public int GetStartParameter(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void SetScriptState(UUID itemID, bool state) + { + throw new System.NotImplementedException (); + } + + public void SetState(UUID itemID, string newState) + { + throw new System.NotImplementedException (); + } + + public void ApiResetScript(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void ResetScript (UUID itemID) + { + throw new System.NotImplementedException (); + } + + public IScriptApi GetApi(UUID itemID, string name) + { + throw new System.NotImplementedException (); + } + + public Scene World { get { return m_scene; } } + + public IScriptModule ScriptModule { get { throw new System.NotImplementedException(); } } + + public IConfig Config { get { throw new System.NotImplementedException (); } } + + public IConfigSource ConfigSource { get { throw new System.NotImplementedException (); } } + + public string ScriptEnginePath { get { throw new System.NotImplementedException (); }} + + public string ScriptClassName { get { throw new System.NotImplementedException (); } } + + public string ScriptBaseClassName { get { throw new System.NotImplementedException (); } } + + public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } + + public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } + } +} \ No newline at end of file -- cgit v1.1 From 145e38e5e9bed04d5c41880a5d508cab4603cc1d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 02:21:17 +0000 Subject: Remove long unused Scene.DumpAssetsToFile boolean. --- OpenSim/Tests/Common/Mock/TestScene.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index d4b5648..a7e0dfb 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -41,10 +41,9 @@ namespace OpenSim.Tests.Common.Mock public TestScene( RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, - bool dumpAssetsToFile, IConfigSource config, string simulatorVersion) : base(regInfo, authen, sceneGridService, simDataService, estateDataService, - dumpAssetsToFile, config, simulatorVersion) + config, simulatorVersion) { } -- cgit v1.1 From 3657a08844731e5a24eeda3195c23f417b4570a5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 7 Feb 2013 02:19:26 +0000 Subject: Add TestJsonWriteReadNotecard() regression test --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 51f2712..78bab5b 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -85,7 +85,7 @@ namespace OpenSim.Tests.Common public bool PostScriptEvent(UUID itemID, string name, object[] args) { - throw new System.NotImplementedException (); + return false; } public bool PostObjectEvent(UUID itemID, string name, object[] args) -- cgit v1.1 From 7bf33d333af6e7393a05940d1ab436f5dce73814 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 22:25:28 +0000 Subject: Plumb the path from the client to the extra physics params and back --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dde37ab..182f4d9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1276,5 +1276,10 @@ namespace OpenSim.Tests.Common.Mock public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) { } + + public void SendPartPhysicsProprieties(ISceneEntity entity) + { + } + } } -- cgit v1.1 From b8a7c8b26f3005eed5b161c37509b06b1d604967 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Feb 2013 23:36:36 +0000 Subject: Add regression test for llRequestUrl() --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 57 ++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 78bab5b..6a53fe7 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -40,10 +40,33 @@ namespace OpenSim.Tests.Common { public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine { + public IConfigSource ConfigSource { get; private set; } + + public IConfig Config { get; private set; } + private Scene m_scene; + /// + /// Expose posted events to tests. + /// + public Dictionary> PostedEvents { get; private set; } + + /// + /// A very primitive way of hooking text cose to a posed event. + /// + /// + /// May be replaced with something that uses more original code in the future. + /// + public event Action PostEventHook; + public void Initialise(IConfigSource source) { + ConfigSource = source; + + // Can set later on if required + Config = new IniConfig("MockScriptEngine", ConfigSource); + + PostedEvents = new Dictionary>(); } public void Close() @@ -85,7 +108,28 @@ namespace OpenSim.Tests.Common public bool PostScriptEvent(UUID itemID, string name, object[] args) { - return false; +// Console.WriteLine("Posting event {0} for {1}", name, itemID); + + EventParams evParams = new EventParams(name, args, null); + + List eventsForItem; + + if (!PostedEvents.ContainsKey(itemID)) + { + eventsForItem = new List(); + PostedEvents.Add(itemID, eventsForItem); + } + else + { + eventsForItem = PostedEvents[itemID]; + } + + eventsForItem.Add(evParams); + + if (PostEventHook != null) + PostEventHook(itemID, evParams); + + return true; } public bool PostObjectEvent(UUID itemID, string name, object[] args) @@ -195,11 +239,7 @@ namespace OpenSim.Tests.Common public Scene World { get { return m_scene; } } - public IScriptModule ScriptModule { get { throw new System.NotImplementedException(); } } - - public IConfig Config { get { throw new System.NotImplementedException (); } } - - public IConfigSource ConfigSource { get { throw new System.NotImplementedException (); } } + public IScriptModule ScriptModule { get { return this; } } public string ScriptEnginePath { get { throw new System.NotImplementedException (); }} @@ -210,5 +250,10 @@ namespace OpenSim.Tests.Common public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } + + public void ClearPostedEvents() + { + PostedEvents.Clear(); + } } } \ No newline at end of file -- cgit v1.1 From 14684116f8ef23892b71ef16759224a536ac27bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Feb 2013 20:57:03 +0000 Subject: Add regression tests for llGetNotecardLine() --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 31 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 6a53fe7..b444241 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Reflection; using Nini.Config; using OpenMetaverse; +using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.ScriptEngine.Interfaces; @@ -110,8 +111,11 @@ namespace OpenSim.Tests.Common { // Console.WriteLine("Posting event {0} for {1}", name, itemID); - EventParams evParams = new EventParams(name, args, null); + return PostScriptEvent(itemID, new EventParams(name, args, null)); + } + public bool PostScriptEvent(UUID itemID, EventParams evParams) + { List eventsForItem; if (!PostedEvents.ContainsKey(itemID)) @@ -132,9 +136,22 @@ namespace OpenSim.Tests.Common return true; } + public bool PostObjectEvent(uint localID, EventParams evParams) + { + return PostObjectEvent(m_scene.GetSceneObjectPart(localID), evParams); + } + public bool PostObjectEvent(UUID itemID, string name, object[] args) { - throw new System.NotImplementedException (); + return PostObjectEvent(m_scene.GetSceneObjectPart(itemID), new EventParams(name, args, null)); + } + + private bool PostObjectEvent(SceneObjectPart part, EventParams evParams) + { + foreach (TaskInventoryItem item in part.Inventory.GetInventoryItems(InventoryType.LSL)) + PostScriptEvent(item.ItemID, evParams); + + return true; } public void SuspendScript(UUID itemID) @@ -187,16 +204,6 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } - public bool PostScriptEvent(UUID itemID,EventParams parms) - { - throw new System.NotImplementedException (); - } - - public bool PostObjectEvent (uint localID, EventParams parms) - { - throw new System.NotImplementedException (); - } - public DetectParams GetDetectParams(UUID item, int number) { throw new System.NotImplementedException (); -- cgit v1.1 From 8960418e7d51a0f861e7b4cb800f007d76862c9c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Mar 2013 21:37:53 +0000 Subject: Add regression test for presence crossing between regions on the same simulator. Unlike a much earlier commented out version of this test, this is done in synchronous mode. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 182f4d9..a448cc5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -60,6 +60,8 @@ namespace OpenSim.Tests.Common.Mock public List SentImagePacketPackets { get; private set; } public List SentImageNotInDatabasePackets { get; private set; } + public event Action OnReceivedMoveAgentIntoRegion; + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -566,6 +568,8 @@ namespace OpenSim.Tests.Common.Mock public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { + if (OnReceivedMoveAgentIntoRegion != null) + OnReceivedMoveAgentIntoRegion(regInfo, pos, look); } public virtual AgentCircuitData RequestClientInfo() -- cgit v1.1 From 5751ecde5250484fe8e4b79ef38bfbf441e3dead Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Mar 2013 23:06:00 +0000 Subject: Add code for testing event queue messages recevied on region cross. This is currently disabled pending an improvement in the test code to properly add avatars when an event queue module is present. --- .../Tests/Common/Mock/TestEventQueueGetModule.cs | 178 +++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs new file mode 100644 index 0000000..6707019 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -0,0 +1,178 @@ +/* + * 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; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Threading; +using log4net; +using Nini.Config; +using Mono.Addins; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Framework.Servers; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Tests.Common +{ + public class TestEventQueueGetModule : IEventQueue, INonSharedRegionModule + { + public class Event + { + public string Name { get; set; } + public object[] Args { get; set; } + + public Event(string name, object[] args) + { + name = Name; + args = Args; + } + } + + public Dictionary> Events { get; set; } + + public void Initialise(IConfigSource source) {} + + public void Close() {} + + public void AddRegion(Scene scene) + { + Events = new Dictionary>(); + scene.RegisterModuleInterface(this); + } + + public void RemoveRegion (Scene scene) {} + + public void RegionLoaded (Scene scene) {} + + public string Name { get { return "TestEventQueueGetModule"; } } + + public Type ReplaceableInterface { get { return null; } } + + private void AddEvent(UUID avatarID, string name, params object[] args) + { + Console.WriteLine("Adding event {0} for {1}", name, avatarID); + + List avEvents; + + if (!Events.ContainsKey(avatarID)) + { + avEvents = new List(); + Events[avatarID] = avEvents; + } + else + { + avEvents = Events[avatarID]; + } + + avEvents.Add(new Event(name, args)); + } + + public void ClearEvents() + { + if (Events != null) + Events.Clear(); + } + + public bool Enqueue(OSD o, UUID avatarID) + { + AddEvent(avatarID, "Enqueue", o); + return true; + } + + public void DisableSimulator(ulong handle, UUID avatarID) + { + AddEvent(avatarID, "DisableSimulator", handle); + } + + public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID) + { + AddEvent(avatarID, "EnableSimulator", handle); + } + + public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath) + { + AddEvent(avatarID, "EstablishAgentCommunication", endPoint, capsPath); + } + + public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID agentID) + { + AddEvent(agentID, "TeleportFinishEvent", regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); + } + + public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID) + { + AddEvent(avatarID, "CrossRegion", handle, pos, lookAt, newRegionExternalEndPoint, capsURL, sessionID); + } + + public void ChatterboxInvitation( + UUID sessionID, string sessionName, UUID fromAgent, string message, UUID toAgent, string fromName, + byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, + UUID transactionID, bool fromGroup, byte[] binaryBucket) + { + AddEvent( + toAgent, "ChatterboxInvitation", sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, + timeStamp, offline, parentEstateID, position, ttl, transactionID, fromGroup, binaryBucket); + } + + public void ChatterBoxSessionAgentListUpdates (UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute) + { + AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute); + } + + public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) + { + AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); + } + + public void GroupMembership (OpenMetaverse.Packets.AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) + { + AddEvent(avatarID, "GroupMembership", groupUpdate); + } + + public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) + { + Console.WriteLine("ONE"); + throw new System.NotImplementedException (); + } + + public OSD BuildEvent (string eventName, OSD eventBody) + { + Console.WriteLine("TWO"); + throw new System.NotImplementedException (); + } + + public void partPhysicsProperties (uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID) + { + AddEvent(avatarID, "partPhysicsProperties", localID, physhapetype, density, friction, bounce, gravmod); + } + } +} \ No newline at end of file -- cgit v1.1 From c1115e4c2e8a35fee3287add748881f3718deba5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Mar 2013 22:56:26 +0000 Subject: Add ILandChannel.GetLandObject(Vector3 position) as this is a very common input to GetLandObject() This conforms to the existing ILandChannel.ParcelsNearPoint() method --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 4b4d52d..3115035 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -81,6 +81,11 @@ namespace OpenSim.Tests.Common.Mock return obj; } + public ILandObject GetLandObject(Vector3 position) + { + return GetLandObject(position.X, position.Y); + } + public ILandObject GetLandObject(int x, int y) { return GetNoLand(); -- cgit v1.1 From 36651bed71ce1011c376078943a4fef7e8a9ada6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 23:01:16 +0000 Subject: On the later forms of teleport failure, tell the user if this was because viewer couldn't/didn't connect with destination or if destination didn't signal teleport completion. Also adds regression test for the case where the viewer couldn't connect with the destination region. Also refactoring of regression test support code associated with entity transfer in order to make this test possible and the code less obscure. --- OpenSim/Tests/Common/Mock/TestClient.cs | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a448cc5..2d4fef1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -46,8 +46,6 @@ namespace OpenSim.Tests.Common.Mock EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); - private TestClient TeleportSceneClient; - private Scene m_scene; private SceneManager m_sceneManager; @@ -60,7 +58,9 @@ namespace OpenSim.Tests.Common.Mock public List SentImagePacketPackets { get; private set; } public List SentImageNotInDatabasePackets { get; private set; } + // Test client specific events - for use by tests to implement some IClientAPI behaviour. public event Action OnReceivedMoveAgentIntoRegion; + public event Action OnTestClientInformClientOfNeighbour; // disable warning: public events, part of the public API #pragma warning disable 67 @@ -595,23 +595,8 @@ namespace OpenSim.Tests.Common.Mock public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) { - m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour"); - - // In response to this message, we are going to make a teleport to the scene we've previous been told - // about by test code (this needs to be improved). - AgentCircuitData newAgent = RequestClientInfo(); - - // Stage 2: add the new client as a child agent to the scene - uint x, y; - Utils.LongToUInts(neighbourHandle, out x, out y); - x /= Constants.RegionSize; - y /= Constants.RegionSize; - - Scene neighbourScene; - m_sceneManager.TryGetScene(x, y, out neighbourScene); - - TeleportSceneClient = new TestClient(newAgent, neighbourScene, m_sceneManager); - neighbourScene.AddNewClient(TeleportSceneClient, PresenceType.User); + if (OnTestClientInformClientOfNeighbour != null) + OnTestClientInformClientOfNeighbour(neighbourHandle, neighbourExternalEndPoint); } public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, @@ -626,12 +611,6 @@ namespace OpenSim.Tests.Common.Mock // CompleteTeleportClientSide(); } - public void CompleteTeleportClientSide() - { - TeleportSceneClient.CompleteMovement(); - //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); - } - public virtual void SendTeleportFailed(string reason) { m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); -- cgit v1.1 From 293a024c141d3567d42169f625bc449b89a1b59d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 22 Apr 2013 22:24:41 +0200 Subject: Allow callers to set the invoice parameter for GenericMessage --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2d4fef1..d26e3f7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -541,12 +541,12 @@ namespace OpenSim.Tests.Common.Mock } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, UUID invoice, List message) { } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, UUID invoice, List message) { } -- cgit v1.1 From a7cbb9edc98fabc6d2705d69310f4356e84c7596 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 20:50:49 +0100 Subject: Add regression test for offer, accept and subsequent receiver delete of an item offered via instant message. --- OpenSim/Tests/Common/Mock/TestClient.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d26e3f7..b7a7463 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -484,6 +484,18 @@ namespace OpenSim.Tests.Common.Mock OnCompleteMovementToRegion(this, true); } + /// + /// Emulate sending an IM from the viewer to the simulator. + /// + /// + public void HandleImprovedInstantMessage(GridInstantMessage im) + { + ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; + + if (handlerInstantMessage != null) + handlerInstantMessage(this, im); + } + public virtual void ActivateGesture(UUID assetId, UUID gestureId) { } -- cgit v1.1 From 0beccf23c0c2e7b2420f4f150d5f2566f0d63370 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 21:11:44 +0100 Subject: Add regression test for inventory item give, reject and subsequent trash folder purge by receiver. This commit also actually adds the InventoryTransferModuleTests file which I previously forgot --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b7a7463..41402a4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -61,6 +61,7 @@ namespace OpenSim.Tests.Common.Mock // Test client specific events - for use by tests to implement some IClientAPI behaviour. public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; + public event Action OnReceivedInstantMessage; // disable warning: public events, part of the public API #pragma warning disable 67 @@ -550,7 +551,8 @@ namespace OpenSim.Tests.Common.Mock public void SendInstantMessage(GridInstantMessage im) { - + if (OnReceivedInstantMessage != null) + OnReceivedInstantMessage(im); } public void SendGenericMessage(string method, UUID invoice, List message) -- cgit v1.1 From 67789201c3ae40bd4697f3479eb183599baa3658 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 22:14:13 +0100 Subject: Add TestRejectGivenFolder() and TestAcceptGivenFolder() regression tests --- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index ccbdf81..30b1f38 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -53,6 +53,9 @@ namespace OpenSim.Tests.Common.Mock public XInventoryFolder[] GetFolders(string[] fields, string[] vals) { +// Console.WriteLine( +// "Requesting folders, fields {0}, vals {1}", string.Join(",", fields), string.Join(",", vals)); + List origFolders = Get(fields, vals, m_allFolders.Values.ToList()); @@ -104,7 +107,30 @@ 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 bool MoveFolder(string id, string newParent) + { + // Don't use GetFolders() here - it takes a clone! + XInventoryFolder folder = m_allFolders[new UUID(id)]; + + if (folder == null) + return false; + + folder.parentFolderID = new UUID(newParent); + + XInventoryFolder[] newParentFolders + = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); + +// Console.WriteLine( +// "Moved folder {0} {1}, to {2} {3}", +// folder.folderName, folder.folderID, newParentFolders[0].folderName, folder.parentFolderID); + + // TODO: Really need to implement folder version incrementing, though this should be common code anyway, + // not reimplemented in each db plugin. + + return true; + } + public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); } public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); } } -- cgit v1.1 From 33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 8 May 2013 13:13:51 -0700 Subject: Adds an event and a method so that handling of the CachedTexture packet can be pulled out of LLClientView and moved to AvatarFactory. The first pass at reusing textures (turned off by default) is included. When reusing textures, if the baked textures from a previous login are still in the asset service (which generally means that they are in the simulator's cache) then the avatar will not need to rebake. This is both a performance improvement (specifically that an avatars baked textures do not need to be sent to other users who have the old textures cached) and a resource improvement (don't have to deal with duplicate bakes in the asset service cache). --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 41402a4..664ecb6 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -196,6 +196,7 @@ namespace OpenSim.Tests.Common.Mock public event EstateCovenantRequest OnEstateCovenantRequest; public event EstateChangeInfo OnEstateChangeInfo; public event EstateManageTelehub OnEstateManageTelehub; + public event CachedTextureRequest OnCachedTextureRequest; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; @@ -509,6 +510,11 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List cachedTextures) + { + + } + public virtual void Kick(string message) { } -- cgit v1.1 From 2cb2f1d7e30fa583a9f43ddd6b420deb8e9b56bd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 9 May 2013 18:02:19 +0100 Subject: Fix issue where objects removed via llDie() would not disappear for users looking in from neighbouring sims. This was because this particular code path (unlike user delete) only sent kills to root presences, for no apparent good reason. Added regression test for this case. This fixes http://opensimulator.org/mantis/view.php?id=6627 --- OpenSim/Tests/Common/Mock/TestClient.cs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 664ecb6..3f9690f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -47,9 +47,9 @@ namespace OpenSim.Tests.Common.Mock EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); private Scene m_scene; - private SceneManager m_sceneManager; // Properties so that we can get at received data for test purposes + public List ReceivedKills { get; private set; } public List ReceivedOfflineNotifications { get; private set; } public List ReceivedOnlineNotifications { get; private set; } public List ReceivedFriendshipTerminations { get; private set; } @@ -434,33 +434,21 @@ namespace OpenSim.Tests.Common.Mock /// /// Constructor /// - /// - /// Can be used for a test where there is only one region or where there are multiple regions that are not - /// neighbours and where no teleporting takes place. In other situations, the constructor that takes in a - /// scene manager should be used. - /// - /// - /// - public TestClient(AgentCircuitData agentData, Scene scene) : this(agentData, scene, null) {} - - /// - /// Constructor - /// /// /// /// - public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) + public TestClient(AgentCircuitData agentData, Scene scene) { m_agentId = agentData.AgentID; m_firstName = agentData.firstname; m_lastName = agentData.lastname; m_circuitCode = agentData.circuitcode; m_scene = scene; - m_sceneManager = sceneManager; SessionId = agentData.SessionID; SecureSessionId = agentData.SecureSessionID; CapsSeedUrl = agentData.CapsPath; + ReceivedKills = new List(); ReceivedOfflineNotifications = new List(); ReceivedOnlineNotifications = new List(); ReceivedFriendshipTerminations = new List(); @@ -534,11 +522,13 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendKillObject(ulong regionHandle, List localID) { + ReceivedKills.AddRange(localID); } public virtual void SetChildAgentThrottle(byte[] throttle) { } + public byte[] GetThrottlesPacked(float multiplier) { return new byte[0]; -- cgit v1.1 From 3290cd09d3ecd45c52bd131ada2a793c48fd99dc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 9 May 2013 18:12:17 +0100 Subject: remove pointless region handle paramter from IClientAPI.SendKillObject() --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 3f9690f..09e751a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -517,10 +517,9 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { - } - public virtual void SendKillObject(ulong regionHandle, List localID) + public virtual void SendKillObject(List localID) { ReceivedKills.AddRange(localID); } @@ -534,7 +533,6 @@ namespace OpenSim.Tests.Common.Mock return new byte[0]; } - public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) { } -- cgit v1.1 From 292a6037add00c9e8f817c733d8fc375806caf99 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 9 May 2013 22:48:10 +0100 Subject: minor: Remove unnecessary code that was generating warning in TestXInventoryDataPlugin --- OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index 30b1f38..2be5524 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -118,8 +118,8 @@ namespace OpenSim.Tests.Common.Mock folder.parentFolderID = new UUID(newParent); - XInventoryFolder[] newParentFolders - = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); +// XInventoryFolder[] newParentFolders +// = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); // Console.WriteLine( // "Moved folder {0} {1}, to {2} {3}", -- cgit v1.1 From 533bbf033df88fd231eb0e7d2b0aa5a0058163ea Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 25 May 2013 02:08:54 +0100 Subject: Update the money framework to allow sending the new style linden "serverside is now viewerside" messages regarding currency This will require all money modules to be refactored! --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 09e751a..c660501 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -651,7 +651,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) { } @@ -875,11 +875,6 @@ namespace OpenSim.Tests.Common.Mock } - public bool AddMoney(int debit) - { - return false; - } - public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) { } -- cgit v1.1 From 98f59ffed59d33c3737787bff85a72fde545fc94 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 14 Jul 2013 09:22:55 -0700 Subject: Fix broken tests -- the test setup was wrong... sigh. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c660501..2fc3f0b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -584,7 +584,7 @@ namespace OpenSim.Tests.Common.Mock { AgentCircuitData agentData = new AgentCircuitData(); agentData.AgentID = AgentId; - agentData.SessionID = UUID.Zero; + agentData.SessionID = SessionId; agentData.SecureSessionID = UUID.Zero; agentData.circuitcode = m_circuitCode; agentData.child = false; -- cgit v1.1 From d5a1779465b6d875ebe5822ce6f15df3378b759f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Jul 2013 12:20:35 -0700 Subject: Manage AgentUpdates more sanely: - The existing event to scene has been split into 2: OnAgentUpdate and OnAgentCameraUpdate, to better reflect the two types of updates that the viewer sends. We can run one without the other, which is what happens when the avie is still but the user is camming around - Added thresholds (as opposed to equality) to determine whether the update is significant or not. I thin these thresholds are ok, but we can play with them later - Ignore updates of HeadRotation, which were problematic and aren't being used up stream --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2fc3f0b..5d7349a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -106,6 +106,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; + public event UpdateAgent OnAgentCameraUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; public event AvatarPickerRequest OnAvatarPickerRequest; -- cgit v1.1 From b5ab0698d6328c90d779c2af29914da840335233 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Jul 2013 17:58:32 -0700 Subject: EDIT BEAMS!!! They had been missing from OpenSim since ever. Thanks to lkalif for telling me how to route the information. The viewer effect is under the distance filter, so only avatars with cameras < 10m away see the beams. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5d7349a..f7220d7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1256,7 +1256,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void StopFlying(ISceneEntity presence) + public void SendAgentTerseUpdate(ISceneEntity presence) { } -- cgit v1.1 From b64d3ecaed2c4cc0ffab2e44d02745de4e8f5717 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 12 Aug 2013 18:15:12 +0100 Subject: Create TestSameSimulatorNeighbouringRegionsTeleportV2() regression test for V2 transfer protocol. --- OpenSim/Tests/Common/Mock/TestClient.cs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f7220d7..9370102 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -61,8 +61,13 @@ namespace OpenSim.Tests.Common.Mock // Test client specific events - for use by tests to implement some IClientAPI behaviour. public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; + public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; public event Action OnReceivedInstantMessage; + public delegate void TestClientOnSendRegionTeleportDelegate( + ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL); + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -472,7 +477,8 @@ namespace OpenSim.Tests.Common.Mock public void CompleteMovement() { - OnCompleteMovementToRegion(this, true); + if (OnCompleteMovementToRegion != null) + OnCompleteMovementToRegion(this, true); } /// @@ -608,21 +614,25 @@ namespace OpenSim.Tests.Common.Mock OnTestClientInformClientOfNeighbour(neighbourHandle, neighbourExternalEndPoint); } - public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, - uint locationID, uint flags, string capsURL) + public virtual void SendRegionTeleport( + ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL) { - m_log.DebugFormat("[TEST CLIENT]: Received SendRegionTeleport"); + m_log.DebugFormat( + "[TEST CLIENT]: Received SendRegionTeleport for {0} {1} on {2}", m_firstName, m_lastName, m_scene.Name); CapsSeedUrl = capsURL; - // We don't do this here so that the source region can complete processing first in a single-threaded - // regression test scenario. The test itself will have to call CompleteTeleportClientSide() after a teleport - // CompleteTeleportClientSide(); + if (OnTestClientSendRegionTeleport != null) + OnTestClientSendRegionTeleport( + regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); } public virtual void SendTeleportFailed(string reason) { - m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); + m_log.DebugFormat( + "[TEST CLIENT]: Teleport failed for {0} {1} on {2} with reason {3}", + m_firstName, m_lastName, m_scene.Name, reason); } public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, -- cgit v1.1 From ff5885ab234bc9a7efda49eea0e2200711c4933c Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 1 Nov 2013 11:35:31 -0700 Subject: varregion: push TerrainData implementation up and down the database storage stack. Implement both LoadTerrain and StoreTerrain for all DBs. Move all database blob serialization/deserialization into TerrainData. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 29 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index ed29c39..5df8e04 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -69,11 +69,21 @@ namespace OpenSim.Data.Null m_store.StoreTerrain(terrain, regionID); } + public void StoreTerrain(TerrainData terrain, UUID regionID) + { + m_store.StoreTerrain(terrain, regionID); + } + public double[,] LoadTerrain(UUID regionID) { return m_store.LoadTerrain(regionID); } + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) + { + return m_store.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); + } + public void StoreLandObject(ILandObject Parcel) { m_store.StoreLandObject(Parcel); @@ -154,7 +164,7 @@ namespace OpenSim.Data.Null protected Dictionary m_sceneObjectParts = new Dictionary(); protected Dictionary> m_primItems = new Dictionary>(); - protected Dictionary m_terrains = new Dictionary(); + protected Dictionary m_terrains = new Dictionary(); protected Dictionary m_landData = new Dictionary(); public void Initialise(string dbfile) @@ -299,12 +309,17 @@ namespace OpenSim.Data.Null return new List(objects.Values); } - public void StoreTerrain(double[,] ter, UUID regionID) + public void StoreTerrain(TerrainData ter, UUID regionID) { m_terrains[regionID] = ter; } - public double[,] LoadTerrain(UUID regionID) + public void StoreTerrain(double[,] ter, UUID regionID) + { + m_terrains[regionID] = new HeightmapTerrainData(ter); + } + + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) { if (m_terrains.ContainsKey(regionID)) return m_terrains[regionID]; @@ -312,6 +327,14 @@ namespace OpenSim.Data.Null return null; } + public double[,] LoadTerrain(UUID regionID) + { + if (m_terrains.ContainsKey(regionID)) + return m_terrains[regionID].GetDoubles(); + else + return null; + } + public void RemoveLandObject(UUID globalID) { if (m_landData.ContainsKey(globalID)) -- cgit v1.1 From a5ca15c42893681a777d091c737d5c7615af4f48 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 Dec 2013 23:35:38 +0000 Subject: Create regression test TestSendAgentGroupDataUpdate() for groups agent data sending --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 6707019..e666433 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -38,6 +38,7 @@ using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Framework.Servers; +using OpenSim.Region.ClientStack.Linden; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -164,7 +165,7 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } - public OSD BuildEvent (string eventName, OSD eventBody) + public OSD BuildEvent(string eventName, OSD eventBody) { Console.WriteLine("TWO"); throw new System.NotImplementedException (); -- cgit v1.1 From 9984ecf862ff7362b0caa6c55554c3fd2243873d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Jan 2014 07:41:06 -0800 Subject: varregion: Add region size to teleport event messages (EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service return the region size. Many teleport related debug log messages. Can be removed when teleport works (like that's ever going to happen). --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index e666433..f2bae58 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -114,22 +114,25 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "DisableSimulator", handle); } - public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID) + public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EnableSimulator", handle); } - public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath) + public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath, + ulong regionHandle, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EstablishAgentCommunication", endPoint, capsPath); } - public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID agentID) + public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL, UUID agentID, int regionSizeX, int regionSizeY) { AddEvent(agentID, "TeleportFinishEvent", regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); } - public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID) + public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, + string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "CrossRegion", handle, pos, lookAt, newRegionExternalEndPoint, capsURL, sessionID); } -- cgit v1.1 From 7e32313a491defe8f5fb62ce0036c1692d4b4af9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Jan 2014 07:41:06 -0800 Subject: varregion: Add region size to teleport event messages (EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service return the region size. Many teleport related debug log messages. Can be removed when teleport works (like that's ever going to happen). Conflicts: OpenSim/Framework/RegionInfo.cs --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index e666433..f2bae58 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -114,22 +114,25 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "DisableSimulator", handle); } - public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID) + public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EnableSimulator", handle); } - public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath) + public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath, + ulong regionHandle, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EstablishAgentCommunication", endPoint, capsPath); } - public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID agentID) + public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL, UUID agentID, int regionSizeX, int regionSizeY) { AddEvent(agentID, "TeleportFinishEvent", regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); } - public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID) + public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, + string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "CrossRegion", handle, pos, lookAt, newRegionExternalEndPoint, capsURL, sessionID); } -- cgit v1.1 From 8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 20 Jan 2014 19:16:19 +0000 Subject: Stop exceptions being generated on agent connection if a telehub object has been deleted or has no spawn points. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9370102..a4247e3 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -788,11 +788,6 @@ namespace OpenSim.Tests.Common.Mock { OnRegionHandShakeReply(this); } - - if (OnCompleteMovementToRegion != null) - { - OnCompleteMovementToRegion(this, true); - } } public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) -- cgit v1.1 From fd1b2a1c574a3397383a91279d56cece81945547 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 24 Feb 2014 19:20:50 +0000 Subject: Stop mesh avatars that specify the alpha texture in their bake slots from causing the simulator to continually request that they rebake This is because the alpha texture is not in the cache, we must continue to have the fallback of looking for these and other persisted bakes in the asset service. Relates to http://opensimulator.org/mantis/view.php?id=6927 --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a4247e3..09ff531 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -63,6 +63,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnTestClientInformClientOfNeighbour; public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; public event Action OnReceivedInstantMessage; + public event Action OnReceivedSendRebakeAvatarTextures; public delegate void TestClientOnSendRegionTeleportDelegate( ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, @@ -1227,6 +1228,8 @@ namespace OpenSim.Tests.Common.Mock public void SendRebakeAvatarTextures(UUID textureID) { + if (OnReceivedSendRebakeAvatarTextures != null) + OnReceivedSendRebakeAvatarTextures(textureID); } public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) -- cgit v1.1 From c9415fd76378af35ff76037d46245f2b95e4264f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Mar 2014 00:35:02 +0000 Subject: If an avatar is sitting, send out position updates to clients for any change, not just those outside the usual tolerances. This is to allow small adjustments of less than 0.05m in functions such as llSetPrimitiveLinkParams() to work This is another fix for http://opensimulator.org/mantis/view.php?id=7044 Extends regression test for this case. --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 09ff531..c2b0935 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -62,6 +62,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; + public event Action OnReceivedEntityUpdate; public event Action OnReceivedInstantMessage; public event Action OnReceivedSendRebakeAvatarTextures; @@ -685,6 +686,8 @@ namespace OpenSim.Tests.Common.Mock public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { + if (OnReceivedEntityUpdate != null) + OnReceivedEntityUpdate(entity, updateFlags); } public void ReprioritizeUpdates() -- cgit v1.1 From 71918eeab4beee076d53469e8d19addab49135b7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 7 Mar 2014 01:04:40 +0000 Subject: Add regression test for sending group notices via xmlrpc groups connector. --- .../Common/Mock/MockGroupsServicesConnector.cs | 152 +++++++++++++++++---- 1 file changed, 129 insertions(+), 23 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 3035cea..b3f8c36 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -138,33 +138,28 @@ namespace OpenSim.Tests.Common.Mock { } + private XGroup GetXGroup(UUID groupID, string name) + { + XGroup group = m_data.GetGroup(groupID); + + + if (group == null) + m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: No group found with ID {0}", groupID); + + return group; + } + public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { 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); + XGroup xg = GetXGroup(groupID, groupName); - if (groups.Length == 0) + if (xg == null) return null; - XGroup xg = groups[0]; - GroupRecord gr = new GroupRecord() { GroupID = xg.groupID, @@ -196,8 +191,25 @@ namespace OpenSim.Tests.Common.Mock { } - public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile) + public void SetAgentGroupInfo(UUID requestingAgentID, UUID agentID, UUID groupID, bool acceptNotices, bool listInProfile) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: SetAgentGroupInfo, requestingAgentID {0}, agentID {1}, groupID {2}, acceptNotices {3}, listInProfile {4}", + requestingAgentID, agentID, groupID, acceptNotices, listInProfile); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return; + + XGroupMember xgm = null; + if (!group.members.TryGetValue(agentID, out xgm)) + return; + + xgm.acceptNotices = acceptNotices; + xgm.listInProfile = listInProfile; + + m_data.StoreGroup(group); } public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID) @@ -213,8 +225,27 @@ namespace OpenSim.Tests.Common.Mock { } - public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + public void AddAgentToGroup(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: AddAgentToGroup, requestingAgentID {0}, agentID {1}, groupID {2}, roleID {3}", + requestingAgentID, agentID, groupID, roleID); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return; + + XGroupMember groupMember = new XGroupMember() + { + agentID = agentID, + groupID = groupID, + roleID = roleID + }; + + group.members[agentID] = groupMember; + + m_data.StoreGroup(group); } public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) @@ -259,9 +290,31 @@ namespace OpenSim.Tests.Common.Mock return null; } - public List GetGroupMembers(UUID requestingAgentID, UUID GroupID) + public List GetGroupMembers(UUID requestingAgentID, UUID groupID) { - return null; + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: GetGroupMembers, requestingAgentID {0}, groupID {1}", + requestingAgentID, groupID); + + List groupMembers = new List(); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return groupMembers; + + foreach (XGroupMember xgm in group.members.Values) + { + GroupMembersData gmd = new GroupMembersData(); + gmd.AgentID = xgm.agentID; + gmd.IsOwner = group.founderID == gmd.AgentID; + gmd.AcceptNotices = xgm.acceptNotices; + gmd.ListInProfile = xgm.listInProfile; + + groupMembers.Add(gmd); + } + + return groupMembers; } public List GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID) @@ -269,18 +322,71 @@ namespace OpenSim.Tests.Common.Mock return null; } - public List GetGroupNotices(UUID requestingAgentID, UUID GroupID) + public List GetGroupNotices(UUID requestingAgentID, UUID groupID) { return null; } public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: GetGroupNotices, requestingAgentID {0}, noticeID {1}", + requestingAgentID, noticeID); + + // Yes, not an efficient way to do it. + Dictionary groups = m_data.GetGroups(); + + foreach (XGroup group in groups.Values) + { + if (group.notices.ContainsKey(noticeID)) + { + XGroupNotice n = group.notices[noticeID]; + + GroupNoticeInfo gni = new GroupNoticeInfo(); + gni.GroupID = n.groupID; + gni.Message = n.message; + gni.BinaryBucket = n.binaryBucket; + gni.noticeData.NoticeID = n.noticeID; + gni.noticeData.Timestamp = n.timestamp; + gni.noticeData.FromName = n.fromName; + gni.noticeData.Subject = n.subject; + gni.noticeData.HasAttachment = n.hasAttachment; + gni.noticeData.AssetType = (byte)n.assetType; + + return gni; + } + } + return null; } public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: AddGroupNotice, requestingAgentID {0}, groupID {1}, noticeID {2}, fromName {3}, subject {4}, message {5}, binaryBucket.Length {6}", + requestingAgentID, groupID, noticeID, fromName, subject, message, binaryBucket.Length); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return; + + XGroupNotice groupNotice = new XGroupNotice() + { + groupID = groupID, + noticeID = noticeID, + fromName = fromName, + subject = subject, + message = message, + timestamp = (uint)Util.UnixTimeSinceEpoch(), + hasAttachment = false, + assetType = 0, + binaryBucket = binaryBucket + }; + + group.notices[noticeID] = groupNotice; + + m_data.StoreGroup(group); } public void ResetAgentGroupChatSessions(UUID agentID) -- cgit v1.1 From f3e177814a30ee91a2fdd27f2a1aebf06a39cd15 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Mar 2014 20:51:35 +0000 Subject: Add regression test for http inventory fetch. Involved some restructuring to allow regression tests to dequeue inventory requests and perform poll responses synchronously rather than async --- OpenSim/Tests/Common/Mock/TestHttpClientContext.cs | 110 +++++++++++++ OpenSim/Tests/Common/Mock/TestHttpRequest.cs | 174 +++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestHttpResponse.cs | 171 ++++++++++++++++++++ 3 files changed, 455 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestHttpClientContext.cs create mode 100644 OpenSim/Tests/Common/Mock/TestHttpRequest.cs create mode 100644 OpenSim/Tests/Common/Mock/TestHttpResponse.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs new file mode 100644 index 0000000..5a55b09 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs @@ -0,0 +1,110 @@ +/* + * 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.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using HttpServer; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common +{ + public class TestHttpClientContext: IHttpClientContext + { + /// + /// Bodies of responses from the server. + /// + public string ResponseBody + { + get { return Encoding.UTF8.GetString(m_responseStream.ToArray()); } + } + + public Byte[] ResponseBodyBytes + { + get{ return m_responseStream.ToArray(); } + } + + private MemoryStream m_responseStream = new MemoryStream(); + + public bool IsSecured { get; set; } + + public bool Secured + { + get { return IsSecured; } + set { IsSecured = value; } + } + + public TestHttpClientContext(bool secured) + { + Secured = secured; + } + + public void Disconnect(SocketError error) + { +// Console.WriteLine("TestHttpClientContext.Disconnect Received disconnect with status {0}", error); + } + + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body) {Console.WriteLine("x");} + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason) {Console.WriteLine("xx");} + public void Respond(string body) { Console.WriteLine("xxx");} + + public void Send(byte[] buffer) + { + // Getting header data here +// Console.WriteLine("xxxx: Got {0}", Encoding.UTF8.GetString(buffer)); + } + + public void Send(byte[] buffer, int offset, int size) + { +// Util.PrintCallStack(); +// +// Console.WriteLine( +// "TestHttpClientContext.Send(byte[], int, int) got offset={0}, size={1}, buffer={2}", +// offset, size, Encoding.UTF8.GetString(buffer)); + + m_responseStream.Write(buffer, offset, size); + } + + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType) {Console.WriteLine("xxxxxx");} + public void Close() { } + public bool EndWhenDone { get { return false;} set { return;}} + + public HTTPNetworkContext GiveMeTheNetworkStreamIKnowWhatImDoing() + { + return new HTTPNetworkContext(); + } + + public event EventHandler Disconnected = delegate { }; + /// + /// A request have been received in the context. + /// + public event EventHandler RequestReceived = delegate { }; + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs new file mode 100644 index 0000000..b868895 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs @@ -0,0 +1,174 @@ +/* + * 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.Specialized; +using System.IO; +using HttpServer; +using HttpServer.FormDecoders; + +namespace OpenSim.Tests.Common +{ + public class TestHttpRequest: IHttpRequest + { + private string _uriPath; + public bool BodyIsComplete + { + get { return true; } + } + public string[] AcceptTypes + { + get {return _acceptTypes; } + } + private string[] _acceptTypes; + public Stream Body + { + get { return _body; } + set { _body = value;} + } + private Stream _body; + public ConnectionType Connection + { + get { return _connection; } + set { _connection = value; } + } + private ConnectionType _connection; + public int ContentLength + { + get { return _contentLength; } + set { _contentLength = value; } + } + private int _contentLength; + public NameValueCollection Headers + { + get { return _headers; } + } + private NameValueCollection _headers = new NameValueCollection(); + + public string HttpVersion { get; set; } + + public string Method + { + get { return _method; } + set { _method = value; } + } + private string _method = null; + public HttpInput QueryString + { + get { return _queryString; } + } + private HttpInput _queryString = null; + public Uri Uri + { + get { return _uri; } + set { _uri = value; } + } + private Uri _uri = null; + public string[] UriParts + { + get { return _uri.Segments; } + } + public HttpParam Param + { + get { return null; } + } + public HttpForm Form + { + get { return null; } + } + public bool IsAjax + { + get { return false; } + } + public RequestCookies Cookies + { + get { return null; } + } + + public TestHttpRequest() + { + HttpVersion = "HTTP/1.1"; + } + + public TestHttpRequest(string contentEncoding, string contentType, string userAgent, + string remoteAddr, string remotePort, string[] acceptTypes, + ConnectionType connectionType, int contentLength, Uri uri) : base() + { + _headers["content-encoding"] = contentEncoding; + _headers["content-type"] = contentType; + _headers["user-agent"] = userAgent; + _headers["remote_addr"] = remoteAddr; + _headers["remote_port"] = remotePort; + + _acceptTypes = acceptTypes; + _connection = connectionType; + _contentLength = contentLength; + _uri = uri; + } + + public void DecodeBody(FormDecoderProvider providers) {} + public void SetCookies(RequestCookies cookies) {} + public void AddHeader(string name, string value) + { + _headers.Add(name, value); + } + public int AddToBody(byte[] bytes, int offset, int length) + { + return 0; + } + public void Clear() {} + + public object Clone() + { + TestHttpRequest clone = new TestHttpRequest(); + clone._acceptTypes = _acceptTypes; + clone._connection = _connection; + clone._contentLength = _contentLength; + clone._uri = _uri; + clone._headers = new NameValueCollection(_headers); + + return clone; + } + public IHttpResponse CreateResponse(IHttpClientContext context) + { + return new HttpResponse(context, this); + } + /// + /// Path and query (will be merged with the host header) and put in Uri + /// + /// + public string UriPath + { + get { return _uriPath; } + set + { + _uriPath = value; + + } + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs new file mode 100644 index 0000000..ff47c10 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs @@ -0,0 +1,171 @@ +/* + * 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.IO; +using System.Net; +using System.Text; +using HttpServer; + +namespace OpenSim.Tests.Common +{ + public class TestHttpResponse: IHttpResponse + { + public Stream Body + { + get { return _body; } + + set { _body = value; } + } + private Stream _body; + + public string ProtocolVersion + { + get { return _protocolVersion; } + set { _protocolVersion = value; } + } + private string _protocolVersion; + + public bool Chunked + { + get { return _chunked; } + + set { _chunked = value; } + } + private bool _chunked; + + public ConnectionType Connection + { + get { return _connection; } + + set { _connection = value; } + } + private ConnectionType _connection; + + public Encoding Encoding + { + get { return _encoding; } + + set { _encoding = value; } + } + private Encoding _encoding; + + public int KeepAlive + { + get { return _keepAlive; } + + set { _keepAlive = value; } + } + private int _keepAlive; + + public HttpStatusCode Status + { + get { return _status; } + + set { _status = value; } + } + private HttpStatusCode _status; + + public string Reason + { + get { return _reason; } + + set { _reason = value; } + } + private string _reason; + + public long ContentLength + { + get { return _contentLength; } + + set { _contentLength = value; } + } + private long _contentLength; + + public string ContentType + { + get { return _contentType; } + + set { _contentType = value; } + } + private string _contentType; + + public bool HeadersSent + { + get { return _headersSent; } + } + private bool _headersSent; + + public bool Sent + { + get { return _sent; } + } + private bool _sent; + + public ResponseCookies Cookies + { + get { return _cookies; } + } + private ResponseCookies _cookies = null; + + public TestHttpResponse() + { + _headersSent = false; + _sent = false; + } + + public void AddHeader(string name, string value) {} + + public void Send() + { + if (!_headersSent) SendHeaders(); + if (_sent) throw new InvalidOperationException("stuff already sent"); + _sent = true; + } + + public void SendBody(byte[] buffer, int offset, int count) + { + if (!_headersSent) SendHeaders(); + _sent = true; + } + + public void SendBody(byte[] buffer) + { + if (!_headersSent) SendHeaders(); + _sent = true; + } + + public void SendHeaders() + { + if (_headersSent) throw new InvalidOperationException("headers already sent"); + _headersSent = true; + } + + public void Redirect(Uri uri) {} + public void Redirect(string url) {} + } +} \ No newline at end of file -- cgit v1.1 From d1c3f8eef58b29eb8760eeb1ac03852a2387f927 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 31 Mar 2014 11:53:12 +0300 Subject: Added assets service method AssetsExist(), which returns whether the given list of assets exist. This method is used to optimize sending assets with embedded assets: e.g., when a Hypergrid visitor takes an item into the inventory. --- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index cfefd38..e6e08cd 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; @@ -37,7 +38,7 @@ namespace OpenSim.Tests.Common.Mock public AssetBase FetchAsset(UUID uuid) { - if (ExistsAsset(uuid)) + if (AssetsExist(new[] { uuid })[0]) return Assets[uuid]; else return null; @@ -53,9 +54,9 @@ namespace OpenSim.Tests.Common.Mock CreateAsset(asset); } - public bool ExistsAsset(UUID uuid) - { - return Assets.ContainsKey(uuid); + public bool[] AssetsExist(UUID[] uuids) + { + return Array.ConvertAll(uuids, id => Assets.ContainsKey(id)); } } } \ No newline at end of file -- cgit v1.1 From 998d7009a65def0a4debc9369d35b63611db5b55 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Apr 2014 20:04:12 +0300 Subject: Eliminated many warnings --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index b444241..57be1da 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -94,8 +94,10 @@ namespace OpenSim.Tests.Common public Type ReplaceableInterface { get { return null; } } +#pragma warning disable 0067 public event ScriptRemoved OnScriptRemoved; public event ObjectRemoved OnObjectRemoved; +#pragma warning restore 0067 public string GetXMLState (UUID itemID) { @@ -263,4 +265,4 @@ namespace OpenSim.Tests.Common PostedEvents.Clear(); } } -} \ No newline at end of file +} -- cgit v1.1 From 3a6f3124841ee91778df1d7fa2fbda9893079c6d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 May 2014 22:06:41 +0100 Subject: Fix recent regression from 77e7bbc where an attachment on a received group notice with XmlRpcGroups messaging did not appear in the user's inventory. This was because the "session ID" when the message template was copied was always replaced with the group ID, whereas a notice requires this to be the notice ID. Instead just copy the "session ID" as is - other callers already have this set properly so replacing with group ID was redundant anyway. Relates to http://opensimulator.org/mantis/view.php?id=7037 --- .../Common/Mock/MockGroupsServicesConnector.cs | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index b3f8c36..5a257e9 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -324,7 +324,29 @@ namespace OpenSim.Tests.Common.Mock public List GetGroupNotices(UUID requestingAgentID, UUID groupID) { - return null; + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return null; + + List notices = new List(); + + foreach (XGroupNotice notice in group.notices.Values) + { + GroupNoticeData gnd = new GroupNoticeData() + { + NoticeID = notice.noticeID, + Timestamp = notice.timestamp, + FromName = notice.fromName, + Subject = notice.subject, + HasAttachment = notice.hasAttachment, + AssetType = (byte)notice.assetType + }; + + notices.Add(gnd); + } + + return notices; } public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) -- cgit v1.1 From 1b156b7fe84bf132b51ff198d6d730708f5930b7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 May 2014 19:18:24 +0100 Subject: Add regression test for in-range chat between neighbouring regions from east to west. --- OpenSim/Tests/Common/Mock/TestClient.cs | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c2b0935..8eeaf99 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -62,14 +62,23 @@ namespace OpenSim.Tests.Common.Mock public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; + public event Action OnReceivedEntityUpdate; + + public event OnReceivedChatMessageDelegate OnReceivedChatMessage; public event Action OnReceivedInstantMessage; + public event Action OnReceivedSendRebakeAvatarTextures; public delegate void TestClientOnSendRegionTeleportDelegate( ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL); + public delegate void OnReceivedChatMessageDelegate( + string message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, UUID ownerID, byte source, byte audible); + + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -467,6 +476,34 @@ namespace OpenSim.Tests.Common.Mock } /// + /// Trigger chat coming from this connection. + /// + /// + /// + /// + public bool Chat(int channel, ChatTypeEnum type, string message) + { + ChatMessage handlerChatFromClient = OnChatFromClient; + + if (handlerChatFromClient != null) + { + OSChatMessage args = new OSChatMessage(); + args.Channel = channel; + args.From = Name; + args.Message = message; + args.Type = type; + + args.Scene = Scene; + args.Sender = this; + args.SenderUUID = AgentId; + + handlerChatFromClient(this, args); + } + + return true; + } + + /// /// Attempt a teleport to the given region. /// /// @@ -550,6 +587,9 @@ namespace OpenSim.Tests.Common.Mock string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source, byte audible) { +// Console.WriteLine("mmm {0} {1} {2}", message, Name, AgentId); + if (OnReceivedChatMessage != null) + OnReceivedChatMessage(message, type, fromPos, fromName, fromAgentID, ownerID, source, audible); } public void SendInstantMessage(GridInstantMessage im) -- cgit v1.1 From 0eede1467f4807de3ad84673ba524f1e99de6b72 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 30 May 2014 13:11:46 -0700 Subject: Moved these two estate-related interfaces to the projects where they belong. --- OpenSim/Tests/Common/Mock/TestScene.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index a7e0dfb..2773624 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,6 +33,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common.Mock { -- cgit v1.1 From 3654ae8d8cea0bf0455974efe18ff99e484d2893 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 29 Jul 2014 01:21:15 +0100 Subject: Allow the "debug scene set physics false|true" command to work when bulletsim physics is running in a separate thread. This will also allow the "disable physics" setting in the region debug viewer dialog to work in this circumstance. --- OpenSim/Tests/Common/Mock/TestScene.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 2773624..40e2adc 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,6 +33,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Physics.Manager; using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common.Mock @@ -40,10 +41,10 @@ namespace OpenSim.Tests.Common.Mock public class TestScene : Scene { public TestScene( - RegionInfo regInfo, AgentCircuitManager authen, + RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, simDataService, estateDataService, + : base(regInfo, authen, physicsScene, sceneGridService, simDataService, estateDataService, config, simulatorVersion) { } -- cgit v1.1 From 52370ac94de4f449645eb0471fab4cc515fccbe2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 8 Oct 2014 20:17:51 +0100 Subject: refactor: Move test clientstack setup code out of BasicCircuitTests into OpenSim.Tests.Common.ClientStackHelpers --- OpenSim/Tests/Common/Mock/TestLLUDPServer.cs | 171 +++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestLLUDPServer.cs (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs new file mode 100644 index 0000000..26887c9 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs @@ -0,0 +1,171 @@ +/* + * 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.Net; +using System.Net.Sockets; +using Nini.Config; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.ClientStack.LindenUDP; + +namespace OpenSim.Tests.Common +{ + /// + /// This class enables regression testing of the LLUDPServer by allowing us to intercept outgoing data. + /// + public class TestLLUDPServer : LLUDPServer + { + public List PacketsSent { get; private set; } + + public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) + : base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager) + { + PacketsSent = new List(); + } + + public override void SendAckImmediate(IPEndPoint remoteEndpoint, PacketAckPacket ack) + { + PacketsSent.Add(ack); + } + + public override void SendPacket( + LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method) + { + PacketsSent.Add(packet); + } + + public void ClientOutgoingPacketHandler(IClientAPI client, bool resendUnacked, bool sendAcks, bool sendPing) + { + m_resendUnacked = resendUnacked; + m_sendAcks = sendAcks; + m_sendPing = sendPing; + + ClientOutgoingPacketHandler(client); + } + +//// /// +//// /// The chunks of data to pass to the LLUDPServer when it calls EndReceive +//// /// +//// protected Queue m_chunksToLoad = new Queue(); +// +//// protected override void BeginReceive() +//// { +//// if (m_chunksToLoad.Count > 0 && m_chunksToLoad.Peek().BeginReceiveException) +//// { +//// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); +//// reusedEpSender = tuple.Sender; +//// throw new SocketException(); +//// } +//// } +// +//// protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) +//// { +//// numBytes = 0; +//// +//// //m_log.Debug("Queue size " + m_chunksToLoad.Count); +//// +//// if (m_chunksToLoad.Count <= 0) +//// return false; +//// +//// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); +//// RecvBuffer = tuple.Data; +//// numBytes = tuple.Data.Length; +//// epSender = tuple.Sender; +//// +//// return true; +//// } +// +//// public override void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) +//// { +//// // Don't do anything just yet +//// } +// +// /// +// /// Signal that this chunk should throw an exception on Socket.BeginReceive() +// /// +// /// +// public void LoadReceiveWithBeginException(EndPoint epSender) +// { +// ChunkSenderTuple tuple = new ChunkSenderTuple(epSender); +// tuple.BeginReceiveException = true; +// m_chunksToLoad.Enqueue(tuple); +// } +// +// /// +// /// Load some data to be received by the LLUDPServer on the next receive call +// /// +// /// +// /// +// public void LoadReceive(byte[] data, EndPoint epSender) +// { +// m_chunksToLoad.Enqueue(new ChunkSenderTuple(data, epSender)); +// } +// +// /// +// /// Load a packet to be received by the LLUDPServer on the next receive call +// /// +// /// +// public void LoadReceive(Packet packet, EndPoint epSender) +// { +// LoadReceive(packet.ToBytes(), epSender); +// } +// +// /// +// /// Calls the protected asynchronous result method. This fires out all data chunks currently queued for send +// /// +// /// +// public void ReceiveData(IAsyncResult result) +// { +// // Doesn't work the same way anymore +//// while (m_chunksToLoad.Count > 0) +//// OnReceivedData(result); +// } + } + + /// + /// Record the data and sender tuple + /// + public class ChunkSenderTuple + { + public byte[] Data; + public EndPoint Sender; + public bool BeginReceiveException; + + public ChunkSenderTuple(byte[] data, EndPoint sender) + { + Data = data; + Sender = sender; + } + + public ChunkSenderTuple(EndPoint sender) + { + Sender = sender; + } + } +} -- cgit v1.1 From fc878a33edcb403018e485ba0e8b7a6b3a8c3a16 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 8 Oct 2014 21:09:25 +0100 Subject: refactor: consistently put all test classes in the OpenSim.Tests.Common package rather than some in OpenSim.Tests.Common.Mock the separate mock package was not useful and was just another using line to always add --- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 2 +- OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | 2 +- OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | 2 +- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs | 2 +- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index e6e08cd..cb4fb80 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class BaseAssetRepository { diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index 4a15cf2..dddf75d 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs @@ -31,7 +31,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { /// /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 5a257e9..7f530d0 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -40,7 +40,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8eeaf99..0e1bc8f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -38,7 +38,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Framework.Client; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestClient : IClientAPI, IClientCore { diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index fc44358..a8883b8 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -33,7 +33,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { /// /// In memory inventory data plugin for test purposes. Could be another dll when properly filled out and when the diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 3115035..89ebcd5 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -32,7 +32,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.CoreModules.World.Land; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { /// /// Land channel for test purposes diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs index e769d30..7b1d2b5 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs @@ -35,7 +35,7 @@ using System.Text; using System.Web; using OpenSim.Framework.Servers.HttpServer; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestOSHttpRequest : IOSHttpRequest { diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index e10fe82..2e17f1e 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -32,7 +32,7 @@ using System.Text; using System.Web; using OpenSim.Framework.Servers.HttpServer; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestOSHttpResponse : IOSHttpResponse { diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 40e2adc..45acf91 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -36,7 +36,7 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; using OpenSim.Services.Interfaces; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestScene : Scene { diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index 2be5524..be3a0cb 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -35,7 +35,7 @@ using OpenSim.Framework; using OpenSim.Data; using OpenSim.Data.Null; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestXInventoryDataPlugin : NullGenericDataHandler, IXInventoryData { -- cgit v1.1 From 1d2616e7a24882b197de0db3d76c1e02a7cfcd90 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 3 Feb 2015 23:40:32 +0000 Subject: If the owner of an object is taking a copy from the scene (e.g. via the "take copy" option on a viewer) then only require owner copy perms, not copy and transfer. This matches Linden Lab behaviour and what was already possible via shift-copy. Transfer would not apply here as the owner and copier are the same. This is the only functional change, all other current take copy logic remains the same. Adds regression tests around relevant take copy cases. --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 23 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index a8883b8..c97a765 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -185,7 +185,7 @@ namespace OpenSim.Tests.Common public void addInventoryItem(InventoryItemBase item) { -// InventoryFolderBase folder = m_folders[item.Folder]; + InventoryFolderBase folder = m_folders[item.Folder]; // m_log.DebugFormat( // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index be3a0cb..2b272e6 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -46,20 +46,33 @@ namespace OpenSim.Tests.Common public XInventoryItem[] GetItems(string[] fields, string[] vals) { +// Console.WriteLine( +// "Requesting items, fields {0}, vals {1}", string.Join(", ", fields), string.Join(", ", vals)); + List origItems = Get(fields, vals, m_allItems.Values.ToList()); - return origItems.Select(i => i.Clone()).ToArray(); + XInventoryItem[] items = origItems.Select(i => i.Clone()).ToArray(); + +// Console.WriteLine("Found {0} items", items.Length); +// Array.ForEach(items, i => Console.WriteLine("Found item {0} {1}", i.inventoryName, i.inventoryID)); + + return items; } public XInventoryFolder[] GetFolders(string[] fields, string[] vals) { // Console.WriteLine( -// "Requesting folders, fields {0}, vals {1}", string.Join(",", fields), string.Join(",", vals)); +// "Requesting folders, fields {0}, vals {1}", string.Join(", ", fields), string.Join(", ", vals)); List origFolders = Get(fields, vals, m_allFolders.Values.ToList()); - return origFolders.Select(f => f.Clone()).ToArray(); + XInventoryFolder[] folders = origFolders.Select(f => f.Clone()).ToArray(); + +// Console.WriteLine("Found {0} folders", folders.Length); +// Array.ForEach(folders, f => Console.WriteLine("Found folder {0} {1}", f.folderName, f.folderID)); + + return folders; } public bool StoreFolder(XInventoryFolder folder) @@ -75,7 +88,9 @@ namespace OpenSim.Tests.Common { m_allItems[item.inventoryID] = item.Clone(); -// Console.WriteLine("Added item {0} {1}, creator {2}, owner {3}", item.inventoryName, item.inventoryID, item.creatorID, item.avatarID); +// Console.WriteLine( +// "Added item {0} {1}, folder {2}, creator {3}, owner {4}", +// item.inventoryName, item.inventoryID, item.parentFolderID, item.creatorID, item.avatarID); return true; } -- cgit v1.1 From c53f732163b391e4bcd33c8acb917deb7598e0a8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Aug 2015 21:46:30 +0200 Subject: Change the IScriptApi back to it's original form, removing XEngine specific additions that should not have been there in the first place. Sleeping and time measurement are now completely internal to XEngine --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests/Common/Mock') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 57be1da..d7a144c 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -264,5 +264,9 @@ namespace OpenSim.Tests.Common { PostedEvents.Clear(); } + + public void SleepScript(UUID itemID, int delay) + { + } } } -- cgit v1.1