View Javadoc

1   /*
2    * $Id: AbstractRegistryTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.registry;
11  
12  import org.mule.api.registry.RegistrationException;
13  import org.mule.api.registry.Registry;
14  import org.mule.tck.AbstractMuleTestCase;
15  
16  import java.io.IOException;
17  import java.util.Collection;
18  import java.util.Map;
19  
20  public abstract class AbstractRegistryTestCase extends AbstractMuleTestCase
21  {
22      public abstract Registry getRegistry();
23  
24      public void testNotFoundCalls() throws RegistrationException
25      {
26          Registry r = getRegistry();
27          Map<String, IOException> map = r.lookupByType(IOException.class);
28          assertNotNull(map);
29          assertEquals(0, map.size());
30  
31          IOException object = r.lookupObject(IOException.class);
32          assertNull(object);
33  
34          object = r.lookupObject("foooooo");
35          assertNull(object);
36  
37          Collection<IOException> list = r.lookupObjects(IOException.class);
38          assertNotNull(list);
39          assertEquals(0, list.size());
40      }
41  }