aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock
diff options
context:
space:
mode:
authorDiva Canto2013-05-06 09:18:17 -0700
committerDiva Canto2013-05-06 09:18:17 -0700
commita81ddf3d7097a2e0959080ae7291357435b0bd5b (patch)
tree688ceb63aa41d8eb9d3af27bd57d39cbd38ca250 /OpenSim/Tests/Common/Mock
parentMinor reordering of operations on NewUserConnection. The agent circuit needs ... (diff)
parentMerge branch 'master' into bulletsim4 (diff)
downloadopensim-SC-a81ddf3d7097a2e0959080ae7291357435b0bd5b.zip
opensim-SC-a81ddf3d7097a2e0959080ae7291357435b0bd5b.tar.gz
opensim-SC-a81ddf3d7097a2e0959080ae7291357435b0bd5b.tar.bz2
opensim-SC-a81ddf3d7097a2e0959080ae7291357435b0bd5b.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs16
-rw-r--r--OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs28
2 files changed, 42 insertions, 2 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index d26e3f7..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
61 // Test client specific events - for use by tests to implement some IClientAPI behaviour. 61 // Test client specific events - for use by tests to implement some IClientAPI behaviour.
62 public event Action<RegionInfo, Vector3, Vector3> OnReceivedMoveAgentIntoRegion; 62 public event Action<RegionInfo, Vector3, Vector3> OnReceivedMoveAgentIntoRegion;
63 public event Action<ulong, IPEndPoint> OnTestClientInformClientOfNeighbour; 63 public event Action<ulong, IPEndPoint> OnTestClientInformClientOfNeighbour;
64 public event Action<GridInstantMessage> OnReceivedInstantMessage;
64 65
65// disable warning: public events, part of the public API 66// disable warning: public events, part of the public API
66#pragma warning disable 67 67#pragma warning disable 67
@@ -484,6 +485,18 @@ namespace OpenSim.Tests.Common.Mock
484 OnCompleteMovementToRegion(this, true); 485 OnCompleteMovementToRegion(this, true);
485 } 486 }
486 487
488 /// <summary>
489 /// Emulate sending an IM from the viewer to the simulator.
490 /// </summary>
491 /// <param name='im'></param>
492 public void HandleImprovedInstantMessage(GridInstantMessage im)
493 {
494 ImprovedInstantMessage handlerInstantMessage = OnInstantMessage;
495
496 if (handlerInstantMessage != null)
497 handlerInstantMessage(this, im);
498 }
499
487 public virtual void ActivateGesture(UUID assetId, UUID gestureId) 500 public virtual void ActivateGesture(UUID assetId, UUID gestureId)
488 { 501 {
489 } 502 }
@@ -538,7 +551,8 @@ namespace OpenSim.Tests.Common.Mock
538 551
539 public void SendInstantMessage(GridInstantMessage im) 552 public void SendInstantMessage(GridInstantMessage im)
540 { 553 {
541 554 if (OnReceivedInstantMessage != null)
555 OnReceivedInstantMessage(im);
542 } 556 }
543 557
544 public void SendGenericMessage(string method, UUID invoice, List<string> message) 558 public void SendGenericMessage(string method, UUID invoice, List<string> message)
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
53 53
54 public XInventoryFolder[] GetFolders(string[] fields, string[] vals) 54 public XInventoryFolder[] GetFolders(string[] fields, string[] vals)
55 { 55 {
56// Console.WriteLine(
57// "Requesting folders, fields {0}, vals {1}", string.Join(",", fields), string.Join(",", vals));
58
56 List<XInventoryFolder> origFolders 59 List<XInventoryFolder> origFolders
57 = Get<XInventoryFolder>(fields, vals, m_allFolders.Values.ToList()); 60 = Get<XInventoryFolder>(fields, vals, m_allFolders.Values.ToList());
58 61
@@ -104,7 +107,30 @@ namespace OpenSim.Tests.Common.Mock
104 } 107 }
105 108
106 public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } 109 public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); }
107 public bool MoveFolder(string id, string newParent) { throw new NotImplementedException(); } 110
111 public bool MoveFolder(string id, string newParent)
112 {
113 // Don't use GetFolders() here - it takes a clone!
114 XInventoryFolder folder = m_allFolders[new UUID(id)];
115
116 if (folder == null)
117 return false;
118
119 folder.parentFolderID = new UUID(newParent);
120
121 XInventoryFolder[] newParentFolders
122 = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() });
123
124// Console.WriteLine(
125// "Moved folder {0} {1}, to {2} {3}",
126// folder.folderName, folder.folderID, newParentFolders[0].folderName, folder.parentFolderID);
127
128 // TODO: Really need to implement folder version incrementing, though this should be common code anyway,
129 // not reimplemented in each db plugin.
130
131 return true;
132 }
133
108 public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); } 134 public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); }
109 public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); } 135 public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); }
110 } 136 }