Fixed a bug that failed specifying the value 0 on VLAN ID field for a match condition...
[controller.git] / opendaylight / sal / api / src / test / java / org / opendaylight / controller / sal / match / MatchTest.java
index cfa53fb7f37c052f2562ae94f5e03792cf386ebb..55b5cabf11c30f11a54ba1e10769e864106441a2 100644 (file)
@@ -474,4 +474,15 @@ public class MatchTest {
         Assert.assertTrue(flipflip.equals(flipped));
 
     }
+
+    @Test
+    public void testVlanNone() throws Exception {
+        // The value 0 is used to indicate that no VLAN ID is set
+        short vlan = (short) 0;
+        MatchField field = new MatchField(MatchType.DL_VLAN, vlan);
+
+        Assert.assertTrue(field != null);
+        Assert.assertTrue(field.getValue().equals(new Short(vlan)));
+        Assert.assertTrue(field.isValid());
+    }
 }