1
2
3
4
5
6
7
8
9
10 package org.mule.module.ibeans;
11
12 import org.mule.tck.junit4.AbstractMuleContextTestCase;
13
14 import org.ibeans.annotation.IntegrationBean;
15 import org.junit.Test;
16
17 import static org.junit.Assert.assertNotNull;
18 import static org.junit.Assert.assertTrue;
19
20 public class IntegrationBeanAnnotationTestCase extends AbstractMuleContextTestCase
21 {
22 public IntegrationBeanAnnotationTestCase()
23 {
24 setStartContext(true);
25 }
26
27 @IntegrationBean
28 private HostIpIBean hostip;
29
30 @Override
31 protected void doSetUp() throws Exception
32 {
33 muleContext.getRegistry().registerObject("test", this);
34 }
35
36 @Test
37 public void testIBeanInjection() throws Exception
38 {
39 assertNotNull(hostip);
40 String result = hostip.getHostInfo("192.215.42.198");
41 assertNotNull(result);
42
43
44 assertTrue("has ip", hostip.hasIp("192.215.42.198"));
45 }
46 }