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