- Removed validation for all classifier fields (yang and validation code); 46/39846/2
authorMufaddal Makati <m.makati@cablelabs.com>
Fri, 3 Jun 2016 15:56:44 +0000 (09:56 -0600)
committerRyan Vail <r.vail@cablelabs.com>
Mon, 6 Jun 2016 15:17:21 +0000 (09:17 -0600)
- Added wildcard support for all classifier fields that did not have it (including IP addresses and protocol; basically you can now submit an empty classifier, or one that has only the protocol or just the source IP included);
- Fixed issue with large port ranges;
- Fixed validation unit tests to allow for optional classifer values

Change-Id: Iaa8aba2fdc701546b0819957989bd45a46ba112d
Signed-off-by: Mufaddal Makati <m.makati@cablelabs.com>
packetcable-policy-model/src/main/yang/packetcable.yang
packetcable-policy-server/src/main/java/org/opendaylight/controller/packetcable/provider/PCMMGateReqBuilder.java
packetcable-policy-server/src/main/java/org/opendaylight/controller/packetcable/provider/validation/impl/validators/qos/classifier/ClassifierValidator.java
packetcable-policy-server/src/main/java/org/opendaylight/controller/packetcable/provider/validation/impl/validators/qos/classifier/ExtClassifierValidator.java
packetcable-policy-server/src/main/java/org/opendaylight/controller/packetcable/provider/validation/impl/validators/qos/classifier/Ipv6ClassifierValidator.java
packetcable-policy-server/src/test/java/org/opendaylight/controller/packetcable/provider/validation/impl/validators/qos/classifier/ClassifierValidatorTest.java
packetcable-policy-server/src/test/java/org/opendaylight/controller/packetcable/provider/validation/impl/validators/qos/classifier/ExtClassifierValidatorTest.java
packetcable-policy-server/src/test/java/org/opendaylight/controller/packetcable/provider/validation/impl/validators/qos/classifier/Ipv6ClassifierValidatorTest.java

index ba8553241914d42070bdc25300474384b316c382..f316437377c4454dd4dda3e9cfb95a6c5d908314 100644 (file)
@@ -319,22 +319,18 @@ module packetcable
         leaf srcPort-start {
             type inet:port-number;
             description "TCP/UDP source port range start.";
-            mandatory true;
         }
         leaf srcPort-end {
             type inet:port-number;
             description "TCP/UDP source port range end.";
-            mandatory true;
         }
         leaf dstPort-start {
             type inet:port-number;
             description "TCP/UDP destination port range start.";
-            mandatory true;
         }
         leaf dstPort-end {
             type inet:port-number;
             description "TCP/UDP destination port range end.";
-            mandatory true;
         }
     }
 
@@ -343,37 +339,30 @@ module packetcable
             leaf srcIp {
                 type inet:ipv4-address;
                 description "Source IPv4 address (exact match)";
-                mandatory true;
             }
             leaf dstIp {
                 type inet:ipv4-address;
                 description "Destination IPv4 address (exact match)";
-                mandatory true;
             }
              leaf tos-byte {
                  type tos-byte;
                  description "TOS/DSCP match";
-                 mandatory true;
              }
              leaf tos-mask {
                  type tos-byte;
                  description "TOS/DSCP mask";
-                 mandatory true;
              }
              leaf protocol {
                 type tp-protocol;
                 description "IPv4 transport protocol";
-                mandatory true;
             }
              leaf srcPort {
                 type inet:port-number;
                 description "TCP/UDP source port (exact match).";
-                mandatory true;
                }
              leaf dstPort {
                 type inet:port-number;
                 description "TCP/UDP destination port (exact match).";
-                mandatory true;
                }
            }
     }
@@ -383,37 +372,30 @@ module packetcable
             leaf srcIp {
                 type inet:ipv4-address;
                 description "Source IPv4 address match";
-                mandatory true;
             }
             leaf srcIpMask {
                 type inet:ipv4-address;
                 description "Source IPv4 mask";
-                mandatory true;
             }
             leaf dstIp {
                 type inet:ipv4-address;
                 description "Destination IPv4 address match";
-                mandatory true;
             }
             leaf dstIpMask {
                 type inet:ipv4-address;
                 description "Destination IPv4 mask";
-                mandatory true;
             }
              leaf tos-byte {
                  type tos-byte;
                  description "TOS/DSCP match";
-                 mandatory true;
              }
              leaf tos-mask {
                  type tos-byte;
                  description "TOS/DSCP mask";
-                 mandatory true;
              }
              leaf protocol {
                 type tp-protocol;
                 description "IPv4 transport protocol";
-                mandatory true;
             }
             uses tp-port-match-ranges;
            }
