View Javadoc

1   /*
2    * $Id: AbstractRegistryTestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
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.List;
19  import java.util.Map;
20  
21  public abstract class AbstractRegistryTestCase extends AbstractMuleTestCase
22  {
23      public abstract Registry getRegistry();
24  
25      public void testNotFoundCalls() throws RegistrationException
26      {
27          Registry r = getRegistry();
28          Map<String, IOException> map = r.lookupByType(IOException.class);
29          assertNotNull(map);
30          assertEquals(0, map.size());
31  
32          IOException object = r.lookupObject(IOException.class);
33          assertNull(object);
34  
35          object = r.lookupObject("foooooo");
36          assertNull(object);
37  
38          Collection<IOException> list = r.lookupObjects(IOException.class);
39          assertNotNull(list);
40          assertEquals(0, list.size());
41      }
42  }