1
2
3
4
5
6
7
8
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.junit4.AbstractMuleContextTestCase;
15
16 import java.io.IOException;
17 import java.util.Collection;
18 import java.util.Map;
19
20 import org.junit.Test;
21
22 import static org.junit.Assert.assertEquals;
23 import static org.junit.Assert.assertNotNull;
24 import static org.junit.Assert.assertNull;
25
26 public abstract class AbstractRegistryTestCase extends AbstractMuleContextTestCase
27 {
28 public abstract Registry getRegistry();
29
30 @Test
31 public void testNotFoundCalls() throws RegistrationException
32 {
33 Registry r = getRegistry();
34 Map<String, IOException> map = r.lookupByType(IOException.class);
35 assertNotNull(map);
36 assertEquals(0, map.size());
37
38 IOException object = r.lookupObject(IOException.class);
39 assertNull(object);
40
41 object = r.lookupObject("foooooo");
42 assertNull(object);
43
44 Collection<IOException> list = r.lookupObjects(IOException.class);
45 assertNotNull(list);
46 assertEquals(0, list.size());
47 }
48 }