1 package mock.javax.naming.directory;
2
3 import java.util.Hashtable;
4
5 import javax.naming.Context;
6 import javax.naming.Name;
7 import javax.naming.NameNotFoundException;
8 import javax.naming.NameParser;
9 import javax.naming.NamingEnumeration;
10 import javax.naming.NamingException;
11 import javax.naming.directory.Attributes;
12 import javax.naming.directory.DirContext;
13 import javax.naming.directory.ModificationItem;
14 import javax.naming.directory.SearchControls;
15
16 public class DirContextMock implements DirContext {
17
18 public Attributes getAttributes(Name name) throws NamingException {
19 throw new UnsupportedOperationException("implement me");
20 }
21
22 public boolean getAttributesCalled;
23 public String getAttributesName;
24 public Attributes getAttributesReturn;
25 public NamingException getAttributesNamingException;
26 public Attributes getAttributes(String name) throws NamingException {
27 getAttributesCalled = true;
28 getAttributesName = name;
29 if (getAttributesNamingException != null) {
30 throw getAttributesNamingException;
31 }
32
33 return getAttributesReturn;
34 }
35
36 public Attributes getAttributes(Name name, String[] attrIds) throws NamingException {
37 throw new UnsupportedOperationException("implement me");
38 }
39
40 public Attributes getAttributes(String name, String[] attrIds) throws NamingException {
41 throw new UnsupportedOperationException("implement me");
42 }
43
44 public void modifyAttributes(Name name, int mod_op, Attributes attrs) throws NamingException {
45 throw new UnsupportedOperationException("implement me");
46 }
47
48 public boolean modifyAttributesCalled;
49 public String modifyAttributesName;
50 public int modifyAttributesModOp;
51 public Attributes modifyAttributesAttributes;
52 public NameNotFoundException modifyAttributesNameNotFoundException;
53 public void modifyAttributes(String name, int mod_op, Attributes attrs)
54 throws NamingException {
55 modifyAttributesCalled = true;
56 modifyAttributesName = name;
57 modifyAttributesModOp = mod_op;
58 modifyAttributesAttributes = attrs;
59 if (modifyAttributesNameNotFoundException != null) {
60 throw modifyAttributesNameNotFoundException;
61 }
62 }
63
64 public void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException {
65 throw new UnsupportedOperationException("implement me");
66 }
67
68 public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException {
69 throw new UnsupportedOperationException("implement me");
70 }
71
72 public void bind(Name name, Object obj, Attributes attrs) throws NamingException {
73 throw new UnsupportedOperationException("implement me");
74 }
75
76 public void bind(String name, Object obj, Attributes attrs) throws NamingException {
77 throw new UnsupportedOperationException("implement me");
78 }
79
80 public void rebind(Name name, Object obj, Attributes attrs) throws NamingException {
81 throw new UnsupportedOperationException("implement me");
82 }
83
84 public void rebind(String name, Object obj, Attributes attrs) throws NamingException {
85 throw new UnsupportedOperationException("implement me");
86 }
87
88 public DirContext createSubcontext(Name name, Attributes attrs) throws NamingException {
89 throw new UnsupportedOperationException("implement me");
90 }
91
92 public boolean createSubcontextCalled;
93 public String createSubcontextName;
94 public Attributes createSubcontextAttributes;
95 public DirContextMock createSubcontextReturn;
96 public DirContext createSubcontext(String name, Attributes attrs) throws NamingException {
97 createSubcontextCalled = true;
98 createSubcontextName = name;
99 createSubcontextAttributes = attrs;
100 return createSubcontextReturn;
101 }
102
103 public DirContext getSchema(Name name) throws NamingException {
104 throw new UnsupportedOperationException("implement me");
105 }
106
107 public DirContext getSchema(String name) throws NamingException {
108 throw new UnsupportedOperationException("implement me");
109 }
110
111 public DirContext getSchemaClassDefinition(Name name) throws NamingException {
112 throw new UnsupportedOperationException("implement me");
113 }
114
115 public DirContext getSchemaClassDefinition(String name) throws NamingException {
116 throw new UnsupportedOperationException("implement me");
117 }
118
119 public NamingEnumeration search(
120 Name name,
121 Attributes matchingAttributes,
122 String[] attributesToReturn)
123 throws NamingException {
124 throw new UnsupportedOperationException("implement me");
125 }
126
127 public NamingEnumeration search(
128 String name,
129 Attributes matchingAttributes,
130 String[] attributesToReturn)
131 throws NamingException {
132 throw new UnsupportedOperationException("implement me");
133 }
134
135 public NamingEnumeration search(Name name, Attributes matchingAttributes)
136 throws NamingException {
137 throw new UnsupportedOperationException("implement me");
138 }
139
140 public boolean searchCalled;
141 public String searchName;
142 public Attributes searchMatchingAttributes;
143 public NamingEnumeration searchReturn;
144 public NamingEnumeration search(String name, Attributes matchingAttributes)
145 throws NamingException {
146 searchCalled = true;
147 searchMatchingAttributes = matchingAttributes;
148 searchName = name;
149 return searchReturn;
150 }
151
152 public NamingEnumeration search(Name name, String filter, SearchControls cons)
153 throws NamingException {
154 throw new UnsupportedOperationException("implement me");
155 }
156
157 public NamingEnumeration search(String name, String filter, SearchControls cons)
158 throws NamingException {
159 throw new UnsupportedOperationException("implement me");
160 }
161
162 public NamingEnumeration search(
163 Name name,
164 String filterExpr,
165 Object[] filterArgs,
166 SearchControls cons)
167 throws NamingException {
168 throw new UnsupportedOperationException("implement me");
169 }
170
171 public NamingEnumeration search(
172 String name,
173 String filterExpr,
174 Object[] filterArgs,
175 SearchControls cons)
176 throws NamingException {
177 throw new UnsupportedOperationException("implement me");
178 }
179
180 public Object lookup(Name name) throws NamingException {
181 throw new UnsupportedOperationException("implement me");
182 }
183
184 public boolean lookupCalled;
185 public String lookupName;
186 public Object lookupReturn;
187 public Object lookup(String name) throws NamingException {
188 lookupCalled = true;
189 lookupName = name;
190 return lookupReturn;
191 }
192
193 public void bind(Name name, Object obj) throws NamingException {
194 throw new UnsupportedOperationException("implement me");
195 }
196
197 public void bind(String name, Object obj) throws NamingException {
198 throw new UnsupportedOperationException("implement me");
199 }
200
201 public void rebind(Name name, Object obj) throws NamingException {
202 throw new UnsupportedOperationException("implement me");
203 }
204
205 public void rebind(String name, Object obj) throws NamingException {
206 throw new UnsupportedOperationException("implement me");
207 }
208
209 public void unbind(Name name) throws NamingException {
210 throw new UnsupportedOperationException("implement me");
211 }
212
213 public void unbind(String name) throws NamingException {
214 throw new UnsupportedOperationException("implement me");
215 }
216
217 public void rename(Name oldName, Name newName) throws NamingException {
218 throw new UnsupportedOperationException("implement me");
219 }
220
221 public void rename(String oldName, String newName) throws NamingException {
222 throw new UnsupportedOperationException("implement me");
223 }
224
225 public NamingEnumeration list(Name name) throws NamingException {
226 throw new UnsupportedOperationException("implement me");
227 }
228
229 public NamingEnumeration list(String name) throws NamingException {
230 throw new UnsupportedOperationException("implement me");
231 }
232
233 public NamingEnumeration listBindings(Name name) throws NamingException {
234 throw new UnsupportedOperationException("implement me");
235 }
236
237 public NamingEnumeration listBindings(String name) throws NamingException {
238 throw new UnsupportedOperationException("implement me");
239 }
240
241 public void destroySubcontext(Name name) throws NamingException {
242 throw new UnsupportedOperationException("implement me");
243 }
244
245 public boolean destroySubcontextCalled;
246 public String destroySubcontextName;
247 public void destroySubcontext(String name) throws NamingException {
248 destroySubcontextCalled = true;
249 destroySubcontextName = name;
250 }
251
252 public Context createSubcontext(Name name) throws NamingException {
253 throw new UnsupportedOperationException("implement me");
254 }
255
256 public Context createSubcontext(String name) throws NamingException {
257 throw new UnsupportedOperationException("implement me");
258 }
259
260 public Object lookupLink(Name name) throws NamingException {
261 throw new UnsupportedOperationException("implement me");
262 }
263
264 public Object lookupLink(String name) throws NamingException {
265 throw new UnsupportedOperationException("implement me");
266 }
267
268 public NameParser getNameParser(Name name) throws NamingException {
269 throw new UnsupportedOperationException("implement me");
270 }
271
272 public NameParser getNameParser(String name) throws NamingException {
273 throw new UnsupportedOperationException("implement me");
274 }
275
276 public Name composeName(Name name, Name prefix) throws NamingException {
277 throw new UnsupportedOperationException("implement me");
278 }
279
280 public String composeName(String name, String prefix) throws NamingException {
281 throw new UnsupportedOperationException("implement me");
282 }
283
284 public Object addToEnvironment(String propName, Object propVal) throws NamingException {
285 throw new UnsupportedOperationException("implement me");
286 }
287
288 public Object removeFromEnvironment(String propName) throws NamingException {
289 throw new UnsupportedOperationException("implement me");
290 }
291
292 public Hashtable getEnvironment() throws NamingException {
293 throw new UnsupportedOperationException("implement me");
294 }
295
296 public void close() throws NamingException {
297 throw new UnsupportedOperationException("implement me");
298 }
299
300 public String getNameInNamespace() throws NamingException {
301 throw new UnsupportedOperationException("implement me");
302 }
303
304 }
This page was automatically generated by Maven