コード例 #1
0
  /**
   * Mock setup.
   *
   * @throws ClassNotFoundException
   */
  @BeforeClass
  public static void setup() throws ClassNotFoundException {
    mockPool = createNiceMock(BoneCP.class);
    mockConnectionPartition = createNiceMock(ConnectionPartition.class);
    mockExecutor = createNiceMock(ScheduledExecutorService.class);

    mockLogger = createNiceMock(Logger.class);

    makeThreadSafe(mockLogger, true);
    config = new BoneCPConfig();
    config.setMaxConnectionAgeInSeconds(1);

    testClass =
        new ConnectionMaxAgeThread(mockConnectionPartition, mockExecutor, mockPool, 5000, false);
  }