-/*\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.instruction;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-\r
-import org.junit.Assert;\r
-import org.junit.Test;\r
-import org.opendaylight.openflowjava.util.ByteBufUtils;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Meter;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteActions;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class AbstractInstructionDeserializerTest {\r
-\r
- /**\r
- * Tests {@link AbstractInstructionDeserializer#deserializeHeader(ByteBuf)} with different\r
- * instruction types\r
- */\r
- @Test(expected=IllegalStateException.class)\r
- public void test() {\r
- ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("00 01 00 04");\r
- GoToTableInstructionDeserializer deserializer = new GoToTableInstructionDeserializer();\r
- Instruction instruction = deserializer.deserializeHeader(buffer);\r
- Assert.assertEquals("Wrong type", GotoTable.class, instruction.getType());\r
-\r
- buffer = ByteBufUtils.hexStringToByteBuf("00 02 00 04");\r
- instruction = deserializer.deserializeHeader(buffer);\r
- Assert.assertEquals("Wrong type", WriteMetadata.class, instruction.getType());\r
-\r
- buffer = ByteBufUtils.hexStringToByteBuf("00 03 00 04");\r
- instruction = deserializer.deserializeHeader(buffer);\r
- Assert.assertEquals("Wrong type", WriteActions.class, instruction.getType());\r
-\r
- buffer = ByteBufUtils.hexStringToByteBuf("00 04 00 04");\r
- instruction = deserializer.deserializeHeader(buffer);\r
- Assert.assertEquals("Wrong type", ApplyActions.class, instruction.getType());\r
-\r
- buffer = ByteBufUtils.hexStringToByteBuf("00 05 00 04");\r
- instruction = deserializer.deserializeHeader(buffer);\r
- Assert.assertEquals("Wrong type", ClearActions.class, instruction.getType());\r
-\r
- buffer = ByteBufUtils.hexStringToByteBuf("00 06 00 04");\r
- instruction = deserializer.deserializeHeader(buffer);\r
- Assert.assertEquals("Wrong type", Meter.class, instruction.getType());\r
-\r
- buffer = ByteBufUtils.hexStringToByteBuf("00 00 00 04");\r
- instruction = deserializer.deserializeHeader(buffer);\r
- // exception expected\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.instruction;
+
+import io.netty.buffer.ByteBuf;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Meter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteActions;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class AbstractInstructionDeserializerTest {
+
+ /**
+ * Tests {@link AbstractInstructionDeserializer#deserializeHeader(ByteBuf)} with different
+ * instruction types
+ */
+ @Test(expected=IllegalStateException.class)
+ public void test() {
+ ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("00 01 00 04");
+ GoToTableInstructionDeserializer deserializer = new GoToTableInstructionDeserializer();
+ Instruction instruction = deserializer.deserializeHeader(buffer);
+ Assert.assertEquals("Wrong type", GotoTable.class, instruction.getType());
+
+ buffer = ByteBufUtils.hexStringToByteBuf("00 02 00 04");
+ instruction = deserializer.deserializeHeader(buffer);
+ Assert.assertEquals("Wrong type", WriteMetadata.class, instruction.getType());
+
+ buffer = ByteBufUtils.hexStringToByteBuf("00 03 00 04");
+ instruction = deserializer.deserializeHeader(buffer);
+ Assert.assertEquals("Wrong type", WriteActions.class, instruction.getType());
+
+ buffer = ByteBufUtils.hexStringToByteBuf("00 04 00 04");
+ instruction = deserializer.deserializeHeader(buffer);
+ Assert.assertEquals("Wrong type", ApplyActions.class, instruction.getType());
+
+ buffer = ByteBufUtils.hexStringToByteBuf("00 05 00 04");
+ instruction = deserializer.deserializeHeader(buffer);
+ Assert.assertEquals("Wrong type", ClearActions.class, instruction.getType());
+
+ buffer = ByteBufUtils.hexStringToByteBuf("00 06 00 04");
+ instruction = deserializer.deserializeHeader(buffer);
+ Assert.assertEquals("Wrong type", Meter.class, instruction.getType());
+
+ buffer = ByteBufUtils.hexStringToByteBuf("00 00 00 04");
+ instruction = deserializer.deserializeHeader(buffer);
+ // exception expected
+ }