Package com.alibaba.druid.bvt.pool

Source Code of com.alibaba.druid.bvt.pool.RegisterTest

package com.alibaba.druid.bvt.pool;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.druid.pool.DruidDataSource;


public class RegisterTest extends TestCase {
    public void test() throws Exception {
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.init();
       
        Assert.assertTrue(dataSource.isMbeanRegistered());
       
        dataSource.registerMbean();
        Assert.assertTrue(dataSource.isMbeanRegistered());
       
        dataSource.unregisterMbean();
        Assert.assertFalse(dataSource.isMbeanRegistered());
        Assert.assertFalse(dataSource.isMbeanRegistered());
       
        dataSource.close();
    }
}
TOP

Related Classes of com.alibaba.druid.bvt.pool.RegisterTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.