Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

arthursv
Sean Dague 2009-08-05 14:44:25 -04:00
commit 8f4048c63a
2 changed files with 13 additions and 12 deletions

View File

@ -202,19 +202,19 @@ 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();
//log4net.Config.XmlConfigurator.Configure(); log4net.Config.XmlConfigurator.Configure();
string userFirstName = "Mr"; string userFirstName = "Mr";
string userLastName = "Tiddles"; string userLastName = "Tiddles";
UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555");
string user2FirstName = "Lord"; string userItemCreatorFirstName = "Lord";
string user2LastName = "Lucan"; string userItemCreatorLastName = "Lucan";
UUID user2Uuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
string itemName = "b.lsl"; string itemName = "b.lsl";
string archiveItemName string archiveItemName
@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
item1.Name = itemName; item1.Name = itemName;
item1.AssetID = UUID.Random(); item1.AssetID = UUID.Random();
item1.GroupID = UUID.Random(); item1.GroupID = UUID.Random();
item1.CreatorId = OspResolver.MakeOspa(user2FirstName, user2LastName); item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName);
//item1.CreatorId = userUuid.ToString(); //item1.CreatorId = userUuid.ToString();
//item1.CreatorId = "00000000-0000-0000-0000-000000000444"; //item1.CreatorId = "00000000-0000-0000-0000-000000000444";
item1.Owner = UUID.Zero; item1.Owner = UUID.Zero;
@ -249,13 +249,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
userAdminService.AddUser( userAdminService.AddUser(
userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid);
userAdminService.AddUser( userAdminService.AddUser(
user2FirstName, user2LastName, "hampshire", String.Empty, 1000, 1000, user2Uuid); userItemCreatorFirstName, userItemCreatorLastName, "hampshire",
String.Empty, 1000, 1000, userItemCreatorUuid);
archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream);
CachedUserInfo userInfo CachedUserInfo userInfo
= scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
userInfo.FetchInventory(); //userInfo.FetchInventory();
/*
for (int i = 0 ; i < 50 ; i++) for (int i = 0 ; i < 50 ; i++)
{ {
if (userInfo.HasReceivedInventory == true) if (userInfo.HasReceivedInventory == true)
@ -263,18 +265,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Thread.Sleep(200); Thread.Sleep(200);
} }
Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); 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(
foundItem.CreatorId, Is.EqualTo(item1.CreatorId), foundItem.CreatorId, Is.EqualTo(item1.CreatorId),
"Loaded item non-uuid creator doesn't match original"); "Loaded item non-uuid creator doesn't match original");
Assert.That( Assert.That(
foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid), foundItem.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
"Loaded item uuid creator doesn't match original"); "Loaded item uuid creator doesn't match original");
Assert.That(foundItem.Owner, Is.EqualTo(userUuid), Assert.That(foundItem.Owner, Is.EqualTo(userUuid),
"Loaded item owner doesn't match inventory reciever"); "Loaded item owner doesn't match inventory reciever");
Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod());
} }
/// <summary> /// <summary>

View File

@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common
public static void InMethod() public static void InMethod()
{ {
StackTrace stackTrace = new StackTrace(); StackTrace stackTrace = new StackTrace();
Console.WriteLine("==> In Test Method : {0}", stackTrace.GetFrame(1).GetMethod().Name); Console.WriteLine("===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name);
} }
} }
} }