Package org.springframework.mail

Examples of org.springframework.mail.MailSendException


    assertTrue(rr.getDepth(new MailSendException("")) == 4);
  }

  public void testAlwaysTrueForThrowable() {
    RollbackRuleAttribute rr = new RollbackRuleAttribute("java.lang.Throwable");
    assertTrue(rr.getDepth(new MailSendException("")) > 0);
    assertTrue(rr.getDepth(new ServletException()) > 0);
    assertTrue(rr.getDepth(new FatalBeanException(null,null)) > 0);
    assertTrue(rr.getDepth(new RuntimeException()) > 0);
  }
View Full Code Here


    assertFalse(ta.isReadOnly());
    assertTrue(ta.rollbackOn(new RuntimeException()));
    assertFalse(ta.rollbackOn(new Exception()));
    // Check for our bizarre customized rollback rules
    assertTrue(ta.rollbackOn(new ServletException()));
    assertTrue(!ta.rollbackOn(new MailSendException("")));
  }
View Full Code Here

    assertTrue(ta.isReadOnly());
    assertTrue(ta.rollbackOn(new RuntimeException()));
    assertFalse(ta.rollbackOn(new Exception()));
    // Check for our bizarre customized rollback rules
    assertFalse(ta.rollbackOn(new ServletException()));
    assertTrue(ta.rollbackOn(new MailSendException("")));
  }
View Full Code Here

public class RuleBasedTransactionAttributeTests extends TestCase {

  public void testDefaultRule() {
    RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute();
    assertTrue(rta.rollbackOn(new RuntimeException()));
    assertTrue(rta.rollbackOn(new MailSendException("")));
    assertFalse(rta.rollbackOn(new Exception()));
    assertFalse(rta.rollbackOn(new ServletException()));
  }
View Full Code Here

    List list = new LinkedList();
    list.add(new RollbackRuleAttribute("javax.servlet.ServletException"));
    RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
   
    assertTrue(rta.rollbackOn(new RuntimeException()));
    assertTrue(rta.rollbackOn(new MailSendException("")));
    assertFalse(rta.rollbackOn(new Exception()));
    // Check that default behaviour is overridden
    assertTrue(rta.rollbackOn(new ServletException()));
  }
View Full Code Here

    list.add(new RollbackRuleAttribute("javax.servlet.ServletException"));
    RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
   
    assertTrue(rta.rollbackOn(new RuntimeException()));
    // Check default behaviour is overridden
    assertFalse(rta.rollbackOn(new MailSendException("")));
    assertFalse(rta.rollbackOn(new Exception()));
    // Check that default behaviour is overridden
    assertTrue(rta.rollbackOn(new ServletException()));
  }
View Full Code Here

    list.add(new NoRollbackRuleAttribute("Throwable"));
    RuleBasedTransactionAttribute rta = new RuleBasedTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED, list);
 
    assertFalse(rta.rollbackOn(new Throwable()));
    assertFalse(rta.rollbackOn(new RuntimeException()));
    assertFalse(rta.rollbackOn(new MailSendException("")));
    assertFalse(rta.rollbackOn(new Exception()));
    assertFalse(rta.rollbackOn(new ServletException()));
  }
View Full Code Here

    tae.setAsText(rta.toString());
    rta = (RuleBasedTransactionAttribute) tae.getValue();

    assertFalse(rta.rollbackOn(new Throwable()));
    assertFalse(rta.rollbackOn(new RuntimeException()));
    assertFalse(rta.rollbackOn(new MailSendException("")));
    assertFalse(rta.rollbackOn(new Exception()));
    assertFalse(rta.rollbackOn(new ServletException()));
  }
View Full Code Here

            Store store = getSession().getStore(protocol);
            store.connect(getHost(), getPort(), getUsername(), getPassword());
            return store.getFolder(folderName);
        }
        catch (MessagingException e) {
            throw new MailSendException("Mail server connection failed", e);
        }
    }
View Full Code Here

    }

    @Test
    public void testSendUpdatesOnSubscriptionExceptionCase() {
        enableEmailNotifications();
        Exception fail = new MailSendException("");
        doThrow(fail).when(sender).send(Matchers.<MimeMessage>any());
        service.sendUpdatesOnSubscription(user, codeReview);
        verify(sender).send(Matchers.<MimeMessage>any());
    }
View Full Code Here

TOP

Related Classes of org.springframework.mail.MailSendException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.