Source:
<code>public static void init() { try { dba = Allocator.getInstance(); LOGGER.info("Allocating a new database might take many minutes, depending on the mode the test suite operates in."); db = dba.allocateDB(); assertNotNull("Failed to allocate DB. Check logs for the root cause.", db); prepareContextXML(); final File[] dbDriver = (dba instanceof DBAllocator) ? new File[]{new File(db.dbDriverArtifact)} : Maven.resolver().resolve(db.dbDriverArtifact).withTransitivity().asFile(); assertNotNull("WebArchive was not created by @Deployment before @BeforeClass. Arquillian lifecycle config error?", webArchive); webArchive.addAsLibraries(dbDriver); webArchive.addAsManifestResource("context.xml", "context.xml"); final String versionTXSpec = System.getProperty("version.org.jboss.spec.javax.transaction"); if (StringUtils.isEmpty(versionTXSpec)) { throw new IllegalArgumentException("version.org.jboss.spec.javax.transaction must not be empty"); } catalinaHome = System.getenv("CATALINA_HOME"); if (StringUtils.isEmpty(catalinaHome)) { throw new IllegalArgumentException("CATALINA_HOME must not be empty"); } libFiles = Maven.resolver() .resolve("org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:" + versionTXSpec) .withTransitivity().asFile(); final String dest = catalinaHome + File.separator + "lib" + File.separator + libFiles[0].getName(); try { Files.copy(Paths.get(libFiles[0].toURI()), Paths.get(dest), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { fail("Either CATALINA_HOME or version.org.jboss.spec.javax.transaction is invalid, we cannot copy to " + dest); e.printStackTrace(); } } catch (IOException | NullPointerException e) { e.printStackTrace(); fail(e.getMessage()); <START> if (dba != null && db != null) { <END> dba.deallocateDB(db); } } }</code><technical_language>place finally block, this executed (fail throw AssertionException I expect)</technical_language>

Target:
public static void init() { try { dba = Allocator.getInstance(); LOGGER.info("Allocating a new database might take many minutes, depending on the mode the test suite operates in."); db = dba.allocateDB(); assertNotNull("Failed to allocate DB. Check logs for the root cause.", db); prepareContextXML(); final File[] dbDriver = (dba instanceof DBAllocator) ? new File[]{new File(db.dbDriverArtifact)} : Maven.resolver().resolve(db.dbDriverArtifact).withTransitivity().asFile(); assertNotNull("WebArchive was not created by @Deployment before @BeforeClass. Arquillian lifecycle config error?", webArchive); webArchive.addAsLibraries(dbDriver); webArchive.addAsManifestResource("context.xml", "context.xml"); final String versionTXSpec = System.getProperty("version.org.jboss.spec.javax.transaction"); if (StringUtils.isEmpty(versionTXSpec)) { throw new IllegalArgumentException("version.org.jboss.spec.javax.transaction must not be empty"); } catalinaHome = System.getenv("CATALINA_HOME"); if (StringUtils.isEmpty(catalinaHome)) { throw new IllegalArgumentException("CATALINA_HOME must not be empty"); } libFiles = Maven.resolver() .resolve("org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:" + versionTXSpec) .withTransitivity().asFile(); final String dest = catalinaHome + File.separator + "lib" + File.separator + libFiles[0].getName(); try { Files.copy(Paths.get(libFiles[0].toURI()), Paths.get(dest), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Either CATALINA_HOME or version.org.jboss.spec.javax.transaction is invalid, we cannot copy to " + dest, e); fail(e.getMessage()); } } catch (IOException | NullPointerException e) { LOGGER.log(Level.SEVERE, "Web app war archive generating or /lib dir configuration failed.", e); if (dba != null && db != null) { dba.deallocateDB(db); } fail(e.getMessage()); } }