1 package com.mockobjects.mail; 2 3 import javax.mail.URLName ; 4 import javax.mail.event.ConnectionListener ; 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 aHost, int aPort, String aUser, 30 String aPassword){ 31 myHost.setActual(aHost); 32 myPort.setActual(aPort); 33 myUser.setActual(aUser); 34 myPassword.setActual(aPassword); 35 } 36 37 public void connect(String aHost, String aUser, String aPassword){ 38 notImplemented(); 39 } 40 41 public boolean isConnected(){ 42 notImplemented(); 43 return false; 44 } 45 46 public URLName getURLName(){ 47 notImplemented(); 48 return null; 49 } 50 51 public void addConnectionListener(ConnectionListener connectionListener){ 52 notImplemented(); 53 } 54 55 public void removeConnectionListener(ConnectionListener connectionListener){ 56 notImplemented(); 57 } 58 } 59 | Popular Tags |