From efcf6ff095c55fdcb6870eeb544c53ff964a501a Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 12 Jan 2009 20:42:44 +0000 Subject: * 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 --- .../ClientStack/LindenUDP/Tests/PacketHandlerTests.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs index ac5175c..62e6e96 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs @@ -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 /// /// More a placeholder, really /// - 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))); } /// -- cgit v1.1