Package org.subethamail.wiser

Examples of org.subethamail.wiser.Wiser.stop()


        assertNull(doc.getElementById("errorMessages"));

        // verify an account information e-mail was sent
        assertEquals(1, wiser.getMessages().size());
        wiser.stop();

        //Element successMessages = doc.getElementById("successMessages");
        //assertNotNull(successMessages);
        //assertTrue(successMessages.toString().contains("added successfully"));
        assertTrue(doc.toString().contains("added successfully"));
View Full Code Here


        wiser.start();

        doc = tester.renderPage("passwordHint/admin");

        // verify an account information e-mail was sent
        wiser.stop();
        assertTrue(wiser.getMessages().size() == 1);

        assertTrue(doc.toString().contains("The password hint for admin has been sent to"));
    }
View Full Code Here

        BindingResult errors = new DataBinder(user).getBindingResult();
        c.onSubmit(user, errors, request, response);
        assertFalse("errors returned in model", errors.hasErrors());

        // verify an account information e-mail was sent
        wiser.stop();
        assertTrue(wiser.getMessages().size() == 1);

        // verify that success messages are in the request
        assertNotNull(request.getSession().getAttribute("successMessages"));
        assertNotNull(request.getSession().getAttribute(Constants.REGISTERED));
View Full Code Here

        wiser.start();

        controller.requestRecoveryToken(username, request);

        // verify an account information e-mail was sent
        wiser.stop();
        assertTrue(wiser.getMessages().size() == 1);

        // verify that success messages are in the session
        assertNotNull(request.getSession().getAttribute(BaseFormController.MESSAGES_KEY));
    }
View Full Code Here

        wiser.setPort(getSmtpPort());
        wiser.start();

        ModelAndView mav = controller.onSubmit(username, token, null, password, request);

        wiser.stop();
        assertTrue(wiser.getMessages().size() == 1);

        assertNotNull(request.getSession().getAttribute(BaseFormController.MESSAGES_KEY));
        assertNull(request.getSession().getAttribute(BaseFormController.ERRORS_MESSAGES_KEY));
    }
View Full Code Here

    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);
  }
 
  @Test
  public void testSendMessageNoRecipients() {
View Full Code Here

    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);
  }
 
  @Test
  public void testSendMessage() throws MessagingException {
View Full Code Here

    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());
  }

//  @Test
View Full Code Here

        assertEquals("home", bean.save());
        assertFalse(bean.hasErrors());

        // verify an account information e-mail was sent
        wiser.stop();
        assertTrue(wiser.getMessages().size() == 1);

        // verify that success messages are in the session
        assertNotNull(bean.getSession().getAttribute(Constants.REGISTERED));
View Full Code Here

        bean.setUsername("user");
        assertEquals("success", bean.execute());
        assertFalse(bean.hasErrors());

        // verify an account information e-mail was sent
        wiser.stop();
        assertTrue(wiser.getMessages().size() == 1);

        // verify that success messages are in the request
        assertNotNull(bean.getSession().getAttribute("messages"));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.