diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 2169e36d30..470a386f23 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// - //[Test] + [Test] public void TestSaveIarV0_1() { TestHelper.InMethod(); @@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryArchiverModule archiverModule = new InventoryArchiverModule(); - Scene scene = SceneSetupHelpers.SetupScene(""); + Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); CommunicationsManager cm = scene.CommsManager; @@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// an account exists with the creator name. /// - //[Test] + [Test] public void TestLoadIarV0_1ExistingUsers() { TestHelper.InMethod(); @@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene - Scene scene = SceneSetupHelpers.SetupScene(); + Scene scene = SceneSetupHelpers.SetupScene("inventory"); IUserAdminService userAdminService = scene.CommsManager.UserAdminService; SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); @@ -276,16 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); - //userInfo.FetchInventory(); - /* - for (int i = 0 ; i < 50 ; i++) - { - if (userInfo.HasReceivedInventory == true) - break; - Thread.Sleep(200); - } - Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); - */ + InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); Assert.That( diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs index ec8a71bb55..6dfe78d724 100644 --- a/OpenSim/Services/Interfaces/IAssetService.cs +++ b/OpenSim/Services/Interfaces/IAssetService.cs @@ -34,25 +34,53 @@ namespace OpenSim.Services.Interfaces public interface IAssetService { - // Three different ways to retrieve an asset - // + /// + /// Get an asset synchronously. + /// + /// + /// AssetBase Get(string id); + + /// + /// Get an asset's metadata + /// + /// + /// AssetMetadata GetMetadata(string id); + byte[] GetData(string id); + /// + /// Get an asset asynchronously + /// + /// The asset id + /// Represents the requester. Passed back via the handler + /// The handler to call back once the asset has been retrieved + /// True if the id was parseable, false otherwise bool Get(string id, Object sender, AssetRetrieved handler); - // Creates a new asset - // Returns a random ID if none is passed into it - // + /// + /// Creates a new asset + /// + /// Returns a random ID if none is passed into it + /// + /// string Store(AssetBase asset); - // Attachments and bare scripts need this!! - // + /// + /// Update an asset's content + /// + /// Attachments and bare scripts need this!! + /// + /// + /// bool UpdateContent(string id, byte[] data); - // Kill an asset - // + /// + /// Delete an asset + /// + /// + /// bool Delete(string id); } } diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 5f1184bd96..81f123a1e5 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -45,7 +45,13 @@ namespace OpenSim.Tests.Common.Mock public AssetBase Get(string id) { - return Assets[ id ]; + AssetBase asset; + if (Assets.ContainsKey(id)) + asset = Assets[id]; + else + asset = null; + + return asset; } public AssetMetadata GetMetadata(string id) @@ -59,8 +65,10 @@ namespace OpenSim.Tests.Common.Mock } public bool Get(string id, object sender, AssetRetrieved handler) - { - throw new NotImplementedException(); + { + handler(id, sender, Get(id)); + + return true; } public string Store(AssetBase asset)