return getContext().getExecutor().submit(f);
protected Future<Boolean> send(MailPlugin plugin) throws IOException, MessagingException { return plugin.send(Arrays.asList("dst@gmail.com"), "Testing Subject", "Dear Mail Crawler," + "\n\n No spam to my email, please!"); }
@Override public void init() { smtpHost = getContext().getProperty(SMTP_HOST); smtpPort = getContext().getProperty(SMTP_PORT); smtpSecure = getContext().getProperty(SMTP_SECURE); smtpUsername = getContext().getProperty(SMTP_USERNAME); smtpPassword = getContext().getProperty(SMTP_PASSWORD); smtpFrom = getContext().getProperty(SMTP_FROM); debug = getContext().getProperty(DEBUG); }
protected TestPluginLifeCycle createLifeCycle() throws Exception { TestPluginLifeCycle test = new TestPluginLifeCycle(new MailPlugin(), new GroovyLanguageProxy(), new JavaLanguage()); test.setProperty(MailPlugin.SMTP_HOST, "localhost"); test.setProperty(MailPlugin.SMTP_PORT, 5000); test.setProperty(MailPlugin.SMTP_FROM, "foo@gmail.com"); return test; }
@Override protected Future<Boolean> send(MailPlugin plugin) throws IOException, MessagingException { return plugin.send(Arrays.asList("dst@gmail.com"), "Testing Subject", "<html><body>hello wolrd</body></html>", "text/html;charset=UTF-8"); }
@Override public void init() { smtpHost = getContext().getProperty(SMTP_HOST); smtpPort = getContext().getProperty(SMTP_PORT); smtpSecure = getContext().getProperty(SMTP_SECURE); smtpUsername = getContext().getProperty(SMTP_USERNAME); smtpPassword = getContext().getProperty(SMTP_PASSWORD); smtpFrom = getContext().getProperty(SMTP_FROM); debug = getContext().getProperty(DEBUG); }
return getContext().getExecutor().submit(f);
@Override protected Future<Boolean> send(MailPlugin plugin) throws IOException, MessagingException { return plugin.send(Arrays.asList("dst@gmail.com"), "Testing Subject", "Dear Mail Crawler," + "\n\n No spam to my email, please!", new FileDataSource(f)); } @Override
@Override public void init() { smtpHost = getContext().getProperty(SMTP_HOST); smtpPort = getContext().getProperty(SMTP_PORT); smtpSecure = getContext().getProperty(SMTP_SECURE); smtpUsername = getContext().getProperty(SMTP_USERNAME); smtpPassword = getContext().getProperty(SMTP_PASSWORD); smtpFrom = getContext().getProperty(SMTP_FROM); debug = getContext().getProperty(DEBUG); }
return getContext().getExecutor().submit(f);