1 package org.opendaylight.controller.config.api;
5 import static org.junit.Assert.assertEquals;
6 import static org.junit.Assert.assertNotEquals;
7 import static org.junit.Assert.assertNotNull;
9 public class JmxAttributeTest {
12 public void testJmxAttribute() throws Exception {
13 JmxAttribute attr = new JmxAttribute("test");
14 assertEquals("test", attr.getAttributeName());
18 public void testToString() throws Exception {
19 JmxAttribute attr = new JmxAttribute("test");
20 assertEquals(attr.toString(), new JmxAttribute("test").toString());
23 @Test(expected = NullPointerException.class)
24 public void testJmxAttributeInvalid() throws Exception {
25 JmxAttribute attr = new JmxAttribute(null);
29 public void testJmxAttributeEqual() throws Exception {
30 JmxAttribute a1 = new JmxAttribute("test_string");
31 JmxAttribute a2 = new JmxAttribute("test_string");
36 public void testJmxAttributeNotEqual() throws Exception {
37 JmxAttribute a1 = new JmxAttribute("test_string");
38 JmxAttribute a2 = new JmxAttribute("different");
39 assertNotEquals(a1, a2);
43 public void testJmxAttributeEqual2() throws Exception {
44 JmxAttribute a1 = new JmxAttribute("test_string");
49 public void testJmxAttributeHashCode() throws Exception {
50 JmxAttribute a1 = new JmxAttribute("test_string");
51 assertEquals(a1.hashCode(), new String("test_string").hashCode());