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