View Javadoc

1   /*
2    * $Id: IntegrationBeanAnnotationTestCase.java 19026 2010-08-16 07:30:47Z dirk.olmes $
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.module.ibeans;
11  
12  import org.mule.tck.AbstractMuleTestCase;
13  
14  import org.ibeans.annotation.IntegrationBean;
15  
16  public class IntegrationBeanAnnotationTestCase extends AbstractMuleTestCase
17  {
18      public IntegrationBeanAnnotationTestCase()
19      {
20          setStartContext(true);
21      }
22  
23      @SuppressWarnings("unused")    
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      public void testIBeanInjection() throws Exception {
34          assertNotNull(hostip);
35          String result = hostip.getHostInfo("192.215.42.198");
36          assertNotNull(result);
37          System.out.println(result);
38  //
39  //        System.out.println(hostip.getHostInfoName("192.215.42.198"));
40  
41          assertTrue("has ip", hostip.hasIp("192.215.42.198"));
42      }
43  }