コード例 #1
0
  @BeforeClass
  @Override
  protected void springTestContextPrepareTestInstance() throws Exception {
    artifactoryHomeBoundTest = createArtifactoryHomeTest();
    artifactoryHomeBoundTest.bindArtifactoryHome();

    super.springTestContextPrepareTestInstance();

    try (Connection connection = jdbcHelper.getDataSource().getConnection()) {
      DbTestUtils.refreshOrRecreateSchema(connection, storageProperties.getDbType());
    }
    TestUtils.invokeMethodNoArgs(dbService, "initializeIdGenerator");
  }
コード例 #2
0
 public void verifyDbResourcesReleased() throws IOException, SQLException {
   // make sure there are no active connections
   PoolingDataSource ds = (PoolingDataSource) jdbcHelper.getDataSource();
   GenericObjectPool pool = TestUtils.getField(ds, "_pool", GenericObjectPool.class);
   assertEquals(
       pool.getNumActive(),
       0,
       "Found "
           + pool.getNumActive()
           + " active connections after test ended:\n"
           + TestUtils.invokeMethodNoArgs(pool, "debugInfo"));
   artifactoryHomeBoundTest.unbindArtifactoryHome();
 }
コード例 #3
0
 @AfterMethod
 public void unbindArtifactoryHome() {
   artifactoryHomeBoundTest.unbindArtifactoryHome();
 }
コード例 #4
0
 @BeforeMethod
 public void bindArtifactoryHome() {
   artifactoryHomeBoundTest.bindArtifactoryHome();
 }