Package org.openflow.protocol.factory

Examples of org.openflow.protocol.factory.BasicFactory.parseMessage()


        m.setXid(0xdeadbeef);
        ChannelBuffer bb = ChannelBuffers.dynamicBuffer();
        ChannelBuffer bb2 = ChannelBuffers.dynamicBuffer();
        m.writeTo(bb);
        bb2.writeBytes(bb, bb.readableBytes()-1);
        TestCase.assertNull(factory.parseMessage(bb2));
        bb2.writeByte(bb.readByte());
        List<OFMessage> message = factory.parseMessage(bb2);
        TestCase.assertNotNull(message);
        TestCase.assertEquals(message.size(), 1);
        TestCase.assertTrue(message.get(0).getType() == OFType.ECHO_REQUEST);
View Full Code Here


        ChannelBuffer bb2 = ChannelBuffers.dynamicBuffer();
        m.writeTo(bb);
        bb2.writeBytes(bb, bb.readableBytes()-1);
        TestCase.assertNull(factory.parseMessage(bb2));
        bb2.writeByte(bb.readByte());
        List<OFMessage> message = factory.parseMessage(bb2);
        TestCase.assertNotNull(message);
        TestCase.assertEquals(message.size(), 1);
        TestCase.assertTrue(message.get(0).getType() == OFType.ECHO_REQUEST);
    }
View Full Code Here

        m.setType(OFType.ECHO_REQUEST);
        m.setLength(U16.t(16));
        m.setXid(0xdeadbeef);
        ChannelBuffer bb = ChannelBuffers.dynamicBuffer();
        m.writeTo(bb);
        List<OFMessage> message = factory.parseMessage(bb);
        TestCase.assertNull(message);
    }

    public void testCurrouptedMsgParse() throws MessageParseException {
        BasicFactory factory = BasicFactory.getInstance();
View Full Code Here

        m.setLength(U16.t(8));
        m.setXid(0xdeadbeef);
        ChannelBuffer bb = ChannelBuffers.dynamicBuffer();
        m.writeTo(bb);
        try {
                factory.parseMessage(bb);
        }
        catch(Exception e) {
            TestCase.assertEquals(MessageParseException.class, e.getClass());
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.