KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > mail > MockService


1 package com.mockobjects.mail;
2
3 import javax.mail.URLName JavaDoc;
4 import javax.mail.event.ConnectionListener JavaDoc;
5 import com.mockobjects.*;
6 import alt.javax.mail.Service;
7
8 public class MockService extends MockObject implements Service {
9     private final ExpectationCounter myCloseCalls =
10         new ExpectationCounter("close");
11     private final ExpectationValue myHost = new ExpectationValue("host");
12     private final ExpectationValue myPort = new ExpectationValue("port");
13     private final ExpectationValue myUser = new ExpectationValue("user");
14     private final ExpectationValue myPassword =
15         new ExpectationValue("password");
16
17     public void setExpectedCloseCalls(int aNumberOfCalls){
18         myCloseCalls.setExpected(aNumberOfCalls);
19     }
20
21     public void close(){
22         myCloseCalls.inc();
23     }
24
25     public void connect(){
26         notImplemented();
27     }
28
29     public void connect(String JavaDoc aHost, int aPort, String JavaDoc aUser,
30     String JavaDoc aPassword){
31         myHost.setActual(aHost);
32         myPort.setActual(aPort);
33         myUser.setActual(aUser);
34         myPassword.setActual(aPassword);
35     }
36
37     public void connect(String JavaDoc aHost, String JavaDoc aUser, String JavaDoc aPassword){
38         notImplemented();
39     }
40
41     public boolean isConnected(){
42         notImplemented();
43         return false;
44     }
45
46     public URLName JavaDoc getURLName(){
47         notImplemented();
48         return null;
49     }
50
51     public void addConnectionListener(ConnectionListener JavaDoc connectionListener){
52         notImplemented();
53     }
54
55     public void removeConnectionListener(ConnectionListener JavaDoc connectionListener){
56         notImplemented();
57     }
58 }
59
Popular Tags