X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2FDeserializationFactoryTest.java;h=965e299b1d1a18e29e814420a9ab4803ac9eb092;hb=519a86d1ddcfb8f0fe264174e62e5424e1efba1f;hp=d456332b55eee37f35246b63c878a1c2870e2340;hpb=c9950b8dde27511f46a38130000a843248ffa02f;p=openflowjava.git diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializationFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializationFactoryTest.java index d456332b..965e299b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializationFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializationFactoryTest.java @@ -1,56 +1,56 @@ -/* - * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.openflowjava.protocol.impl.deserialization; - -import static org.junit.Assert.assertEquals; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.PooledByteBufAllocator; - -import org.junit.Test; -import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; - -/** - * @author michal.polkorab - * - */ -public class DeserializationFactoryTest { - - /** - * Test deserializer lookup & deserialization - */ - @Test - public void test() { - DeserializerRegistryImpl registry = new DeserializerRegistryImpl(); - registry.init(); - DeserializationFactory factory = new DeserializationFactory(); - factory.setRegistry(registry); - ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); - buffer.writeByte(0); - buffer.writeShort(EncodeConstants.OFHEADER_SIZE); - buffer.writeInt(1234); - factory.deserialize(buffer, EncodeConstants.OF13_VERSION_ID); - assertEquals("Deserialization failed", 0, buffer.readableBytes()); - } - - /** - * Test deserializer lookup & deserialization - */ - @Test(expected=NullPointerException.class) - public void testNotExistingDeserializer() { - DeserializerRegistryImpl registry = new DeserializerRegistryImpl(); - registry.init(); - DeserializationFactory factory = new DeserializationFactory(); - factory.setRegistry(registry); - ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); - buffer.writeByte(0); - buffer.writeShort(EncodeConstants.OFHEADER_SIZE); - buffer.writeInt(1234); - factory.deserialize(buffer, (short) 0); - } +/* + * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.openflowjava.protocol.impl.deserialization; + +import static org.junit.Assert.assertEquals; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.PooledByteBufAllocator; + +import org.junit.Test; +import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; + +/** + * @author michal.polkorab + * + */ +public class DeserializationFactoryTest { + + /** + * Test deserializer lookup & deserialization + */ + @Test + public void test() { + DeserializerRegistryImpl registry = new DeserializerRegistryImpl(); + registry.init(); + DeserializationFactory factory = new DeserializationFactory(); + factory.setRegistry(registry); + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); + buffer.writeByte(0); + buffer.writeShort(EncodeConstants.OFHEADER_SIZE); + buffer.writeInt(1234); + factory.deserialize(buffer, EncodeConstants.OF13_VERSION_ID); + assertEquals("Deserialization failed", 0, buffer.readableBytes()); + } + + /** + * Test deserializer lookup & deserialization + */ + @Test(expected=NullPointerException.class) + public void testNotExistingDeserializer() { + DeserializerRegistryImpl registry = new DeserializerRegistryImpl(); + registry.init(); + DeserializationFactory factory = new DeserializationFactory(); + factory.setRegistry(registry); + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); + buffer.writeByte(0); + buffer.writeShort(EncodeConstants.OFHEADER_SIZE); + buffer.writeInt(1234); + factory.deserialize(buffer, (short) 0); + } } \ No newline at end of file