* Extend current stub packet handler test into a really basic one that checks that a sent in packet ends up on the client queue ready for processing

0.6.2-post-fixes
Justin Clarke Casey 2009-01-12 20:42:44 +00:00
parent c00c855cc5
commit efcf6ff095
1 changed files with 10 additions and 3 deletions

View File

@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Threading;
using Nini.Config;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
@ -46,7 +47,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
/// <summary>
/// More a placeholder, really
/// </summary>
public void DummyTest()
public void InPacketTest()
{
AgentCircuitData agent = new AgentCircuitData();
agent.AgentID = UUID.Random();
@ -65,11 +66,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
AgentCircuitManager acm;
SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm);
TestClient testClient = new TestClient(agent);
ILLPacketHandler packetHandler
= new LLPacketHandler(new TestClient(agent), testLLPacketServer, new ClientStackUserSettings());
= new LLPacketHandler(testClient, testLLPacketServer, new ClientStackUserSettings());
packetHandler.InPacket(new AgentAnimationPacket());
//Assert.That(Is.Not.Null(packetHandler.PacketQueue.Dequeue()));
LLQueItem receivedPacket = packetHandler.PacketQueue.Dequeue();
Assert.That(receivedPacket, Is.Not.Null);
Assert.That(receivedPacket.Incoming, Is.True);
Assert.That(receivedPacket.Packet, Is.TypeOf(typeof(AgentAnimationPacket)));
}
/// <summary>