Remove raw references to Map in XSQL
[controller.git] / opendaylight / config / config-manager / src / test / java / org / opendaylight / controller / config / manager / impl / AbstractLockedPlatformMBeanServerTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.manager.impl;
9
10 import java.lang.management.ManagementFactory;
11 import java.util.concurrent.locks.ReentrantLock;
12
13 import javax.management.MBeanServer;
14
15 import org.junit.After;
16 import org.junit.Before;
17
18 /**
19  * Each test that works with platform MBeanServer should extend this class.
20  */
21 public abstract class AbstractLockedPlatformMBeanServerTest {
22     private static final ReentrantLock lock = new ReentrantLock();
23     protected static MBeanServer platformMBeanServer = ManagementFactory
24             .getPlatformMBeanServer();
25
26     @Before
27     public void acquireLock() {
28         lock.lock();
29     }
30
31     @After
32     public void unlock() {
33         lock.unlock();
34     }
35
36     public static class SimpleBean implements SimpleBeanMBean {
37
38     }
39
40     public static interface SimpleBeanMBean {
41
42     }
43
44 }