29 using System.Collections.Generic;
31 using System.Reflection;
32 using System.Threading;
33 using NUnit.Framework;
36 using OpenSim.Framework;
37 using OpenSim.Framework.Serialization;
38 using OpenSim.Framework.Serialization.External;
39 using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
40 using OpenSim.Region.CoreModules.World.Serialiser;
41 using OpenSim.Region.Framework.Scenes;
42 using OpenSim.Region.Framework.Scenes.Serialization;
43 using OpenSim.Services.Interfaces;
44 using OpenSim.Tests.Common;
46 namespace OpenSim.
Region.CoreModules.
Avatar.Inventory.Archiver.Tests
51 protected ManualResetEvent mre =
new ManualResetEvent(
false);
65 PrincipalID = UUID.Parse(
"00000000-0000-0000-0000-000000000555"),
67 LastName =
"Tiddles" };
71 PrincipalID = UUID.Parse(
"00000000-0000-0000-0000-000000000666"),
77 PrincipalID = UUID.Parse(
"00000000-0000-0000-0000-000000000777"),
81 protected string m_item1Name =
"Ray Gun Item";
82 protected string m_coaItemName =
"Coalesced Item";
88 Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
90 ConstructDefaultIarBytesForTestLoad();
99 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
106 m_iarStream =
new MemoryStream(m_iarStreamBytes);
115 SceneHelpers.SetupSceneModules(scene, archiverModule);
117 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1,
"hampshire");
119 MemoryStream archiveWriteStream =
new MemoryStream();
122 UUID ownerId = UUID.Parse(
"00000000-0000-0000-0000-000000000040");
123 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId,
"Ray Gun Object", 0x50);
125 UUID asset1Id = UUID.Parse(
"00000000-0000-0000-0000-000000000060");
126 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
127 scene.AssetService.Store(asset1);
131 item1.Name = m_item1Name;
132 item1.ID = UUID.Parse(
"00000000-0000-0000-0000-000000000020");
133 item1.AssetID = asset1.FullID;
134 item1.GroupID = UUID.Random();
135 item1.CreatorId = m_uaLL1.PrincipalID.ToString();
136 item1.Owner = m_uaLL1.PrincipalID;
137 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
138 scene.AddInventoryItem(item1);
141 SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID,
"Object1", 0x120);
142 cobj1.AbsolutePosition =
new Vector3(15, 30, 45);
144 SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID,
"Object2", 0x140);
145 cobj2.AbsolutePosition =
new Vector3(25, 50, 75);
149 AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa);
150 scene.AssetService.Store(coaAsset);
154 coaItem.Name = m_coaItemName;
155 coaItem.ID = UUID.Parse(
"00000000-0000-0000-0000-000000000180");
156 coaItem.AssetID = coaAsset.FullID;
157 coaItem.GroupID = UUID.Random();
158 coaItem.CreatorId = m_uaLL1.PrincipalID.ToString();
159 coaItem.Owner = m_uaLL1.PrincipalID;
160 coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
161 scene.AddInventoryItem(coaItem);
163 archiverModule.ArchiveInventory(
164 UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName,
"/*",
"hampshire", archiveWriteStream);
166 m_iarStreamBytes = archiveWriteStream.ToArray();
170 UUID
id,
bool succeeded,
UserAccount userInfo,
string invPath, Stream saveStream,
171 Exception reportedException,
int SaveCount,
int FilterCount)
void SaveCompleted(UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException, int SaveCount, int FilterCount)
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
MemoryStream m_iarStream
Stream of data representing a common IAR for load tests.
Asset class. All Assets are reference by this class or a class derived from this class ...
This module loads and saves OpenSimulator inventory archives
void ConstructDefaultIarBytesForTestLoad()
byte[] m_iarStreamBytes
A raw array of bytes that we'll use to create an IAR memory stream suitable for isolated use in each ...
Inventory Item - contains all the properties associated with an individual inventory piece...
Helpers for setting up scenes.
Represents a coalescene of scene objects. A coalescence occurs when objects that are not in the same ...