29 using System.Collections.Generic;
31 using System.Reflection;
32 using System.Threading;
35 using NUnit.Framework;
37 using OpenMetaverse.Assets;
38 using OpenSim.Framework;
39 using OpenSim.Region.Framework.Scenes;
40 using OpenSim.Region.Framework.Scenes.Serialization;
41 using OpenSim.Tests.Common;
59 IConfigSource config =
new IniConfigSource();
61 config.AddConfig(
"Modules");
62 config.Configs[
"Modules"].Set(
"AssetCaching",
"FlotsamAssetCache");
63 config.AddConfig(
"AssetCache");
64 config.Configs[
"AssetCache"].Set(
"FileCacheEnabled",
"false");
65 config.Configs[
"AssetCache"].Set(
"MemoryCacheEnabled",
"true");
69 SceneHelpers.SetupSceneModules(m_scene, config, m_cache);
75 TestHelpers.InMethod();
78 AssetBase asset = AssetHelpers.CreateNotecardAsset();
79 asset.ID = TestHelpers.ParseTail(0x1).ToString();
82 AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString());
83 Assert.That(retrievedAsset, Is.Null);
88 retrievedAsset = m_cache.Get(asset.ID.ToString());
89 Assert.That(retrievedAsset, Is.Not.Null);
90 Assert.That(retrievedAsset.ID, Is.EqualTo(asset.ID));
96 TestHelpers.InMethod();
99 AssetBase asset = AssetHelpers.CreateNotecardAsset();
100 asset.ID = TestHelpers.ParseTail(0x2).ToString();
102 m_cache.Store(asset);
104 m_cache.Expire(asset.ID);
106 AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString());
107 Assert.That(retrievedAsset, Is.Null);
113 TestHelpers.InMethod();
116 AssetBase asset = AssetHelpers.CreateNotecardAsset();
117 asset.ID = TestHelpers.ParseTail(0x2).ToString();
119 m_cache.Store(asset);
123 AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString());
124 Assert.That(retrievedAsset, Is.Null);
At the moment we're only test the in-memory part of the FlotsamAssetCache. This is a considerable wea...
Asset class. All Assets are reference by this class or a class derived from this class ...
FlotsamAssetCache m_cache
Helpers for setting up scenes.
Interactive OpenSim region server