Merge branch 'master' of ssh://MyConnection/var/git/opensim

arthursv
Teravus Ovares (Dan Olivares) 2009-08-14 17:53:21 -04:00
commit 8727e773d4
3 changed files with 53 additions and 26 deletions

View File

@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
/// <summary> /// <summary>
/// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet).
/// </summary> /// </summary>
//[Test] [Test]
public void TestSaveIarV0_1() public void TestSaveIarV0_1()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene(""); Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
CommunicationsManager cm = scene.CommsManager; 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 /// 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. /// an account exists with the creator name.
/// </summary> /// </summary>
//[Test] [Test]
public void TestLoadIarV0_1ExistingUsers() public void TestLoadIarV0_1ExistingUsers()
{ {
TestHelper.InMethod(); TestHelper.InMethod();
@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // 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; IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@ -276,16 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
CachedUserInfo userInfo CachedUserInfo userInfo
= scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); = 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); InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName);
Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item");
Assert.That( Assert.That(

View File

@ -34,25 +34,53 @@ namespace OpenSim.Services.Interfaces
public interface IAssetService public interface IAssetService
{ {
// Three different ways to retrieve an asset /// <summary>
// /// Get an asset synchronously.
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
AssetBase Get(string id); AssetBase Get(string id);
/// <summary>
/// Get an asset's metadata
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
AssetMetadata GetMetadata(string id); AssetMetadata GetMetadata(string id);
byte[] GetData(string id); byte[] GetData(string id);
/// <summary>
/// Get an asset asynchronously
/// </summary>
/// <param name="id">The asset id</param>
/// <param name="sender">Represents the requester. Passed back via the handler</param>
/// <param name="handler">The handler to call back once the asset has been retrieved</param>
/// <returns>True if the id was parseable, false otherwise</returns>
bool Get(string id, Object sender, AssetRetrieved handler); bool Get(string id, Object sender, AssetRetrieved handler);
// Creates a new asset /// <summary>
// Returns a random ID if none is passed into it /// Creates a new asset
// /// </summary>
/// Returns a random ID if none is passed into it
/// <param name="asset"></param>
/// <returns></returns>
string Store(AssetBase asset); string Store(AssetBase asset);
// Attachments and bare scripts need this!! /// <summary>
// /// Update an asset's content
/// </summary>
/// Attachments and bare scripts need this!!
/// <param name="id"> </param>
/// <param name="data"></param>
/// <returns></returns>
bool UpdateContent(string id, byte[] data); bool UpdateContent(string id, byte[] data);
// Kill an asset /// <summary>
// /// Delete an asset
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
bool Delete(string id); bool Delete(string id);
} }
} }

View File

@ -45,7 +45,13 @@ namespace OpenSim.Tests.Common.Mock
public AssetBase Get(string id) 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) public AssetMetadata GetMetadata(string id)
@ -60,7 +66,9 @@ namespace OpenSim.Tests.Common.Mock
public bool Get(string id, object sender, AssetRetrieved handler) public bool Get(string id, object sender, AssetRetrieved handler)
{ {
throw new NotImplementedException(); handler(id, sender, Get(id));
return true;
} }
public string Store(AssetBase asset) public string Store(AssetBase asset)