本文整理汇总了Java中org.subethamail.smtp.MessageContext类的典型用法代码示例。如果您正苦于以下问题:Java MessageContext类的具体用法?Java MessageContext怎么用?Java MessageContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageContext类属于org.subethamail.smtp包,在下文中一共展示了MessageContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testCompletedMailTransaction
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Test
public void testCompletedMailTransaction() throws Exception {
new Expectations() {
{
messageHandlerFactory.create((MessageContext) any);
result = messageHandler;
messageHandler.from(anyString);
messageHandler.recipient(anyString);
messageHandler.data((InputStream) any);
messageHandler.done();
}
};
SmartClient client = new SmartClient("localhost", smtpServer.getPort(),
"localhost");
client.from("[email protected]");
client.to("[email protected]");
client.dataStart();
client.dataWrite(TextUtils.getAsciiBytes("body"), 4);
client.dataEnd();
client.quit();
smtpServer.stop(); // wait for the server to catch up
}
开发者ID:voodoodyne,项目名称:subethasmtp,代码行数:26,代码来源:MessageHandlerTest.java
示例2: testAbortedMailTransaction
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Test
public void testAbortedMailTransaction() throws Exception {
new Expectations() {
{
messageHandlerFactory.create((MessageContext) any);
result = messageHandler;
messageHandler.from(anyString);
messageHandler.done();
}
};
SmartClient client = new SmartClient("localhost", smtpServer.getPort(),
"localhost");
client.from("[email protected]");
client.quit();
smtpServer.stop(); // wait for the server to catch up
}
开发者ID:voodoodyne,项目名称:subethasmtp,代码行数:20,代码来源:MessageHandlerTest.java
示例3: create
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Override
public SMTPHandler create(MessageContext ctx) {
SMTPHandler smtpHandler = new SMTPHandler(ctx);
beanFactory.autowireBean(smtpHandler);
return smtpHandler;
}
开发者ID:SpartaSystems,项目名称:holdmail,代码行数:8,代码来源:SMTPHandlerFactory.java
示例4: testDisconnectImmediately
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Test
public void testDisconnectImmediately() throws Exception {
new Expectations() {
{
messageHandlerFactory.create((MessageContext) any);
times = 0;
}
};
SmartClient client = new SmartClient("localhost", smtpServer.getPort(),
"localhost");
client.quit();
smtpServer.stop(); // wait for the server to catch up
}
开发者ID:voodoodyne,项目名称:subethasmtp,代码行数:16,代码来源:MessageHandlerTest.java
示例5: create
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Override
public MessageHandler create(MessageContext ctx) {
MailTransactionImpl mailTransaction = new MailTransactionImpl(ctx);
FilterInstances filterInstances =
filters.createInstanceChain(mailTransaction);
FilterChainMessageHandler filterChainMessageHandler =
new FilterChainMessageHandler(filterInstances, mailTransaction);
return new ErrorHandlerMessageHandler(filterChainMessageHandler);
}
开发者ID:hontvari,项目名称:mireka,代码行数:10,代码来源:MessageHandlerFactoryImpl.java
示例6: create
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public MessageHandler create(MessageContext ctx) {
return new Handler(ctx);
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:4,代码来源:MyMessageHandlerFactory.java
示例7: Handler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public Handler(MessageContext ctx) {
this.ctx = ctx;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:4,代码来源:MyMessageHandlerFactory.java
示例8: Handler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public Handler(MessageContext ctx) {
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:3,代码来源:MailJobTestCase.java
示例9: create
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public MessageHandler create(MessageContext messageContext)
{
return new Handler(messageContext);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:SubethaEmailServer.java
示例10: Handler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public Handler(MessageContext messageContext)
{
this.messageContext = messageContext;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:SubethaEmailServer.java
示例11: getMessageContext
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public MessageContext getMessageContext()
{
return messageContext;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:SubethaEmailServer.java
示例12: create
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Override
public MessageHandler create(MessageContext ctx) {
return myMessageHandler;
}
开发者ID:dopse,项目名称:maildump,代码行数:5,代码来源:MyMessageHandlerFactory.java
示例13: create
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public MessageHandler create(MessageContext ctx)
{
return new Handler(ctx);
}
开发者ID:voodoodyne,项目名称:subetha,代码行数:5,代码来源:SMTPHandler.java
示例14: Handler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
/** */
Handler(MessageContext ctx)
{
this.ctx = ctx;
}
开发者ID:voodoodyne,项目名称:subetha,代码行数:6,代码来源:SMTPHandler.java
示例15: Handler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
/** */
public Handler(MessageContext ctx)
{
this.ctx = ctx;
}
开发者ID:voodoodyne,项目名称:subethasmtp,代码行数:6,代码来源:SmarterMessageListenerAdapter.java
示例16: testTwoMailsInOneSession
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Test
public void testTwoMailsInOneSession() throws Exception {
new Expectations() {
{
messageHandlerFactory.create((MessageContext) any);
result = messageHandler;
onInstance(messageHandler).from(anyString);
onInstance(messageHandler).recipient(anyString);
onInstance(messageHandler).data((InputStream) any);
onInstance(messageHandler).done();
messageHandlerFactory.create((MessageContext) any);
result = messageHandler2;
onInstance(messageHandler2).from(anyString);
onInstance(messageHandler2).recipient(anyString);
onInstance(messageHandler2).data((InputStream) any);
onInstance(messageHandler2).done();
}
};
SmartClient client = new SmartClient("localhost", smtpServer.getPort(),
"localhost");
client.from("[email protected]");
client.to("[email protected]");
client.dataStart();
client.dataWrite(TextUtils.getAsciiBytes("body1"), 5);
client.dataEnd();
client.from("[email protected]");
client.to("[email protected]");
client.dataStart();
client.dataWrite(TextUtils.getAsciiBytes("body2"), 5);
client.dataEnd();
client.quit();
smtpServer.stop(); // wait for the server to catch up
}
开发者ID:voodoodyne,项目名称:subethasmtp,代码行数:43,代码来源:MessageHandlerTest.java
示例17: MailTransactionImpl
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public MailTransactionImpl(MessageContext messageContext) {
super();
this.messageContext = messageContext;
}
开发者ID:hontvari,项目名称:mireka,代码行数:5,代码来源:MailTransactionImpl.java
示例18: getMessageContext
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Override
public MessageContext getMessageContext() {
return messageContext;
}
开发者ID:hontvari,项目名称:mireka,代码行数:5,代码来源:MailTransactionImpl.java
示例19: shouldCreateHandler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
@Test
public void shouldCreateHandler() throws Exception{
MessageContext ctxMock = mock(MessageContext.class);
SMTPHandler handlerMock = mock(SMTPHandler.class);
whenNew(SMTPHandler.class).withArguments(ctxMock).thenReturn(handlerMock);
SMTPHandler actual = smtpHandlerFactory.create(ctxMock);
assertThat(actual).isEqualTo(handlerMock);
verify(beanFactoryMock).autowireBean(handlerMock);
}
开发者ID:SpartaSystems,项目名称:holdmail,代码行数:16,代码来源:SMTPHandlerFactoryTest.java
示例20: SMTPHandler
import org.subethamail.smtp.MessageContext; //导入依赖的package包/类
public SMTPHandler(MessageContext ctx) {
InetSocketAddress hostAddr = (InetSocketAddress) ctx.getRemoteAddress();
this.senderHost = hostAddr.getAddress().getHostAddress();
}
开发者ID:SpartaSystems,项目名称:holdmail,代码行数:7,代码来源:SMTPHandler.java
注:本文中的org.subethamail.smtp.MessageContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论