2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.manager.impl.util;
10 import static org.junit.Assert.assertEquals;
14 import javax.management.MXBean;
16 import org.junit.Test;
17 import org.opendaylight.controller.config.spi.Module;
18 import org.opendaylight.yangtools.concepts.Identifiable;
20 import com.google.common.collect.Sets;
22 public class InterfacesHelperTest {
28 interface SuperBMXBean {
32 interface SuperC extends SuperA, SuperBMXBean {
36 class SuperClass implements SuperC {
45 abstract class SubClass extends SuperClass implements SubA, Module {
50 public void testGetAllInterfaces() {
51 Set<Class<?>> expected = Sets.<Class<?>> newHashSet(SuperA.class, SuperBMXBean.class, SuperC.class,
52 SubA.class, Identifiable.class, Module.class);
53 assertEquals(expected,
54 InterfacesHelper.getAllInterfaces(SubClass.class));
58 public void testGetMXInterfaces() {
59 Set<Class<?>> expected = Sets.<Class<?>> newHashSet(SuperBMXBean.class, SubA.class);
60 assertEquals(expected, InterfacesHelper.getMXInterfaces(SubClass.class));