add testcase & bug fixed

This commit is contained in:
wenshao
2012-08-26 09:18:16 +08:00
parent 994b773242
commit 21c1b1da5d
7 changed files with 235 additions and 2 deletions
@@ -0,0 +1,23 @@
package com.alibaba.druid.bvt.pool;
import junit.framework.Assert;
import junit.framework.TestCase;
import com.alibaba.druid.pool.DataSourceDisableException;
public class DataSourceDisableExceptionTest extends TestCase {
public void test_0() throws Exception {
DataSourceDisableException ex = new DataSourceDisableException();
Assert.assertEquals(null, ex.getMessage());
}
public void test_1() throws Exception {
DataSourceDisableException ex = new DataSourceDisableException("XXX");
Assert.assertEquals("XXX", ex.getMessage());
}
public void test_2() throws Exception {
DataSourceDisableException ex = new DataSourceDisableException(new IllegalStateException());
Assert.assertTrue(ex.getCause() instanceof IllegalStateException);
}
}