From d63a4f1fbe65da6e4ad6d7ca589cc0d919a652a1 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Thu, 4 Jan 2007 22:32:45 +0000 Subject: [PATCH] Improved teardown logic. An error while deleting an account does no longer stop the tear down process (i.e. deletion of the other accounts). git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6530 b35dd754-fafc-0310-a699-88a17e54d16e --- test/org/jivesoftware/smack/test/SmackTestCase.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/org/jivesoftware/smack/test/SmackTestCase.java b/test/org/jivesoftware/smack/test/SmackTestCase.java index bbfb9b002..f1359c437 100644 --- a/test/org/jivesoftware/smack/test/SmackTestCase.java +++ b/test/org/jivesoftware/smack/test/SmackTestCase.java @@ -233,9 +233,16 @@ public abstract class SmackTestCase extends TestCase { for (int i = 0; i < getMaxConnections(); i++) { if (getConnection(i).isConnected()) { // Delete the created account for the test - getConnection(i).getAccountManager().deleteAccount(); - // Close the connection - getConnection(i).disconnect(); + try { + getConnection(i).getAccountManager().deleteAccount(); + } + catch (XMPPException e) { + e.printStackTrace(); + } + if (getConnection(i).isConnected()) { + // Close the connection + getConnection(i).disconnect(); + } } } }