aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-15 21:29:24 +0000
committerJustin Clarke Casey2009-01-15 21:29:24 +0000
commitadc61008cc9541c9bc8fd95302b364ea2bfbd65e (patch)
treec42a98bbec2fb858719aa09556d6610a6839a52c /OpenSim/Region
parent* Add new unit test for simple teleport in a standalone. (diff)
downloadopensim-SC_OLD-adc61008cc9541c9bc8fd95302b364ea2bfbd65e.zip
opensim-SC_OLD-adc61008cc9541c9bc8fd95302b364ea2bfbd65e.tar.gz
opensim-SC_OLD-adc61008cc9541c9bc8fd95302b364ea2bfbd65e.tar.bz2
opensim-SC_OLD-adc61008cc9541c9bc8fd95302b364ea2bfbd65e.tar.xz
* add file I just missed out, nggggff
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs87
1 files changed, 87 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
new file mode 100644
index 0000000..a3d116d
--- /dev/null
+++ b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs
@@ -0,0 +1,87 @@
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 OpenSim 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 Nini.Config;
29using NUnit.Framework;
30using OpenMetaverse;
31using OpenSim.Framework;
32using OpenSim.Framework.Communications;
33using OpenSim.Region.Environment;
34using OpenSim.Region.Environment.Interfaces;
35using OpenSim.Region.Environment.Modules.Communications.REST;
36using OpenSim.Tests.Common.Mock;
37
38namespace OpenSim.Region.Environment.Scenes.Tests
39{
40 /// <summary>
41 /// Teleport tests in a standalone OpenSim
42 /// </summary>
43 [TestFixture]
44 public class StandaloneTeleportTests
45 {
46 /// <summary>
47 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
48 /// </summary>
49 /// Does not yet do what is says on the tin.
50 [Test]
51 public void TestSimpleNotNeighboursTeleport()
52 {
53 log4net.Config.XmlConfigurator.Configure();
54
55 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
56 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
57 CommunicationsManager cm = new TestCommunicationsManager();
58
59 // shared module
60 IRegionModule interregionComms = new RESTInterregionComms();
61
62 // TODO: Clean this up
63 Scene sceneA = SceneTestUtils.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
64 interregionComms.Initialise(sceneA, new IniConfigSource());
65 sceneA.AddModule(interregionComms.Name, interregionComms);
66 sceneA.SetModuleInterfaces();
67 sceneA.RegisterRegionWithGrid();
68
69 // TODO: Clean this up
70 Scene sceneB = SceneTestUtils.SetupScene("sceneB", sceneBId, 1010, 1010, cm);
71 interregionComms.Initialise(sceneB, new IniConfigSource());
72 sceneB.AddModule(interregionComms.Name, interregionComms);
73 sceneB.SetModuleInterfaces();
74 sceneB.RegisterRegionWithGrid();
75
76 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
77
78 TestClient client = SceneTestUtils.AddRootAgent(sceneA, agentId);
79
80 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
81
82 // TODO: Check that everything is as it should be
83
84 // TODO: test what happens if we try to teleport to a region that doesn't exist
85 }
86 }
87} \ No newline at end of file