Package org.subethamail.wiser

Examples of org.subethamail.wiser.Wiser


  /* Wiser is a fake email server for unit testing */
  private Wiser wiser;
 
  @Before
  public void setUp() throws Exception {
    wiser = new Wiser();
    wiser.setPort(5025);
    wiser.start();
  }
View Full Code Here


  @Before
  public void startWiser() {

    this.wiserPort = SocketUtils.findAvailableServerSocket(2500);

    wiser = new Wiser();
    wiser.setPort(this.wiserPort);
    wiser.start();
    LOGGER.info("Wiser was started.");

  }
View Full Code Here

    {
        if (this.fakeMailServer == null || isMailServerStopped(fakeMailServer))
        {
            mailServerPort++;

            this.fakeMailServer = new Wiser();
            this.fakeMailServer.setPort(getMailServerPort());
            this.fakeMailServer.start();

            assertFalse("fake mail server didn't start", isMailServerStopped(fakeMailServer));
View Full Code Here

    assertFieldEquals("Sender should be crohr", mailer, "automatedSender", "crohr");
  }
 
  @Test
  public void testSendMessageMailerDisabled() {
    Wiser server = new Wiser(2500);
    server.start();
   
    Properties props = new Properties();
    props.setProperty("mail.enabled", "false");
    Mailer mailer = new Mailer(props);
    mailer.sendMessage("Test Message Subject", "Test Message Body");
   
    server.stop();
    assertTrue(server.getMessages().size() == 0);
  }
View Full Code Here

    assertTrue(server.getMessages().size() == 0);
  }
 
  @Test
  public void testSendMessageNoRecipients() {
    Wiser server = new Wiser(2500);
    server.start();
   
    Properties props = new Properties();
    props.setProperty("mail.enabled", "true");
    props.setProperty("mail.host", "localhost");
    props.setProperty("mail.port", "25");
    props.setProperty("mail.sender.username", "crohr");
    props.setProperty("mail.from.address", "crohr");
    props.setProperty("mail.sender.password", "password");
    Mailer mailer = new Mailer(props);
    mailer.sendMessage("Test Message Subject", "Test Message Body");
   
    server.stop();
    assertTrue(server.getMessages().size() == 0);
  }
View Full Code Here

    assertTrue(server.getMessages().size() == 0);
  }
 
  @Test
  public void testSendMessage() throws MessagingException {
    Wiser server = new Wiser(2500);
    server.start();
   
    Properties props = new Properties();
    props.setProperty("mail.enabled", "true");
    props.setProperty("mail.host", "localhost");
    props.setProperty("mail.port", "2500");
    props.setProperty("mail.sender.username", "crohr");
    props.setProperty("mail.from.address", "crohr");
    props.setProperty("mail.sender.password", "password");
    props.setProperty("mail.recipients", "crohr@nearinfinity.com|bmarcur@nearinfinity.com");
    Mailer mailer = new Mailer(props);
    mailer.sendMessage("Test Message Subject", "Test Message Body");
   
    server.stop();
    assertTrue(server.getMessages().size() == 2);
    assertEquals("Test Message Subject", server.getMessages().get(0).getMimeMessage().getSubject());
  }
View Full Code Here

    {
        if (this.fakeMailServer == null || isMailServerStopped(fakeMailServer))
        {
            mailServerPort++;

            this.fakeMailServer = new Wiser();
            this.fakeMailServer.setPort(getMailServerPort());
            this.fakeMailServer.start();

            assertFalse("fake mail server didn't start", isMailServerStopped(fakeMailServer));
View Full Code Here

    int port = processEngineConfiguration.getMailServerPort();
   
    boolean serverUpAndRunning = false;
    while (!serverUpAndRunning) {
      wiser = new Wiser();
      wiser.setPort(port);
     
      try {
        log.info("Starting Wiser mail server on port: " + port);
        wiser.start();
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
   
    boolean serverUpAndRunning = false;
    while (!serverUpAndRunning) {
      wiser = new Wiser();
      wiser.setPort(processEngineConfiguration.getMailServerPort());
     
      try {
        wiser.start();
        serverUpAndRunning = true;
View Full Code Here

  private Wiser wiser;
 
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    wiser = new Wiser();
    wiser.setPort(processEngineConfiguration.getMailServerPort());
    wiser.start();
  }
View Full Code Here

TOP

Related Classes of org.subethamail.wiser.Wiser

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.