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>
|
||||
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);
|
||||
if (account != null)
|
||||
return MakeOspa(account.FirstName, account.LastName);
|
||||
|
|
|
@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
{
|
||||
item.CreatorIdAsUuid = m_userInfo.PrincipalID;
|
||||
}
|
||||
|
||||
|
||||
item.Owner = m_userInfo.PrincipalID;
|
||||
|
||||
// Reset folder ID to the one in which we want to load it
|
||||
|
|
|
@ -254,14 +254,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
if (m_scenes.Count > 0)
|
||||
{
|
||||
UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
|
||||
|
||||
|
||||
if (userInfo != null)
|
||||
{
|
||||
if (CheckPresence(userInfo.PrincipalID))
|
||||
{
|
||||
|
||||
InventoryArchiveReadRequest request;
|
||||
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge);
|
||||
|
@ -275,7 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
UpdateClientWithLoadedNodes(userInfo, request.Execute());
|
||||
|
||||
return true;
|
||||
|
@ -287,6 +288,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
|
||||
}
|
||||
}
|
||||
else
|
||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found",
|
||||
firstName, lastName);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -95,14 +95,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
item1.Name = m_item1Name;
|
||||
item1.AssetID = 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 = "00000000-0000-0000-0000-000000000444";
|
||||
item1.CreatorId = m_ua2.PrincipalID.ToString();
|
||||
item1.Owner = UUID.Zero;
|
||||
|
||||
|
||||
Scene scene = SceneSetupHelpers.SetupScene("Inventory");
|
||||
UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire");
|
||||
|
||||
string item1FileName
|
||||
= 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();
|
||||
m_iarStream = new MemoryStream(archiveWriteStream.ToArray());
|
||||
}
|
||||
|
@ -385,7 +388,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
Scene scene = SceneSetupHelpers.SetupScene("inventory");
|
||||
|
||||
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||
|
||||
|
||||
UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood");
|
||||
UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire");
|
||||
|
||||
|
|
Loading…
Reference in New Issue