diff options
author | lbsa71 | 2009-06-22 07:39:04 +0000 |
---|---|---|
committer | lbsa71 | 2009-06-22 07:39:04 +0000 |
commit | e365440461a4b250612cb5f25f15d495539d4c4d (patch) | |
tree | 1a682b1a09aea9d370488d65096f40a5cda75e8a /OpenSim | |
parent | Suppress exception dump when informing friends in another region about login (diff) | |
download | opensim-SC_OLD-e365440461a4b250612cb5f25f15d495539d4c4d.zip opensim-SC_OLD-e365440461a4b250612cb5f25f15d495539d4c4d.tar.gz opensim-SC_OLD-e365440461a4b250612cb5f25f15d495539d4c4d.tar.bz2 opensim-SC_OLD-e365440461a4b250612cb5f25f15d495539d4c4d.tar.xz |
* Added SceneTests and SceneBaseTests
* Changed some fields to protectesd to enable faking
Diffstat (limited to 'OpenSim')
4 files changed, 220 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs new file mode 100644 index 0000000..54bf51b --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs | |||
@@ -0,0 +1,80 @@ | |||
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 | |||
28 | using System; | ||
29 | using NUnit.Framework; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | |||
33 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// Scene presence tests | ||
37 | /// </summary> | ||
38 | [TestFixture] | ||
39 | public class SceneBaseTests | ||
40 | { | ||
41 | private class SceneBaseImpl : SceneBase | ||
42 | { | ||
43 | public override void Update() | ||
44 | { | ||
45 | throw new NotImplementedException(); | ||
46 | } | ||
47 | |||
48 | public override void LoadWorldMap() | ||
49 | { | ||
50 | throw new NotImplementedException(); | ||
51 | } | ||
52 | |||
53 | public override void AddNewClient(IClientAPI client) | ||
54 | { | ||
55 | throw new NotImplementedException(); | ||
56 | } | ||
57 | |||
58 | public override void RemoveClient(UUID agentID) | ||
59 | { | ||
60 | throw new NotImplementedException(); | ||
61 | } | ||
62 | |||
63 | public override void CloseAllAgents(uint circuitcode) | ||
64 | { | ||
65 | throw new NotImplementedException(); | ||
66 | } | ||
67 | |||
68 | public override bool OtherRegionUp(RegionInfo thisRegion) | ||
69 | { | ||
70 | throw new NotImplementedException(); | ||
71 | } | ||
72 | } | ||
73 | |||
74 | [Test] | ||
75 | public void TestConstructor() | ||
76 | { | ||
77 | SceneBase scene = new SceneBaseImpl(); | ||
78 | } | ||
79 | } | ||
80 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index f0c31d0..fff4422 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
200 | Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); | 200 | Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); |
201 | } | 201 | } |
202 | 202 | ||
203 | [Test] | 203 | [LongRunning] |
204 | public void T021_TestCrossToNewRegion() | 204 | public void T021_TestCrossToNewRegion() |
205 | { | 205 | { |
206 | TestHelper.InMethod(); | 206 | TestHelper.InMethod(); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs new file mode 100644 index 0000000..3c2fa1a --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -0,0 +1,138 @@ | |||
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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using NUnit.Framework; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Region.Framework.Interfaces; | ||
34 | |||
35 | namespace OpenSim.Region.Framework.Scenes.Tests | ||
36 | { | ||
37 | /// <summary> | ||
38 | /// Scene presence tests | ||
39 | /// </summary> | ||
40 | [TestFixture] | ||
41 | public class SceneTests | ||
42 | { | ||
43 | private class FakeStorageManager : StorageManager | ||
44 | { | ||
45 | private class FakeRegionDataStore : IRegionDataStore | ||
46 | { | ||
47 | public void Initialise(string filename) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | public void Dispose() | ||
52 | { | ||
53 | } | ||
54 | |||
55 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) | ||
56 | { | ||
57 | throw new NotImplementedException(); | ||
58 | } | ||
59 | |||
60 | public void RemoveObject(UUID uuid, UUID regionUUID) | ||
61 | { | ||
62 | throw new NotImplementedException(); | ||
63 | } | ||
64 | |||
65 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) | ||
66 | { | ||
67 | throw new NotImplementedException(); | ||
68 | } | ||
69 | |||
70 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) | ||
71 | { | ||
72 | throw new NotImplementedException(); | ||
73 | } | ||
74 | |||
75 | public void StoreTerrain(double[,] terrain, UUID regionID) | ||
76 | { | ||
77 | throw new NotImplementedException(); | ||
78 | } | ||
79 | |||
80 | public double[,] LoadTerrain(UUID regionID) | ||
81 | { | ||
82 | throw new NotImplementedException(); | ||
83 | } | ||
84 | |||
85 | public void StoreLandObject(ILandObject Parcel) | ||
86 | { | ||
87 | throw new NotImplementedException(); | ||
88 | } | ||
89 | |||
90 | public void RemoveLandObject(UUID globalID) | ||
91 | { | ||
92 | throw new NotImplementedException(); | ||
93 | } | ||
94 | |||
95 | public List<LandData> LoadLandObjects(UUID regionUUID) | ||
96 | { | ||
97 | throw new NotImplementedException(); | ||
98 | } | ||
99 | |||
100 | public void StoreRegionSettings(RegionSettings rs) | ||
101 | { | ||
102 | throw new NotImplementedException(); | ||
103 | } | ||
104 | |||
105 | public RegionSettings LoadRegionSettings(UUID regionUUID) | ||
106 | { | ||
107 | return null; | ||
108 | } | ||
109 | |||
110 | public void Shutdown() | ||
111 | { | ||
112 | throw new NotImplementedException(); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | public FakeStorageManager() : base( new FakeRegionDataStore() ) | ||
117 | { | ||
118 | } | ||
119 | |||
120 | public FakeStorageManager(IRegionDataStore storage) : this() | ||
121 | { | ||
122 | } | ||
123 | |||
124 | public FakeStorageManager(string dllName, string connectionstring, string estateconnectionstring) : this() | ||
125 | { | ||
126 | } | ||
127 | } | ||
128 | |||
129 | [Test] | ||
130 | public void TestConstructor() | ||
131 | { | ||
132 | RegionInfo regionInfo = new RegionInfo(0,0,null,null); | ||
133 | FakeStorageManager storageManager = new FakeStorageManager(); | ||
134 | |||
135 | Scene scene = new Scene(regionInfo, null, null, null, storageManager, null, false, false, false, null, null ); | ||
136 | } | ||
137 | } | ||
138 | } | ||
diff --git a/OpenSim/Region/Framework/StorageManager.cs b/OpenSim/Region/Framework/StorageManager.cs index 237eb54..9375b4a 100644 --- a/OpenSim/Region/Framework/StorageManager.cs +++ b/OpenSim/Region/Framework/StorageManager.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Region.Framework | |||
36 | { | 36 | { |
37 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 37 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
38 | 38 | ||
39 | private IRegionDataStore m_dataStore; | 39 | protected IRegionDataStore m_dataStore; |
40 | 40 | ||
41 | public IRegionDataStore DataStore | 41 | public IRegionDataStore DataStore |
42 | { | 42 | { |