aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs84
1 files changed, 79 insertions, 5 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
36namespace OpenSim.Data.Null 36namespace 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 }