aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Tests/StandaloneTeleportTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Tests/StandaloneTeleportTests.cs')
-rw-r--r--OpenSim/Region/Framework/Tests/StandaloneTeleportTests.cs111
1 files changed, 0 insertions, 111 deletions
diff --git a/OpenSim/Region/Framework/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Tests/StandaloneTeleportTests.cs
deleted file mode 100644
index 2d286af..0000000
--- a/OpenSim/Region/Framework/Tests/StandaloneTeleportTests.cs
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Reflection;
30using Nini.Config;
31using NUnit.Framework;
32using NUnit.Framework.SyntaxHelpers;
33using OpenMetaverse;
34using OpenSim.Framework;
35using OpenSim.Framework.Communications;
36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.CoreModules.ServiceConnectors.Interregion;
38using OpenSim.Tests.Common;
39using OpenSim.Tests.Common.Mock;
40using OpenSim.Tests.Common.Setup;
41
42namespace OpenSim.Region.Framework.Scenes.Tests
43{
44 /// <summary>
45 /// Teleport tests in a standalone OpenSim
46 /// </summary>
47 [TestFixture]
48 public class StandaloneTeleportTests
49 {
50 /// <summary>
51 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
52 /// </summary>
53 /// Does not yet do what is says on the tin.
54 [Test, LongRunning]
55 public void TestSimpleNotNeighboursTeleport()
56 {
57 TestHelper.InMethod();
58
59 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());
60
61 log4net.Config.XmlConfigurator.Configure();
62
63 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
64 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
65 TestCommunicationsManager cm = new TestCommunicationsManager();
66
67 // shared module
68 IRegionModule interregionComms = new RESTInterregionComms();
69
70 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
71 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
72 sceneA.RegisterRegionWithGrid();
73
74 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm);
75 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
76 sceneB.RegisterRegionWithGrid();
77
78 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
79 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId);
80
81 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
82
83 Assert.That(
84 sceneACapsModule.GetCapsPath(agentId),
85 Is.EqualTo(client.CapsSeedUrl),
86 "Incorrect caps object path set up in sceneA");
87
88 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
89 client.TeleportTargetScene = sceneB;
90 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
91
92 Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
93 Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");
94
95 ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>();
96
97 // Temporary assertion - caps url construction should at least be doable through a method.
98 Assert.That(
99 "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
100 Is.EqualTo(client.CapsSeedUrl),
101 "Incorrect caps object path set up in sceneB");
102
103 // This assertion will currently fail since we don't remove the caps paths when no longer needed
104 //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");
105
106 // TODO: Check that more of everything is as it should be
107
108 // TODO: test what happens if we try to teleport to a region that doesn't exist
109 }
110 }
111}