31 using System.Reflection;
32 using System.Threading;
35 using NUnit.Framework;
37 using OpenMetaverse.Packets;
38 using OpenSim.Framework;
39 using OpenSim.Region.CoreModules.Agent.TextureSender;
40 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Tests.Common;
43 namespace OpenSim.
Region.ClientStack.LindenUDP.Tests
57 Util.FireAndForgetMethod = FireAndForgetMethod.None;
61 = GetType().Assembly.GetManifestResourceStream(
62 "OpenSim.Region.ClientStack.LindenUDP.Tests.Resources.4-tile2.jp2"))
64 using (BinaryReader br =
new BinaryReader(resource))
70 (sbyte)AssetType.Texture,
73 m_testImageAsset.Data = br.ReadBytes(99999999);
83 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
91 UUID userId = TestHelpers.ParseTail(0x3);
96 scene = sceneHelpers.SetupScene();
97 SceneHelpers.SetupSceneModules(scene, j2kdm);
106 TestHelpers.InMethod();
109 scene.AssetService.Store(m_testImageAsset);
112 args.RequestedAssetID = m_testImageAsset.FullID;
113 args.DiscardLevel = 0;
114 args.PacketNumber = 1;
116 args.requestSequence = 1;
118 llim.EnqueueReq(args);
119 llim.ProcessImageQueue(20);
121 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(1));
127 TestHelpers.InMethod();
130 scene.AssetService.Store(m_testImageAsset);
133 args.RequestedAssetID = m_testImageAsset.FullID;
134 args.DiscardLevel = 0;
135 args.PacketNumber = 1;
137 args.requestSequence = 1;
138 llim.EnqueueReq(args);
142 discardArgs.RequestedAssetID = m_testImageAsset.FullID;
143 discardArgs.DiscardLevel = -1;
144 discardArgs.PacketNumber = 1;
145 discardArgs.Priority = 0;
146 discardArgs.requestSequence = 2;
147 llim.EnqueueReq(discardArgs);
149 llim.ProcessImageQueue(20);
151 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0));
157 TestHelpers.InMethod();
161 args.RequestedAssetID = m_testImageAsset.FullID;
162 args.DiscardLevel = 0;
163 args.PacketNumber = 1;
165 args.requestSequence = 1;
167 llim.EnqueueReq(args);
168 llim.ProcessImageQueue(20);
170 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0));
171 Assert.That(tc.SentImageNotInDatabasePackets.Count, Is.EqualTo(1));
Asset class. All Assets are reference by this class or a class derived from this class ...
static UUID ParseTail(int tail)
Parse tail section into full UUID.
static AgentCircuitData GenerateAgentData(UUID agentId)
Generate some standard agent connection data.
Helpers for setting up scenes.
This class handles UDP texture requests.