1 package com.mockobjects.mail; 2 3 import com.mockobjects.*; 4 import javax.mail.Authenticator ; 5 import javax.mail.Provider ; 6 import javax.mail.URLName ; 7 import javax.mail.PasswordAuthentication ; 8 import alt.javax.mail.Transport; 9 import alt.javax.mail.Session; 10 11 import javax.mail.Address ; 12 import javax.mail.Store ; 13 import javax.mail.Folder ; 14 import java.util.*; 15 16 public class MockSession extends MockObject implements Session { 17 private final ExpectationValue myDebug = new ExpectationValue("debug"); 18 private final ExpectationValue myTransportName = 19 new ExpectationValue("transport name"); 20 private final ReturnValue myTransport = new ReturnValue("transport"); 21 22 public Session getInstance(Properties props, Authenticator authenticator){ 23 notImplemented(); 24 return null; 25 } 26 27 public Session getInstance(Properties props){ 28 notImplemented(); 29 return null; 30 } 31 32 public Session getDefaultInstance(Properties props, Authenticator 33 authenticator){ 34 notImplemented(); 35 return null; 36 } 37 38 public Session getDefaultInstance(Properties props){ 39 notImplemented(); 40 return null; 41 } 42 43 public void setExpectedDebug(boolean aDebug){ 44 myDebug.setActual(aDebug); 45 } 46 47 public void setDebug(boolean aDebug){ 48 myDebug.setActual(aDebug); 49 } 50 51 public boolean getDebug(){ 52 notImplemented(); 53 return false; 54 } 55 56 public Provider getProviders()[]{ 57 notImplemented(); 58 return null; 59 } 60 61 public Provider getProvider(String name){ 62 notImplemented(); 63 return null; 64 } 65 66 public void setProvider(Provider provider){ 67 notImplemented(); 68 } 69 70 public Transport getTransport(){ 71 notImplemented(); 72 return null; 73 } 74 75 public void setExpectedTransport(String aTransportName){ 76 myTransportName.setExpected(aTransportName); 77 } 78 79 public void setupGetTransport(Transport aTransport){ 80 myTransport.setValue(aTransport); 81 } 82 83 public Transport getTransport(String aTransportName){ 84 myTransportName.setActual(aTransportName); 85 return (Transport)myTransport.getValue(); 86 } 87 88 public Transport getTransport(Address address){ 89 notImplemented(); 90 return null; 91 } 92 93 public Transport getTransport(Provider provider){ 94 notImplemented(); 95 return null; 96 } 97 98 public Transport getTransport(URLName url){ 99 notImplemented(); 100 return null; 101 } 102 103 public Store getStore(){ 104 notImplemented(); 105 return null; 106 } 107 108 public Store getStore(String name){ 109 notImplemented(); 110 return null; 111 } 112 113 public Store getStore(URLName url){ 114 notImplemented(); 115 return null; 116 } 117 118 public Store getStore(Provider provider){ 119 notImplemented(); 120 return null; 121 } 122 123 public Folder getFolder(){ 124 notImplemented(); 125 return null; 126 } 127 128 public Folder getFolder(Store store){ 129 notImplemented(); 130 return null; 131 } 132 133 public Folder getFolder(URLName url){ 134 notImplemented(); 135 return null; 136 } 137 138 public void setPasswordAuthentication(URLName url, PasswordAuthentication 139 passwordAuthentication){ 140 notImplemented(); 141 } 142 143 public PasswordAuthentication getPasswordAuthentication(URLName url){ 144 notImplemented(); 145 return null; 146 } 147 148 public PasswordAuthentication requestPasswordAuthentication(java.net.InetAddress address, int port, String protocol, String prompt, String defaultUserName){ 149 notImplemented(); 150 return null; 151 } 152 153 public Properties getProperties(){ 154 notImplemented(); 155 return null; 156 } 157 158 public String getProperty(String name){ 159 notImplemented(); 160 return null; 161 } 162 163 public javax.mail.Session getWrappedSession(){ 164 notImplemented(); 165 return null; 166 } 167 168 } 169 | Popular Tags |