X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fmatch%2FMatchTest.java;h=f3c7a95b0ebcdfb44a5de81e8a5509572827d2f6;hp=5dcb898dfbb9db5e4420e0cafa06b8977979d8af;hb=144cfa4b4a926b7d0c3d5f60ada050c609762699;hpb=b23b4346d9bddc2829dcfe6d0c8c20af19552dea diff --git a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/match/MatchTest.java b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/match/MatchTest.java index 5dcb898dfb..f3c7a95b0e 100644 --- a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/match/MatchTest.java +++ b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/match/MatchTest.java @@ -565,8 +565,9 @@ public class MatchTest { Assert.assertTrue(((InetAddress)i.getField(MatchType.NW_SRC).getValue()).equals(ip2)); Assert.assertTrue(((InetAddress)i.getField(MatchType.NW_SRC).getMask()).equals(ipm2)); + // Empty set i = m2.getIntersection(m3); - Assert.assertTrue(i.getMatches() == 0); + Assert.assertNull(i); Match m4 = new Match(); m4.setField(MatchType.DL_TYPE, ethType); @@ -608,9 +609,12 @@ public class MatchTest { Assert.assertTrue(m6.intersetcs(m6)); Assert.assertTrue(m6.getIntersection(m6).equals(m6)); - // Empty match, represents the empty set - Match o = new Match(); - Assert.assertTrue(m6.getIntersection(o).equals(o)); - Assert.assertTrue(o.getIntersection(m6).equals(o)); + // Empty match, represents the universal set (all packets) + Match u = new Match(); + Assert.assertTrue(m6.getIntersection(u).equals(m6)); + Assert.assertTrue(u.getIntersection(m6).equals(m6)); + + // No intersection with null match, empty set + Assert.assertNull(m6.getIntersection(null)); } }