Copyright update
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / OF10VendorInputMessageFactoryTest.java
index 360b33e27de844814e9f1678e476aa08fe435c0c..540801a9748c7063793333b8463277b649ad14d3 100644 (file)
@@ -1,43 +1,50 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.opendaylight.openflowjava.protocol.impl.serialization.factories;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-import io.netty.buffer.UnpooledByteBufAllocator;\r
-\r
-import org.junit.Assert;\r
-import org.junit.Test;\r
-import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
-import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class OF10VendorInputMessageFactoryTest {\r
-\r
-    /**\r
-     * Testing of {@link OF10VendorInputMessageFactory} for correct translation from POJO\r
-     * @throws Exception \r
-     */\r
-    @Test\r
-    public void test() throws Exception {\r
-        ExperimenterInputBuilder builder = new ExperimenterInputBuilder();\r
-        BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);\r
-        builder.setExperimenter(0x0001020304L);\r
-        builder.setData(new byte[] {0x01, 0x02, 0x03, 0x04});\r
-        ExperimenterInput message = builder.build();\r
-        \r
-        ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();\r
-        OF10VendorInputMessageFactory factory = OF10VendorInputMessageFactory.getInstance();\r
-        factory.messageToBuffer(EncodeConstants.OF10_VERSION_ID, out, message);\r
-        \r
-        BufferHelper.checkHeaderV10(out, (byte) 4, factory.computeLength(message));\r
-        Assert.assertEquals("Wrong experimenter", 0x0001020304L, out.readUnsignedInt());\r
-        byte[] data = new byte[4];\r
-        out.readBytes(data);\r
-        Assert.assertArrayEquals("Wrong data", message.getData(), data);\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 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.serialization.factories;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.UnpooledByteBufAllocator;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class OF10VendorInputMessageFactoryTest {
+
+    /**
+     * Testing of {@link OF10VendorInputMessageFactory} for correct translation from POJO
+     * @throws Exception 
+     */
+    @Test
+    public void test() throws Exception {
+        ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
+        BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
+        builder.setExperimenter(0x0001020304L);
+        builder.setData(new byte[] {0x01, 0x02, 0x03, 0x04});
+        ExperimenterInput message = builder.build();
+        
+        ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
+        OF10VendorInputMessageFactory factory = OF10VendorInputMessageFactory.getInstance();
+        factory.messageToBuffer(EncodeConstants.OF10_VERSION_ID, out, message);
+        
+        BufferHelper.checkHeaderV10(out, (byte) 4, factory.computeLength(message));
+        Assert.assertEquals("Wrong experimenter", 0x0001020304L, out.readUnsignedInt());
+        byte[] data = new byte[4];
+        out.readBytes(data);
+        Assert.assertArrayEquals("Wrong data", message.getData(), data);
+    }
+
+}