diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 84 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestScene.cs | 12 |
2 files changed, 83 insertions, 13 deletions
diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 2a055cc..de6e815 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | |||
@@ -35,11 +35,86 @@ using OpenSim.Region.Framework.Scenes; | |||
35 | 35 | ||
36 | namespace OpenSim.Data.Null | 36 | namespace OpenSim.Data.Null |
37 | { | 37 | { |
38 | public class NullDataService : ISimulationDataService | ||
39 | { | ||
40 | private NullDataStore m_store; | ||
41 | |||
42 | public NullDataService() | ||
43 | { | ||
44 | m_store = new NullDataStore(); | ||
45 | } | ||
46 | |||
47 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) | ||
48 | { | ||
49 | m_store.StoreObject(obj, regionUUID); | ||
50 | } | ||
51 | |||
52 | public void RemoveObject(UUID uuid, UUID regionUUID) | ||
53 | { | ||
54 | m_store.RemoveObject(uuid, regionUUID); | ||
55 | } | ||
56 | |||
57 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) | ||
58 | { | ||
59 | m_store.StorePrimInventory(primID, items); | ||
60 | } | ||
61 | |||
62 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) | ||
63 | { | ||
64 | return m_store.LoadObjects(regionUUID); | ||
65 | } | ||
66 | |||
67 | public void StoreTerrain(double[,] terrain, UUID regionID) | ||
68 | { | ||
69 | m_store.StoreTerrain(terrain, regionID); | ||
70 | } | ||
71 | |||
72 | public double[,] LoadTerrain(UUID regionID) | ||
73 | { | ||
74 | return m_store.LoadTerrain(regionID); | ||
75 | } | ||
76 | |||
77 | public void StoreLandObject(ILandObject Parcel) | ||
78 | { | ||
79 | m_store.StoreLandObject(Parcel); | ||
80 | } | ||
81 | |||
82 | public void RemoveLandObject(UUID globalID) | ||
83 | { | ||
84 | m_store.RemoveLandObject(globalID); | ||
85 | } | ||
86 | |||
87 | public List<LandData> LoadLandObjects(UUID regionUUID) | ||
88 | { | ||
89 | return m_store.LoadLandObjects(regionUUID); | ||
90 | } | ||
91 | |||
92 | public void StoreRegionSettings(RegionSettings rs) | ||
93 | { | ||
94 | m_store.StoreRegionSettings(rs); | ||
95 | } | ||
96 | |||
97 | public RegionSettings LoadRegionSettings(UUID regionUUID) | ||
98 | { | ||
99 | return m_store.LoadRegionSettings(regionUUID); | ||
100 | } | ||
101 | |||
102 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) | ||
103 | { | ||
104 | return m_store.LoadRegionWindlightSettings(regionUUID); | ||
105 | } | ||
106 | |||
107 | public void StoreRegionWindlightSettings(RegionLightShareData wl) | ||
108 | { | ||
109 | m_store.StoreRegionWindlightSettings(wl); | ||
110 | } | ||
111 | } | ||
112 | |||
38 | /// <summary> | 113 | /// <summary> |
39 | /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that | 114 | /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that |
40 | /// tests can check correct persistence. | 115 | /// tests can check correct persistence. |
41 | /// </summary> | 116 | /// </summary> |
42 | public class NullDataStore : IRegionDataStore | 117 | public class NullDataStore : ISimulationDataStore |
43 | { | 118 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 119 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 120 | ||
@@ -99,7 +174,7 @@ namespace OpenSim.Data.Null | |||
99 | } | 174 | } |
100 | 175 | ||
101 | public void RemoveObject(UUID obj, UUID regionUUID) | 176 | public void RemoveObject(UUID obj, UUID regionUUID) |
102 | { | 177 | { |
103 | // All parts belonging to the object with the uuid are removed. | 178 | // All parts belonging to the object with the uuid are removed. |
104 | List<SceneObjectPart> parts = new List<SceneObjectPart>(m_sceneObjectParts.Values); | 179 | List<SceneObjectPart> parts = new List<SceneObjectPart>(m_sceneObjectParts.Values); |
105 | foreach (SceneObjectPart part in parts) | 180 | foreach (SceneObjectPart part in parts) |
@@ -108,13 +183,12 @@ namespace OpenSim.Data.Null | |||
108 | { | 183 | { |
109 | m_log.DebugFormat( | 184 | m_log.DebugFormat( |
110 | "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", | 185 | "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", |
111 | part.Name, part.UUID, obj, regionUUID); | 186 | part.Name, part.UUID, obj, regionUUID); |
112 | m_sceneObjectParts.Remove(part.UUID); | 187 | m_sceneObjectParts.Remove(part.UUID); |
113 | } | 188 | } |
114 | } | 189 | } |
115 | } | 190 | } |
116 | 191 | ||
117 | // see IRegionDatastore | ||
118 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) | 192 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) |
119 | { | 193 | { |
120 | m_primItems[primID] = items; | 194 | m_primItems[primID] = items; |
@@ -130,7 +204,7 @@ namespace OpenSim.Data.Null | |||
130 | if (prim.IsRoot) | 204 | if (prim.IsRoot) |
131 | { | 205 | { |
132 | m_log.DebugFormat( | 206 | m_log.DebugFormat( |
133 | "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); | 207 | "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); |
134 | objects[prim.UUID] = new SceneObjectGroup(prim); | 208 | objects[prim.UUID] = new SceneObjectGroup(prim); |
135 | } | 209 | } |
136 | } | 210 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 615e519..0e1433a 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs | |||
@@ -31,6 +31,7 @@ using OpenSim.Framework; | |||
31 | using OpenSim.Framework.Communications; | 31 | using OpenSim.Framework.Communications; |
32 | using OpenSim.Framework.Servers; | 32 | using OpenSim.Framework.Servers; |
33 | using OpenSim.Region.Framework; | 33 | using OpenSim.Region.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | ||
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
35 | 36 | ||
36 | namespace OpenSim.Tests.Common.Mock | 37 | namespace OpenSim.Tests.Common.Mock |
@@ -39,20 +40,15 @@ namespace OpenSim.Tests.Common.Mock | |||
39 | { | 40 | { |
40 | public TestScene( | 41 | public TestScene( |
41 | RegionInfo regInfo, AgentCircuitManager authen, | 42 | RegionInfo regInfo, AgentCircuitManager authen, |
42 | SceneCommunicationService sceneGridService, StorageManager storeManager, | 43 | SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, |
43 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, | 44 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, |
44 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) | 45 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) |
45 | : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, | 46 | : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, |
46 | dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) | 47 | dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) |
47 | { | 48 | { |
48 | } | 49 | } |
49 | 50 | ||
50 | /// <summary> | 51 | /// <summary> |
51 | /// Allow retrieval for test check purposes | ||
52 | /// </summary> | ||
53 | public StorageManager StorageManager { get { return m_storageManager; } } | ||
54 | |||
55 | /// <summary> | ||
56 | /// Temporarily override session authentication for tests (namely teleport). | 52 | /// Temporarily override session authentication for tests (namely teleport). |
57 | /// </summary> | 53 | /// </summary> |
58 | /// | 54 | /// |
@@ -69,6 +65,6 @@ namespace OpenSim.Tests.Common.Mock | |||
69 | public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter | 65 | public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter |
70 | { | 66 | { |
71 | get { return m_asyncSceneObjectDeleter; } | 67 | get { return m_asyncSceneObjectDeleter; } |
72 | } | 68 | } |
73 | } | 69 | } |
74 | } \ No newline at end of file | 70 | } \ No newline at end of file |