From 997c859834d229b9de4ad32f3340a59a2ceada66 Mon Sep 17 00:00:00 2001 From: Gurunandan Rao Date: Wed, 15 Nov 2023 15:58:10 +0530 Subject: [PATCH] code cleanup. Signed-off-by: Gurunandan Rao --- .../sun/ts/tests/jpa/common/PMClientBase.java | 27 +++++++++++-------- .../core/StoredProcedureQuery/Client1IT.java | 2 +- .../core/StoredProcedureQuery/Client2IT.java | 2 +- .../jpa/core/types/generator/Client2IT.java | 1 - .../sequencegenerators/ClientIT.java | 8 +++--- .../repeatable/secondarytable/ClientIT.java | 19 +++++-------- .../tests/jpa/se/cache/inherit/ClientIT.java | 20 +++++--------- .../tests/jpa/se/cache/xml/all/ClientIT.java | 18 +++++-------- .../cache/xml/disableselective/ClientIT.java | 18 +++++-------- .../cache/xml/enableselective/ClientIT.java | 20 +++++--------- .../tests/jpa/se/cache/xml/none/ClientIT.java | 21 +++++---------- .../ts/tests/jpa/se/descriptor/ClientIT.java | 16 +++++------ .../tests/jpa/se/entityManager/ClientIT.java | 19 +++++-------- .../jpa/se/entityManagerFactory/ClientIT.java | 10 +++---- .../contracts/resource_local/ClientIT.java | 27 +++++++++++++------ .../jpa/se/resource_local/Client1IT.java | 18 +++++-------- .../discriminatorColumn/ClientIT.java | 21 +++++++-------- .../annotations/enumerated/ClientIT.java | 20 ++++++-------- .../annotations/id/ClientIT.java | 21 +++++++-------- .../annotations/index/ClientIT.java | 20 ++++++-------- .../annotations/joinTable/ClientIT.java | 21 +++++++-------- .../annotations/orderColumn/ClientIT.java | 21 +++++++-------- .../annotations/secondaryTable/ClientIT.java | 21 +++++++-------- .../sequenceGenerator/ClientIT.java | 21 +++++++-------- .../annotations/table/ClientIT.java | 22 +++++++-------- .../annotations/tableGenerator/ClientIT.java | 21 +++++++-------- .../annotations/temporal/ClientIT.java | 20 ++++++-------- .../uniqueConstraint/ClientIT.java | 21 +++++++-------- .../annotations/version/ClientIT.java | 21 +++++++-------- .../se/schemaGeneration/scripts/ClientIT.java | 22 +++++++-------- 30 files changed, 230 insertions(+), 309 deletions(-) diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/common/PMClientBase.java b/jpa/src/main/java/com/sun/ts/tests/jpa/common/PMClientBase.java index f6f0edcf8c..93283157a3 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/common/PMClientBase.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/common/PMClientBase.java @@ -87,6 +87,8 @@ abstract public class PMClientBase implements UseEntityManager, UseEntityManager transient private boolean inContainer; + private boolean testArtifactDeployed = false; + // The following are properties specific to standalone TCK, // not used when running tests in JakartaEE environment transient private EntityManagerFactory emf; @@ -1095,9 +1097,9 @@ public String convertToURI(String path) { public static final String PERSISTENCE_XML = "persistence.xml"; public static final String ORM_XML = "orm.xml"; public static final String MAPPING_FILE_XML = "myMappingFile.xml"; - - public static JavaArchive createDeploymentJar(String jarName, String packageName, String[] classes, - String persistenceFile, String[] xmlFiles) throws Exception { + + public JavaArchive createDeploymentJar(String jarName, String packageName, String[] classes, String persistenceFile, + String[] xmlFiles) throws Exception { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, jarName); @@ -1157,27 +1159,30 @@ public static JavaArchive createDeploymentJar(String jarName, String packageName URLClassLoader urlClassLoader = new URLClassLoader( new URL[] { new File(TEMP_DIR + File.separator + jarName).toURL() }, currentThreadClassLoader); Thread.currentThread().setContextClassLoader(urlClassLoader); + testArtifactDeployed = true; return archive; } - public static JavaArchive createDeploymentJar(String jarName, String packageName, String[] classes, - String[] xmlFiles) throws Exception { + public JavaArchive createDeploymentJar(String jarName, String packageName, String[] classes, String[] xmlFiles) + throws Exception { return createDeploymentJar(jarName, packageName, classes, STANDALONE_PERSISTENCE_XML, xmlFiles); } - public static JavaArchive createDeploymentJar(String jarName, String packageName, String[] classes) - throws Exception { + public JavaArchive createDeploymentJar(String jarName, String packageName, String[] classes) throws Exception { String xmlFiles[] = {}; return createDeploymentJar(jarName, packageName, classes, STANDALONE_PERSISTENCE_XML, xmlFiles); } - public static void removeTestJarFromCP() throws Exception { - URLClassLoader currentThreadClassLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(currentThreadClassLoader.getParent()); - currentThreadClassLoader.close(); + public void removeTestJarFromCP() throws Exception { + if (testArtifactDeployed) { + URLClassLoader currentThreadClassLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(currentThreadClassLoader.getParent()); + currentThreadClassLoader.close(); + testArtifactDeployed = false; + } } public static String toString(InputStream inStream) throws IOException { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client1IT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client1IT.java index fb488398e9..176e6cf9ac 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client1IT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client1IT.java @@ -45,7 +45,7 @@ public class Client1IT extends Client { public Client1IT() { } - public static JavaArchive createDeployment() throws Exception { + public JavaArchive createDeployment() throws Exception { String pkgNameWithoutSuffix = Client1IT.class.getPackageName(); String pkgName = pkgNameWithoutSuffix + "."; diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client2IT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client2IT.java index d371ff64b4..1408c9e899 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client2IT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/core/StoredProcedureQuery/Client2IT.java @@ -38,7 +38,7 @@ public class Client2IT extends Client { public Client2IT() { } - public static JavaArchive createDeployment() throws Exception { + public JavaArchive createDeployment() throws Exception { String pkgNameWithoutSuffix = Client2IT.class.getPackageName(); String pkgName = pkgNameWithoutSuffix + "."; diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/core/types/generator/Client2IT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/core/types/generator/Client2IT.java index caaeb28bc8..a817e0e315 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/core/types/generator/Client2IT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/core/types/generator/Client2IT.java @@ -145,7 +145,6 @@ public void generatorTypeSequenceTest() throws Exception { public void createDataTypes2Data() { try { - getEntityTransaction().begin(); diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/generators/sequencegenerators/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/generators/sequencegenerators/ClientIT.java index 137f9cd6fe..66d8528de0 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/generators/sequencegenerators/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/generators/sequencegenerators/ClientIT.java @@ -64,10 +64,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); supportSequence = Boolean.valueOf(System.getProperty("db.supports.sequence")); @@ -87,6 +83,10 @@ public void setup() throws Exception { throw new Exception(msg); } removeTestData(); + + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/repeatable/secondarytable/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/repeatable/secondarytable/ClientIT.java index 46365d24ee..e91c5b4e69 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/repeatable/secondarytable/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/jpa22/se/repeatable/secondarytable/ClientIT.java @@ -54,14 +54,12 @@ public JavaArchive createDeployment() throws Exception { public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { - super.setup(); + createDeployment(); + removeTestData(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); - removeTestData(); } } @@ -159,14 +157,11 @@ public void subClassInheritsCacheableTrue() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/inherit/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/inherit/ClientIT.java index bce145a112..8c7567f9b8 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/inherit/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/inherit/ClientIT.java @@ -53,15 +53,12 @@ public JavaArchive createDeployment() throws Exception { public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { - super.setup(); - + createDeployment(); + removeTestData(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); - removeTestData(); } } @@ -253,14 +250,11 @@ public void subClassInheritsCacheableFalse() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/all/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/all/ClientIT.java index d00f1f990f..aeaa2a26ce 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/all/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/all/ClientIT.java @@ -70,12 +70,11 @@ public void setup() throws Exception { jpaprops.put("Insert_Jpa_Purchase_Order", System.getProperty("Insert_Jpa_Purchase_Order")); jpaprops.put("Select_Jpa_Purchase_Order", System.getProperty("Select_Jpa_Purchase_Order")); displayMap(jpaprops); + createDeployment(); + removeTestData(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); - removeTestData(); } } @@ -629,14 +628,11 @@ public void createDataVIAJDBC(Properties p) { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/disableselective/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/disableselective/ClientIT.java index e6bb84f657..4264515c70 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/disableselective/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/disableselective/ClientIT.java @@ -53,13 +53,12 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); + createDeployment(); + removeTestData(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); - removeTestData(); } } @@ -139,14 +138,11 @@ public void containsTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/enableselective/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/enableselective/ClientIT.java index fa2e645941..5c4a115d98 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/enableselective/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/enableselective/ClientIT.java @@ -52,15 +52,12 @@ public JavaArchive createDeployment() throws Exception { public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { - super.setup(); - + createDeployment(); + removeTestData(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); - removeTestData(); } } @@ -154,14 +151,11 @@ public void containsTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/none/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/none/ClientIT.java index 9a40bfc80b..e31df26744 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/none/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/cache/xml/none/ClientIT.java @@ -53,16 +53,12 @@ public JavaArchive createDeployment() throws Exception { public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { - super.setup(); - + createDeployment(); + removeTestData(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); - removeTestData(); - } } @@ -124,14 +120,11 @@ public void containsTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/descriptor/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/descriptor/ClientIT.java index 101d5ad690..999e7ccfbc 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/descriptor/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/descriptor/ClientIT.java @@ -49,12 +49,11 @@ public JavaArchive createDeployment() throws Exception { public void setup() throws Exception { try { super.setup(); - } catch (Exception e) { - throw new Exception("Setup Failed!", e); - } finally { createDeployment(); removeTestData(); createTestData(); + } catch (Exception e) { + throw new Exception("Setup Failed!", e); } } @@ -122,13 +121,10 @@ public void createTestData() { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManager/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManager/ClientIT.java index fb898ee0d2..27ff5047d5 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManager/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManager/ClientIT.java @@ -75,29 +75,24 @@ public void setupOrderData() throws Exception { logger.log(Logger.Level.TRACE, "setupOrderData"); try { super.setup(); - - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); removeTestData(); createOrderData(); map.putAll(getEntityManager().getProperties()); map.put("foo", "bar"); displayMap(map); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @AfterEach public void cleanupData() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanupData"); - removeTestData(); - cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanupData"); + removeTestData(); + cleanup(); + removeTestJarFromCP(); } /* diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManagerFactory/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManagerFactory/ClientIT.java index 3eb0f7ad5e..a562425c23 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManagerFactory/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/entityManagerFactory/ClientIT.java @@ -54,21 +54,17 @@ public void setupNoData() throws Exception { logger.log(Logger.Level.TRACE, "setupNoData"); try { super.setup(); + createDeployment(); } catch (Exception e) { logger.log(Logger.Level.ERROR, "Exception: ", e); throw new Exception("Setup failed:", e); - } finally { - createDeployment(); } } @AfterEach public void cleanupNoData() throws Exception { - try { - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + super.cleanup(); + removeTestJarFromCP(); } /* diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/pluggability/contracts/resource_local/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/pluggability/contracts/resource_local/ClientIT.java index 6890752324..f4d3dbeab2 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/pluggability/contracts/resource_local/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/pluggability/contracts/resource_local/ClientIT.java @@ -70,6 +70,8 @@ public class ClientIT extends PMClientBase { private String LOGMESSAGE_PREFIX = "JPA_ALTERNATE_PROVIDER : "; + private boolean pluggabilityJarDeployed = false; + public ClientIT() { } @@ -85,6 +87,15 @@ public JavaArchive createDeployment() throws Exception { } + public void removeTestJarFromCP() throws Exception { + if (pluggabilityJarDeployed) { + URLClassLoader currentThreadClassLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(currentThreadClassLoader.getParent()); + currentThreadClassLoader.close(); + pluggabilityJarDeployed = false; + } + } + public JavaArchive createPluggabilityJar() throws Exception { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jpa_alternate_provider.jar"); @@ -102,6 +113,8 @@ public JavaArchive createPluggabilityJar() throws Exception { currentThreadClassLoader); Thread.currentThread().setContextClassLoader(urlClassLoader); + pluggabilityJarDeployed = true; + return archive; } @@ -666,13 +679,11 @@ public void getClassObjects() { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - logger.log(Logger.Level.TRACE, "calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + logger.log(Logger.Level.TRACE, "calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + removeTestJarFromCP(); + } } diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/resource_local/Client1IT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/resource_local/Client1IT.java index e55341cd5f..1b11513350 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/resource_local/Client1IT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/resource_local/Client1IT.java @@ -61,12 +61,11 @@ public void setup() throws Exception { try { super.setup(); + createDeployment(); + removeTestData(); } catch (Exception e) { throw new Exception("Setup Failed!", e); - } finally { - createDeployment(); - removeTestData(); } } @@ -817,14 +816,11 @@ public void createEntityManagerSynchronizationTypeMapIllegalStateExceptionTest() @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/discriminatorColumn/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/discriminatorColumn/ClientIT.java index 32a73b13e8..3193642d3b 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/discriminatorColumn/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/discriminatorColumn/ClientIT.java @@ -58,10 +58,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); if (!schemaGenerationDir.endsWith(File.separator)) { @@ -80,6 +76,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -202,14 +201,12 @@ public void discriminatorColumnTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/enumerated/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/enumerated/ClientIT.java index 370517520f..ede6e8c197 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/enumerated/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/enumerated/ClientIT.java @@ -58,10 +58,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -81,6 +77,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -202,14 +201,11 @@ public void enumeratedTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/id/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/id/ClientIT.java index 94e15e9f9e..9f920bffeb 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/id/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/id/ClientIT.java @@ -58,10 +58,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -81,7 +77,11 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } + } /* @@ -201,14 +201,11 @@ public void idTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/index/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/index/ClientIT.java index b5aeeb43a3..1bfb8c63e5 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/index/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/index/ClientIT.java @@ -60,10 +60,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -83,6 +79,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -280,14 +279,11 @@ public void indexTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/joinTable/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/joinTable/ClientIT.java index 9bb48acf11..1c3e41a149 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/joinTable/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/joinTable/ClientIT.java @@ -61,10 +61,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -84,6 +80,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -337,14 +336,12 @@ public void joinTableTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/orderColumn/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/orderColumn/ClientIT.java index 03e31a02db..e8180e76fe 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/orderColumn/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/orderColumn/ClientIT.java @@ -62,10 +62,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -85,6 +81,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -274,14 +273,12 @@ public void orderColumnTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/secondaryTable/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/secondaryTable/ClientIT.java index a6a51542e8..c9de647609 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/secondaryTable/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/secondaryTable/ClientIT.java @@ -60,10 +60,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -83,6 +79,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -231,14 +230,12 @@ public void secondaryTableTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/sequenceGenerator/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/sequenceGenerator/ClientIT.java index c7c1ebd776..3ca5f96c42 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/sequenceGenerator/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/sequenceGenerator/ClientIT.java @@ -65,10 +65,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); @@ -91,6 +87,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -228,14 +227,12 @@ public void sequenceGeneratorTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/table/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/table/ClientIT.java index 0752322961..83afb892a1 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/table/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/table/ClientIT.java @@ -56,10 +56,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -79,6 +75,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -193,14 +192,13 @@ public void tableTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/tableGenerator/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/tableGenerator/ClientIT.java index 7f8638bd12..beceed8d07 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/tableGenerator/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/tableGenerator/ClientIT.java @@ -62,10 +62,6 @@ public void setup() throws Exception { try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); if (!schemaGenerationDir.endsWith(File.separator)) { @@ -83,6 +79,10 @@ public void setup() throws Exception { throw new Exception(msg); } removeTestData(false); + + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -225,14 +225,11 @@ public void tableGeneratorTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(true); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(true); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData(boolean expectExist) { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/temporal/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/temporal/ClientIT.java index f7b77064f4..05f97eced7 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/temporal/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/temporal/ClientIT.java @@ -59,10 +59,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -82,6 +78,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -206,14 +205,11 @@ public void temporalTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/uniqueConstraint/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/uniqueConstraint/ClientIT.java index 13f6176fdf..139191469c 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/uniqueConstraint/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/uniqueConstraint/ClientIT.java @@ -60,10 +60,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -82,6 +78,10 @@ public void setup() throws Exception { throw new Exception(msg); } removeTestData(); + + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -225,14 +225,11 @@ public void uniqueConstraintTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/version/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/version/ClientIT.java index 49c1eb14ec..8332c65e90 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/version/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/annotations/version/ClientIT.java @@ -57,10 +57,6 @@ public void setup() throws Exception { logger.log(Logger.Level.TRACE, "setup"); try { super.setup(); - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { createDeployment(); schemaGenerationDir = System.getProperty("user.dir"); @@ -80,6 +76,9 @@ public void setup() throws Exception { } removeTestData(); + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -203,14 +202,12 @@ public void versionTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); + } private void removeTestData() { diff --git a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/scripts/ClientIT.java b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/scripts/ClientIT.java index a55d5e08ab..6d5096db6b 100644 --- a/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/scripts/ClientIT.java +++ b/jpa/src/main/java/com/sun/ts/tests/jpa/se/schemaGeneration/scripts/ClientIT.java @@ -66,11 +66,6 @@ public void setup() throws Exception { try { super.setup(); createDeployment(); - - } catch (Exception e) { - logger.log(Logger.Level.ERROR, "Exception: ", e); - throw new Exception("Setup failed:", e); - } finally { schemaGenerationDir = System.getProperty("user.dir"); if (!schemaGenerationDir.endsWith(File.separator)) { schemaGenerationDir += File.separator; @@ -87,6 +82,10 @@ public void setup() throws Exception { throw new Exception(msg); } removeTestData(); + + } catch (Exception e) { + logger.log(Logger.Level.ERROR, "Exception: ", e); + throw new Exception("Setup failed:", e); } } @@ -1086,14 +1085,11 @@ public void executeDropScriptReaderTest() throws Exception { @AfterEach public void cleanup() throws Exception { - try { - logger.log(Logger.Level.TRACE, "cleanup"); - removeTestData(); - logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); - super.cleanup(); - } finally { - removeTestJarFromCP(); - } + logger.log(Logger.Level.TRACE, "cleanup"); + removeTestData(); + logger.log(Logger.Level.TRACE, "cleanup complete, calling super.cleanup"); + super.cleanup(); + removeTestJarFromCP(); } private void removeTestData() {