KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > kernel > registry > RegistryUtilTest


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: RegistryUtilTest.java 2:37:11 PM ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.kernel.registry;
23
24 import junit.framework.TestCase;
25
26 import org.easymock.classextension.EasyMock;
27 import org.objectweb.petals.util.LoggingUtil;
28 import org.objectweb.util.monolog.api.Logger;
29
30 /**
31  * Tests of the RegistryUtil
32  *
33  * @author ddesjardins - eBMWebsourcing
34  */

35 public class RegistryUtilTest extends TestCase {
36
37     protected RegistryUtil registryUtil;
38
39     public void setUp() {
40         RegistryServer server = new RegistryServer();
41         registryUtil = new RegistryUtil(server);
42         registryUtil.log = new LoggingUtil(EasyMock.createMock(Logger.class));
43     }
44
45     public void testBindException() {
46         try {
47             registryUtil.bind("/", null, null);
48             fail();
49         } catch (Exception JavaDoc e) {
50             // do nothing
51
}
52     }
53
54     public void testBindException2() {
55         try {
56             registryUtil.bind("/", "", "test");
57             fail();
58         } catch (Exception JavaDoc e) {
59             // do nothing
60
}
61     }
62
63     public void testBindException4() {
64         try {
65             registryUtil.bind(null, "foo", "test");
66             fail();
67         } catch (Exception JavaDoc e) {
68             // do nothing
69
}
70     }
71
72     public void testBindException5() {
73         try {
74             registryUtil.bind("/test/", "foo", "test");
75             fail();
76         } catch (Exception JavaDoc e) {
77             // do nothing
78
}
79     }
80
81     public void testCreateSubcontextException() {
82         try {
83             registryUtil.createSubcontext("/", null);
84             fail();
85         } catch (Exception JavaDoc e) {
86             // do nothing
87
}
88     }
89
90     public void testCreateSubcontextException1() {
91         try {
92             registryUtil.createSubcontext(null, null);
93             fail();
94         } catch (Exception JavaDoc e) {
95             // do nothing
96
}
97     }
98
99     public void testCreateSubcontextException2() {
100         try {
101             registryUtil.createSubcontext("/", "");
102             fail();
103         } catch (Exception JavaDoc e) {
104             // do nothing
105
}
106     }
107
108     public void testCreateSubcontextException4() {
109         try {
110             registryUtil.createSubcontext(null, "foo");
111             fail();
112         } catch (Exception JavaDoc e) {
113             // do nothing
114
}
115     }
116
117     public void testCreateSubcontextException5() {
118         try {
119             registryUtil.createSubcontext("/bar/", "foo");
120             fail();
121         } catch (Exception JavaDoc e) {
122             // do nothing
123
}
124     }
125
126     public void testDestroySubcontextException() {
127         try {
128             registryUtil.destroySubcontext(null, null);
129             fail();
130         } catch (Exception JavaDoc e) {
131             // do nothing
132
}
133     }
134
135     public void testDestroySubcontextException1() {
136         try {
137             registryUtil.destroySubcontext(null, "foo");
138             fail();
139         } catch (Exception JavaDoc e) {
140             // do nothing
141
}
142     }
143
144     public void testDestroySubcontextException2() {
145         try {
146             registryUtil.destroySubcontext("/", "");
147             fail();
148         } catch (Exception JavaDoc e) {
149             // do nothing
150
}
151     }
152
153     public void testDestroySubcontextException3() {
154         try {
155             registryUtil.destroySubcontext("/", "foo");
156             fail();
157         } catch (Exception JavaDoc e) {
158             // do nothing
159
}
160     }
161
162     public void testDestroySubcontextException4() {
163         try {
164             registryUtil.destroySubcontext("/bar/", "foo");
165             fail();
166         } catch (Exception JavaDoc e) {
167             // do nothing
168
}
169     }
170
171     public void testListException() {
172         try {
173             registryUtil.list(null, null);
174             fail();
175         } catch (Exception JavaDoc e) {
176             // do nothing
177
}
178     }
179
180     public void testListException1() {
181         try {
182             registryUtil.list(null, "foo");
183             fail();
184         } catch (Exception JavaDoc e) {
185             // do nothing
186
}
187     }
188
189     public void testListException2() {
190         try {
191             registryUtil.list("/", "");
192             fail();
193         } catch (Exception JavaDoc e) {
194             // do nothing
195
}
196     }
197
198     public void testListException3() {
199         try {
200             registryUtil.list("/", "foo");
201             fail();
202         } catch (Exception JavaDoc e) {
203             // do nothing
204
}
205     }
206
207     public void testListBindingsException() {
208         try {
209             registryUtil.listBindings(null, null);
210             fail();
211         } catch (Exception JavaDoc e) {
212             // do nothing
213
}
214     }
215
216     public void testListBindingsException1() {
217         try {
218             registryUtil.listBindings(null, "foo");
219             fail();
220         } catch (Exception JavaDoc e) {
221             // do nothing
222
}
223     }
224
225     public void testListBindingsException2() {
226         try {
227             registryUtil.listBindings("/", "");
228             fail();
229         } catch (Exception JavaDoc e) {
230             // do nothing
231
}
232     }
233
234     public void testListBindingsException3() {
235         try {
236             registryUtil.listBindings("/", "foo");
237             fail();
238         } catch (Exception JavaDoc e) {
239             // do nothing
240
}
241     }
242
243     public void testLookupException() {
244         try {
245             registryUtil.lookup(null, null);
246             fail();
247         } catch (Exception JavaDoc e) {
248             // do nothing
249
}
250     }
251
252     public void testLookupException1() {
253         try {
254             registryUtil.lookup(null, "foo");
255             fail();
256         } catch (Exception JavaDoc e) {
257             // do nothing
258
}
259     }
260
261     public void testLookupException2() {
262         try {
263             registryUtil.lookup("/", "");
264             fail();
265         } catch (Exception JavaDoc e) {
266             // do nothing
267
}
268     }
269
270     public void testLookupException3() {
271         try {
272             registryUtil.lookup("/", "foo");
273             fail();
274         } catch (Exception JavaDoc e) {
275             // do nothing
276
}
277     }
278
279     public void testLookupException4() {
280         try {
281             registryUtil.lookup("/bar/", "foo");
282             fail();
283         } catch (Exception JavaDoc e) {
284             // do nothing
285
}
286     }
287
288     public void testLookupLinkException() {
289         try {
290             registryUtil.lookupLink(null, null);
291             fail();
292         } catch (Exception JavaDoc e) {
293             // do nothing
294
}
295     }
296
297     public void testLookupLinkException1() {
298         try {
299             registryUtil.lookupLink(null, "foo");
300             fail();
301         } catch (Exception JavaDoc e) {
302             // do nothing
303
}
304     }
305
306     public void testLookupLinkException2() {
307         try {
308             registryUtil.lookupLink("/", "");
309             fail();
310         } catch (Exception JavaDoc e) {
311             // do nothing
312
}
313     }
314
315     public void testLookupLinkException3() {
316         try {
317             registryUtil.lookupLink("/", "foo");
318             fail();
319         } catch (Exception JavaDoc e) {
320             // do nothing
321
}
322     }
323
324     public void testRebindException() {
325         try {
326             registryUtil.rebind(null, null, null);
327             fail();
328         } catch (Exception JavaDoc e) {
329             // do nothing
330
}
331     }
332
333     public void testRebindException1() {
334         try {
335             registryUtil.rebind(null, "foo", null);
336             fail();
337         } catch (Exception JavaDoc e) {
338             // do nothing
339
}
340     }
341
342     public void testRebindException2() {
343         try {
344             registryUtil.rebind("/", "", null);
345             fail();
346         } catch (Exception JavaDoc e) {
347             // do nothing
348
}
349     }
350
351     public void testRebindException3() {
352         try {
353             registryUtil.rebind("/foo", "bar", null);
354             fail();
355         } catch (Exception JavaDoc e) {
356             // do nothing
357
}
358     }
359
360     public void testRebindException4() {
361         try {
362             registryUtil.rebind("/", "bar", "foo");
363             fail();
364         } catch (Exception JavaDoc e) {
365             // do nothing
366
}
367     }
368
369     public void testRenameException() {
370         RegistryServer server = new RegistryServer();
371         RegistryUtil registryUtil = new RegistryUtil(server);
372         try {
373             registryUtil.rename(null, null, null);
374             fail();
375         } catch (Exception JavaDoc e) {
376             // do nothing
377
}
378     }
379
380     public void testRenameException1() {
381         try {
382             registryUtil.rename(null, "foo", null);
383             fail();
384         } catch (Exception JavaDoc e) {
385             // do nothing
386
}
387     }
388
389     public void testRenameException2() {
390         try {
391             registryUtil.rename(null, "foo", "bar");
392             fail();
393         } catch (Exception JavaDoc e) {
394             // do nothing
395
}
396     }
397
398     public void testRenameException3() {
399         try {
400             registryUtil.rename("/", "", "bar");
401             fail();
402         } catch (Exception JavaDoc e) {
403             // do nothing
404
}
405     }
406
407     public void testRenameException4() {
408         try {
409             registryUtil.rename("/", "foo", "");
410             fail();
411         } catch (Exception JavaDoc e) {
412             // do nothing
413
}
414     }
415
416     public void testRenameException5() {
417         try {
418             registryUtil.rename("/", null, "");
419             fail();
420         } catch (Exception JavaDoc e) {
421             // do nothing
422
}
423     }
424
425     public void testUnbindException() {
426         try {
427             registryUtil.unbind(null, null);
428             fail();
429         } catch (Exception JavaDoc e) {
430             // do nothing
431
}
432     }
433
434     public void testUnbindException1() {
435         try {
436             registryUtil.unbind(null, "foo");
437             fail();
438         } catch (Exception JavaDoc e) {
439             // do nothing
440
}
441     }
442
443     public void testUnbindException2() {
444         try {
445             registryUtil.unbind("/", "");
446             fail();
447         } catch (Exception JavaDoc e) {
448             // do nothing
449
}
450     }
451
452     public void testUnbindException3() {
453         try {
454             registryUtil.unbind("/foo", "bar");
455             fail();
456         } catch (Exception JavaDoc e) {
457             // do nothing
458
}
459     }
460
461     public void testUnbindException4() {
462         try {
463             registryUtil.unbind("/", "bar");
464             fail();
465         } catch (Exception JavaDoc e) {
466             // do nothing
467
}
468     }
469 }
470
Popular Tags