1 15 package hivemind.test.lib.impl; 16 17 import java.util.HashMap ; 18 import java.util.Hashtable ; 19 import java.util.Map ; 20 21 import javax.naming.Context ; 22 import javax.naming.Name ; 23 import javax.naming.NameParser ; 24 import javax.naming.NamingEnumeration ; 25 import javax.naming.NamingException ; 26 27 public class FakeContext implements Context 28 { 29 private boolean _forceError; 30 private Map _names = new HashMap (); 31 32 public Object lookup(Name name) throws NamingException 33 { 34 35 return null; 36 } 37 38 public Object lookup(String name) throws NamingException 39 { 40 if (_forceError) 41 throw new NamingException ("Forced error: " + name); 42 43 return _names.get(name); 44 } 45 46 public void bind(Name name, Object obj) throws NamingException 47 { 48 49 } 50 51 public void bind(String name, Object obj) throws NamingException 52 { 53 _names.put(name, obj); 54 } 55 56 public void rebind(Name name, Object obj) throws NamingException 57 { 58 59 } 60 61 public void rebind(String name, Object obj) throws NamingException 62 { 63 64 } 65 66 public void unbind(Name name) throws NamingException 67 { 68 69 } 70 71 public void unbind(String name) throws NamingException 72 { 73 74 } 75 76 public void rename(Name oldName, Name newName) throws NamingException 77 { 78 79 } 80 81 public void rename(String oldName, String newName) throws NamingException 82 { 83 84 } 85 86 public NamingEnumeration list(Name name) throws NamingException 87 { 88 return null; 89 } 90 91 public NamingEnumeration list(String name) throws NamingException 92 { 93 return null; 94 } 95 96 public NamingEnumeration listBindings(Name name) throws NamingException 97 { 98 return null; 99 } 100 101 public NamingEnumeration listBindings(String name) throws NamingException 102 { 103 return null; 104 } 105 106 public void destroySubcontext(Name name) throws NamingException 107 { 108 109 } 110 111 public void destroySubcontext(String name) throws NamingException 112 { 113 114 } 115 116 public Context createSubcontext(Name name) throws NamingException 117 { 118 return null; 119 } 120 121 public Context createSubcontext(String name) throws NamingException 122 { 123 return null; 124 } 125 126 public Object lookupLink(Name name) throws NamingException 127 { 128 return null; 129 } 130 131 public Object lookupLink(String name) throws NamingException 132 { 133 return null; 134 } 135 136 public NameParser getNameParser(Name name) throws NamingException 137 { 138 return null; 139 } 140 141 public NameParser getNameParser(String name) throws NamingException 142 { 143 return null; 144 } 145 146 public Name composeName(Name name, Name prefix) throws NamingException 147 { 148 return null; 149 } 150 151 public String composeName(String name, String prefix) throws NamingException 152 { 153 return null; 154 } 155 156 public Object addToEnvironment(String propName, Object propVal) throws NamingException 157 { 158 return null; 159 } 160 161 public Object removeFromEnvironment(String propName) throws NamingException 162 { 163 return null; 164 } 165 166 public Hashtable getEnvironment() throws NamingException 167 { 168 return null; 169 } 170 171 public void close() throws NamingException 172 { 173 174 } 175 176 public String getNameInNamespace() throws NamingException 177 { 178 return null; 179 } 180 181 public boolean isForceError() 182 { 183 return _forceError; 184 } 185 186 public void setForceError(boolean b) 187 { 188 _forceError = b; 189 } 190 191 } 192 | Popular Tags |