Bug 1225: Added DataBroker and DataChangeListener test suite.
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / md / sal / binding / test / AssertCollections.java
1 package org.opendaylight.controller.md.sal.binding.test;
2
3 import java.util.Collection;
4 import java.util.Map;
5
6 import org.junit.Assert;
7
8 public class AssertCollections {
9
10     public static void assertEmpty(final Collection<?> set) {
11         Assert.assertTrue(set.isEmpty());
12     }
13
14     public static void assertEmpty(final Map<?,?> set) {
15         Assert.assertTrue(set.isEmpty());
16     }
17
18     public static void assertContains(final Collection<?> set, final Object... values) {
19         for (Object key : values) {
20             Assert.assertTrue(set.contains(key));
21         }
22
23     }
24
25     public static void assertNotContains(final Collection<?> set, final Object... values) {
26         for (Object key : values) {
27             Assert.assertFalse(set.contains(key));
28         }
29     }
30
31     public static void assertContains(final Map<?,?> map, final Object... values) {
32         for (Object key : values) {
33             Assert.assertTrue(map.containsKey(key));
34         }
35     }
36
37     public static void assertNotContains(final Map<?,?> map, final Object... values) {
38         for (Object key : values) {
39             Assert.assertFalse(map.containsKey(key));
40         }
41     }
42 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.