@@ -424,39 +406,32 @@ module packetcable
             leaf srcIp6 {
                 type inet:ipv6-prefix;
                 description "Source IPv6 prefix match in  'address/len' notation";
-                mandatory true;
             }
             leaf dstIp6 {
                 type inet:ipv6-prefix;
                 description "Destination IPv6 prefix match in 'address/len' notation";
-                mandatory true;
             }
              leaf tc-low {
                  type tos-byte;
                  description "TC low range match";
-                 mandatory true;
              }
              leaf tc-high {
                  type tos-byte;
                  description "TC high range match";
-                 mandatory true;
              }
              leaf tc-mask {
                  type tos-byte;
                  description "TC mask";
-                 mandatory true;
              }
              leaf next-hdr {
                 type tp-protocol;
                 description "IPv6 Next Header";
-                mandatory true;
             }
             leaf flow-label {
                 type uint32 {
                     range "0 .. 1048575";
                 }
                 description "IPv6 Flow Label (20 bits)";
-                mandatory true;
             }
                uses tp-port-match-ranges;
            }
index 98e1d276d95b029282c835d46376cfa7a119f1a9..97327408c20ebef2322d9e84399d8cb9a7d1886b 100644 (file)
@@ -166,30 +166,35 @@ public class PCMMGateReqBuilder {
         Protocol protocol = null;
         byte tosOverwrite = 0;
         byte tosMask = (byte)0x0;
-        Inet4Address srcAddress = null;
-        Inet4Address dstAddress = null;
         short srcPort = (short) 0;
         short dstPort = (short) 0;
         byte priority = (byte) 64;
         //byte priority = index.byteValue();
         
-        
         // Legacy classifier
+        
+        // Protocol -- zero is match any
         if (qosClassifier.getProtocol() != null) {
             protocol = Protocol.valueOf(qosClassifier.getProtocol().getValue().shortValue());
+        } else {
+            protocol = Protocol.NONE;
         }
+        
+         // IP Addresss and mask wildcards - addr byte 0 for no match (or match anything)
+        
+        Inet4Address srcAddress = (Inet4Address) getByName("0.0.0.0");
+        
         if (qosClassifier.getSrcIp() != null) {
-            final InetAddress sip = getByName(qosClassifier.getSrcIp().getValue());
-            if (sip != null && sip instanceof Inet4Address) {
-                srcAddress = (Inet4Address) sip;
-            }
+               srcAddress = (Inet4Address) getByName(qosClassifier.getSrcIp().getValue());
         }
+        
+        Inet4Address dstAddress = (Inet4Address) getByName("0.0.0.0");
+        
         if (qosClassifier.getDstIp() != null) {
-            final InetAddress dip = getByName(qosClassifier.getDstIp().getValue());
-            if (dip != null && dip instanceof Inet4Address) {
-                dstAddress = (Inet4Address) dip;
-            }
+            dstAddress = (Inet4Address) getByName(qosClassifier.getDstIp().getValue());
         }
+        
+        
         if (qosClassifier.getSrcPort() != null) {
             srcPort = qosClassifier.getSrcPort().getValue().shortValue();
         }
@@ -209,7 +214,7 @@ public class PCMMGateReqBuilder {
         classifiers.add(new org.pcmm.gates.impl.Classifier(protocol, tosOverwrite, tosMask, srcAddress, dstAddress, srcPort,
                         dstPort, priority));
     }
-
+    
     private void addExtClassifier(final Short index, final ExtClassifier qosExtClassifier) {
         // Extended classifier
         final byte priority = (byte) 64;
@@ -233,7 +238,7 @@ public class PCMMGateReqBuilder {
             if (qosExtClassifier.getSrcPortEnd() != null) {
                 srcEndPort = qosExtClassifier.getSrcPortEnd().getValue().shortValue();
             }
-            if (srcStartPort > srcEndPort) {
+            if ((int)(srcStartPort & 0xffff) > (int) (srcEndPort & 0xffff)) {
                 logger.warn("Start port %d > End port %d in ext-classifier source port range -- forcing to same",
                         srcStartPort, srcEndPort);
                 srcEndPort = srcStartPort;
@@ -250,7 +255,7 @@ public class PCMMGateReqBuilder {
             if (qosExtClassifier.getDstPortEnd() != null) {
                 dstEndPort = qosExtClassifier.getDstPortEnd().getValue().shortValue();
             }
-            if (dstStartPort > dstEndPort) {
+            if ((int)(dstStartPort & 0xffff) > (int)(dstEndPort & 0xffff)) {
                 logger.warn("Start port %d > End port %d in ext-classifier destination port range -- forcing to same",
                         dstStartPort, dstEndPort);
                 dstEndPort = dstStartPort;
@@ -272,6 +277,29 @@ public class PCMMGateReqBuilder {
             }
         }
 
+        // IP Addresss and mask wildcards - addr byte 0 for no match (or match anything) and mask is 255.255.255.255 by default
+        Inet4Address srcIpAddr = (Inet4Address) getByName("0.0.0.0");
+
+        if (qosExtClassifier.getSrcIp() != null) {
+               srcIpAddr = getInet4Address(qosExtClassifier.getSrcIp());
+        }
+        
+        Inet4Address dstIpAddr = (Inet4Address) getByName("0.0.0.0");
+        if (qosExtClassifier.getDstIp() != null) {
+               dstIpAddr = getInet4Address(qosExtClassifier.getDstIp());
+        }
+        
+        //mask
+        Inet4Address srcIpMask = (Inet4Address) getByName("255.255.255.255");
+        if (qosExtClassifier.getSrcIpMask() != null) {
+               srcIpMask = getInet4Address(qosExtClassifier.getSrcIpMask());
+        }
+        
+        Inet4Address dstIpMask = (Inet4Address) getByName("255.255.255.255");
+        if (qosExtClassifier.getDstIpMask() != null) {
+               dstIpMask = getInet4Address(qosExtClassifier.getDstIpMask());
+        }
+        
         // TODO - find out what the classifier ID should really be. It was never getting set previously
         final short classifierId = (short)index;
 
@@ -280,9 +308,8 @@ public class PCMMGateReqBuilder {
 
         // push the extended classifier to the gate request
         classifiers.add(new org.pcmm.gates.impl.ExtendedClassifier(protocol, tosOverwrite, tosMask,
-                getInet4Address(qosExtClassifier.getSrcIp()), getInet4Address(qosExtClassifier.getDstIp()),
-                srcStartPort, dstStartPort, priority, getInet4Address(qosExtClassifier.getSrcIpMask()),
-                getInet4Address(qosExtClassifier.getDstIpMask()), srcEndPort, dstEndPort, classifierId, activationState,
+                srcIpAddr, dstIpAddr,
+                srcStartPort, dstStartPort, priority, srcIpMask, dstIpMask, srcEndPort, dstEndPort, classifierId, activationState,
                 action));
     }
 
@@ -311,7 +338,8 @@ public class PCMMGateReqBuilder {
         // Source IPv6 address & prefix len
         // TODO - try to make these two variables immutable
         byte srcPrefixLen = (byte) 128;
-        Inet6Address srcAddress = null;
+        Inet6Address srcAddress = (Inet6Address) getByName("0::0");
+        
         if (qosIpv6Classifier.getSrcIp6() != null) {
             String[] parts = qosIpv6Classifier.getSrcIp6().getValue().split("/");
             String Ipv6AddressStr = parts[0];
@@ -325,7 +353,8 @@ public class PCMMGateReqBuilder {
         }
 
         // TODO - try to make these two variables immutable
-        Inet6Address dstAddress = null;
+        Inet6Address dstAddress = (Inet6Address) getByName("0::0");
+
         byte dstPrefLen = (byte) 128;
         // Destination IPv6 address & prefix len
         if (qosIpv6Classifier.getDstIp6() != null) {
@@ -346,7 +375,7 @@ public class PCMMGateReqBuilder {
             if (qosIpv6Classifier.getSrcPortEnd() != null) {
                 srcPortEnd = qosIpv6Classifier.getSrcPortEnd().getValue().shortValue();
             }
-            if (srcPortBegin > srcPortEnd) {
+            if ((int)(srcPortBegin & 0xffff) > (int)(srcPortEnd & 0xffff)) {
                 logger.warn("Start port %d > End port %d in ipv6-classifier source port range -- forcing to same",
                         srcPortBegin, srcPortEnd);
                 srcPortEnd = srcPortBegin;
@@ -363,7 +392,7 @@ public class PCMMGateReqBuilder {
             if (qosIpv6Classifier.getDstPortEnd() != null) {
                 dstPortEnd = qosIpv6Classifier.getDstPortEnd().getValue().shortValue();
             }
-            if (dstPortBegin > dstPortEnd) {
+            if ( (int)(dstPortBegin & 0xffff) > (int)(dstPortEnd & 0xffff)) {
                 logger.warn("Start port %d > End port %d in ipv6-classifier destination port range -- forcing to same",
                         dstPortBegin, dstPortEnd);
                 dstPortEnd = dstPortBegin;
@@ -385,6 +414,15 @@ public class PCMMGateReqBuilder {
             tcMask = qosIpv6Classifier.getTcHigh().getValue().byteValue();
         else if (qosIpv6Classifier.getTcLow() != null) tcMask = (byte) 0xff;
         else tcMask = (byte) 0x00;
+        
+        FlowLabel flowLabelFlag = FlowLabel.IRRELEVANT;
+        int flowLabelId = 0;
+        
+        if (qosIpv6Classifier.getFlowLabel() != null) {
+               flowLabelFlag = FlowLabel.VALID;
+               flowLabelId = qosIpv6Classifier.getFlowLabel().intValue();
+        }
+        
 
         // TODO - find out what the classifier ID should really be. It was never getting set previously
         final short classifierId = (short)index;
@@ -395,7 +433,7 @@ public class PCMMGateReqBuilder {
         // push the IPv6 classifier to the gate request
         classifiers.add(
                 new org.pcmm.gates.impl.IPv6Classifier(srcAddress, dstAddress, srcPortBegin, dstPortBegin, (byte) 64,
-                        srcPortEnd, dstPortEnd, classifierId, ActivationState.ACTIVE, action, FlowLabel.VALID, tcLow,
-                        tcHigh, tcMask, qosIpv6Classifier.getFlowLabel().intValue(), nextHdr, srcPrefixLen, dstPrefLen));
+                        srcPortEnd, dstPortEnd, classifierId, ActivationState.ACTIVE, action, flowLabelFlag, tcLow,
+                        tcHigh, tcMask, flowLabelId, nextHdr, srcPrefixLen, dstPrefLen));
     }
 }
index 6444055b34135f1b17a0eab7049cd77fd8e50174..a0c3a5c230ef0eb9fb1efbad823ed3356cd3768b 100644 (file)
@@ -35,15 +35,6 @@ public class ClassifierValidator extends AbstractValidator<Classifier> {
             return;
         }
 
-        mustExist(classifier.getSrcIp(), SRC_IP);
-        mustExist(classifier.getSrcPort(), SRC_PORT);
-
-        mustExist(classifier.getDstIp(), DST_IP);
-        mustExist(classifier.getDstPort(), DST_PORT);
-
-        mustExist(classifier.getTosByte(), TOS_BYTE);
-        mustExist(classifier.getTosMask(), TOS_MASK);
-
-        mustExist(classifier.getProtocol(), PROTOCOL);
+        // all values are optional
     }
 }
index 275b18e80a517d387835a37ed3ea24e952270456..f4fe83979decdd2b9cd65f504ce494d9d88be214 100644 (file)
@@ -40,21 +40,7 @@ public class ExtClassifierValidator extends AbstractValidator<ExtClassifier> {
             return;
         }
 
-        mustExist(extClassifier.getSrcIp(), SRC_IP);
-        mustExist(extClassifier.getSrcIpMask(), SRC_MASK);
+        // all values are optional and have defaults
 
-        mustExist(extClassifier.getDstIp(), DST_IP);
-        mustExist(extClassifier.getDstIpMask(), DST_MASK);
-
-        mustExist(extClassifier.getTosByte(), TOS_BYTE);
-        mustExist(extClassifier.getTosMask(), TOS_MASK);
-
-        mustExist(extClassifier.getProtocol(), PROTOCOL);
-
-        mustExist(extClassifier.getSrcPortStart(), SRC_PORT_START);
-        mustExist(extClassifier.getSrcPortEnd(), SRC_PORT_END);
-
-        mustExist(extClassifier.getDstPortStart(), DST_PORT_START);
-        mustExist(extClassifier.getDstPortEnd(), DST_PORT_END);
     }
 }
index c966a69a29fa39b0fef7ed332c7c31fb9ea2af71..48e17d2242816d36491c345af5179e9b415b160f 100644 (file)
@@ -41,21 +41,6 @@ public class Ipv6ClassifierValidator extends AbstractValidator<Ipv6Classifier> {
             return;
         }
 
-        mustExist(ipv6Classifier.getSrcIp6(), SRC_IP6);
-        mustExist(ipv6Classifier.getDstIp6(), DST_IP6);
-
-        mustExist(ipv6Classifier.getTcLow(), TC_LOW);
-        mustExist(ipv6Classifier.getTcHigh(), TC_HIGH);
-        mustExist(ipv6Classifier.getTcMask(), TC_MASK);
-
-        mustExist(ipv6Classifier.getNextHdr(), NEXT_HEADER);
-
-        mustExist(ipv6Classifier.getFlowLabel(), FLOW_LABEL);
-
-        mustExist(ipv6Classifier.getSrcPortStart(), SRC_PORT_START);
-        mustExist(ipv6Classifier.getSrcPortEnd(), SRC_PORT_END);
-
-        mustExist(ipv6Classifier.getDstPortStart(), DST_PORT_START);
-        mustExist(ipv6Classifier.getDstPortEnd(), DST_PORT_END);
+        // all values are optional
     }
 }
index b32f10c6fdd7389c79264e523be07e6d32cf7b5a..2d4a70e4c901dec4598b028ab06fc4f75388b728 100644 (file)
@@ -42,7 +42,7 @@ public class ClassifierValidatorTest {
         validator.validate(buildValidClassifierTree(), null);
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcIp() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setSrcIp(null)
@@ -51,7 +51,7 @@ public class ClassifierValidatorTest {
         validator.validate(classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
      public void nullSrcPort() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setSrcPort(null)
@@ -60,7 +60,7 @@ public class ClassifierValidatorTest {
         validator.validate(classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstIp() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setDstIp(null)
@@ -69,7 +69,7 @@ public class ClassifierValidatorTest {
         validator.validate(classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstPort() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setDstPort(null)
@@ -78,7 +78,7 @@ public class ClassifierValidatorTest {
         validator.validate(classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullProtocol() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setProtocol(null)
@@ -87,7 +87,7 @@ public class ClassifierValidatorTest {
         validator.validate(classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullTosByte() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setTosByte(null)
@@ -96,7 +96,7 @@ public class ClassifierValidatorTest {
         validator.validate(classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
      public void nullTosMask() throws ValidationException {
         Classifier classifier = new ClassifierBuilder(buildValidClassifierTree())
                 .setTosMask(null)
index 05f19ba0ff863ee168d5988d84ec7a72b5c752ed..5f78f81b84927ab711946a7327db1dc5201cbeb9 100644 (file)
@@ -41,7 +41,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(buildValidExtClassifier(), null);
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcIp() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setSrcIp(null)
@@ -50,7 +50,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcPortStart() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setSrcPortStart(null)
@@ -59,7 +59,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcPortEnd() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setSrcPortEnd(null)
@@ -68,7 +68,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstIp() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setDstIp(null)
@@ -77,7 +77,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstPortStart() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setDstPortStart(null)
@@ -86,7 +86,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstPortEnd() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setDstPortEnd(null)
@@ -95,7 +95,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullProtocol() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setProtocol(null)
@@ -104,7 +104,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullTosByte() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setTosByte(null)
@@ -113,7 +113,7 @@ public class ExtClassifierValidatorTest {
         validator.validate(extClassifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullTosMask() throws ValidationException {
         ExtClassifier extClassifier = new ExtClassifierBuilder(buildValidExtClassifier())
                 .setTosMask(null)
index 689c385758013687c64e060a4227d70cc5f7d1fd..087bed852ec4fc45b111b9049977b70fcd72fdb4 100644 (file)
@@ -41,14 +41,14 @@ public class Ipv6ClassifierValidatorTest {
         validator.validate(buildValidIpv6Classifier(), null);
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcIp6() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setSrcIp6(null).build();
 
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcPortStart() throws ValidationException {
         Ipv6Classifier ipv6Classifier =
                 new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setSrcPortStart(null).build();
@@ -56,7 +56,7 @@ public class Ipv6ClassifierValidatorTest {
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullSrcPortEnd() throws ValidationException {
         Ipv6Classifier ipv6Classifier =
                 new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setSrcPortEnd(null).build();
@@ -64,14 +64,14 @@ public class Ipv6ClassifierValidatorTest {
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstIp6() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setDstIp6(null).build();
 
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstPortStart() throws ValidationException {
         Ipv6Classifier ipv6Classifier =
                 new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setDstPortStart(null).build();
@@ -79,7 +79,7 @@ public class Ipv6ClassifierValidatorTest {
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullDstPortEnd() throws ValidationException {
         Ipv6Classifier ipv6Classifier =
                 new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setDstPortEnd(null).build();
@@ -87,35 +87,35 @@ public class Ipv6ClassifierValidatorTest {
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullFlowLabel() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setFlowLabel(null).build();
 
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullNextHdr() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setNextHdr(null).build();
 
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullTcHigh() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setTcHigh(null).build();
 
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullTcLow() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setTcLow(null).build();
 
         validator.validate(ipv6Classifier, extentParams.getCurrentParam());
     }
 
-    @Test(expected = ValidationException.class)
+    @Test
     public void nullTcMask() throws ValidationException {
         Ipv6Classifier ipv6Classifier = new Ipv6ClassifierBuilder(buildValidIpv6Classifier()).setTcMask(null).build();