diff options
author | Mic Bowman | 2011-04-18 11:29:43 -0700 |
---|---|---|
committer | Mic Bowman | 2011-04-18 11:29:43 -0700 |
commit | 452ae375f0fdd62ba16fb170869ea470c6906cfe (patch) | |
tree | b5a7d364e509f2ff7f1b9086e2ba5658f4ee99ac /OpenSim/Tests/Common/Mock/MockAssetService.cs | |
parent | Remove the call to remove tokens from the parent. Under heavy load (diff) | |
parent | Mantis #5442: Add admin_save_heightmap (diff) | |
download | opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.zip opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.gz opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.bz2 opensim-SC_OLD-452ae375f0fdd62ba16fb170869ea470c6906cfe.tar.xz |
Merge branch 'master' into test-merge0418
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockAssetService.cs | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs deleted file mode 100644 index 4118308..0000000 --- a/OpenSim/Tests/Common/Mock/MockAssetService.cs +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
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 System.Reflection; | ||
31 | using log4net; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Data; | ||
35 | using OpenSim.Services.Interfaces; | ||
36 | using Nini.Config; | ||
37 | |||
38 | namespace OpenSim.Tests.Common.Mock | ||
39 | { | ||
40 | public class MockAssetService : IAssetService | ||
41 | { | ||
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
44 | private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>(); | ||
45 | |||
46 | public MockAssetService() {} | ||
47 | |||
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) {} | ||
54 | |||
55 | public AssetBase Get(string id) | ||
56 | { | ||
57 | m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id); | ||
58 | |||
59 | AssetBase asset; | ||
60 | if (Assets.ContainsKey(id)) | ||
61 | asset = Assets[id]; | ||
62 | else | ||
63 | asset = null; | ||
64 | |||
65 | return asset; | ||
66 | } | ||
67 | |||
68 | public AssetBase GetCached(string id) | ||
69 | { | ||
70 | return Get(id); | ||
71 | } | ||
72 | |||
73 | public AssetMetadata GetMetadata(string id) | ||
74 | { | ||
75 | throw new System.NotImplementedException(); | ||
76 | } | ||
77 | |||
78 | public byte[] GetData(string id) | ||
79 | { | ||
80 | throw new System.NotImplementedException(); | ||
81 | } | ||
82 | |||
83 | public bool Get(string id, object sender, AssetRetrieved handler) | ||
84 | { | ||
85 | handler(id, sender, Get(id)); | ||
86 | |||
87 | return true; | ||
88 | } | ||
89 | |||
90 | public string Store(AssetBase asset) | ||
91 | { | ||
92 | m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID); | ||
93 | |||
94 | Assets[asset.ID] = asset; | ||
95 | |||
96 | return asset.ID; | ||
97 | } | ||
98 | |||
99 | public bool UpdateContent(string id, byte[] data) | ||
100 | { | ||
101 | throw new System.NotImplementedException(); | ||
102 | } | ||
103 | |||
104 | public bool Delete(string id) | ||
105 | { | ||
106 | throw new System.NotImplementedException(); | ||
107 | } | ||
108 | } | ||
109 | } \ No newline at end of file | ||