diff options
author | KittoFlora | 2009-11-15 22:20:51 +0100 |
---|---|---|
committer | KittoFlora | 2009-11-15 22:20:51 +0100 |
commit | ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee (patch) | |
tree | e218f290178d98e63aa8ab6aef46c1715195c32e /OpenSim/Tests/Common/Mock/MockAssetService.cs | |
parent | Merge branch 'master' into vehicles (diff) | |
parent | Make GroupRootUpdate be a terse update. This method is not used by opensim (i... (diff) | |
download | opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.zip opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.tar.gz opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.tar.bz2 opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockAssetService.cs (renamed from OpenSim/Tests/Common/Mock/TestAssetService.cs) | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs index 317ec06..cb38043 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs | |||
@@ -27,6 +27,8 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
31 | using log4net; | ||
30 | using OpenMetaverse; | 32 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
32 | using OpenSim.Data; | 34 | using OpenSim.Data; |
@@ -35,16 +37,25 @@ using Nini.Config; | |||
35 | 37 | ||
36 | namespace OpenSim.Tests.Common.Mock | 38 | namespace OpenSim.Tests.Common.Mock |
37 | { | 39 | { |
38 | public class TestAssetService : IAssetService | 40 | public class MockAssetService : IAssetService |
39 | { | 41 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
40 | private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>(); | 44 | private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>(); |
41 | 45 | ||
42 | public TestAssetService(IConfigSource config) | 46 | public MockAssetService() {} |
43 | { | 47 | |
44 | } | 48 | /// <summary> |
49 | /// This constructor is required if the asset service is being created reflectively (which is the case in some | ||
50 | /// tests). | ||
51 | /// </summary> | ||
52 | /// <param name="config"></param> | ||
53 | public MockAssetService(IConfigSource config) {} | ||
45 | 54 | ||
46 | public AssetBase Get(string id) | 55 | public AssetBase Get(string id) |
47 | { | 56 | { |
57 | m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); | ||
58 | |||
48 | AssetBase asset; | 59 | AssetBase asset; |
49 | if (Assets.ContainsKey(id)) | 60 | if (Assets.ContainsKey(id)) |
50 | asset = Assets[id]; | 61 | asset = Assets[id]; |
@@ -73,6 +84,8 @@ namespace OpenSim.Tests.Common.Mock | |||
73 | 84 | ||
74 | public string Store(AssetBase asset) | 85 | public string Store(AssetBase asset) |
75 | { | 86 | { |
87 | m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); | ||
88 | |||
76 | Assets[asset.ID] = asset; | 89 | Assets[asset.ID] = asset; |
77 | 90 | ||
78 | return asset.ID; | 91 | return asset.ID; |