aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-10 22:52:41 +0000
committerJustin Clark-Casey (justincc)2011-03-10 22:52:41 +0000
commit8d69e6831136fea089ed0ca04249bf65ba66db28 (patch)
tree04f40869f27893d344aa6ba21d375f90499da1b1 /OpenSim/Region/CoreModules
parentfactor out common scene setup code in InventoryArchiveTestCase (diff)
downloadopensim-SC-8d69e6831136fea089ed0ca04249bf65ba66db28.zip
opensim-SC-8d69e6831136fea089ed0ca04249bf65ba66db28.tar.gz
opensim-SC-8d69e6831136fea089ed0ca04249bf65ba66db28.tar.bz2
opensim-SC-8d69e6831136fea089ed0ca04249bf65ba66db28.tar.xz
refactor: rename test user account fields
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs16
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs28
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs26
3 files changed, 35 insertions, 35 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 31e6d75..e5127a0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -63,17 +63,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
63 /// </summary> 63 /// </summary>
64 protected MemoryStream m_iarStream; 64 protected MemoryStream m_iarStream;
65 65
66 protected UserAccount m_ua1 66 protected UserAccount m_uaMT
67 = new UserAccount { 67 = new UserAccount {
68 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), 68 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"),
69 FirstName = "Mr", 69 FirstName = "Mr",
70 LastName = "Tiddles" }; 70 LastName = "Tiddles" };
71 protected UserAccount m_ua2 71 protected UserAccount m_uaLL1
72 = new UserAccount { 72 = new UserAccount {
73 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), 73 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"),
74 FirstName = "Lord", 74 FirstName = "Lord",
75 LastName = "Lucan" }; 75 LastName = "Lucan" };
76 protected UserAccount m_ua3 76 protected UserAccount m_uaLL2
77 = new UserAccount { 77 = new UserAccount {
78 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), 78 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"),
79 FirstName = "Lord", 79 FirstName = "Lord",
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
100 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 100 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
101 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 101 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
102 102
103 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); 103 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
104 104
105 MemoryStream archiveWriteStream = new MemoryStream(); 105 MemoryStream archiveWriteStream = new MemoryStream();
106 106
@@ -134,13 +134,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
134 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); 134 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020");
135 item1.AssetID = asset1.FullID; 135 item1.AssetID = asset1.FullID;
136 item1.GroupID = UUID.Random(); 136 item1.GroupID = UUID.Random();
137 item1.CreatorIdAsUuid = m_ua2.PrincipalID; 137 item1.CreatorIdAsUuid = m_uaLL1.PrincipalID;
138 item1.Owner = m_ua2.PrincipalID; 138 item1.Owner = m_uaLL1.PrincipalID;
139 item1.Folder = scene.InventoryService.GetRootFolder(m_ua2.PrincipalID).ID; 139 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
140 scene.AddInventoryItem(item1); 140 scene.AddInventoryItem(item1);
141 141
142 archiverModule.ArchiveInventory( 142 archiverModule.ArchiveInventory(
143 Guid.NewGuid(), m_ua2.FirstName, m_ua2.LastName, m_item1Name, "hampshire", archiveWriteStream); 143 Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, m_item1Name, "hampshire", archiveWriteStream);
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 79b4777..c7aad5e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -188,27 +188,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
188 TestHelper.InMethod(); 188 TestHelper.InMethod();
189// log4net.Config.XmlConfigurator.Configure(); 189// log4net.Config.XmlConfigurator.Configure();
190 190
191 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_ua1, "meowfood"); 191 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
192 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_ua3, "hampshire"); 192 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire");
193 193
194 m_archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); 194 m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
195 InventoryItemBase foundItem1 195 InventoryItemBase foundItem1
196 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_ua1.PrincipalID, m_item1Name); 196 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name);
197 197
198 Assert.That( 198 Assert.That(
199 foundItem1.CreatorId, Is.EqualTo(m_ua3.PrincipalID.ToString()), 199 foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()),
200 "Loaded item non-uuid creator doesn't match original"); 200 "Loaded item non-uuid creator doesn't match original");
201 Assert.That( 201 Assert.That(
202 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_ua3.PrincipalID), 202 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID),
203 "Loaded item uuid creator doesn't match original"); 203 "Loaded item uuid creator doesn't match original");
204 Assert.That(foundItem1.Owner, Is.EqualTo(m_ua1.PrincipalID), 204 Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID),
205 "Loaded item owner doesn't match inventory reciever"); 205 "Loaded item owner doesn't match inventory reciever");
206 206
207 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); 207 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString());
208 string xmlData = Utils.BytesToString(asset1.Data); 208 string xmlData = Utils.BytesToString(asset1.Data);
209 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 209 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
210 210
211 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_ua3.PrincipalID)); 211 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID));
212 } 212 }
213 213
214 /// <summary> 214 /// <summary>
@@ -221,25 +221,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
221 TestHelper.InMethod(); 221 TestHelper.InMethod();
222// log4net.Config.XmlConfigurator.Configure(); 222// log4net.Config.XmlConfigurator.Configure();
223 223
224 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_ua1, "password"); 224 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaMT, "password");
225 m_archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "password", m_iarStream); 225 m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream);
226 226
227 InventoryItemBase foundItem1 227 InventoryItemBase foundItem1
228 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_ua1.PrincipalID, m_item1Name); 228 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name);
229 229
230 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 230 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
231 Assert.That( 231 Assert.That(
232 foundItem1.CreatorId, Is.EqualTo(m_ua1.PrincipalID.ToString()), 232 foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()),
233 "Loaded item non-uuid creator doesn't match that of the loading user"); 233 "Loaded item non-uuid creator doesn't match that of the loading user");
234 Assert.That( 234 Assert.That(
235 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_ua1.PrincipalID), 235 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID),
236 "Loaded item uuid creator doesn't match that of the loading user"); 236 "Loaded item uuid creator doesn't match that of the loading user");
237 237
238 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); 238 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString());
239 string xmlData = Utils.BytesToString(asset1.Data); 239 string xmlData = Utils.BytesToString(asset1.Data);
240 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 240 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
241 241
242 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_ua1.PrincipalID)); 242 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID));
243 } 243 }
244 } 244 }
245} \ No newline at end of file 245} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 66c19f4..0e8f647 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -184,31 +184,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
184 184
185 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 185 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
186 186
187 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood"); 187 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "meowfood");
188 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); 188 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
189 189
190 archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); 190 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
191 InventoryItemBase foundItem1 191 InventoryItemBase foundItem1
192 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, m_item1Name); 192 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name);
193 193
194 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 194 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
195 195
196 // Now try loading to a root child folder 196 // Now try loading to a root child folder
197 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xA"); 197 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA");
198 MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray()); 198 MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray());
199 archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xA", "meowfood", archiveReadStream); 199 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xA", "meowfood", archiveReadStream);
200 200
201 InventoryItemBase foundItem2 201 InventoryItemBase foundItem2
202 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xA/" + m_item1Name); 202 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xA/" + m_item1Name);
203 Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); 203 Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
204 204
205 // Now try loading to a more deeply nested folder 205 // Now try loading to a more deeply nested folder
206 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xB/xC"); 206 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC");
207 archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); 207 archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
208 archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xB/xC", "meowfood", archiveReadStream); 208 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xB/xC", "meowfood", archiveReadStream);
209 209
210 InventoryItemBase foundItem3 210 InventoryItemBase foundItem3
211 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xB/xC/" + m_item1Name); 211 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name);
212 Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); 212 Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
213 } 213 }
214 214
@@ -226,12 +226,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
226 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 226 Scene scene = SceneSetupHelpers.SetupScene("inventory");
227 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 227 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
228 228
229 UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "password"); 229 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password");
230 archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/Objects", "password", m_iarStream); 230 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
231 231
232 InventoryItemBase foundItem1 232 InventoryItemBase foundItem1
233 = InventoryArchiveUtils.FindItemByPath( 233 = InventoryArchiveUtils.FindItemByPath(
234 scene.InventoryService, m_ua1.PrincipalID, "/Objects/" + m_item1Name); 234 scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name);
235 235
236 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); 236 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()");
237 } 237 }