From a668a5b0d39f04497e5ea170e5af0e659a43febb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 14 Aug 2009 19:59:42 +0100
Subject: Add standard doc and standard doc formatting to IAssetService
---
.../Archiver/Tests/InventoryArchiverTests.cs | 2 +-
OpenSim/Services/Interfaces/IAssetService.cs | 46 +++++++++++++++++-----
2 files changed, 38 insertions(+), 10 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 2169e36..9784fcf 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -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;
diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs
index ec8a71b..6dfe78d 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);
}
}
--
cgit v1.1
From ff28ecee1b35ba24ec538d8ed018c764476c62b4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 14 Aug 2009 20:07:13 +0100
Subject: Re-enable TestSaveIarV0_1() Implement more parts of TestAssetService
---
.../Inventory/Archiver/Tests/InventoryArchiverTests.cs | 2 +-
OpenSim/Tests/Common/Mock/TestAssetService.cs | 14 +++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 9784fcf..c66678f 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();
diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs
index 5f1184b..81f123a 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)
--
cgit v1.1
From e17a2331a02d36a3b9f6f37630601ab4a63a4fb2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 14 Aug 2009 20:38:56 +0100
Subject: * Re-enable TestLoadIarV0_1ExistingUsers()
---
.../Inventory/Archiver/Tests/InventoryArchiverTests.cs | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index c66678f..470a386 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -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(
--
cgit v1.1