diff options
author | ubit | 2012-07-17 02:07:21 +0200 |
---|---|---|
committer | ubit | 2012-07-17 02:07:21 +0200 |
commit | e925b0654d12c534ff9f837355ad43483dbd22cb (patch) | |
tree | e8a05e918e55ec8034dd724c38f143aac31493b2 /OpenSim/Tests/Common/Mock | |
parent | Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Merge branch 'avination' into ubitwork (diff) | |
download | opensim-SC-e925b0654d12c534ff9f837355ad43483dbd22cb.zip opensim-SC-e925b0654d12c534ff9f837355ad43483dbd22cb.tar.gz opensim-SC-e925b0654d12c534ff9f837355ad43483dbd22cb.tar.bz2 opensim-SC-e925b0654d12c534ff9f837355ad43483dbd22cb.tar.xz |
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Tests/Common/Mock')
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 35 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 48 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestLandChannel.cs | 17 |
3 files changed, 77 insertions, 23 deletions
diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 38fbbe3..3f99a39 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | |||
@@ -113,6 +113,21 @@ namespace OpenSim.Data.Null | |||
113 | m_store.StoreRegionWindlightSettings(wl); | 113 | m_store.StoreRegionWindlightSettings(wl); |
114 | } | 114 | } |
115 | 115 | ||
116 | public string LoadRegionEnvironmentSettings(UUID regionUUID) | ||
117 | { | ||
118 | return m_store.LoadRegionEnvironmentSettings(regionUUID); | ||
119 | } | ||
120 | |||
121 | public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) | ||
122 | { | ||
123 | m_store.StoreRegionEnvironmentSettings(regionUUID, settings); | ||
124 | } | ||
125 | |||
126 | public void RemoveRegionEnvironmentSettings(UUID regionUUID) | ||
127 | { | ||
128 | m_store.RemoveRegionEnvironmentSettings(regionUUID); | ||
129 | } | ||
130 | |||
116 | public UUID[] GetObjectIDs(UUID regionID) | 131 | public UUID[] GetObjectIDs(UUID regionID) |
117 | { | 132 | { |
118 | return new UUID[0]; | 133 | return new UUID[0]; |
@@ -163,7 +178,25 @@ namespace OpenSim.Data.Null | |||
163 | { | 178 | { |
164 | //This connector doesn't support the windlight module yet | 179 | //This connector doesn't support the windlight module yet |
165 | } | 180 | } |
166 | 181 | ||
182 | #region Environment Settings | ||
183 | public string LoadRegionEnvironmentSettings(UUID regionUUID) | ||
184 | { | ||
185 | //This connector doesn't support the Environment module yet | ||
186 | return string.Empty; | ||
187 | } | ||
188 | |||
189 | public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings) | ||
190 | { | ||
191 | //This connector doesn't support the Environment module yet | ||
192 | } | ||
193 | |||
194 | public void RemoveRegionEnvironmentSettings(UUID regionUUID) | ||
195 | { | ||
196 | //This connector doesn't support the Environment module yet | ||
197 | } | ||
198 | #endregion | ||
199 | |||
167 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 200 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
168 | { | 201 | { |
169 | RegionSettings rs = null; | 202 | RegionSettings rs = null; |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b2c824c..e254dd8 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -46,12 +46,10 @@ namespace OpenSim.Tests.Common.Mock | |||
46 | 46 | ||
47 | EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); | 47 | EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); |
48 | 48 | ||
49 | // TODO: This is a really nasty (and temporary) means of telling the test client which scene to invoke setup | ||
50 | // methods on when a teleport is requested | ||
51 | public Scene TeleportTargetScene; | ||
52 | private TestClient TeleportSceneClient; | 49 | private TestClient TeleportSceneClient; |
53 | 50 | ||
54 | private Scene m_scene; | 51 | private Scene m_scene; |
52 | private SceneManager m_sceneManager; | ||
55 | 53 | ||
56 | // Properties so that we can get at received data for test purposes | 54 | // Properties so that we can get at received data for test purposes |
57 | public List<UUID> ReceivedOfflineNotifications { get; private set; } | 55 | public List<UUID> ReceivedOfflineNotifications { get; private set; } |
@@ -435,15 +433,29 @@ namespace OpenSim.Tests.Common.Mock | |||
435 | /// <summary> | 433 | /// <summary> |
436 | /// Constructor | 434 | /// Constructor |
437 | /// </summary> | 435 | /// </summary> |
436 | /// <remarks> | ||
437 | /// Can be used for a test where there is only one region or where there are multiple regions that are not | ||
438 | /// neighbours and where no teleporting takes place. In other situations, the constructor that takes in a | ||
439 | /// scene manager should be used. | ||
440 | /// </remarks> | ||
438 | /// <param name="agentData"></param> | 441 | /// <param name="agentData"></param> |
439 | /// <param name="scene"></param> | 442 | /// <param name="scene"></param> |
440 | public TestClient(AgentCircuitData agentData, Scene scene) | 443 | public TestClient(AgentCircuitData agentData, Scene scene) : this(agentData, scene, null) {} |
444 | |||
445 | /// <summary> | ||
446 | /// Constructor | ||
447 | /// </summary> | ||
448 | /// <param name="agentData"></param> | ||
449 | /// <param name="scene"></param> | ||
450 | /// <param name="sceneManager"></param> | ||
451 | public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) | ||
441 | { | 452 | { |
442 | m_agentId = agentData.AgentID; | 453 | m_agentId = agentData.AgentID; |
443 | m_firstName = agentData.firstname; | 454 | m_firstName = agentData.firstname; |
444 | m_lastName = agentData.lastname; | 455 | m_lastName = agentData.lastname; |
445 | m_circuitCode = agentData.circuitcode; | 456 | m_circuitCode = agentData.circuitcode; |
446 | m_scene = scene; | 457 | m_scene = scene; |
458 | m_sceneManager = sceneManager; | ||
447 | SessionId = agentData.SessionID; | 459 | SessionId = agentData.SessionID; |
448 | SecureSessionId = agentData.SecureSessionID; | 460 | SecureSessionId = agentData.SecureSessionID; |
449 | CapsSeedUrl = agentData.CapsPath; | 461 | CapsSeedUrl = agentData.CapsPath; |
@@ -593,8 +605,16 @@ namespace OpenSim.Tests.Common.Mock | |||
593 | AgentCircuitData newAgent = RequestClientInfo(); | 605 | AgentCircuitData newAgent = RequestClientInfo(); |
594 | 606 | ||
595 | // Stage 2: add the new client as a child agent to the scene | 607 | // Stage 2: add the new client as a child agent to the scene |
596 | TeleportSceneClient = new TestClient(newAgent, TeleportTargetScene); | 608 | uint x, y; |
597 | TeleportTargetScene.AddNewClient(TeleportSceneClient, PresenceType.User); | 609 | Utils.LongToUInts(neighbourHandle, out x, out y); |
610 | x /= Constants.RegionSize; | ||
611 | y /= Constants.RegionSize; | ||
612 | |||
613 | Scene neighbourScene; | ||
614 | m_sceneManager.TryGetScene(x, y, out neighbourScene); | ||
615 | |||
616 | TeleportSceneClient = new TestClient(newAgent, neighbourScene, m_sceneManager); | ||
617 | neighbourScene.AddNewClient(TeleportSceneClient, PresenceType.User); | ||
598 | } | 618 | } |
599 | 619 | ||
600 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | 620 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, |
@@ -604,6 +624,13 @@ namespace OpenSim.Tests.Common.Mock | |||
604 | 624 | ||
605 | CapsSeedUrl = capsURL; | 625 | CapsSeedUrl = capsURL; |
606 | 626 | ||
627 | // We don't do this here so that the source region can complete processing first in a single-threaded | ||
628 | // regression test scenario. The test itself will have to call CompleteTeleportClientSide() after a teleport | ||
629 | // CompleteTeleportClientSide(); | ||
630 | } | ||
631 | |||
632 | public void CompleteTeleportClientSide() | ||
633 | { | ||
607 | TeleportSceneClient.CompleteMovement(); | 634 | TeleportSceneClient.CompleteMovement(); |
608 | //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); | 635 | //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); |
609 | } | 636 | } |
@@ -944,11 +971,6 @@ namespace OpenSim.Tests.Common.Mock | |||
944 | { | 971 | { |
945 | } | 972 | } |
946 | 973 | ||
947 | public EndPoint GetClientEP() | ||
948 | { | ||
949 | return null; | ||
950 | } | ||
951 | |||
952 | public ClientInfo GetClientInfo() | 974 | public ClientInfo GetClientInfo() |
953 | { | 975 | { |
954 | return null; | 976 | return null; |
@@ -1104,10 +1126,6 @@ namespace OpenSim.Tests.Common.Mock | |||
1104 | { | 1126 | { |
1105 | } | 1127 | } |
1106 | 1128 | ||
1107 | public void KillEndDone() | ||
1108 | { | ||
1109 | } | ||
1110 | |||
1111 | public void SendEventInfoReply (EventData info) | 1129 | public void SendEventInfoReply (EventData info) |
1112 | { | 1130 | { |
1113 | } | 1131 | } |
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 | |||
46 | { | 46 | { |
47 | m_scene = scene; | 47 | m_scene = scene; |
48 | m_parcels = new List<ILandObject>(); | 48 | m_parcels = new List<ILandObject>(); |
49 | SetupDefaultParcel(); | ||
50 | } | ||
51 | |||
52 | private void SetupDefaultParcel() | ||
53 | { | ||
54 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | ||
55 | obj.LandData.Name = "Your Parcel"; | ||
56 | m_parcels.Add(obj); | ||
49 | } | 57 | } |
50 | 58 | ||
51 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | 59 | public List<ILandObject> ParcelsNearPoint(Vector3 position) |
@@ -63,11 +71,7 @@ namespace OpenSim.Tests.Common.Mock | |||
63 | m_parcels.Clear(); | 71 | m_parcels.Clear(); |
64 | 72 | ||
65 | if (setupDefaultParcel) | 73 | if (setupDefaultParcel) |
66 | { | 74 | SetupDefaultParcel(); |
67 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | ||
68 | obj.LandData.Name = "Your Parcel"; | ||
69 | m_parcels.Add(obj); | ||
70 | } | ||
71 | } | 75 | } |
72 | 76 | ||
73 | protected ILandObject GetNoLand() | 77 | protected ILandObject GetNoLand() |
@@ -102,6 +106,5 @@ namespace OpenSim.Tests.Common.Mock | |||
102 | 106 | ||
103 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} | 107 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} |
104 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} | 108 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} |
105 | |||
106 | } | 109 | } |
107 | } | 110 | } \ No newline at end of file |