diff options
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | 2 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 54 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 24 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | 4 |
4 files changed, 12 insertions, 72 deletions
diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 6cc7ff2..1b960b1 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | |||
@@ -82,7 +82,7 @@ namespace OpenSim.Tests.Common | |||
82 | Scene neighbourScene; | 82 | Scene neighbourScene; |
83 | SceneManager.Instance.TryGetScene(x, y, out neighbourScene); | 83 | SceneManager.Instance.TryGetScene(x, y, out neighbourScene); |
84 | 84 | ||
85 | TestClient neighbourTc = new TestClient(newAgent, neighbourScene, SceneManager.Instance); | 85 | TestClient neighbourTc = new TestClient(newAgent, neighbourScene); |
86 | neighbourTcs.Add(neighbourTc); | 86 | neighbourTcs.Add(neighbourTc); |
87 | neighbourScene.AddNewClient(neighbourTc, PresenceType.User); | 87 | neighbourScene.AddNewClient(neighbourTc, PresenceType.User); |
88 | }; | 88 | }; |
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index bdd9093..d9bb85e 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs | |||
@@ -447,9 +447,6 @@ namespace OpenSim.Tests.Common | |||
447 | /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test | 447 | /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test |
448 | /// </summary> | 448 | /// </summary> |
449 | /// <remarks> | 449 | /// <remarks> |
450 | /// This can be used for tests where there is only one region or where there are multiple non-neighbour regions | ||
451 | /// and teleport doesn't take place. | ||
452 | /// | ||
453 | /// XXX: Use the version of this method that takes the UserAccount structure wherever possible - this will | 450 | /// XXX: Use the version of this method that takes the UserAccount structure wherever possible - this will |
454 | /// make the agent circuit data (e.g. first, lastname) consistent with the user account data. | 451 | /// make the agent circuit data (e.g. first, lastname) consistent with the user account data. |
455 | /// </remarks> | 452 | /// </remarks> |
@@ -462,22 +459,6 @@ namespace OpenSim.Tests.Common | |||
462 | } | 459 | } |
463 | 460 | ||
464 | /// <summary> | 461 | /// <summary> |
465 | /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test | ||
466 | /// </summary> | ||
467 | /// <remarks> | ||
468 | /// XXX: Use the version of this method that takes the UserAccount structure wherever possible - this will | ||
469 | /// make the agent circuit data (e.g. first, lastname) consistent with the user account data. | ||
470 | /// </remarks> | ||
471 | /// <param name="scene"></param> | ||
472 | /// <param name="agentId"></param> | ||
473 | /// <param name="sceneManager"></param> | ||
474 | /// <returns></returns> | ||
475 | public static ScenePresence AddScenePresence(Scene scene, UUID agentId, SceneManager sceneManager) | ||
476 | { | ||
477 | return AddScenePresence(scene, GenerateAgentData(agentId), sceneManager); | ||
478 | } | ||
479 | |||
480 | /// <summary> | ||
481 | /// Add a root agent. | 462 | /// Add a root agent. |
482 | /// </summary> | 463 | /// </summary> |
483 | /// <param name="scene"></param> | 464 | /// <param name="scene"></param> |
@@ -508,31 +489,7 @@ namespace OpenSim.Tests.Common | |||
508 | /// <returns></returns> | 489 | /// <returns></returns> |
509 | public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData) | 490 | public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData) |
510 | { | 491 | { |
511 | return AddScenePresence(scene, agentData, null); | 492 | return AddScenePresence(scene, new TestClient(agentData, scene), agentData); |
512 | } | ||
513 | |||
514 | /// <summary> | ||
515 | /// Add a root agent. | ||
516 | /// </summary> | ||
517 | /// <remarks> | ||
518 | /// This function | ||
519 | /// | ||
520 | /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the | ||
521 | /// userserver if grid) would give initial login data back to the client and separately tell the scene that the | ||
522 | /// agent was coming. | ||
523 | /// | ||
524 | /// 2) Connects the agent with the scene | ||
525 | /// | ||
526 | /// This function performs actions equivalent with notifying the scene that an agent is | ||
527 | /// coming and then actually connecting the agent to the scene. The one step missed out is the very first | ||
528 | /// </remarks> | ||
529 | /// <param name="scene"></param> | ||
530 | /// <param name="agentData"></param> | ||
531 | /// <param name="sceneManager"></param> | ||
532 | /// <returns></returns> | ||
533 | public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData, SceneManager sceneManager) | ||
534 | { | ||
535 | return AddScenePresence(scene, new TestClient(agentData, scene, sceneManager), agentData, sceneManager); | ||
536 | } | 493 | } |
537 | 494 | ||
538 | /// <summary> | 495 | /// <summary> |
@@ -552,10 +509,9 @@ namespace OpenSim.Tests.Common | |||
552 | /// </remarks> | 509 | /// </remarks> |
553 | /// <param name="scene"></param> | 510 | /// <param name="scene"></param> |
554 | /// <param name="agentData"></param> | 511 | /// <param name="agentData"></param> |
555 | /// <param name="sceneManager"></param> | ||
556 | /// <returns></returns> | 512 | /// <returns></returns> |
557 | public static ScenePresence AddScenePresence( | 513 | public static ScenePresence AddScenePresence( |
558 | Scene scene, IClientAPI client, AgentCircuitData agentData, SceneManager sceneManager) | 514 | Scene scene, IClientAPI client, AgentCircuitData agentData) |
559 | { | 515 | { |
560 | // We emulate the proper login sequence here by doing things in four stages | 516 | // We emulate the proper login sequence here by doing things in four stages |
561 | 517 | ||
@@ -578,10 +534,6 @@ namespace OpenSim.Tests.Common | |||
578 | /// Introduce an agent into the scene by adding a new client. | 534 | /// Introduce an agent into the scene by adding a new client. |
579 | /// </summary> | 535 | /// </summary> |
580 | /// <returns>The scene presence added</returns> | 536 | /// <returns>The scene presence added</returns> |
581 | /// <param name='sceneManager'> | ||
582 | /// Scene manager. Can be null if there is only one region in the test or multiple regions that are not | ||
583 | /// neighbours and where no teleporting takes place. | ||
584 | /// </param> | ||
585 | /// <param name='scene'></param> | 537 | /// <param name='scene'></param> |
586 | /// <param name='testClient'></param> | 538 | /// <param name='testClient'></param> |
587 | /// <param name='agentData'></param> | 539 | /// <param name='agentData'></param> |
@@ -607,7 +559,7 @@ namespace OpenSim.Tests.Common | |||
607 | acd.child = true; | 559 | acd.child = true; |
608 | 560 | ||
609 | // XXX: ViaLogin may not be correct for child agents | 561 | // XXX: ViaLogin may not be correct for child agents |
610 | TestClient client = new TestClient(acd, scene, null); | 562 | TestClient client = new TestClient(acd, scene); |
611 | return IntroduceClientToScene(scene, client, acd, TeleportFlags.ViaLogin); | 563 | return IntroduceClientToScene(scene, client, acd, TeleportFlags.ViaLogin); |
612 | } | 564 | } |
613 | 565 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 664ecb6..09e751a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -47,9 +47,9 @@ namespace OpenSim.Tests.Common.Mock | |||
47 | EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); | 47 | EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); |
48 | 48 | ||
49 | private Scene m_scene; | 49 | private Scene m_scene; |
50 | private SceneManager m_sceneManager; | ||
51 | 50 | ||
52 | // Properties so that we can get at received data for test purposes | 51 | // Properties so that we can get at received data for test purposes |
52 | public List<uint> ReceivedKills { get; private set; } | ||
53 | public List<UUID> ReceivedOfflineNotifications { get; private set; } | 53 | public List<UUID> ReceivedOfflineNotifications { get; private set; } |
54 | public List<UUID> ReceivedOnlineNotifications { get; private set; } | 54 | public List<UUID> ReceivedOnlineNotifications { get; private set; } |
55 | public List<UUID> ReceivedFriendshipTerminations { get; private set; } | 55 | public List<UUID> ReceivedFriendshipTerminations { get; private set; } |
@@ -434,33 +434,21 @@ namespace OpenSim.Tests.Common.Mock | |||
434 | /// <summary> | 434 | /// <summary> |
435 | /// Constructor | 435 | /// Constructor |
436 | /// </summary> | 436 | /// </summary> |
437 | /// <remarks> | ||
438 | /// Can be used for a test where there is only one region or where there are multiple regions that are not | ||
439 | /// neighbours and where no teleporting takes place. In other situations, the constructor that takes in a | ||
440 | /// scene manager should be used. | ||
441 | /// </remarks> | ||
442 | /// <param name="agentData"></param> | ||
443 | /// <param name="scene"></param> | ||
444 | public TestClient(AgentCircuitData agentData, Scene scene) : this(agentData, scene, null) {} | ||
445 | |||
446 | /// <summary> | ||
447 | /// Constructor | ||
448 | /// </summary> | ||
449 | /// <param name="agentData"></param> | 437 | /// <param name="agentData"></param> |
450 | /// <param name="scene"></param> | 438 | /// <param name="scene"></param> |
451 | /// <param name="sceneManager"></param> | 439 | /// <param name="sceneManager"></param> |
452 | public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) | 440 | public TestClient(AgentCircuitData agentData, Scene scene) |
453 | { | 441 | { |
454 | m_agentId = agentData.AgentID; | 442 | m_agentId = agentData.AgentID; |
455 | m_firstName = agentData.firstname; | 443 | m_firstName = agentData.firstname; |
456 | m_lastName = agentData.lastname; | 444 | m_lastName = agentData.lastname; |
457 | m_circuitCode = agentData.circuitcode; | 445 | m_circuitCode = agentData.circuitcode; |
458 | m_scene = scene; | 446 | m_scene = scene; |
459 | m_sceneManager = sceneManager; | ||
460 | SessionId = agentData.SessionID; | 447 | SessionId = agentData.SessionID; |
461 | SecureSessionId = agentData.SecureSessionID; | 448 | SecureSessionId = agentData.SecureSessionID; |
462 | CapsSeedUrl = agentData.CapsPath; | 449 | CapsSeedUrl = agentData.CapsPath; |
463 | 450 | ||
451 | ReceivedKills = new List<uint>(); | ||
464 | ReceivedOfflineNotifications = new List<UUID>(); | 452 | ReceivedOfflineNotifications = new List<UUID>(); |
465 | ReceivedOnlineNotifications = new List<UUID>(); | 453 | ReceivedOnlineNotifications = new List<UUID>(); |
466 | ReceivedFriendshipTerminations = new List<UUID>(); | 454 | ReceivedFriendshipTerminations = new List<UUID>(); |
@@ -529,22 +517,22 @@ namespace OpenSim.Tests.Common.Mock | |||
529 | 517 | ||
530 | public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) | 518 | public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) |
531 | { | 519 | { |
532 | |||
533 | } | 520 | } |
534 | 521 | ||
535 | public virtual void SendKillObject(ulong regionHandle, List<uint> localID) | 522 | public virtual void SendKillObject(List<uint> localID) |
536 | { | 523 | { |
524 | ReceivedKills.AddRange(localID); | ||
537 | } | 525 | } |
538 | 526 | ||
539 | public virtual void SetChildAgentThrottle(byte[] throttle) | 527 | public virtual void SetChildAgentThrottle(byte[] throttle) |
540 | { | 528 | { |
541 | } | 529 | } |
530 | |||
542 | public byte[] GetThrottlesPacked(float multiplier) | 531 | public byte[] GetThrottlesPacked(float multiplier) |
543 | { | 532 | { |
544 | return new byte[0]; | 533 | return new byte[0]; |
545 | } | 534 | } |
546 | 535 | ||
547 | |||
548 | public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) | 536 | public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) |
549 | { | 537 | { |
550 | } | 538 | } |
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 | |||
118 | 118 | ||
119 | folder.parentFolderID = new UUID(newParent); | 119 | folder.parentFolderID = new UUID(newParent); |
120 | 120 | ||
121 | XInventoryFolder[] newParentFolders | 121 | // XInventoryFolder[] newParentFolders |
122 | = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); | 122 | // = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); |
123 | 123 | ||
124 | // Console.WriteLine( | 124 | // Console.WriteLine( |
125 | // "Moved folder {0} {1}, to {2} {3}", | 125 | // "Moved folder {0} {1}, to {2} {3}", |