Support ModOchSignalInstruction in InstructionCodec
Resolve ONOS-1875
Change-Id: I63e10aeb4689991bfb5c6df349843ef5aff4d6f7
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
index 949707b..29af34a 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java
@@ -24,6 +24,9 @@
import org.onlab.packet.VlanId;
import org.onosproject.codec.CodecContext;
import org.onosproject.codec.JsonCodec;
+import org.onosproject.net.ChannelSpacing;
+import org.onosproject.net.GridType;
+import org.onosproject.net.Lambda;
import org.onosproject.net.PortNumber;
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions;
@@ -105,6 +108,19 @@
}
/**
+ * Tests the encoding of mod OCh signal instructions.
+ */
+ @Test
+ public void modOchSignalInstructionTest() {
+ L0ModificationInstruction.ModOchSignalInstruction instruction =
+ (L0ModificationInstruction.ModOchSignalInstruction)
+ Instructions.modL0Lambda(Lambda.ochSignal(GridType.DWDM, ChannelSpacing.CHL_100GHZ, 4, 8));
+ ObjectNode instructionJson =
+ instructionCodec.encode(instruction, context);
+ assertThat(instructionJson, matchesInstruction(instruction));
+ }
+
+ /**
* Tests the encoding of mod ether instructions.
*/
@Test