aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-03-09 19:40:32 +0000
committerJustin Clarke Casey2009-03-09 19:40:32 +0000
commitae759f2d060bc53cc0b372d5584fcd4ffdd963b4 (patch)
tree304c4c40fa8be68943a3b5cad0b22a19769b2cf9 /OpenSim/Tests/Common
parent* Move method documentation from AssetCache up to IAssetCache (diff)
downloadopensim-SC_OLD-ae759f2d060bc53cc0b372d5584fcd4ffdd963b4.zip
opensim-SC_OLD-ae759f2d060bc53cc0b372d5584fcd4ffdd963b4.tar.gz
opensim-SC_OLD-ae759f2d060bc53cc0b372d5584fcd4ffdd963b4.tar.bz2
opensim-SC_OLD-ae759f2d060bc53cc0b372d5584fcd4ffdd963b4.tar.xz
* Add basic asset cache get test
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r--OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs37
1 files changed, 29 insertions, 8 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs
index d6bce5b..80b9ae3 100644
--- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs
+++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs
@@ -38,18 +38,39 @@ namespace OpenSim.Tests.Common.Mock
38 /// tests are single threaded. 38 /// tests are single threaded.
39 /// </summary> 39 /// </summary>
40 public class TestAssetDataPlugin : IAssetDataPlugin 40 public class TestAssetDataPlugin : IAssetDataPlugin
41 { 41 {
42 public string Version { get { return "0"; } } 42 public string Version { get { return "0"; } }
43 public string Name { get { return "TestAssetDataPlugin"; } } 43 public string Name { get { return "TestAssetDataPlugin"; } }
44
45 protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>();
44 46
45 public void Initialise() {} 47 public void Initialise() {}
48 public void Initialise(string connect) {}
46 public void Dispose() {} 49 public void Dispose() {}
47 50
48 public AssetBase FetchAsset(UUID uuid) { return null; } 51 public AssetBase FetchAsset(UUID uuid)
49 public void CreateAsset(AssetBase asset) {} 52 {
50 public void UpdateAsset(AssetBase asset) {} 53 if (ExistsAsset(uuid))
51 public bool ExistsAsset(UUID uuid) { return false; } 54 return Assets[uuid];
52 public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); } 55 else
53 public void Initialise(string connect) {} 56 return null;
57 }
58
59 public void CreateAsset(AssetBase asset)
60 {
61 Assets[asset.FullID] = asset;
62 }
63
64 public void UpdateAsset(AssetBase asset)
65 {
66 CreateAsset(asset);
67 }
68
69 public bool ExistsAsset(UUID uuid)
70 {
71 return Assets.ContainsKey(uuid);
72 }
73
74 public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); }
54 } 75 }
55} 76} \ No newline at end of file