content: package com.alibaba.druid.bvt.pool;
  
  import com.alibaba.druid.pool.DruidDataSource;
  import junit.framework.TestCase;
  
  public class DruidDataSourceTest_fill extends TestCase {
      private DruidDataSource dataSource;
  
      private int maxActive = 10;
  
      protected void setUp() throws Exception {
          dataSource = new DruidDataSource();
          dataSource.setUrl("jdbc:mock:xxx");
          dataSource.setMaxActive(maxActive);
          dataSource.setTestOnBorrow(false);
      }
  
      protected void tearDown() throws Exception {
          dataSource.close();
      }
  
      public void test_fill_0() throws Exception {
          int fillCount = dataSource.fill(3);
          assertEquals(3, fillCount);
      }
  
      public void test_fill_1() throws Exception {
          int fillCount = dataSource.fill(1000);
          assertEquals(maxActive, fillCount);
      }
  
      public void test_fill_2() throws Exception {
          int fillCount = dataSource.fill(maxActive);
          assertEquals(maxActive, fillCount);
      }
  
      public void test_fill_3() throws Exception {
          int fillCount = dataSource.fill();
          assertEquals(maxActive, fillCount);
      }
  
      public void test_fill_5() throws Exception {
          Exception error = null;
          try {
              dataSource.fill(-1);
          } catch (IllegalArgumentException e) {
              error = e;
          }
          assertNotNull(error);
      }
  }
  