Author: eric Date: Sun Dec 26 12:45:13 2010 New Revision: 1052884 URL: http://svn.apache.org/viewvc?rev=1052884&view=rev Log: Delete JPA mailboxes created in memory in the other tests cause it was failing when run via mvn test.
Modified: james/mailbox/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/JPAMailboxManagerTest.java Modified: james/mailbox/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/JPAMailboxManagerTest.java URL: http://svn.apache.org/viewvc/james/mailbox/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/JPAMailboxManagerTest.java?rev=1052884&r1=1052883&r2=1052884&view=diff ============================================================================== --- james/mailbox/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/JPAMailboxManagerTest.java (original) +++ james/mailbox/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/JPAMailboxManagerTest.java Sun Dec 26 12:45:13 2010 @@ -69,6 +69,7 @@ public class JPAMailboxManagerTest exten */ @After public void tearDown() throws BadCredentialsException, MailboxException { + deleteAllMailboxes(); MailboxSession session = getMailboxManager().createSystemSession("test", new SimpleLog("Test")); session.close(); entityManagerFactory.close(); @@ -102,8 +103,21 @@ public class JPAMailboxManagerTest exten JPAMailboxManager mailboxManager = new OpenJPAMailboxManager(mf, null, uidProvider); mailboxManager.init(); - + setMailboxManager(mailboxManager); + + deleteAllMailboxes(); + + } + + private void deleteAllMailboxes() throws BadCredentialsException, MailboxException { + MailboxSession session = getMailboxManager().createSystemSession("test", new SimpleLog("Test")); + try { + ((OpenJPAMailboxManager) mailboxManager).deleteEverything(session); + } catch (MailboxException e) { + e.printStackTrace(); + } + session.close(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org