Fix unit test.
parent
f86c438653
commit
49b59fffee
|
@ -57,6 +57,12 @@ namespace OpenSim.Framework.Serialization
|
||||||
/// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns>
|
/// <returns>The OSPA. Null if a user with the given UUID could not be found.</returns>
|
||||||
public static string MakeOspa(UUID userId, IUserAccountService userService)
|
public static string MakeOspa(UUID userId, IUserAccountService userService)
|
||||||
{
|
{
|
||||||
|
if (userService == null)
|
||||||
|
{
|
||||||
|
m_log.Warn("[OSP RESOLVER]: UserService is null");
|
||||||
|
return userId.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
UserAccount account = userService.GetUserAccount(UUID.Zero, userId);
|
UserAccount account = userService.GetUserAccount(UUID.Zero, userId);
|
||||||
if (account != null)
|
if (account != null)
|
||||||
return MakeOspa(account.FirstName, account.LastName);
|
return MakeOspa(account.FirstName, account.LastName);
|
||||||
|
|
|
@ -259,6 +259,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
{
|
{
|
||||||
if (CheckPresence(userInfo.PrincipalID))
|
if (CheckPresence(userInfo.PrincipalID))
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryArchiveReadRequest request;
|
InventoryArchiveReadRequest request;
|
||||||
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
|
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
|
||||||
|
|
||||||
|
@ -287,6 +288,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
|
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found",
|
||||||
|
firstName, lastName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -95,14 +95,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
item1.Name = m_item1Name;
|
item1.Name = m_item1Name;
|
||||||
item1.AssetID = UUID.Random();
|
item1.AssetID = UUID.Random();
|
||||||
item1.GroupID = UUID.Random();
|
item1.GroupID = UUID.Random();
|
||||||
item1.CreatorId = OspResolver.MakeOspa(m_ua2.FirstName, m_ua2.LastName);
|
//item1.CreatorId = OspResolver.MakeOspa(m_ua2.FirstName, m_ua2.LastName);
|
||||||
//item1.CreatorId = userUuid.ToString();
|
//item1.CreatorId = userUuid.ToString();
|
||||||
//item1.CreatorId = "00000000-0000-0000-0000-000000000444";
|
item1.CreatorId = m_ua2.PrincipalID.ToString();
|
||||||
item1.Owner = UUID.Zero;
|
item1.Owner = UUID.Zero;
|
||||||
|
|
||||||
|
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
|
||||||
|
UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire");
|
||||||
|
|
||||||
string item1FileName
|
string item1FileName
|
||||||
= string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
|
= string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName);
|
||||||
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1, new Dictionary<string, object>(), null));
|
tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1, new Dictionary<string, object>(), scene.UserAccountService));
|
||||||
tar.Close();
|
tar.Close();
|
||||||
m_iarStream = new MemoryStream(archiveWriteStream.ToArray());
|
m_iarStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue