aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-10 19:40:19 +0000
committerJustin Clark-Casey (justincc)2011-03-10 19:40:19 +0000
commita151afebe3348ad05db3d78074e3eaf99dc06afe (patch)
treedff7165e6f189f9c53902312dd6d295864155cad
parentChange existing users load iar test so that it fulfills it's original intenti... (diff)
downloadopensim-SC_OLD-a151afebe3348ad05db3d78074e3eaf99dc06afe.zip
opensim-SC_OLD-a151afebe3348ad05db3d78074e3eaf99dc06afe.tar.gz
opensim-SC_OLD-a151afebe3348ad05db3d78074e3eaf99dc06afe.tar.bz2
opensim-SC_OLD-a151afebe3348ad05db3d78074e3eaf99dc06afe.tar.xz
When setting up default iar for testing, use iar archiving code rather than constructing the tar manually
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs20
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs4
3 files changed, 17 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index dcafc49..d77bff2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -96,11 +96,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
96 { 96 {
97// log4net.Config.XmlConfigurator.Configure(); 97// log4net.Config.XmlConfigurator.Configure();
98 98
99 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
99 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 100 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
101 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
102
100 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); 103 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire");
101 104
102 MemoryStream archiveWriteStream = new MemoryStream(); 105 MemoryStream archiveWriteStream = new MemoryStream();
103 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
104 106
105 // Create asset 107 // Create asset
106 SceneObjectGroup object1; 108 SceneObjectGroup object1;
@@ -129,18 +131,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
129 // Create item 131 // Create item
130 InventoryItemBase item1 = new InventoryItemBase(); 132 InventoryItemBase item1 = new InventoryItemBase();
131 item1.Name = m_item1Name; 133 item1.Name = m_item1Name;
134 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020");
132 item1.AssetID = asset1.FullID; 135 item1.AssetID = asset1.FullID;
133 item1.GroupID = UUID.Random(); 136 item1.GroupID = UUID.Random();
134 item1.CreatorIdAsUuid = m_ua2.PrincipalID; 137 item1.CreatorIdAsUuid = m_ua2.PrincipalID;
135 item1.Owner = UUID.Zero; 138 item1.Owner = m_ua2.PrincipalID;
136 139 item1.Folder = scene.InventoryService.GetRootFolder(m_ua2.PrincipalID).ID;
137 string archiveItem1Name = InventoryArchiveWriteRequest.CreateArchiveItemName(m_item1Name, UUID.Random()); 140 scene.AddInventoryItem(item1);
138 string archiveItem1Path = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItem1Name); 141
139 tar.WriteFile( 142 archiverModule.ArchiveInventory(
140 archiveItem1Path, 143 Guid.NewGuid(), m_ua2.FirstName, m_ua2.LastName, m_item1Name, "hampshire", archiveWriteStream);
141 UserInventoryItemSerializer.Serialize(
142 item1, new Dictionary<string, object>(), scene.UserAccountService));
143 tar.Close();
144 144
145 m_iarStreamBytes = archiveWriteStream.ToArray(); 145 m_iarStreamBytes = archiveWriteStream.ToArray();
146 } 146 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index b52014b..3eb4104 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -206,6 +206,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
206 "Loaded item uuid creator doesn't match original"); 206 "Loaded item uuid creator doesn't match original");
207 Assert.That(foundItem1.Owner, Is.EqualTo(m_ua1.PrincipalID), 207 Assert.That(foundItem1.Owner, Is.EqualTo(m_ua1.PrincipalID),
208 "Loaded item owner doesn't match inventory reciever"); 208 "Loaded item owner doesn't match inventory reciever");
209
210// AssetBase asset1 = scene.AssetService.Get(foundItem1.AssetID.ToString());
211// string xmlData = Utils.BytesToString(asset1.Data);
212// SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
213//
214// Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_ua3.PrincipalID.ToString()));
209 } 215 }
210 216
211 /// <summary> 217 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 1220a70..66c19f4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -84,9 +84,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
84 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); 84 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
85 Vector3 offsetPosition = new Vector3(5, 10, 15); 85 Vector3 offsetPosition = new Vector3(5, 10, 15);
86 86
87 part1 87 part1 = new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition);
88 = new SceneObjectPart(
89 ownerId, shape, groupPosition, rotationOffset, offsetPosition);
90 part1.Name = partName; 88 part1.Name = partName;
91 89
92 object1 = new SceneObjectGroup(part1); 90 object1 = new SceneObjectGroup(part1);