-/*\r
- * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.openflowjava.protocol.impl.deserialization;\r
-\r
-import static org.junit.Assert.assertEquals;\r
-import io.netty.buffer.ByteBuf;\r
-import io.netty.buffer.PooledByteBufAllocator;\r
-\r
-import org.junit.Test;\r
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class DeserializationFactoryTest {\r
-\r
- /**\r
- * Test deserializer lookup & deserialization\r
- */\r
- @Test\r
- public void test() {\r
- DeserializerRegistryImpl registry = new DeserializerRegistryImpl();\r
- registry.init();\r
- DeserializationFactory factory = new DeserializationFactory();\r
- factory.setRegistry(registry);\r
- ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();\r
- buffer.writeByte(0);\r
- buffer.writeShort(EncodeConstants.OFHEADER_SIZE);\r
- buffer.writeInt(1234);\r
- factory.deserialize(buffer, EncodeConstants.OF13_VERSION_ID);\r
- assertEquals("Deserialization failed", 0, buffer.readableBytes());\r
- }\r
-\r
- /**\r
- * Test deserializer lookup & deserialization\r
- */\r
- @Test(expected=NullPointerException.class)\r
- public void testNotExistingDeserializer() {\r
- DeserializerRegistryImpl registry = new DeserializerRegistryImpl();\r
- registry.init();\r
- DeserializationFactory factory = new DeserializationFactory();\r
- factory.setRegistry(registry);\r
- ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();\r
- buffer.writeByte(0);\r
- buffer.writeShort(EncodeConstants.OFHEADER_SIZE);\r
- buffer.writeInt(1234);\r
- factory.deserialize(buffer, (short) 0);\r
- }\r
+/*
+ * 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