Copyright update
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / OF10PortStatusMessageFactoryTest.java
index 0e3ed52d443e49673427e541f2a3535e19cf29ae..d4fa28bf711f89fa9155dce96babbd6fddaa0b0c 100644 (file)
@@ -1,51 +1,58 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
-package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-\r
-import org.junit.Assert;\r
-import org.junit.Test;\r
-import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortReason;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortStateV10;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class OF10PortStatusMessageFactoryTest {\r
-\r
-    /**\r
-     * Testing {@link OF10PortStatusMessageFactory} for correct translation into POJO\r
-     */\r
-    @Test\r
-    public void test(){\r
-        ByteBuf bb = BufferHelper.buildBuffer("00 00 00 00 00 00 00 00 "\r
-                + "00 10 01 01 05 01 04 02 41 4C 4F 48 41 00 00 00 00 00 00 00 00 00 00 "\r
-                + "00 00 00 00 15 00 00 01 01 00 00 00 31 00 00 04 42 00 00 03 0C 00 00 08 88");\r
-        PortStatusMessage builtByFactory = BufferHelper.decodeV10(OF10PortStatusMessageFactory.getInstance(), bb);\r
-        \r
-        BufferHelper.checkHeaderV10(builtByFactory);\r
-        Assert.assertEquals("Wrong reason", PortReason.OFPPRADD, builtByFactory.getReason());\r
-        Assert.assertEquals("Wrong port - port-no", 16, builtByFactory.getPortNo().intValue());\r
-        Assert.assertEquals("Wrong builtByFactory - hw-addr", new MacAddress("01:01:05:01:04:02"), builtByFactory.getHwAddr());\r
-        Assert.assertEquals("Wrong builtByFactory - name", new String("ALOHA"), builtByFactory.getName());\r
-        Assert.assertEquals("Wrong builtByFactory - config", new PortConfigV10(true, false, false, true, false, false, true),\r
-                builtByFactory.getConfigV10());\r
-        Assert.assertEquals("Wrong builtByFactory - state", new PortStateV10(false, true, false, false, false, true, false, false),\r
-                builtByFactory.getStateV10());\r
-        Assert.assertEquals("Wrong builtByFactory - curr", new PortFeaturesV10(false, false, false, false, true, true, true,\r
-                false, false, false, false, false), builtByFactory.getCurrentFeaturesV10());\r
-        Assert.assertEquals("Wrong builtByFactory - advertised", new PortFeaturesV10(false, false, true, true, false, false,\r
-                false, false, false, false, true, false), builtByFactory.getAdvertisedFeaturesV10());\r
-        Assert.assertEquals("Wrong builtByFactory - supbuiltByFactoryed", new PortFeaturesV10(true, true, false, false, false, false,\r
-                false, true, false, true, false, false), builtByFactory.getSupportedFeaturesV10());\r
-        Assert.assertEquals("Wrong builtByFactory - peer", new PortFeaturesV10(true, false, false, false, false, false, false,\r
-                false, true, false, false, true), builtByFactory.getPeerFeaturesV10());\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.deserialization.factories;
+
+import io.netty.buffer.ByteBuf;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortReason;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortStateV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class OF10PortStatusMessageFactoryTest {
+
+    /**
+     * Testing {@link OF10PortStatusMessageFactory} for correct translation into POJO
+     */
+    @Test
+    public void test(){
+        ByteBuf bb = BufferHelper.buildBuffer("00 00 00 00 00 00 00 00 "
+                + "00 10 01 01 05 01 04 02 41 4C 4F 48 41 00 00 00 00 00 00 00 00 00 00 "
+                + "00 00 00 00 15 00 00 01 01 00 00 00 31 00 00 04 42 00 00 03 0C 00 00 08 88");
+        PortStatusMessage builtByFactory = BufferHelper.decodeV10(OF10PortStatusMessageFactory.getInstance(), bb);
+        
+        BufferHelper.checkHeaderV10(builtByFactory);
+        Assert.assertEquals("Wrong reason", PortReason.OFPPRADD, builtByFactory.getReason());
+        Assert.assertEquals("Wrong port - port-no", 16, builtByFactory.getPortNo().intValue());
+        Assert.assertEquals("Wrong builtByFactory - hw-addr", new MacAddress("01:01:05:01:04:02"), builtByFactory.getHwAddr());
+        Assert.assertEquals("Wrong builtByFactory - name", new String("ALOHA"), builtByFactory.getName());
+        Assert.assertEquals("Wrong builtByFactory - config", new PortConfigV10(true, false, false, true, false, false, true),
+                builtByFactory.getConfigV10());
+        Assert.assertEquals("Wrong builtByFactory - state", new PortStateV10(false, true, false, false, false, true, false, false),
+                builtByFactory.getStateV10());
+        Assert.assertEquals("Wrong builtByFactory - curr", new PortFeaturesV10(false, false, false, false, true, true, true,
+                false, false, false, false, false), builtByFactory.getCurrentFeaturesV10());
+        Assert.assertEquals("Wrong builtByFactory - advertised", new PortFeaturesV10(false, false, true, true, false, false,
+                false, false, false, false, true, false), builtByFactory.getAdvertisedFeaturesV10());
+        Assert.assertEquals("Wrong builtByFactory - supbuiltByFactoryed", new PortFeaturesV10(true, true, false, false, false, false,
+                false, true, false, true, false, false), builtByFactory.getSupportedFeaturesV10());
+        Assert.assertEquals("Wrong builtByFactory - peer", new PortFeaturesV10(true, false, false, false, false, false, false,
+                false, true, false, false, true), builtByFactory.getPeerFeaturesV10());
+    }
+
+}