diff options
author | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-20 20:58:58 +0000 |
---|---|---|
committer | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-20 20:58:58 +0000 |
commit | 6d91145f80d26d341aa31c5eb41284364137f30d (patch) | |
tree | fd6453ea106a777f305432178060ccfe48c3653b /branches/sca-java-1.x/modules | |
parent | 2a83d8422d3ea46230edad375265bf0e8f1b0a3b (diff) |
Issue: NullPointerException will be thrown in the destory methods if the domains fail to initialise because the destroy method attempts to close the domain but the domain is null.
Fix: Added check for null before attempting to close the domain
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@786907 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules')
8 files changed, 51 insertions, 30 deletions
diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java index 7688a5dd26..a427a076cd 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java @@ -49,8 +49,12 @@ public class AtomDeleteTestCase { @AfterClass public static void destroy() throws Exception { // System.out.println(">>>AtomDeleteTestCase.destroy entry"); - scaConsumerDomain.close(); - scaProviderDomain.close(); + if (scaConsumerDomain != null) { + scaConsumerDomain.close(); + } + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } } @Test diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java index 03a427f11c..32a01ebe2a 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java @@ -47,8 +47,12 @@ public class AtomGetTestCase { @AfterClass public static void destroy() throws Exception { // System.out.println(">>>AtomGetTestCase.destroy entry"); - scaConsumerDomain.close(); - scaProviderDomain.close(); + if (scaConsumerDomain != null) { + scaConsumerDomain.close(); + } + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } } @Test diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java index e9e0e315ab..49e9c2f25f 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java @@ -47,8 +47,12 @@ public class AtomPostTestCase { @AfterClass public static void destroy() throws Exception { System.out.println(">>>AtomPostTestCase.destroy entry"); - scaConsumerDomain.close(); - scaProviderDomain.close(); + if (scaConsumerDomain != null) { + scaConsumerDomain.close(); + } + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } } @Test diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java index c46634e784..3aaad681f4 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java @@ -49,8 +49,12 @@ public class AtomPutTestCase { @AfterClass public static void destroy() throws Exception { // System.out.println(">>>AtomPutTestCase.destroy entry"); - scaConsumerDomain.close(); - scaProviderDomain.close(); + if (scaConsumerDomain != null) { + scaConsumerDomain.close(); + } + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } } @Test diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java index 394cdf3f6d..2ed0729b00 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java @@ -51,7 +51,6 @@ import org.junit.Test; */ public class MediaCollectionTestCase { public final static String providerURI = "http://localhost:8084/receipt"; - protected static SCADomain scaConsumerDomain; protected static SCADomain scaProviderDomain; protected static CustomerClient testService; protected static Abdera abdera; @@ -71,11 +70,13 @@ public class MediaCollectionTestCase { abderaParser = Abdera.getNewParser(); } - @AfterClass - public static void destroy() throws Exception { - System.out.println(">>>MediaCollectionTestCase.destroy"); - scaProviderDomain.close(); - } + @AfterClass + public static void destroy() throws Exception { + System.out.println(">>>MediaCollectionTestCase.destroy"); + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } + } @Test public void testPrelim() throws Exception { diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java index 1ba1dcca11..c209e2dfe6 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java @@ -47,7 +47,6 @@ import org.junit.Test; */ public class ProviderEntryEntityTagsTestCase { public final static String providerURI = "http://localhost:8084/customer"; - protected static SCADomain scaConsumerDomain; protected static SCADomain scaProviderDomain; protected static CustomerClient testService; protected static Abdera abdera; @@ -66,11 +65,13 @@ public class ProviderEntryEntityTagsTestCase { abderaParser = Abdera.getNewParser(); } - @AfterClass - public static void destroy() throws Exception { - System.out.println(">>>ProviderEntryEntityTagsTestCase.destroy"); - scaProviderDomain.close(); - } + @AfterClass + public static void destroy() throws Exception { + System.out.println(">>>ProviderEntryEntityTagsTestCase.destroy"); + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } + } @Test public void testPrelim() throws Exception { diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java index 030bed62e5..42edeb8f0d 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java @@ -53,7 +53,6 @@ import org.junit.Test; */ public class ProviderFeedEntityTagsTestCase { public final static String providerURI = "http://localhost:8084/customer"; - protected static SCADomain scaConsumerDomain; protected static SCADomain scaProviderDomain; protected static CustomerClient testService; protected static Abdera abdera; @@ -72,11 +71,13 @@ public class ProviderFeedEntityTagsTestCase { abderaParser = Abdera.getNewParser(); } - @AfterClass - public static void destroy() throws Exception { - System.out.println(">>>ProviderFeedEntityTagsTestCase.destroy"); - scaProviderDomain.close(); - } + @AfterClass + public static void destroy() throws Exception { + System.out.println(">>>ProviderFeedEntityTagsTestCase.destroy"); + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } + } @Test public void testPrelim() throws Exception { diff --git a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java index a92d4577d1..0d4194070d 100644 --- a/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java +++ b/branches/sca-java-1.x/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java @@ -65,10 +65,12 @@ public class ProviderServiceDocumentTestCase { abderaParser = Abdera.getNewParser(); } - @AfterClass - public static void destroy() throws Exception { - scaProviderDomain.close(); - } + @AfterClass + public static void destroy() throws Exception { + if (scaProviderDomain != null) { + scaProviderDomain.close(); + } + } @Test public void testPrelim() throws Exception { |