Search in sources :

Example 1 with PacketProcessorFactory

use of org.webpieces.nio.api.libs.PacketProcessorFactory in project webpieces by deanhiller.

the class TestUnpacketizer method setUpImpl.

//--------------------------------------------------------------------
//	BUSINESS METHODS
//--------------------------------------------------------------------
protected void setUpImpl() {
    listener = createMock(PacketListener.class);
    listener.setDefaultBehavior("incomingPacket", new CloneByteBuffer());
    Map<String, Object> p = new HashMap<String, Object>();
    p.put(FactoryCreator.KEY_PACKET_SEPARATOR, PACKET_SEPARATOR);
    FactoryCreator creator = FactoryCreator.createFactory(null);
    PacketProcessorFactory factory = creator.createPacketProcFactory(p);
    unpacketizer = factory.createPacketProcessor("someId");
    helper = ChannelServiceFactory.bufferHelper(null);
    unpacketizer.setPacketListener((PacketListener) listener);
}
Also used : HashMap(java.util.HashMap) CloneByteBuffer(org.webpieces.nio.api.testutil.CloneByteBuffer) FactoryCreator(org.webpieces.nio.api.libs.FactoryCreator) PacketProcessorFactory(org.webpieces.nio.api.libs.PacketProcessorFactory) MockObject(biz.xsoftware.mock.MockObject) PacketListener(org.webpieces.nio.api.libs.PacketListener)

Aggregations

MockObject (biz.xsoftware.mock.MockObject)1 HashMap (java.util.HashMap)1 FactoryCreator (org.webpieces.nio.api.libs.FactoryCreator)1 PacketListener (org.webpieces.nio.api.libs.PacketListener)1 PacketProcessorFactory (org.webpieces.nio.api.libs.PacketProcessorFactory)1 CloneByteBuffer (org.webpieces.nio.api.testutil.CloneByteBuffer)1