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