From ad1dea5affe24674ada19b801cab423f667f7979 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 10 Mar 2011 22:56:11 +0000
Subject: Add test for simple case where creator account with appropriate uuid
 exists on the target system for an iar load

---
 .../Archiver/Tests/InventoryArchiverTests.cs       | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index c7aad5e..7f156f8 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -179,6 +179,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
         }
         
         /// <summary>
+        /// Test case where a creator account exists for the creator UUID embedded in item metadata and serialized
+        /// objects.
+        /// </summary>        
+        [Test]
+        public void TestLoadIarCreatorAccountPresent()
+        {
+            TestHelper.InMethod();
+//            log4net.Config.XmlConfigurator.Configure();
+
+            UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
+            
+            m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream);            
+            InventoryItemBase foundItem1
+                = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name);
+
+            Assert.That(
+                foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()), 
+                "Loaded item non-uuid creator doesn't match original");            
+            Assert.That(
+                foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID), 
+                "Loaded item uuid creator doesn't match original");
+            Assert.That(foundItem1.Owner, Is.EqualTo(m_uaLL1.PrincipalID),
+                "Loaded item owner doesn't match inventory reciever");
+            
+            AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString());            
+            string xmlData = Utils.BytesToString(asset1.Data);
+            SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
+            
+            Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID));            
+        }
+        
+        /// <summary>
         /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
         /// an account exists with the same name as the creator, though not the same id.
         /// </summary>
-- 
cgit v1.1