KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > imapserver > mock > MockMailServer


1 /****************************************************************
2  * Licensed to the Apache Software Foundation (ASF) under one *
3  * or more contributor license agreements. See the NOTICE file *
4  * distributed with this work for additional information *
5  * regarding copyright ownership. The ASF licenses this file *
6  * to you under the Apache License, Version 2.0 (the *
7  * "License"); you may not use this file except in compliance *
8  * with the License. You may obtain a copy of the License at *
9  * *
10  * http://www.apache.org/licenses/LICENSE-2.0 *
11  * *
12  * Unless required by applicable law or agreed to in writing, *
13  * software distributed under the License is distributed on an *
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15  * KIND, either express or implied. See the License for the *
16  * specific language governing permissions and limitations *
17  * under the License. *
18  ****************************************************************/

19
20 package org.apache.james.imapserver.mock;
21
22 import java.io.InputStream JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.HashMap JavaDoc;
25 import java.util.Map JavaDoc;
26
27 import javax.mail.MessagingException JavaDoc;
28 import javax.mail.internet.MimeMessage JavaDoc;
29
30 import org.apache.james.imapserver.TestConstants;
31 import org.apache.james.services.MailRepository;
32 import org.apache.james.services.MailServer;
33 import org.apache.mailet.Mail;
34 import org.apache.mailet.MailAddress;
35
36 public class MockMailServer implements MailServer, TestConstants
37 {
38
39     public void sendMail(MailAddress sender, Collection JavaDoc recipients,
40             MimeMessage JavaDoc msg) throws MessagingException JavaDoc
41     {
42         throw new RuntimeException JavaDoc("not implemented");
43
44     }
45
46     public void sendMail(MailAddress sender, Collection JavaDoc recipients,
47             InputStream JavaDoc msg) throws MessagingException JavaDoc
48     {
49         throw new RuntimeException JavaDoc("not implemented");
50     }
51
52     public void sendMail(Mail mail) throws MessagingException JavaDoc
53     {
54         throw new RuntimeException JavaDoc("not implemented");
55     }
56
57     public void sendMail(MimeMessage JavaDoc message) throws MessagingException JavaDoc
58     {
59         throw new RuntimeException JavaDoc("not implemented");
60     }
61
62     Map JavaDoc userToMailRepo = new HashMap JavaDoc();
63
64     public MailRepository getUserInbox(String JavaDoc userName) {
65         return null;
66     }
67
68     public String JavaDoc getId()
69     {
70         throw new RuntimeException JavaDoc("not implemented");
71     }
72
73     public boolean addUser(String JavaDoc userName, String JavaDoc password)
74     {
75         throw new RuntimeException JavaDoc("not implemented");
76     }
77
78     public boolean isLocalServer(String JavaDoc serverName)
79     {
80         throw new RuntimeException JavaDoc("not implemented");
81     }
82     
83     public boolean supportVirtualHosting() {
84         return false;
85     }
86
87     public String JavaDoc getDefaultDomain() {
88         return "localhost";
89     }
90
91     public String JavaDoc getHelloName() {
92         return "localhost";
93     }
94
95 }
96
Popular Tags