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;
12 import javax.management.ObjectName;
14 import org.junit.After;
15 import org.junit.Before;
16 import org.opendaylight.controller.config.manager.impl.AbstractLockedPlatformMBeanServerTest;
18 import com.google.common.base.Throwables;
19 import com.google.common.collect.Sets;
21 public class ObjectNameUtilTest extends AbstractLockedPlatformMBeanServerTest {
22 private Set<ObjectName> unregisterONs;
25 public void initUnregisterList() {
26 unregisterONs = Sets.newHashSet();
30 public void unregisterONs() {
31 Exception lastException = null;
32 for (ObjectName on : unregisterONs) {
34 platformMBeanServer.unregisterMBean(on);
35 } catch (Exception e) {
39 if (lastException != null) {
40 Throwables.propagate(lastException);